gimp: Fix interpreter path

GIMP uses python interpreter specified in pygimp.interp file for running Python plug-ins,
so any Python related wrapping is useless. It will pick up and use the python from build PATH.

Let’s use a python environment containing pygtk, which is needed by many plug-ins.

Closes: https://github.com/NixOS/nixpkgs/issues/87883
This commit is contained in:
Jan Tojnar 2020-07-03 05:44:35 +02:00
parent 55668eb671
commit 3b701aa4b6
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4

View file

@ -28,9 +28,10 @@
, ghostscript , ghostscript
, aalib , aalib
, shared-mime-info , shared-mime-info
, python2Packages , python2
, libexif , libexif
, gettext , gettext
, makeWrapper
, xorg , xorg
, glib-networking , glib-networking
, libmypaint , libmypaint
@ -47,7 +48,7 @@
}: }:
let let
inherit (python2Packages) pygtk wrapPython python; python = python2.withPackages (pp: [ pp.pygtk ]);
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
pname = "gimp"; pname = "gimp";
version = "2.10.20"; version = "2.10.20";
@ -63,7 +64,7 @@ in stdenv.mkDerivation rec {
pkgconfig pkgconfig
intltool intltool
gettext gettext
wrapPython makeWrapper
]; ];
buildInputs = [ buildInputs = [
@ -97,7 +98,6 @@ in stdenv.mkDerivation rec {
libwebp libwebp
libheif libheif
python python
pygtk
libexif libexif
xorg.libXpm xorg.libXpm
glib-networking glib-networking
@ -116,8 +116,6 @@ in stdenv.mkDerivation rec {
gegl gegl
]; ];
pythonPath = [ pygtk ];
# Check if librsvg was built with --disable-pixbuf-loader. # Check if librsvg was built with --disable-pixbuf-loader.
PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}"; PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}";
@ -136,9 +134,7 @@ in stdenv.mkDerivation rec {
]; ];
postFixup = '' postFixup = ''
wrapPythonProgramsIn $out/lib/gimp/${passthru.majorVersion}/plug-ins/
wrapProgram $out/bin/gimp-${lib.versions.majorMinor version} \ wrapProgram $out/bin/gimp-${lib.versions.majorMinor version} \
--prefix PYTHONPATH : "$PYTHONPATH" \
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
''; '';