dotfiles/pkgs/gimp/default.nix

145 lines
3.4 KiB
Nix
Raw Normal View History

2023-09-13 17:20:18 +07:00
{ lib
, gimp
, fetchFromGitHub
, substituteAll
, fetchpatch
, meson
, ninja
, pkg-config
, gettext
, gtk3
, graphviz
, libarchive
, luajit
, python3
, wrapGAppsHook
, libxslt
, gobject-introspection
, vala
, gi-docgen
, perl
, appstream-glib
, desktop-file-utils
, json-glib
, gjs
, xorg
, xvfb-run
, dbus
, adwaita-icon-theme
2023-09-13 17:20:18 +07:00
, alsa-lib
, glib
, glib-networking
2024-08-15 09:06:06 +07:00
, libiff
, libilbm
, cfitsio
2023-09-13 17:20:18 +07:00
}:
let
python = python3.withPackages (pp: with pp; [
pygobject3
]);
in gimp.overrideAttrs (old: rec {
2024-08-15 09:06:06 +07:00
version = "2_99_18+date=2024-02-18";
2023-09-13 17:20:18 +07:00
outputs = [ "out" "dev" "devdoc" ];
src = fetchFromGitHub {
owner = "GNOME";
repo = "gimp";
2024-08-15 09:06:06 +07:00
rev = "f94c4cb5dbf9766b27ecb5016b7a39497cc74ddc";
hash = "sha256-rQd/EwGk6AFQ4dQCx2Jys60mcDvaLSkXeVsrjTJw8wg=";
2023-09-13 17:20:18 +07:00
};
patches = [
(substituteAll {
2024-08-15 09:06:06 +07:00
src = ./hardcode-plugin-interpreters.patch;
2023-09-13 17:20:18 +07:00
python_interpreter = python.interpreter;
})
(substituteAll {
src = fetchpatch {
url = "https://raw.githubusercontent.com/NixOS/nixpkgs/86947c8f83a3bd593eefb8e5f433f0d045c3d9a7/pkgs/applications/graphics/gimp/tests-dbus-conf.patch";
hash = "sha256-XEsYmrNcuF6i4/EwTbXZ+vI6zY9iLbasn0I5EHhwLWU=";
};
session_conf = "${dbus.out}/share/dbus-1/session.conf";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/NixOS/nixpkgs/86947c8f83a3bd593eefb8e5f433f0d045c3d9a7/pkgs/applications/graphics/gimp/fix-isocodes-paths.patch";
hash = "sha256-8jqQmfbOARMPNIsBfNKpMIeK4dXoAme7rUJeQZwh4PM=";
})
2023-10-10 04:07:13 +07:00
./floating-paste.patch
2024-08-15 09:06:06 +07:00
./fix-docs.patch
2023-09-13 17:20:18 +07:00
];
nativeBuildInputs = [
meson
ninja
pkg-config
gettext
wrapGAppsHook
libxslt
gobject-introspection
perl
vala
gi-docgen
desktop-file-utils
xvfb-run
dbus
];
buildInputs = builtins.filter (x: !builtins.elem (lib.getName x) ["gtk2"]) old.buildInputs
++ [
appstream-glib
gtk3
libarchive
json-glib
python
xorg.libXmu
adwaita-icon-theme
2023-09-13 17:20:18 +07:00
(luajit.withPackages (ps: [ ps.lgi ]))
alsa-lib
gjs
2024-08-15 09:06:06 +07:00
libiff
libilbm
cfitsio
2023-09-13 17:20:18 +07:00
];
2024-08-15 09:06:06 +07:00
configureFlags = [ ];
2023-09-13 17:20:18 +07:00
mesonFlags = [
"-Dbug-report-url=https://github.com/NixOS/nixpkgs/issues/new"
"-Dicc-directory=/run/current-system/sw/share/color/icc"
"-Dcheck-update=no"
"-Dappdata-test=disabled"
];
2023-10-08 08:23:29 +07:00
env = old.env // { GIO_EXTRA_MODULES = "${glib-networking}/lib/gio/modules"; };
2023-09-13 17:20:18 +07:00
preConfigure = "";
2023-10-08 08:23:29 +07:00
postPatch = ''
2023-09-13 17:20:18 +07:00
patchShebangs \
app/tests/create_test_env.sh \
tools/gimp-mkenums
substitute app/git-version.h.in git-version.h \
--subst-var-by GIMP_GIT_VERSION "GIMP_2.99.?-g${builtins.substring 0 10 src.rev}" \
--subst-var-by GIMP_GIT_VERSION_ABBREV "${builtins.substring 0 10 src.rev}" \
--subst-var-by GIMP_GIT_LAST_COMMIT_YEAR "${builtins.head (builtins.match ".+\+date=([0-9]{4})-[0-9]{2}-[0-9]{2}" version)}"
'';
preCheck = ''
export NO_AT_BRIDGE=1
export HOME="$TMPDIR"
export XDG_DATA_DIRS="${glib.getSchemaDataDirPath gtk3}:$XDG_DATA_DIRS"
'';
checkPhase = ''
runHook preCheck
meson test --timeout-multiplier 4 --print-errorlogs
runHook postCheck
'';
2024-08-15 09:06:06 +07:00
doCheck = false;
2023-09-13 17:20:18 +07:00
preFixup = ''
2023-10-08 08:23:29 +07:00
gappsWrapperArgs+=(\
--prefix PATH : "${lib.makeBinPath [ graphviz ]}:$out/bin" \
--suffix XDG_DATA_DIRS : "${adwaita-icon-theme}/share" \
2023-10-08 08:23:29 +07:00
)
2023-09-13 17:20:18 +07:00
'';
postFixup = ''
moveToOutput "share/doc" "$devdoc"
'';
passthru = old.passthru // {
majorVersion = "2.99";
gtk = gtk3;
};
})