1
- # install these packages into your profile. Then add
2
- # ~/.nix-profile/gimp-version-plugins to your plugin list you can find at
3
- # preferences -> Folders -> Plug-ins
4
- # same applies for the scripts
1
+ # Use `gimp-with-plugins` package for GIMP with all plug-ins.
2
+ # If you just want a subset of plug-ins, you can specify them explicitly:
3
+ # `gimp-with-plugins.override { plugins = with gimpPlugins; [ gap ]; }`.
4
+
5
+ { config , lib , pkgs } :
5
6
6
- { config , pkgs , gimp } :
7
7
let
8
- inherit ( pkgs ) stdenv fetchurl pkgconfig intltool glib fetchFromGitHub ;
9
- inherit ( gimp ) targetPluginDir targetScriptDir ;
8
+ inherit ( pkgs ) stdenv fetchurl pkg-config intltool glib fetchFromGitHub ;
9
+ in
10
10
11
- pluginDerivation = a : let
12
- name = a . name or "${ a . pname } -${ a . version } " ;
11
+ lib . makeScope pkgs . newScope ( self :
12
+
13
+ let
14
+ # Use GIMP from the scope.
15
+ inherit ( self ) gimp ;
16
+
17
+ pluginDerivation = attrs : let
18
+ name = attrs . name or "${ attrs . pname } -${ attrs . version } " ;
13
19
in stdenv . mkDerivation ( {
14
20
prePhases = "extraLib" ;
15
21
extraLib = ''
16
22
installScripts(){
17
- mkdir -p $out/${ targetScriptDir } /${ name } ;
18
- for p in "$@"; do cp "$p" -r $out/${ targetScriptDir } /${ name } ; done
23
+ mkdir -p $out/${ gimp . targetScriptDir } /${ name } ;
24
+ for p in "$@"; do cp "$p" -r $out/${ gimp . targetScriptDir } /${ name } ; done
19
25
}
20
26
installPlugins(){
21
- mkdir -p $out/${ targetPluginDir } /${ name } ;
22
- for p in "$@"; do cp "$p" -r $out/${ targetPluginDir } /${ name } ; done
27
+ mkdir -p $out/${ gimp . targetPluginDir } /${ name } ;
28
+ for p in "$@"; do cp "$p" -r $out/${ gimp . targetPluginDir } /${ name } ; done
23
29
}
24
30
'' ;
31
+
32
+ # Override installation paths.
33
+ PKG_CONFIG_GIMP_2_0_GIMPLIBDIR = "${ placeholder "out" } /${ gimp . targetLibDir } " ;
34
+ PKG_CONFIG_GIMP_2_0_GIMPDATADIR = "${ placeholder "out" } /${ gimp . targetDataDir } " ;
25
35
}
26
- // a
36
+ // attrs
27
37
// {
28
38
name = "gimp-plugin-${ name } " ;
29
- buildInputs = [ gimp gimp . gtk glib ] ++ ( a . buildInputs or [ ] ) ;
30
- nativeBuildInputs = [ pkgconfig intltool ] ++ ( a . nativeBuildInputs or [ ] ) ;
39
+ buildInputs = [
40
+ gimp
41
+ gimp . gtk
42
+ glib
43
+ ] ++ ( attrs . buildInputs or [ ] ) ;
44
+
45
+ nativeBuildInputs = [
46
+ pkg-config
47
+ intltool
48
+ ] ++ ( attrs . nativeBuildInputs or [ ] ) ;
31
49
}
32
50
) ;
33
51
34
52
scriptDerivation = { src , ...} @attrs : pluginDerivation ( {
35
53
phases = [ "extraLib" "installPhase" ] ;
36
54
installPhase = "installScripts ${ src } " ;
37
55
} // attrs ) ;
38
-
39
56
in
57
+ {
58
+ # Allow overriding GIMP package in the scope.
59
+ inherit ( pkgs ) gimp ;
40
60
41
- stdenv . lib . makeScope pkgs . newScope ( self : with self ; {
42
61
gap = pluginDerivation {
43
62
/* menu:
44
63
Video
@@ -49,10 +68,6 @@ stdenv.lib.makeScope pkgs.newScope (self: with self; {
49
68
sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql" ;
50
69
} ;
51
70
NIX_LDFLAGS = "-lm" ;
52
- patchPhase = ''
53
- sed -e 's,^\(GIMP_PLUGIN_DIR=\).*,\1'"$out/${ gimp . name } -plugins", \
54
- -e 's,^\(GIMP_DATA_DIR=\).*,\1'"$out/share/${ gimp . name } ", -i configure
55
- '' ;
56
71
hardeningDisable = [ "format" ] ;
57
72
meta = with stdenv . lib ; {
58
73
description = "The GIMP Animation Package" ;
@@ -99,7 +114,7 @@ stdenv.lib.makeScope pkgs.newScope (self: with self; {
99
114
version = "2.0.3" ;
100
115
buildInputs = with pkgs ; [ fftw ] ;
101
116
nativeBuildInputs = with pkgs ; [ autoreconfHook ] ;
102
- makeFlags = [ "GIMP_LIBDIR=${ placeholder "out" } /lib/ gimp/2.0 " ] ;
117
+ makeFlags = [ "GIMP_LIBDIR=${ placeholder "out" } /${ gimp . targetLibDir } " ] ;
103
118
src = fetchFromGitHub {
104
119
owner = "bootchk" ;
105
120
repo = "resynthesizer" ;
@@ -138,14 +153,14 @@ stdenv.lib.makeScope pkgs.newScope (self: with self; {
138
153
Layer/Liquid Rescale
139
154
*/
140
155
pname = "lqr-plugin" ;
141
- version = "0.7.1 " ;
156
+ version = "0.7.2 " ;
142
157
buildInputs = with pkgs ; [ liblqr1 ] ;
143
- src = fetchurl {
144
- url = "https://github.com/pixlsus/registry.gimp.org_static/raw/master/registry.gimp.org/files/gimp-lqr-plugin-${ version } .tar.bz2" ;
145
- sha256 = "sha256-YpgYPjHZkueJWS51QGmugXavGS+1x4o20St31qoRng4=" ;
158
+ src = fetchFromGitHub {
159
+ owner = "carlobaldassi" ;
160
+ repo = "gimp-lqr-plugin" ;
161
+ rev = "v${ version } " ;
162
+ sha256 = "81ajdZ2zQi/THxnBlSeT36tVTEzrS1YqLGpHMhFTKAo=" ;
146
163
} ;
147
- #postInstall = ''mkdir -p $out/nix-support; echo "${liblqr1}" > "$out/nix-support/propagated-user-env-packages"'';
148
- installPhase = "installPlugins src/gimp-lqr-plugin" ;
149
164
} ;
150
165
151
166
gmic = pkgs . gmic-qt . override {
@@ -201,9 +216,4 @@ stdenv.lib.makeScope pkgs.newScope (self: with self; {
201
216
sha256 = "c14a8f4f709695ede3f77348728a25b3f3ded420da60f3f8de3944b7eae98a49" ;
202
217
} ;
203
218
} ;
204
-
205
- } // stdenv . lib . optionalAttrs ( config . allowAliases or true ) {
206
-
207
- resynthesizer2 = resynthesizer ;
208
-
209
219
} )
0 commit comments