2019-06-16 21:59:06 +02:00
|
|
|
{ stdenv, fetchurl, fixDarwinDylibNames, meson, ninja, pkgconfig, gettext, python3, libxml2, libxslt, docbook_xsl
|
2018-03-04 22:06:08 +01:00
|
|
|
, docbook_xml_dtd_43, gtk-doc, glib, libtiff, libjpeg, libpng, libX11, gnome3
|
2018-12-02 12:41:15 +01:00
|
|
|
, jasper, gobject-introspection, doCheck ? false, makeWrapper }:
|
2011-09-20 08:21:56 +02:00
|
|
|
|
2013-10-05 20:21:13 +02:00
|
|
|
let
|
2018-03-03 06:20:46 +01:00
|
|
|
pname = "gdk-pixbuf";
|
2019-02-28 23:11:36 +01:00
|
|
|
version = "2.38.1";
|
2018-09-05 02:44:17 +02:00
|
|
|
in stdenv.mkDerivation rec {
|
2018-03-03 06:20:46 +01:00
|
|
|
name = "${pname}-${version}";
|
2011-09-20 08:21:56 +02:00
|
|
|
|
2018-09-05 02:44:17 +02:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
|
2019-02-28 23:11:36 +01:00
|
|
|
sha256 = "0fmbjgjcyym3qg46f64qgl7icdm4ii77flyc1mhk244rp8vgi7zi";
|
2011-09-20 08:21:56 +02:00
|
|
|
};
|
|
|
|
|
2018-06-01 00:13:15 +02:00
|
|
|
patches = [
|
2018-09-05 02:44:17 +02:00
|
|
|
# Move installed tests to a separate output
|
|
|
|
./installed-tests-path.patch
|
2018-06-01 00:13:15 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "man" "devdoc" "installedTests" ];
|
|
|
|
|
|
|
|
setupHook = ./setup-hook.sh;
|
2018-05-31 17:41:14 +02:00
|
|
|
|
2011-09-20 08:21:56 +02:00
|
|
|
# !!! We might want to factor out the gdk-pixbuf-xlib subpackage.
|
2018-06-01 00:13:15 +02:00
|
|
|
buildInputs = [ libX11 ];
|
2011-09-20 08:21:56 +02:00
|
|
|
|
2018-06-01 00:13:15 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson ninja pkgconfig gettext python3 libxml2 libxslt docbook_xsl docbook_xml_dtd_43
|
2018-12-02 12:41:15 +01:00
|
|
|
gtk-doc gobject-introspection makeWrapper
|
2018-06-01 00:13:15 +02:00
|
|
|
]
|
2018-05-28 20:21:45 +02:00
|
|
|
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
2011-09-20 08:21:56 +02:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ glib libtiff libjpeg libpng jasper ];
|
|
|
|
|
2018-06-01 00:13:15 +02:00
|
|
|
mesonFlags = [
|
|
|
|
"-Ddocs=true"
|
|
|
|
"-Djasper=true"
|
|
|
|
"-Dx11=true"
|
2018-12-02 12:41:15 +01:00
|
|
|
"-Dgir=${if gobject-introspection != null then "true" else "false"}"
|
2019-02-28 23:11:36 +01:00
|
|
|
"-Dgio_sniffing=false"
|
2018-06-06 10:49:36 +02:00
|
|
|
];
|
2018-06-01 00:13:15 +02:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
chmod +x build-aux/* # patchShebangs only applies to executables
|
|
|
|
patchShebangs build-aux
|
2016-12-28 20:16:12 +01:00
|
|
|
|
2018-06-01 00:13:15 +02:00
|
|
|
substituteInPlace tests/meson.build --subst-var-by installedtestsprefix "$installedTests"
|
2015-10-19 19:12:01 +02:00
|
|
|
'';
|
|
|
|
|
2016-12-28 20:16:12 +01:00
|
|
|
postInstall =
|
2018-06-06 12:00:55 +02: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 20:16:12 +01:00
|
|
|
''
|
2018-06-06 12:00:55 +02:00
|
|
|
# All except one utility seem to be only useful during building.
|
|
|
|
+ ''
|
2016-12-28 20:16:12 +01:00
|
|
|
moveToOutput "bin" "$dev"
|
|
|
|
moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out"
|
2018-06-01 00:13:15 +02: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 20:16:12 +01:00
|
|
|
'';
|
2011-09-20 08:21:56 +02:00
|
|
|
|
2018-06-06 11:48:23 +02:00
|
|
|
# The fixDarwinDylibNames hook doesn't patch binaries.
|
2018-05-28 23:55:39 +02:00
|
|
|
preFixup = stdenv.lib.optionalString stdenv.isDarwin ''
|
2018-05-29 08:46:39 +02:00
|
|
|
for f in $out/bin/* $dev/bin/*; do
|
2018-05-30 01:13:59 +02:00
|
|
|
install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
|
2018-05-29 08:46:39 +02:00
|
|
|
done
|
2018-05-28 23:55:39 +02:00
|
|
|
'';
|
|
|
|
|
2018-09-05 02:44:17 +02:00
|
|
|
preInstall = ''
|
|
|
|
PATH=$PATH:$out/bin # for install script
|
|
|
|
'';
|
|
|
|
|
2015-08-21 12:56:55 +02:00
|
|
|
# The tests take an excessive amount of time (> 1.5 hours) and memory (> 6 GB).
|
2018-04-25 05:20:18 +02:00
|
|
|
inherit doCheck;
|
2013-10-05 20:21:13 +02:00
|
|
|
|
2018-03-03 06:20:46 +01:00
|
|
|
passthru = {
|
|
|
|
updateScript = gnome3.updateScript {
|
|
|
|
packageName = pname;
|
|
|
|
attrPath = "gdk_pixbuf";
|
|
|
|
};
|
2018-03-27 16:23:21 +02:00
|
|
|
|
|
|
|
# gdk_pixbuf_moduledir variable from gdk-pixbuf-2.0.pc
|
|
|
|
moduleDir = "lib/gdk-pixbuf-2.0/2.10.0/loaders";
|
2018-03-03 06:20:46 +01:00
|
|
|
};
|
|
|
|
|
2015-10-28 12:05:37 +01:00
|
|
|
meta = with stdenv.lib; {
|
2011-09-20 08:21:56 +02:00
|
|
|
description = "A library for image loading and manipulation";
|
|
|
|
homepage = http://library.gnome.org/devel/gdk-pixbuf/;
|
2015-10-28 12:05:37 +01:00
|
|
|
maintainers = [ maintainers.eelco ];
|
2018-08-20 19:32:10 +02:00
|
|
|
license = licenses.lgpl21;
|
2015-10-28 12:05:37 +01:00
|
|
|
platforms = platforms.unix;
|
2011-09-20 08:21:56 +02:00
|
|
|
};
|
|
|
|
}
|