23 variant ? "standalone",
33 description = "GIMP plugin for the G'MIC image processing framework";
37 extraDeps = [ ]; # Just to keep uniformity and avoid test-for-null
38 description = "Versatile front-end to the image processing framework G'MIC";
44 assert lib.assertMsg (builtins.hasAttr variant variants)
45 "gmic-qt variant \"${variant}\" is not supported. Please use one of ${lib.concatStringsSep ", " (builtins.attrNames variants)}.";
47 assert lib.assertMsg (builtins.all (d: d != null)
48 variants.${variant}.extraDeps
49 ) "gmic-qt variant \"${variant}\" is missing one of its dependencies.";
51 stdenv.mkDerivation (finalAttrs: {
52 pname = "gmic-qt${lib.optionalString (variant != "standalone") "-${variant}"}";
55 src = fetchFromGitHub {
58 rev = "v.${finalAttrs.version}";
59 hash = "sha256-fM6dBxBC2b1/v+rfiP//QaAcTJmMtYPn4OUNwVqKhYk=";
64 libsForQt5.wrapQtAppsHook
82 ++ (with libsForQt5; [
86 ++ lib.optionals stdenv.cc.isClang [
89 ++ variants.${variant}.extraDeps;
93 translations/filters/csv2ts.sh \
94 translations/lrelease.sh
97 ln -s ${gmic.src}/src/gmic.cpp ../src/gmic.cpp
101 (lib.cmakeBool "ENABLE_DYNAMIC_LINKING" true)
102 (lib.cmakeBool "ENABLE_SYSTEM_GMIC" true)
103 (lib.cmakeFeature "GMIC_QT_HOST" (if variant == "standalone" then "none" else variant))
106 postFixup = lib.optionalString (variant == "gimp") ''
107 echo "wrapping $out/${gimp.targetPluginDir}/gmic_gimp_qt/gmic_gimp_qt"
108 wrapQtApp "$out/${gimp.targetPluginDir}/gmic_gimp_qt/gmic_gimp_qt"
113 # They need to be update in lockstep.
114 gimp-plugin = gimpPlugins.gmic;
118 updateScript = nix-update-script {
127 homepage = "http://gmic.eu/";
128 inherit (variants.${variant}) description;
129 license = lib.licenses.gpl3Plus;
130 mainProgram = "gmic_qt";
131 maintainers = with lib.maintainers; [ AndersonTorres ];
132 platforms = lib.platforms.unix;