2020-11-11 14:33:49 +01:00
|
|
|
# Use `gimp-with-plugins` package for GIMP with all plug-ins.
|
|
|
|
# If you just want a subset of plug-ins, you can specify them explicitly:
|
|
|
|
# `gimp-with-plugins.override { plugins = with gimpPlugins; [ gap ]; }`.
|
|
|
|
|
|
|
|
{ config, lib, pkgs }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (pkgs) stdenv fetchurl pkg-config intltool glib fetchFromGitHub;
|
|
|
|
in
|
|
|
|
|
|
|
|
lib.makeScope pkgs.newScope (self:
|
2009-06-14 03:30:12 +02:00
|
|
|
|
|
|
|
let
|
2020-11-11 14:33:49 +01:00
|
|
|
# Use GIMP from the scope.
|
|
|
|
inherit (self) gimp;
|
2009-06-14 03:30:12 +02:00
|
|
|
|
2020-11-11 00:14:16 +01:00
|
|
|
pluginDerivation = attrs: let
|
|
|
|
name = attrs.name or "${attrs.pname}-${attrs.version}";
|
2019-11-03 04:35:30 +01:00
|
|
|
in stdenv.mkDerivation ({
|
2009-06-14 03:30:12 +02:00
|
|
|
prePhases = "extraLib";
|
|
|
|
extraLib = ''
|
|
|
|
installScripts(){
|
2020-11-11 14:33:49 +01:00
|
|
|
mkdir -p $out/${gimp.targetScriptDir}/${name};
|
|
|
|
for p in "$@"; do cp "$p" -r $out/${gimp.targetScriptDir}/${name}; done
|
2009-06-14 03:30:12 +02:00
|
|
|
}
|
2021-02-11 02:11:01 +01:00
|
|
|
installPlugin() {
|
|
|
|
# The base name of the first argument is the plug-in name and the main executable.
|
|
|
|
# GIMP only allows a single plug-in per directory:
|
|
|
|
# https://gitlab.gnome.org/GNOME/gimp/-/commit/efae55a73e98389e38fa0e59ebebcda0abe3ee96
|
|
|
|
pluginDir=$out/${gimp.targetPluginDir}/$(basename "$1")
|
|
|
|
install -Dt "$pluginDir" "$@"
|
2009-06-14 03:30:12 +02:00
|
|
|
}
|
|
|
|
'';
|
2020-11-11 00:14:16 +01:00
|
|
|
|
|
|
|
# Override installation paths.
|
|
|
|
PKG_CONFIG_GIMP_2_0_GIMPLIBDIR = "${placeholder "out"}/${gimp.targetLibDir}";
|
|
|
|
PKG_CONFIG_GIMP_2_0_GIMPDATADIR = "${placeholder "out"}/${gimp.targetDataDir}";
|
2009-06-14 03:30:12 +02:00
|
|
|
}
|
2020-11-11 00:14:16 +01:00
|
|
|
// attrs
|
2017-05-01 16:52:29 +02:00
|
|
|
// {
|
2020-03-02 23:48:21 +01:00
|
|
|
name = "${gimp.name}-plugin-${name}";
|
2020-11-11 14:33:49 +01:00
|
|
|
buildInputs = [
|
|
|
|
gimp
|
|
|
|
gimp.gtk
|
|
|
|
glib
|
|
|
|
] ++ (attrs.buildInputs or []);
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
intltool
|
|
|
|
] ++ (attrs.nativeBuildInputs or []);
|
2017-05-01 16:52:29 +02:00
|
|
|
}
|
2009-06-14 03:30:12 +02:00
|
|
|
);
|
|
|
|
|
2019-11-03 13:56:21 +01:00
|
|
|
scriptDerivation = {src, ...}@attrs : pluginDerivation ({
|
|
|
|
phases = [ "extraLib" "installPhase" ];
|
2009-06-14 03:30:12 +02:00
|
|
|
installPhase = "installScripts ${src}";
|
2019-11-03 13:56:21 +01:00
|
|
|
} // attrs);
|
2009-06-14 03:30:12 +02:00
|
|
|
in
|
2020-11-11 14:33:49 +01:00
|
|
|
{
|
|
|
|
# Allow overriding GIMP package in the scope.
|
|
|
|
inherit (pkgs) gimp;
|
2019-05-12 14:40:30 +02:00
|
|
|
|
2010-02-11 16:08:05 +01:00
|
|
|
gap = pluginDerivation {
|
|
|
|
/* menu:
|
|
|
|
Video
|
|
|
|
*/
|
|
|
|
name = "gap-2.6.0";
|
|
|
|
src = fetchurl {
|
2020-04-01 03:11:51 +02:00
|
|
|
url = "https://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2";
|
2010-02-11 16:08:05 +01:00
|
|
|
sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql";
|
|
|
|
};
|
2019-10-30 01:40:49 +01:00
|
|
|
NIX_LDFLAGS = "-lm";
|
2016-10-13 22:50:55 +02:00
|
|
|
hardeningDisable = [ "format" ];
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2010-02-11 16:08:05 +01:00
|
|
|
description = "The GIMP Animation Package";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.gimp.org";
|
2010-02-11 16:08:05 +01:00
|
|
|
# The main code is given in GPLv3, but it has ffmpeg in it, and I think ffmpeg license
|
|
|
|
# falls inside "free".
|
2015-05-27 21:56:04 +02:00
|
|
|
license = with licenses; [ gpl3 free ];
|
2010-02-11 16:08:05 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-02-18 13:03:04 +01:00
|
|
|
farbfeld = pluginDerivation rec {
|
|
|
|
pname = "farbfeld";
|
|
|
|
version = "unstable-2019-08-12";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ids1024";
|
|
|
|
repo = "gimp-farbfeld";
|
|
|
|
rev = "5feacebf61448bd3c550dda03cd08130fddc5af4";
|
|
|
|
sha256 = "1vmw7k773vrndmfffj0m503digdjmkpcqy2r3p3i5x0qw9vkkkc6";
|
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
installPlugin farbfeld
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Gimp plug-in for the farbfeld image format";
|
|
|
|
homepage = "https://github.com/ids1024/gimp-farbfeld";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ sikmir ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2013-11-10 20:16:37 +01:00
|
|
|
fourier = pluginDerivation rec {
|
2009-06-14 03:30:12 +02:00
|
|
|
/* menu:
|
|
|
|
Filters/Generic/FFT Forward
|
|
|
|
Filters/Generic/FFT Inverse
|
|
|
|
*/
|
2021-02-11 01:45:15 +01:00
|
|
|
pname = "fourier";
|
|
|
|
version = "0.4.3";
|
2019-11-20 23:29:45 +01:00
|
|
|
|
2009-06-14 03:30:12 +02:00
|
|
|
src = fetchurl {
|
2021-02-11 01:45:15 +01:00
|
|
|
url = "https://www.lprp.fr/files/old-web/soft/gimp/${pname}-${version}.tar.gz";
|
2019-11-20 23:29:45 +01:00
|
|
|
sha256 = "0mf7f8vaqs2madx832x3kcxw3hv3w3wampvzvaps1mkf2kvrjbsn";
|
|
|
|
};
|
|
|
|
|
2021-02-11 01:45:15 +01:00
|
|
|
buildInputs = with pkgs; [ fftw ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# The tarball contains a prebuilt binary.
|
|
|
|
make clean
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2021-02-11 02:11:01 +01:00
|
|
|
installPlugin fourier
|
2021-02-11 01:45:15 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2019-11-20 23:29:45 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-11-20 23:29:45 +01:00
|
|
|
description = "GIMP plug-in to do the fourier transform";
|
|
|
|
homepage = "https://people.via.ecp.fr/~remi/soft/gimp/gimp_plugin_en.php3#fourier";
|
|
|
|
license = with licenses; [ gpl3Plus ];
|
2009-06-14 03:30:12 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-05-12 14:41:35 +02:00
|
|
|
resynthesizer = pluginDerivation rec {
|
2016-10-11 19:57:26 +02:00
|
|
|
/* menu:
|
2019-05-12 14:58:16 +02:00
|
|
|
Edit/Fill with pattern seamless...
|
|
|
|
Filters/Enhance/Heal selection...
|
|
|
|
Filters/Enhance/Heal transparency...
|
|
|
|
Filters/Enhance/Sharpen by synthesis...
|
|
|
|
Filters/Enhance/Uncrop...
|
|
|
|
Filters/Map/Style...
|
|
|
|
Filters/Render/Texture...
|
2016-10-11 19:57:26 +02:00
|
|
|
*/
|
2019-05-04 02:43:46 +02:00
|
|
|
pname = "resynthesizer";
|
|
|
|
version = "2.0.3";
|
2017-05-02 08:26:10 +02:00
|
|
|
buildInputs = with pkgs; [ fftw ];
|
2017-05-04 15:44:59 +02:00
|
|
|
nativeBuildInputs = with pkgs; [ autoreconfHook ];
|
2020-11-11 00:14:16 +01:00
|
|
|
makeFlags = [ "GIMP_LIBDIR=${placeholder "out"}/${gimp.targetLibDir}" ];
|
2016-10-11 19:57:26 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bootchk";
|
|
|
|
repo = "resynthesizer";
|
2019-05-04 02:43:46 +02:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j";
|
2016-10-11 19:57:26 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2009-06-14 03:30:12 +02:00
|
|
|
texturize = pluginDerivation {
|
2017-11-16 01:55:49 +01:00
|
|
|
name = "texturize-2.2.2017-07-28";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lmanul";
|
|
|
|
repo = "gimp-texturize";
|
|
|
|
rev = "de4367f71e40fe6d82387eaee68611a80a87e0e1";
|
|
|
|
sha256 = "1zzvbczly7k456c0y6s92a1i8ph4ywmbvdl8i4rcc29l4qd2z8fw";
|
2009-06-14 03:30:12 +02:00
|
|
|
};
|
2021-02-11 02:11:01 +01:00
|
|
|
installPhase = "installPlugin src/texturize";
|
2018-04-29 14:23:46 +02:00
|
|
|
meta.broken = true; # https://github.com/lmanul/gimp-texturize/issues/1
|
2009-06-14 03:30:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
waveletSharpen = pluginDerivation {
|
|
|
|
/* menu:
|
|
|
|
Filters/Enhance/Wavelet sharpen
|
|
|
|
*/
|
|
|
|
name = "wavelet-sharpen-0.1.2";
|
2019-10-30 01:40:49 +01:00
|
|
|
NIX_LDFLAGS = "-lm";
|
2009-06-14 03:30:12 +02:00
|
|
|
src = fetchurl {
|
2020-11-10 22:32:37 +01:00
|
|
|
url = "https://github.com/pixlsus/registry.gimp.org_static/raw/master/registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz";
|
2009-06-14 03:30:12 +02:00
|
|
|
sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw";
|
|
|
|
};
|
2021-02-11 02:11:01 +01:00
|
|
|
installPhase = "installPlugin src/wavelet-sharpen"; # TODO translations are not copied .. How to do this on nix?
|
2009-06-14 03:30:12 +02:00
|
|
|
};
|
|
|
|
|
2020-11-10 22:32:37 +01:00
|
|
|
lqrPlugin = pluginDerivation rec {
|
2009-06-14 03:30:12 +02:00
|
|
|
/* menu:
|
|
|
|
Layer/Liquid Rescale
|
|
|
|
*/
|
2020-11-10 22:32:37 +01:00
|
|
|
pname = "lqr-plugin";
|
2020-11-11 00:16:39 +01:00
|
|
|
version = "0.7.2";
|
2018-04-12 22:02:37 +02:00
|
|
|
buildInputs = with pkgs; [ liblqr1 ];
|
2020-11-11 00:16:39 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "carlobaldassi";
|
|
|
|
repo = "gimp-lqr-plugin";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "81ajdZ2zQi/THxnBlSeT36tVTEzrS1YqLGpHMhFTKAo=";
|
2009-06-14 03:30:12 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-09-07 12:33:56 +02:00
|
|
|
gmic = pkgs.gmic-qt.override {
|
|
|
|
variant = "gimp";
|
|
|
|
};
|
2009-06-26 18:52:35 +02:00
|
|
|
|
2011-09-03 19:31:10 +02:00
|
|
|
gimplensfun = pluginDerivation rec {
|
2019-07-10 23:36:57 +02:00
|
|
|
version = "unstable-2018-10-21";
|
2016-11-11 11:27:08 +01:00
|
|
|
name = "gimplensfun-${version}";
|
2011-09-03 19:31:10 +02:00
|
|
|
|
2016-11-11 11:27:08 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "seebk";
|
|
|
|
repo = "GIMP-Lensfun";
|
2019-07-10 23:36:57 +02:00
|
|
|
rev = "1c5a5c1534b5faf098b7441f8840d22835592f17";
|
|
|
|
sha256 = "1jj3n7spkjc63aipwdqsvq9gi07w13bb1v8iqzvxwzld2kxa3c8w";
|
2011-09-03 19:31:10 +02:00
|
|
|
};
|
|
|
|
|
2019-07-10 23:36:57 +02:00
|
|
|
buildInputs = with pkgs; [ lensfun gexiv2 ];
|
2011-09-03 19:31:10 +02:00
|
|
|
|
|
|
|
installPhase = "
|
2021-02-11 02:11:01 +01:00
|
|
|
installPlugin gimp-lensfun
|
2011-09-03 19:31:10 +02:00
|
|
|
";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "GIMP plugin to correct lens distortion using the lensfun library and database";
|
|
|
|
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://lensfun.sebastiankraft.net/";
|
2011-09-03 19:31:10 +02:00
|
|
|
|
2021-01-15 14:21:58 +01:00
|
|
|
license = lib.licenses.gpl3Plus;
|
2015-01-13 22:33:24 +01:00
|
|
|
maintainers = [ ];
|
2021-01-15 14:21:58 +01:00
|
|
|
platforms = lib.platforms.gnu ++ lib.platforms.linux;
|
2011-09-03 19:31:10 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2009-06-14 03:30:12 +02:00
|
|
|
/* =============== simple script files ==================== */
|
|
|
|
|
2015-11-14 21:32:51 +01:00
|
|
|
# also have a look at enblend-enfuse in all-packages.nix
|
2009-06-30 18:14:34 +02:00
|
|
|
exposureBlend = scriptDerivation {
|
|
|
|
name = "exposure-blend";
|
|
|
|
src = fetchurl {
|
2020-04-01 03:11:51 +02:00
|
|
|
url = "http://tir.astro.utoledo.edu/jdsmith/code/eb/exposure-blend.scm";
|
2009-06-30 18:14:34 +02:00
|
|
|
sha256 = "1b6c9wzpklqras4wwsyw3y3jp6fjmhnnskqiwm5sabs8djknfxla";
|
|
|
|
};
|
2019-11-03 13:57:25 +01:00
|
|
|
meta.broken = true;
|
2009-06-30 18:14:34 +02:00
|
|
|
};
|
|
|
|
|
2009-06-14 03:30:12 +02:00
|
|
|
lightning = scriptDerivation {
|
|
|
|
name = "Lightning";
|
|
|
|
src = fetchurl {
|
2020-11-10 22:32:37 +01:00
|
|
|
url = "https://github.com/pixlsus/registry.gimp.org_static/raw/master/registry.gimp.org/files/Lightning.scm";
|
2009-06-14 03:30:12 +02:00
|
|
|
sha256 = "c14a8f4f709695ede3f77348728a25b3f3ded420da60f3f8de3944b7eae98a49";
|
|
|
|
};
|
|
|
|
};
|
2019-05-12 14:40:30 +02:00
|
|
|
})
|