2020-05-18 18:26:28 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, nixosTests
|
|
|
|
, fixDarwinDylibNames
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, gettext
|
|
|
|
, python3
|
|
|
|
, libxslt
|
|
|
|
, docbook-xsl-nons
|
|
|
|
, docbook_xml_dtd_43
|
2021-03-23 07:53:26 +00:00
|
|
|
, gi-docgen
|
2020-05-18 18:26:28 +00:00
|
|
|
, glib
|
|
|
|
, libtiff
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
2021-05-07 21:18:14 +00:00
|
|
|
, gnome
|
2020-05-18 18:26:28 +00:00
|
|
|
, doCheck ? false
|
|
|
|
, makeWrapper
|
2020-10-13 23:46:17 +00:00
|
|
|
, lib
|
2021-10-22 23:41:34 +00:00
|
|
|
, withIntrospection ? (stdenv.buildPlatform == stdenv.hostPlatform)
|
|
|
|
, gobject-introspection
|
2020-01-08 14:36:39 +00:00
|
|
|
}:
|
2011-09-20 06:21:56 +00:00
|
|
|
|
2021-05-21 21:21:27 +00:00
|
|
|
let
|
|
|
|
withGtkDoc = stdenv.buildPlatform == stdenv.hostPlatform;
|
|
|
|
in
|
2020-05-18 18:26:28 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2018-03-03 05:20:46 +00:00
|
|
|
pname = "gdk-pixbuf";
|
2021-03-23 07:53:26 +00:00
|
|
|
version = "2.42.6";
|
2020-05-18 18:26:28 +00:00
|
|
|
|
2021-05-21 21:21:27 +00:00
|
|
|
outputs = [ "out" "dev" "man" ]
|
|
|
|
++ lib.optional withGtkDoc "devdoc"
|
|
|
|
++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "installedTests";
|
2011-09-20 06:21:56 +00:00
|
|
|
|
2018-09-05 00:44:17 +00:00
|
|
|
src = fetchurl {
|
2021-01-21 17:00:13 +00:00
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2021-03-23 07:53:26 +00:00
|
|
|
sha256 = "0zz7pmw2z46g7mr1yjxbsdldd5pd03xbjc58inj8rxfqgrdvg9n4";
|
2011-09-20 06:21:56 +00:00
|
|
|
};
|
|
|
|
|
2018-05-31 22:13:15 +00:00
|
|
|
patches = [
|
2018-09-05 00:44:17 +00:00
|
|
|
# Move installed tests to a separate output
|
|
|
|
./installed-tests-path.patch
|
2018-05-31 22:13:15 +00:00
|
|
|
];
|
|
|
|
|
2021-10-22 23:41:34 +00:00
|
|
|
# gdk-pixbuf-thumbnailer is not wrapped therefore strictDeps will work
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
depsBuildBuild = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2020-05-18 18:26:28 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
gettext
|
|
|
|
python3
|
|
|
|
makeWrapper
|
|
|
|
glib
|
2021-03-23 07:53:26 +00:00
|
|
|
gi-docgen
|
|
|
|
|
|
|
|
# for man pages
|
|
|
|
libxslt
|
|
|
|
docbook-xsl-nons
|
|
|
|
docbook_xml_dtd_43
|
2021-10-22 23:41:34 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
fixDarwinDylibNames
|
|
|
|
] ++ lib.optionals withIntrospection [
|
|
|
|
gobject-introspection
|
|
|
|
];
|
2018-05-31 15:41:14 +00:00
|
|
|
|
2020-05-18 18:26:28 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
glib
|
|
|
|
libtiff
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
];
|
2011-09-20 06:21:56 +00:00
|
|
|
|
2018-05-31 22:13:15 +00:00
|
|
|
mesonFlags = [
|
2021-05-21 21:21:27 +00:00
|
|
|
"-Dgtk_doc=${lib.boolToString withGtkDoc}"
|
2021-10-22 23:41:34 +00:00
|
|
|
"-Dintrospection=${if withIntrospection then "enabled" else "disabled"}"
|
2019-02-28 22:11:36 +00:00
|
|
|
"-Dgio_sniffing=false"
|
2018-06-06 08:49:36 +00:00
|
|
|
];
|
2018-05-31 22:13:15 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
chmod +x build-aux/* # patchShebangs only applies to executables
|
|
|
|
patchShebangs build-aux
|
2016-12-28 19:16:12 +00:00
|
|
|
|
2018-05-31 22:13:15 +00:00
|
|
|
substituteInPlace tests/meson.build --subst-var-by installedtestsprefix "$installedTests"
|
2015-10-19 17:12:01 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-23 07:53:26 +00:00
|
|
|
preInstall = ''
|
|
|
|
PATH=$PATH:$out/bin # for install script
|
|
|
|
'';
|
|
|
|
|
2016-12-28 19:16:12 +00:00
|
|
|
postInstall =
|
2021-03-23 07:53:26 +00:00
|
|
|
''
|
|
|
|
# All except one utility seem to be only useful during building.
|
|
|
|
moveToOutput "bin" "$dev"
|
|
|
|
moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out"
|
|
|
|
|
|
|
|
'' + 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.
|
2018-06-06 10:00:55 +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-01-21 17:00:13 +00:00
|
|
|
'' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
2018-05-31 22:13:15 +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
|
2016-12-28 19:16:12 +00:00
|
|
|
'';
|
2011-09-20 06:21:56 +00:00
|
|
|
|
2018-06-06 09:48:23 +00:00
|
|
|
# The fixDarwinDylibNames hook doesn't patch binaries.
|
2021-01-21 17:00:13 +00:00
|
|
|
preFixup = lib.optionalString stdenv.isDarwin ''
|
2018-05-29 06:46:39 +00:00
|
|
|
for f in $out/bin/* $dev/bin/*; do
|
2018-05-29 23:13:59 +00:00
|
|
|
install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
|
2018-05-29 06:46:39 +00:00
|
|
|
done
|
2018-05-28 21:55:39 +00:00
|
|
|
'';
|
|
|
|
|
2022-02-27 11:54:30 +00:00
|
|
|
postFixup = lib.optionalString withGtkDoc ''
|
|
|
|
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
|
|
|
|
moveToOutput "share/doc" "$devdoc"
|
|
|
|
'';
|
|
|
|
|
2015-08-21 10:56:55 +00:00
|
|
|
# The tests take an excessive amount of time (> 1.5 hours) and memory (> 6 GB).
|
2018-04-25 03:20:18 +00:00
|
|
|
inherit doCheck;
|
2013-10-05 18:21:13 +00:00
|
|
|
|
2020-05-18 18:26:28 +00:00
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2020-12-28 01:19:17 +00:00
|
|
|
separateDebugInfo = stdenv.isLinux;
|
|
|
|
|
2018-03-03 05:20:46 +00:00
|
|
|
passthru = {
|
2021-05-07 21:18:14 +00:00
|
|
|
updateScript = gnome.updateScript {
|
2018-03-03 05:20:46 +00:00
|
|
|
packageName = pname;
|
2021-03-20 23:57:24 +00:00
|
|
|
versionPolicy = "odd-unstable";
|
2018-03-03 05:20:46 +00:00
|
|
|
};
|
2018-03-27 14:23:21 +00:00
|
|
|
|
2019-11-07 13:38:41 +00:00
|
|
|
tests = {
|
|
|
|
installedTests = nixosTests.installed-tests.gdk-pixbuf;
|
|
|
|
};
|
|
|
|
|
2018-03-27 14:23:21 +00:00
|
|
|
# gdk_pixbuf_moduledir variable from gdk-pixbuf-2.0.pc
|
|
|
|
moduleDir = "lib/gdk-pixbuf-2.0/2.10.0/loaders";
|
2018-03-03 05:20:46 +00:00
|
|
|
};
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2011-09-20 06:21:56 +00:00
|
|
|
description = "A library for image loading and manipulation";
|
2020-05-18 18:26:28 +00:00
|
|
|
homepage = "https://gitlab.gnome.org/GNOME/gdk-pixbuf";
|
|
|
|
maintainers = [ maintainers.eelco ] ++ teams.gnome.members;
|
2020-11-20 00:16:51 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2015-10-28 11:05:37 +00:00
|
|
|
platforms = platforms.unix;
|
2011-09-20 06:21:56 +00:00
|
|
|
};
|
|
|
|
}
|