2018-07-21 02:44:44 +02:00
|
|
|
{ stdenv, fetchurl, cmake, ninja, pkgconfig
|
2018-04-29 06:05:04 +02:00
|
|
|
, opencv, openexr, graphicsmagick, fftw, zlib, libjpeg, libtiff, libpng
|
|
|
|
, withGimpPlugin ? true, gimp ? null}:
|
2015-07-16 22:01:43 +02:00
|
|
|
|
2018-04-29 06:05:04 +02:00
|
|
|
assert withGimpPlugin -> gimp != null;
|
|
|
|
|
|
|
|
let
|
|
|
|
version = "2.2.2";
|
|
|
|
|
|
|
|
# CMakeLists.txt is missing from the tarball and Makefile is terrible
|
|
|
|
CMakeLists = fetchurl {
|
|
|
|
url = "https://github.com/dtschump/gmic/raw/v.${version}/CMakeLists.txt";
|
|
|
|
sha256 = "0lv5jrg98cpbk13fl4xm7l4sk1axfz054q570bpi741w815d7cpg";
|
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
2015-07-16 22:01:43 +02:00
|
|
|
name = "gmic-${version}";
|
2018-04-29 06:05:04 +02:00
|
|
|
|
|
|
|
outputs = [ "out" "lib" "dev" "man" ] ++ stdenv.lib.optional withGimpPlugin "gimpPlugin";
|
2015-07-16 22:01:43 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 20:43:35 +02:00
|
|
|
url = "https://gmic.eu/files/source/gmic_${version}.tar.gz";
|
2018-04-29 06:05:04 +02:00
|
|
|
sha256 = "0zqfj2ym5nn3ff93xh2wf9ayxqlznabbdi00xw4lm7vw3iwkzqnc";
|
2015-07-16 22:01:43 +02:00
|
|
|
};
|
|
|
|
|
2018-04-29 06:05:04 +02:00
|
|
|
nativeBuildInputs = [ cmake ninja pkgconfig ];
|
2016-11-16 23:50:44 +01:00
|
|
|
|
2018-04-29 06:05:04 +02:00
|
|
|
buildInputs = [
|
|
|
|
fftw zlib libjpeg libtiff libpng opencv openexr graphicsmagick
|
|
|
|
] ++ stdenv.lib.optionals withGimpPlugin [ gimp gimp.gtk ];
|
2015-07-16 22:01:43 +02:00
|
|
|
|
2018-04-29 06:05:04 +02:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_LIB_STATIC=OFF"
|
|
|
|
"-DBUILD_PLUGIN=${if withGimpPlugin then "ON" else "OFF"}"
|
|
|
|
"-DENABLE_DYNAMIC_LINKING=ON"
|
|
|
|
];
|
2015-07-16 22:01:43 +02:00
|
|
|
|
2018-04-29 06:05:04 +02:00
|
|
|
postPatch = ''
|
|
|
|
cp ${CMakeLists} CMakeLists.txt
|
2015-07-16 22:01:43 +02:00
|
|
|
'';
|
|
|
|
|
2018-04-29 06:05:04 +02:00
|
|
|
preConfigure = stdenv.lib.optionalString withGimpPlugin ''
|
|
|
|
cmakeFlags="$cmakeFlags -DPLUGIN_INSTALL_PREFIX=$gimpPlugin/${gimp.targetPluginDir}"
|
2015-07-16 22:01:43 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "G'MIC is an open and full-featured framework for image processing";
|
|
|
|
homepage = http://gmic.eu/;
|
|
|
|
license = licenses.cecill20;
|
2016-09-22 03:51:07 +02:00
|
|
|
platforms = platforms.unix;
|
2015-07-16 22:01:43 +02:00
|
|
|
};
|
|
|
|
}
|