47 , desktopToDarwinBundle
50 , gtk-mac-integration-gtk2
56 python = python2.withPackages (pp: [ pp.pygtk ]);
57 in stdenv.mkDerivation (finalAttrs: {
61 outputs = [ "out" "dev" ];
64 url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor finalAttrs.version}/gimp-${finalAttrs.version}.tar.bz2";
65 sha256 = "sha256-PTvDxppL2zrqm6LVOF7ZjqA5U/OFeq/R1pdgEe1827I=";
69 # to remove compiler from the runtime closure, reference was retained via
70 # gimp --version --verbose output
72 src = ./remove-cc-reference.patch;
73 cc_version = stdenv.cc.cc.name;
76 # Use absolute paths instead of relying on PATH
77 # to make sure plug-ins are loaded by the correct interpreter.
78 ./hardcode-plugin-interpreters.patch
82 autoreconfHook # hardcode-plugin-interpreters.patch changes Makefile.am
88 ] ++ lib.optionals stdenv.isDarwin [
128 ] ++ lib.optionals stdenv.isDarwin [
131 gtk-mac-integration-gtk2
132 ] ++ lib.optionals stdenv.isLinux [
134 ] ++ lib.optionals withPython [
136 # Duplicated here because python.withPackages does not expose the dev output with pkg-config files
140 # needed by gimp-2.0.pc
141 propagatedBuildInputs = [
146 "--without-webkit" # old version is required
147 "--disable-check-update"
148 "--with-bug-report-url=https://github.com/NixOS/nixpkgs/issues/new"
149 "--with-icc-directory=/run/current-system/sw/share/color/icc"
150 # fix libdir in pc files (${exec_prefix} needs to be passed verbatim)
151 "--libdir=\${exec_prefix}/lib"
152 ] ++ lib.optionals (!withPython) [
153 "--disable-python" # depends on Python2 which was EOLed on 2020-01-01
156 enableParallelBuilding = true;
161 NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DGDK_OSX_BIG_SUR=16";
163 # Check if librsvg was built with --disable-pixbuf-loader.
164 PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}";
168 # The check runs before glib-networking is registered
169 export GIO_EXTRA_MODULES="${glib-networking}/lib/gio/modules:$GIO_EXTRA_MODULES"
173 wrapProgram $out/bin/gimp-${lib.versions.majorMinor finalAttrs.version} \
174 --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
178 # The declarations for `gimp-with-plugins` wrapper,
179 # used for determining plug-in installation paths
180 majorVersion = "${lib.versions.major finalAttrs.version}.0";
181 targetLibDir = "lib/gimp/${finalAttrs.passthru.majorVersion}";
182 targetDataDir = "share/gimp/${finalAttrs.passthru.majorVersion}";
183 targetPluginDir = "${finalAttrs.passthru.targetLibDir}/plug-ins";
184 targetScriptDir = "${finalAttrs.passthru.targetDataDir}/scripts";
186 # probably its a good idea to use the same gtk in plugins ?
189 python2Support = withPython;
193 description = "The GNU Image Manipulation Program";
194 homepage = "https://www.gimp.org/";
195 maintainers = with maintainers; [ jtojnar ];
196 license = licenses.gpl3Plus;
197 platforms = platforms.unix;
198 mainProgram = "gimp";