Loading pkgs/applications/graphics/gimp/default.nix +17 −13 Original line number Diff line number Diff line Loading @@ -53,14 +53,14 @@ let python = python2.withPackages (pp: [ pp.pygtk ]); in stdenv.mkDerivation rec { in stdenv.mkDerivation (finalAttrs: { pname = "gimp"; version = "2.10.34"; outputs = [ "out" "dev" ]; src = fetchurl { url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2"; url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor finalAttrs.version}/gimp-${finalAttrs.version}.tar.bz2"; sha256 = "hABGQtNRs5ikKTzX/TWSBEqUTwW7UoUO5gaPJHxleqM="; }; Loading Loading @@ -154,10 +154,12 @@ in stdenv.mkDerivation rec { doCheck = true; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DGDK_OSX_BIG_SUR=16"; env = { NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DGDK_OSX_BIG_SUR=16"; # Check if librsvg was built with --disable-pixbuf-loader. PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}"; }; preConfigure = '' # The check runs before glib-networking is registered Loading @@ -165,21 +167,23 @@ in stdenv.mkDerivation rec { ''; postFixup = '' wrapProgram $out/bin/gimp-${lib.versions.majorMinor version} \ wrapProgram $out/bin/gimp-${lib.versions.majorMinor finalAttrs.version} \ --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" ''; passthru = rec { passthru = { # The declarations for `gimp-with-plugins` wrapper, # used for determining plug-in installation paths majorVersion = "${lib.versions.major version}.0"; targetLibDir = "lib/gimp/${majorVersion}"; targetDataDir = "share/gimp/${majorVersion}"; targetPluginDir = "${targetLibDir}/plug-ins"; targetScriptDir = "${targetDataDir}/scripts"; majorVersion = "${lib.versions.major finalAttrs.version}.0"; targetLibDir = "lib/gimp/${finalAttrs.passthru.majorVersion}"; targetDataDir = "share/gimp/${finalAttrs.passthru.majorVersion}"; targetPluginDir = "${finalAttrs.passthru.targetLibDir}/plug-ins"; targetScriptDir = "${finalAttrs.passthru.targetDataDir}/scripts"; # probably its a good idea to use the same gtk in plugins ? gtk = gtk2; python2Support = withPython; }; meta = with lib; { Loading @@ -190,4 +194,4 @@ in stdenv.mkDerivation rec { platforms = platforms.unix; mainProgram = "gimp"; }; } }) pkgs/applications/graphics/gimp/plugins/default.nix +37 −23 Original line number Diff line number Diff line Loading @@ -31,10 +31,6 @@ let install -Dt "$pluginDir" "$@" } ''; # Override installation paths. PKG_CONFIG_GIMP_2_0_GIMPLIBDIR = "${placeholder "out"}/${gimp.targetLibDir}"; PKG_CONFIG_GIMP_2_0_GIMPDATADIR = "${placeholder "out"}/${gimp.targetDataDir}"; } // attrs // { Loading @@ -49,8 +45,13 @@ let pkg-config intltool ] ++ (attrs.nativeBuildInputs or []); } ); # Override installation paths. env = { PKG_CONFIG_GIMP_2_0_GIMPLIBDIR = "${placeholder "out"}/${gimp.targetLibDir}"; PKG_CONFIG_GIMP_2_0_GIMPDATADIR = "${placeholder "out"}/${gimp.targetDataDir}"; } // attrs.env or { }; }); scriptDerivation = {src, ...}@attrs : pluginDerivation ({ prePhases = "extraLib"; Loading Loading @@ -116,8 +117,13 @@ in url = "https://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2"; sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql"; }; NIX_LDFLAGS = "-lm"; hardeningDisable = [ "format" ]; env = { NIX_LDFLAGS = "-lm"; }; meta = with lib; { description = "The GIMP Animation Package"; homepage = "https://www.gimp.org"; Loading Loading @@ -208,6 +214,10 @@ in rev = "v${version}"; sha256 = "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j"; }; meta = { broken = !gimp.python2Support; }; }; texturize = pluginDerivation { Loading @@ -233,15 +243,19 @@ in pname = "wavelet-sharpen"; version = "0.1.2"; src = fetchurl { url = "https://github.com/pixlsus/registry.gimp.org_static/raw/master/registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz"; sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw"; }; env = { # Workaround build failure on -fno-common toolchains like upstream # gcc-10. Otherwise build fails as: # ld: interface.o:(.bss+0xe0): multiple definition of `fimg'; plugin.o:(.bss+0x40): first defined here env.NIX_CFLAGS_COMPILE = "-fcommon"; NIX_CFLAGS_COMPILE = "-fcommon"; NIX_LDFLAGS = "-lm"; src = fetchurl { url = "https://github.com/pixlsus/registry.gimp.org_static/raw/master/registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz"; sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw"; }; installPhase = "installPlugin src/wavelet-sharpen"; # TODO translations are not copied .. How to do this on nix? }; Loading pkgs/applications/graphics/gimp/wrapper.nix +3 −2 Original line number Diff line number Diff line { lib, symlinkJoin, gimp, makeWrapper, gimpPlugins, gnome, plugins ? null}: { lib, symlinkJoin, makeWrapper, gimpPlugins, gnome, plugins ? null}: let inherit (gimpPlugins) gimp; allPlugins = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (lib.attrValues gimpPlugins); selectedPlugins = lib.filter (pkg: pkg != gimpPlugins.gimp) (if plugins == null then allPlugins else plugins); selectedPlugins = lib.filter (pkg: pkg != gimp) (if plugins == null then allPlugins else plugins); extraArgs = map (x: x.wrapArgs or "") selectedPlugins; versionBranch = lib.versions.majorMinor gimp.version; Loading Loading
pkgs/applications/graphics/gimp/default.nix +17 −13 Original line number Diff line number Diff line Loading @@ -53,14 +53,14 @@ let python = python2.withPackages (pp: [ pp.pygtk ]); in stdenv.mkDerivation rec { in stdenv.mkDerivation (finalAttrs: { pname = "gimp"; version = "2.10.34"; outputs = [ "out" "dev" ]; src = fetchurl { url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2"; url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor finalAttrs.version}/gimp-${finalAttrs.version}.tar.bz2"; sha256 = "hABGQtNRs5ikKTzX/TWSBEqUTwW7UoUO5gaPJHxleqM="; }; Loading Loading @@ -154,10 +154,12 @@ in stdenv.mkDerivation rec { doCheck = true; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DGDK_OSX_BIG_SUR=16"; env = { NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DGDK_OSX_BIG_SUR=16"; # Check if librsvg was built with --disable-pixbuf-loader. PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}"; }; preConfigure = '' # The check runs before glib-networking is registered Loading @@ -165,21 +167,23 @@ in stdenv.mkDerivation rec { ''; postFixup = '' wrapProgram $out/bin/gimp-${lib.versions.majorMinor version} \ wrapProgram $out/bin/gimp-${lib.versions.majorMinor finalAttrs.version} \ --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" ''; passthru = rec { passthru = { # The declarations for `gimp-with-plugins` wrapper, # used for determining plug-in installation paths majorVersion = "${lib.versions.major version}.0"; targetLibDir = "lib/gimp/${majorVersion}"; targetDataDir = "share/gimp/${majorVersion}"; targetPluginDir = "${targetLibDir}/plug-ins"; targetScriptDir = "${targetDataDir}/scripts"; majorVersion = "${lib.versions.major finalAttrs.version}.0"; targetLibDir = "lib/gimp/${finalAttrs.passthru.majorVersion}"; targetDataDir = "share/gimp/${finalAttrs.passthru.majorVersion}"; targetPluginDir = "${finalAttrs.passthru.targetLibDir}/plug-ins"; targetScriptDir = "${finalAttrs.passthru.targetDataDir}/scripts"; # probably its a good idea to use the same gtk in plugins ? gtk = gtk2; python2Support = withPython; }; meta = with lib; { Loading @@ -190,4 +194,4 @@ in stdenv.mkDerivation rec { platforms = platforms.unix; mainProgram = "gimp"; }; } })
pkgs/applications/graphics/gimp/plugins/default.nix +37 −23 Original line number Diff line number Diff line Loading @@ -31,10 +31,6 @@ let install -Dt "$pluginDir" "$@" } ''; # Override installation paths. PKG_CONFIG_GIMP_2_0_GIMPLIBDIR = "${placeholder "out"}/${gimp.targetLibDir}"; PKG_CONFIG_GIMP_2_0_GIMPDATADIR = "${placeholder "out"}/${gimp.targetDataDir}"; } // attrs // { Loading @@ -49,8 +45,13 @@ let pkg-config intltool ] ++ (attrs.nativeBuildInputs or []); } ); # Override installation paths. env = { PKG_CONFIG_GIMP_2_0_GIMPLIBDIR = "${placeholder "out"}/${gimp.targetLibDir}"; PKG_CONFIG_GIMP_2_0_GIMPDATADIR = "${placeholder "out"}/${gimp.targetDataDir}"; } // attrs.env or { }; }); scriptDerivation = {src, ...}@attrs : pluginDerivation ({ prePhases = "extraLib"; Loading Loading @@ -116,8 +117,13 @@ in url = "https://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2"; sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql"; }; NIX_LDFLAGS = "-lm"; hardeningDisable = [ "format" ]; env = { NIX_LDFLAGS = "-lm"; }; meta = with lib; { description = "The GIMP Animation Package"; homepage = "https://www.gimp.org"; Loading Loading @@ -208,6 +214,10 @@ in rev = "v${version}"; sha256 = "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j"; }; meta = { broken = !gimp.python2Support; }; }; texturize = pluginDerivation { Loading @@ -233,15 +243,19 @@ in pname = "wavelet-sharpen"; version = "0.1.2"; src = fetchurl { url = "https://github.com/pixlsus/registry.gimp.org_static/raw/master/registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz"; sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw"; }; env = { # Workaround build failure on -fno-common toolchains like upstream # gcc-10. Otherwise build fails as: # ld: interface.o:(.bss+0xe0): multiple definition of `fimg'; plugin.o:(.bss+0x40): first defined here env.NIX_CFLAGS_COMPILE = "-fcommon"; NIX_CFLAGS_COMPILE = "-fcommon"; NIX_LDFLAGS = "-lm"; src = fetchurl { url = "https://github.com/pixlsus/registry.gimp.org_static/raw/master/registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz"; sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw"; }; installPhase = "installPlugin src/wavelet-sharpen"; # TODO translations are not copied .. How to do this on nix? }; Loading
pkgs/applications/graphics/gimp/wrapper.nix +3 −2 Original line number Diff line number Diff line { lib, symlinkJoin, gimp, makeWrapper, gimpPlugins, gnome, plugins ? null}: { lib, symlinkJoin, makeWrapper, gimpPlugins, gnome, plugins ? null}: let inherit (gimpPlugins) gimp; allPlugins = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (lib.attrValues gimpPlugins); selectedPlugins = lib.filter (pkg: pkg != gimpPlugins.gimp) (if plugins == null then allPlugins else plugins); selectedPlugins = lib.filter (pkg: pkg != gimp) (if plugins == null then allPlugins else plugins); extraArgs = map (x: x.wrapArgs or "") selectedPlugins; versionBranch = lib.versions.majorMinor gimp.version; Loading