7 , common-updater-scripts
30 stdenv.mkDerivation (finalAttrs: {
34 outputs = [ "out" "lib" "dev" "man" ];
36 src = fetchFromGitHub {
39 rev = "v.${finalAttrs.version}";
40 hash = "sha256-dYHADdt9PboUgIRU6wu5uCs2KQ88z5/FZPXvvyYct00=";
43 # TODO: build this from source
44 # Reference: src/Makefile, directive gmic_stdlib_community.h
45 gmic_stdlib = fetchurl {
46 name = "gmic_stdlib_community.h";
47 url = "https://gmic.eu/gmic_stdlib_community${lib.replaceStrings ["."] [""] finalAttrs.version}.h";
48 hash = "sha256-M/AL1w9KGi+dIGVQ+vdWY8PSCHi+s/aZef08AxeQMJE=";
69 ] ++ lib.optionals stdenv.cc.isClang [
74 (lib.cmakeBool "BUILD_LIB_STATIC" false)
75 (lib.cmakeBool "ENABLE_CURL" false)
76 (lib.cmakeBool "ENABLE_DYNAMIC_LINKING" true)
77 (lib.cmakeBool "ENABLE_OPENCV" true)
78 (lib.cmakeBool "ENABLE_XSHM" true)
79 (lib.cmakeBool "USE_SYSTEM_CIMG" true)
83 cp -r ${finalAttrs.gmic_stdlib} src/gmic_stdlib_community.h
85 + lib.optionalString stdenv.hostPlatform.isDarwin ''
86 substituteInPlace CMakeLists.txt \
87 --replace "LD_LIBRARY_PATH" "DYLD_LIBRARY_PATH"
92 # Needs to update them all in lockstep.
96 updateScript = writeShellScript "gmic-update-script" ''
98 PATH=${lib.makeBinPath [ common-updater-scripts coreutils curl gnugrep gnused jq ]}
100 latestVersion=$(curl 'https://gmic.eu/files/source/' \
101 | grep -E 'gmic_[^"]+\.tar\.gz' \
102 | sed -E 's/.+<a href="gmic_([^"]+)\.tar\.gz".+/\1/g' \
103 | sort --numeric-sort --reverse | head -n1)
105 if [[ "${finalAttrs.version}" = "$latestVersion" ]]; then
106 echo "The new version same as the old version."
110 for component in src gmic_stdlib; do
111 update-source-version "--source-key=$component" "gmic" $latestVersion --ignore-same-version
117 homepage = "https://gmic.eu/";
118 description = "Open and full-featured framework for image processing";
119 mainProgram = "gmic";
120 license = lib.licenses.cecill21;
122 lib.maintainers.AndersonTorres
124 platforms = lib.platforms.unix;