2020-06-18 07:06:33 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, nixosTests
|
|
|
|
, fixDarwinDylibNames
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, gettext
|
|
|
|
, python3
|
|
|
|
, libxslt
|
|
|
|
, docbook-xsl-nons
|
|
|
|
, docbook_xml_dtd_43
|
2021-05-20 23:08:51 +00:00
|
|
|
, gi-docgen
|
2020-06-18 07:06:33 +00:00
|
|
|
, glib
|
|
|
|
, libtiff
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
2021-05-20 23:08:51 +00:00
|
|
|
, gnome
|
2020-06-18 07:06:33 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, doCheck ? false
|
|
|
|
, makeWrapper
|
2020-10-27 00:29:36 +00:00
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gdk-pixbuf";
|
2021-05-20 23:08:51 +00:00
|
|
|
version = "2.42.6";
|
2020-06-18 07:06:33 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" "man" "devdoc" "installedTests" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-05 17:12:51 +00:00
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2021-05-20 23:08:51 +00:00
|
|
|
sha256 = "0zz7pmw2z46g7mr1yjxbsdldd5pd03xbjc58inj8rxfqgrdvg9n4";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Move installed tests to a separate output
|
|
|
|
./installed-tests-path.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2020-06-18 07:06:33 +00:00
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
gettext
|
|
|
|
python3
|
|
|
|
gobject-introspection
|
|
|
|
makeWrapper
|
|
|
|
glib
|
2021-05-20 23:08:51 +00:00
|
|
|
gi-docgen
|
|
|
|
|
|
|
|
# for man pages
|
|
|
|
libxslt
|
|
|
|
docbook-xsl-nons
|
|
|
|
docbook_xml_dtd_43
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
glib
|
|
|
|
libtiff
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
mesonFlags = [
|
2020-12-03 08:41:04 +00:00
|
|
|
"-Dgtk_doc=true"
|
|
|
|
"-Dintrospection=${if gobject-introspection != null then "enabled" else "disabled"}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Dgio_sniffing=false"
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
chmod +x build-aux/* # patchShebangs only applies to executables
|
|
|
|
patchShebangs build-aux
|
|
|
|
|
|
|
|
substituteInPlace tests/meson.build --subst-var-by installedtestsprefix "$installedTests"
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
preInstall = ''
|
|
|
|
PATH=$PATH:$out/bin # for install script
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall =
|
2021-05-20 23:08:51 +00:00
|
|
|
''
|
|
|
|
# All except one utility seem to be only useful during building.
|
|
|
|
moveToOutput "bin" "$dev"
|
|
|
|
moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out"
|
|
|
|
|
|
|
|
# So that devhelp can find this.
|
|
|
|
mkdir -p "$devdoc/share/devhelp"
|
|
|
|
mv "$out/share/doc" "$devdoc/share/devhelp/books"
|
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
# meson erroneously installs loaders with .dylib extension on Darwin.
|
|
|
|
# Their @rpath has to be replaced before gdk-pixbuf-query-loaders looks at them.
|
2020-04-24 23:36:52 +00:00
|
|
|
for f in $out/${passthru.moduleDir}/*.dylib; do
|
|
|
|
install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
|
|
|
|
mv $f ''${f%.dylib}.so
|
|
|
|
done
|
2021-02-05 17:12:51 +00:00
|
|
|
'' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
2020-04-24 23:36:52 +00:00
|
|
|
# We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/
|
|
|
|
$dev/bin/gdk-pixbuf-query-loaders --update-cache
|
|
|
|
'';
|
|
|
|
|
|
|
|
# The fixDarwinDylibNames hook doesn't patch binaries.
|
2021-02-05 17:12:51 +00:00
|
|
|
preFixup = lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
for f in $out/bin/* $dev/bin/*; do
|
|
|
|
install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
# The tests take an excessive amount of time (> 1.5 hours) and memory (> 6 GB).
|
|
|
|
inherit doCheck;
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
separateDebugInfo = stdenv.isLinux;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
passthru = {
|
2021-05-20 23:08:51 +00:00
|
|
|
updateScript = gnome.updateScript {
|
2020-04-24 23:36:52 +00:00
|
|
|
packageName = pname;
|
2021-05-20 23:08:51 +00:00
|
|
|
versionPolicy = "odd-unstable";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
tests = {
|
|
|
|
installedTests = nixosTests.installed-tests.gdk-pixbuf;
|
|
|
|
};
|
|
|
|
|
|
|
|
# gdk_pixbuf_moduledir variable from gdk-pixbuf-2.0.pc
|
|
|
|
moduleDir = "lib/gdk-pixbuf-2.0/2.10.0/loaders";
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A library for image loading and manipulation";
|
2020-06-18 07:06:33 +00:00
|
|
|
homepage = "https://gitlab.gnome.org/GNOME/gdk-pixbuf";
|
|
|
|
maintainers = [ maintainers.eelco ] ++ teams.gnome.members;
|
2020-12-03 08:41:04 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|