2018-05-28 18:21:45 +00:00
|
|
|
{ stdenv, fetchurl, fetchgit, fetchpatch, fixDarwinDylibNames, meson, ninja, pkgconfig, gettext, python3, libxml2, libxslt, docbook_xsl
|
2018-03-04 21:06:08 +00:00
|
|
|
, docbook_xml_dtd_43, gtk-doc, glib, libtiff, libjpeg, libpng, libX11, gnome3
|
|
|
|
, jasper, gobjectIntrospection, doCheck ? false, makeWrapper }:
|
2011-09-20 06:21:56 +00:00
|
|
|
|
2013-10-05 18:21:13 +00:00
|
|
|
let
|
2018-03-03 05:20:46 +00:00
|
|
|
pname = "gdk-pixbuf";
|
2018-05-31 22:13:15 +00:00
|
|
|
version = "2.36.12";
|
2013-10-05 18:21:13 +00:00
|
|
|
in
|
2012-05-16 21:58:57 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2018-03-03 05:20:46 +00:00
|
|
|
name = "${pname}-${version}";
|
2011-09-20 06:21:56 +00:00
|
|
|
|
2018-05-31 22:13:15 +00:00
|
|
|
# TODO: Change back once tests/bug753605-atsize.jpg is part of the dist tarball
|
|
|
|
# src = fetchurl {
|
|
|
|
# url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
|
|
|
|
# sha256 = "0d534ysa6n9prd17wwzisq7mj6qkhwh8wcf8qgin1ar3hbs5ry7z";
|
|
|
|
# };
|
|
|
|
src = fetchgit {
|
|
|
|
url = https://gitlab.gnome.org/GNOME/gdk-pixbuf.git;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "18lwqg63vyap2m1mw049rnb8fm869429xbf7636a2n21gs3d3jwv";
|
2011-09-20 06:21:56 +00:00
|
|
|
};
|
|
|
|
|
2018-05-31 22:13:15 +00:00
|
|
|
patches = [
|
|
|
|
# TODO: since 2.36.8 gdk-pixbuf gets configured to use mime-type sniffing,
|
|
|
|
# which requires access to shared-mime-info files during runtime.
|
|
|
|
# For now, we are patching the build script to avoid the dependency.
|
|
|
|
./no-mime-sniffing.patch
|
2012-08-27 02:53:19 +00:00
|
|
|
|
2018-05-31 22:13:15 +00:00
|
|
|
# Fix installed tests with meson
|
|
|
|
# https://bugzilla.gnome.org/show_bug.cgi?id=795527
|
|
|
|
(fetchurl {
|
|
|
|
url = https://bugzilla.gnome.org/attachment.cgi?id=371381;
|
|
|
|
sha256 = "0nl1cixkjfa5kcfh0laz8h6hdsrpdkxqn7a1k35jrb6zwc9hbydn";
|
|
|
|
})
|
|
|
|
|
|
|
|
# Add missing test file bug753605-atsize.jpg
|
|
|
|
(fetchpatch {
|
|
|
|
url = https://gitlab.gnome.org/GNOME/gdk-pixbuf/commit/87f8f4bf01dfb9982c1ef991e4060a5e19fdb7a7.patch;
|
|
|
|
sha256 = "1slzywwnrzfx3zjzdsxrvp4g2q4skmv50pdfmyccp41j7bfyb2j0";
|
|
|
|
})
|
2012-08-27 02:53:19 +00:00
|
|
|
|
2018-05-31 22:13:15 +00:00
|
|
|
# Move installed tests to a separate output
|
|
|
|
./installed-tests-path.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "man" "devdoc" "installedTests" ];
|
|
|
|
|
|
|
|
setupHook = ./setup-hook.sh;
|
2018-05-31 15:41:14 +00:00
|
|
|
|
2011-09-20 06:21:56 +00:00
|
|
|
# !!! We might want to factor out the gdk-pixbuf-xlib subpackage.
|
2018-05-31 22:13:15 +00:00
|
|
|
buildInputs = [ libX11 ];
|
2011-09-20 06:21:56 +00:00
|
|
|
|
2018-05-31 22:13:15 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson ninja pkgconfig gettext python3 libxml2 libxslt docbook_xsl docbook_xml_dtd_43
|
|
|
|
gtk-doc gobjectIntrospection makeWrapper
|
|
|
|
]
|
2018-05-28 18:21:45 +00:00
|
|
|
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
2011-09-20 06:21:56 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ glib libtiff libjpeg libpng jasper ];
|
|
|
|
|
2018-05-31 22:13:15 +00:00
|
|
|
mesonFlags = [
|
|
|
|
"-Ddocs=true"
|
|
|
|
"-Djasper=true"
|
|
|
|
"-Dx11=true"
|
|
|
|
"-Dgir=${if gobjectIntrospection != null then "true" else "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
|
|
|
'';
|
|
|
|
|
2016-12-28 19:16:12 +00:00
|
|
|
postInstall =
|
2018-06-06 10:00:55 +00: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 10:00:55 +00: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"
|
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.
|
2018-05-28 21:55:39 +00:00
|
|
|
preFixup = stdenv.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
|
|
|
'';
|
|
|
|
|
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
|
|
|
|
2018-03-03 05:20:46 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = gnome3.updateScript {
|
|
|
|
packageName = pname;
|
|
|
|
attrPath = "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
|
|
|
};
|
|
|
|
|
2015-10-28 11:05:37 +00:00
|
|
|
meta = with stdenv.lib; {
|
2011-09-20 06:21:56 +00:00
|
|
|
description = "A library for image loading and manipulation";
|
|
|
|
homepage = http://library.gnome.org/devel/gdk-pixbuf/;
|
2015-10-28 11:05:37 +00:00
|
|
|
maintainers = [ maintainers.eelco ];
|
|
|
|
platforms = platforms.unix;
|
2011-09-20 06:21:56 +00:00
|
|
|
};
|
|
|
|
}
|