nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix

80 lines
2.6 KiB
Nix
Raw Normal View History

{ 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 }:
let
2018-03-03 05:20:46 +00:00
pname = "gdk-pixbuf";
version = "2.36.7";
# TODO: since 2.36.8 gdk-pixbuf gets configured to use mime-type sniffing,
# which apparently requires access to shared-mime-info files during runtime.
in
stdenv.mkDerivation rec {
2018-03-03 05:20:46 +00:00
name = "${pname}-${version}";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
sha256 = "1b6e5eef09d98f05f383014ecd3503e25dfb03d7e5b5f5904e5a65b049a6a4d8";
};
outputs = [ "out" "dev" "devdoc" ];
2018-03-04 21:06:08 +00:00
setupHook = ./setup-hook.sh;
enableParallelBuilding = true;
# !!! We might want to factor out the gdk-pixbuf-xlib subpackage.
buildInputs = [ libX11 gobjectIntrospection ];
nativeBuildInputs = [ pkgconfig ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
propagatedBuildInputs = [ glib libtiff libjpeg libpng jasper ];
configureFlags = "--with-libjasper --with-x11"
+ stdenv.lib.optionalString (gobjectIntrospection != null) " --enable-introspection=yes"
;
# on darwin, tests don't link
preBuild = stdenv.lib.optionalString (stdenv.isDarwin && !doCheck) ''
substituteInPlace Makefile --replace "docs tests" "docs"
'';
postInstall =
# All except one utility seem to be only useful during building.
''
moveToOutput "bin" "$dev"
moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out"
'';
# The fixDarwinDylibNames hook doesn't patch library references or binaries.
preFixup = stdenv.lib.optionalString stdenv.isDarwin ''
for f in $(find $out/lib -name '*.dylib'); do
install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
done
2018-05-29 06:46:39 +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
2018-05-29 06:46:39 +00:00
done
'';
# The tests take an excessive amount of time (> 1.5 hours) and memory (> 6 GB).
inherit doCheck;
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
};
meta = with stdenv.lib; {
description = "A library for image loading and manipulation";
homepage = http://library.gnome.org/devel/gdk-pixbuf/;
maintainers = [ maintainers.eelco ];
platforms = platforms.unix;
};
}