From ae8b7a189ac3cd4509d7e21f72e5477aa61a3db4 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 1 Jun 2018 00:13:15 +0200 Subject: Revert "Revert commit 4b2f3971981272b79da7f87b639ca8854a6ea89c" This reverts commit 85ae7137ac6a1623be90c8f0897566367d300c12. --- pkgs/development/libraries/gdk-pixbuf/default.nix | 70 +++++++++++++++++------ 1 file changed, 53 insertions(+), 17 deletions(-) (limited to 'pkgs/development/libraries/gdk-pixbuf/default.nix') diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix index 7660d6481c3..849e72d9a97 100644 --- a/pkgs/development/libraries/gdk-pixbuf/default.nix +++ b/pkgs/development/libraries/gdk-pixbuf/default.nix @@ -4,39 +4,72 @@ let 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. + version = "2.36.12"; in stdenv.mkDerivation rec { name = "${pname}-${version}"; - src = fetchurl { - url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz"; - sha256 = "1b6e5eef09d98f05f383014ecd3503e25dfb03d7e5b5f5904e5a65b049a6a4d8"; + # 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"; }; - outputs = [ "out" "dev" "devdoc" ]; + 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 - setupHook = ./setup-hook.sh; + # 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"; + }) - enableParallelBuilding = true; + # Move installed tests to a separate output + ./installed-tests-path.patch + ]; + + outputs = [ "out" "dev" "man" "devdoc" "installedTests" ]; + + setupHook = ./setup-hook.sh; # !!! We might want to factor out the gdk-pixbuf-xlib subpackage. - buildInputs = [ libX11 gobjectIntrospection ]; + buildInputs = [ libX11 ]; - nativeBuildInputs = [ pkgconfig ] + nativeBuildInputs = [ + meson ninja pkgconfig gettext python3 libxml2 libxslt docbook_xsl docbook_xml_dtd_43 + gtk-doc gobjectIntrospection makeWrapper + ] ++ 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" - ; + mesonFlags = [ + "-Ddocs=true" + "-Djasper=true" + "-Dx11=true" + "-Dgir=${if gobjectIntrospection != null then "true" else "false"}" + ]; + + postPatch = '' + chmod +x build-aux/* # patchShebangs only applies to executables + patchShebangs build-aux - # on darwin, tests don't link - preBuild = stdenv.lib.optionalString (stdenv.isDarwin && !doCheck) '' - substituteInPlace Makefile --replace "docs tests" "docs" + substituteInPlace tests/meson.build --subst-var-by installedtestsprefix "$installedTests" ''; postInstall = @@ -44,6 +77,9 @@ stdenv.mkDerivation rec { '' moveToOutput "bin" "$dev" moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out" + + # We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/ + $dev/bin/gdk-pixbuf-query-loaders --update-cache ''; # The fixDarwinDylibNames hook doesn't patch library references or binaries. -- cgit 1.4.1