2020-05-18 19:26:28 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, nixosTests
|
|
|
|
, fixDarwinDylibNames
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, gettext
|
|
|
|
, python3
|
|
|
|
, libxml2
|
|
|
|
, libxslt
|
|
|
|
, docbook-xsl-nons
|
|
|
|
, docbook_xml_dtd_43
|
|
|
|
, gtk-doc
|
|
|
|
, glib
|
|
|
|
, libtiff
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
|
|
|
, gnome3
|
|
|
|
, gobject-introspection
|
|
|
|
, doCheck ? false
|
|
|
|
, makeWrapper
|
2020-01-08 14:36:39 +00:00
|
|
|
, fetchpatch
|
|
|
|
}:
|
2011-09-20 07:21:56 +01:00
|
|
|
|
2020-05-18 19:26:28 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2018-03-03 05:20:46 +00:00
|
|
|
pname = "gdk-pixbuf";
|
2019-10-12 10:11:46 +01:00
|
|
|
version = "2.40.0";
|
2020-05-18 19:26:28 +01:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" "man" "devdoc" "installedTests" ];
|
2011-09-20 07:21:56 +01:00
|
|
|
|
2018-09-05 01:44:17 +01:00
|
|
|
src = fetchurl {
|
2020-05-18 19:26:28 +01:00
|
|
|
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2019-10-12 10:11:46 +01:00
|
|
|
sha256 = "1rnlx9yfw970maxi2x6niaxmih5la11q1ilr7gzshz2kk585k0hm";
|
2011-09-20 07:21:56 +01:00
|
|
|
};
|
|
|
|
|
2018-05-31 23:13:15 +01:00
|
|
|
patches = [
|
2018-09-05 01:44:17 +01:00
|
|
|
# Move installed tests to a separate output
|
|
|
|
./installed-tests-path.patch
|
2020-05-18 19:26:28 +01:00
|
|
|
|
2020-01-08 14:36:39 +00:00
|
|
|
# Temporary until the fix is released.
|
|
|
|
(fetchpatch {
|
|
|
|
name = "tests-circular-table.patch";
|
|
|
|
url = "https://gitlab.gnome.org/GNOME/gdk-pixbuf/merge_requests/59.diff";
|
|
|
|
sha256 = "0kaflac3mrh6031hwxk7j9fhli775hc503818h8zfl6b28zyn93f";
|
|
|
|
})
|
2018-05-31 23:13:15 +01:00
|
|
|
];
|
|
|
|
|
2020-05-18 19:26:28 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
gettext
|
|
|
|
python3
|
|
|
|
libxml2
|
|
|
|
libxslt
|
|
|
|
docbook-xsl-nons
|
|
|
|
docbook_xml_dtd_43
|
|
|
|
gtk-doc
|
|
|
|
gobject-introspection
|
|
|
|
makeWrapper
|
|
|
|
glib
|
|
|
|
] ++ stdenv.lib.optional stdenv.isDarwin [
|
|
|
|
fixDarwinDylibNames
|
|
|
|
];
|
2018-05-31 16:41:14 +01:00
|
|
|
|
2020-05-18 19:26:28 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
glib
|
|
|
|
libtiff
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
];
|
2011-09-20 07:21:56 +01:00
|
|
|
|
2018-05-31 23:13:15 +01:00
|
|
|
mesonFlags = [
|
|
|
|
"-Ddocs=true"
|
2020-05-18 20:03:59 +01:00
|
|
|
"-Dx11=false" # use gdk-pixbuf-xlib
|
2018-12-02 11:41:15 +00:00
|
|
|
"-Dgir=${if gobject-introspection != null then "true" else "false"}"
|
2019-02-28 22:11:36 +00:00
|
|
|
"-Dgio_sniffing=false"
|
2018-06-06 09:49:36 +01:00
|
|
|
];
|
2018-05-31 23:13:15 +01: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 23:13:15 +01:00
|
|
|
substituteInPlace tests/meson.build --subst-var-by installedtestsprefix "$installedTests"
|
2015-10-19 18:12:01 +01:00
|
|
|
'';
|
|
|
|
|
2016-12-28 19:16:12 +00:00
|
|
|
postInstall =
|
2018-06-06 11:00:55 +01:00
|
|
|
# meson erroneously installs loaders with .dylib extension on Darwin.
|
|
|
|
# Their @rpath has to be replaced before gdk-pixbuf-query-loaders looks at them.
|
|
|
|
stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
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
|
2016-12-28 19:16:12 +00:00
|
|
|
''
|
2018-06-06 11:00:55 +01:00
|
|
|
# All except one utility seem to be only useful during building.
|
|
|
|
+ ''
|
2016-12-28 19:16:12 +00:00
|
|
|
moveToOutput "bin" "$dev"
|
|
|
|
moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out"
|
2020-02-26 23:12:13 +00:00
|
|
|
'' + stdenv.lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
2018-05-31 23:13:15 +01: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 07:21:56 +01:00
|
|
|
|
2018-06-06 10:48:23 +01:00
|
|
|
# The fixDarwinDylibNames hook doesn't patch binaries.
|
2018-05-28 22:55:39 +01:00
|
|
|
preFixup = stdenv.lib.optionalString stdenv.isDarwin ''
|
2018-05-29 07:46:39 +01:00
|
|
|
for f in $out/bin/* $dev/bin/*; do
|
2018-05-30 00:13:59 +01:00
|
|
|
install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
|
2018-05-29 07:46:39 +01:00
|
|
|
done
|
2018-05-28 22:55:39 +01:00
|
|
|
'';
|
|
|
|
|
2018-09-05 01:44:17 +01:00
|
|
|
preInstall = ''
|
|
|
|
PATH=$PATH:$out/bin # for install script
|
|
|
|
'';
|
|
|
|
|
2015-08-21 11:56:55 +01:00
|
|
|
# The tests take an excessive amount of time (> 1.5 hours) and memory (> 6 GB).
|
2018-04-25 04:20:18 +01:00
|
|
|
inherit doCheck;
|
2013-10-05 19:21:13 +01:00
|
|
|
|
2020-05-18 19:26:28 +01:00
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2018-03-03 05:20:46 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = gnome3.updateScript {
|
|
|
|
packageName = pname;
|
|
|
|
};
|
2018-03-27 15:23:21 +01:00
|
|
|
|
2019-11-07 13:38:41 +00:00
|
|
|
tests = {
|
|
|
|
installedTests = nixosTests.installed-tests.gdk-pixbuf;
|
|
|
|
};
|
|
|
|
|
2018-03-27 15:23:21 +01: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
|
|
|
};
|
|
|
|
|
2015-10-28 11:05:37 +00:00
|
|
|
meta = with stdenv.lib; {
|
2011-09-20 07:21:56 +01:00
|
|
|
description = "A library for image loading and manipulation";
|
2020-05-18 19:26:28 +01:00
|
|
|
homepage = "https://gitlab.gnome.org/GNOME/gdk-pixbuf";
|
|
|
|
maintainers = [ maintainers.eelco ] ++ teams.gnome.members;
|
2018-08-20 18:32:10 +01:00
|
|
|
license = licenses.lgpl21;
|
2015-10-28 11:05:37 +00:00
|
|
|
platforms = platforms.unix;
|
2011-09-20 07:21:56 +01:00
|
|
|
};
|
|
|
|
}
|