From e288b9d1b2e8e09e2830f1ad84b8aa3b7853b8df Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 21 Mar 2021 01:22:13 +0000 Subject: [PATCH] =?UTF-8?q?librsvg:=202.50.1=20=E2=86=92=202.50.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../development/libraries/librsvg/default.nix | 84 +++++++++++++------ pkgs/top-level/all-packages.nix | 5 +- 2 files changed, 61 insertions(+), 28 deletions(-) diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix index 2df3d8e270e2..39ad126469c7 100644 --- a/pkgs/development/libraries/librsvg/default.nix +++ b/pkgs/development/libraries/librsvg/default.nix @@ -1,47 +1,79 @@ -{ lib, stdenv, fetchurl, pkg-config, glib, gdk-pixbuf, pango, cairo, libxml2 -, bzip2, libintl, darwin, rustc, cargo, gnome3 -, vala, gobject-introspection }: +{ lib +, stdenv +, fetchurl +, pkg-config +, glib +, gdk-pixbuf +, pango +, cairo +, libxml2 +, bzip2 +, libintl +, ApplicationServices +, Foundation +, libobjc +, rustc +, cargo +, gnome3 +, vala +, gobject-introspection +, nixosTests +}: -let - pname = "librsvg"; - version = "2.50.1"; -in stdenv.mkDerivation rec { - name = "${pname}-${version}"; - - src = fetchurl { - url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz"; - sha256 = "02csvx2nzygh8kyal2qiy3y6xb7d52vszxxr37dzav704a9pkncv"; - }; + pname = "librsvg"; + version = "2.50.5"; outputs = [ "out" "dev" "installedTests" ]; - buildInputs = [ libxml2 bzip2 pango libintl ] - ++ lib.optionals stdenv.isDarwin [ darwin.libobjc ]; + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "0wlj5g1jgp93sj3rr6qspj282whz13ahnv8ca99d7zilq9s1aw1j"; + }; - NIX_LDFLAGS = if stdenv.isDarwin then "-lobjc" else null; + nativeBuildInputs = [ + pkg-config + rustc + cargo + vala + gobject-introspection + ] ++ lib.optionals stdenv.isDarwin [ + ApplicationServices + Foundation + ]; - propagatedBuildInputs = [ glib gdk-pixbuf cairo ]; + buildInputs = [ + libxml2 + bzip2 + pango + libintl + ] ++ lib.optionals stdenv.isDarwin [ + libobjc + ]; - nativeBuildInputs = [ pkg-config rustc cargo vala gobject-introspection ] - ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ - ApplicationServices - ]); + propagatedBuildInputs = [ + glib + gdk-pixbuf + cairo + ]; configureFlags = [ "--enable-introspection" + ] ++ lib.optionals (!stdenv.isDarwin) [ + # Vapi does not build on MacOS. + # https://github.com/NixOS/nixpkgs/pull/117081#issuecomment-827782004 "--enable-vala" + ] ++ [ "--enable-installed-tests" "--enable-always-build-tests" ] ++ lib.optional stdenv.isDarwin "--disable-Bsymbolic"; makeFlags = [ - "installed_test_metadir=$(installedTests)/share/installed-tests/RSVG" - "installed_testdir=$(installedTests)/libexec/installed-tests/RSVG" + "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/RSVG" + "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/RSVG" ]; - NIX_CFLAGS_COMPILE - = lib.optionalString stdenv.isDarwin "-I${cairo.dev}/include/cairo"; + doCheck = false; # all tests fail on libtool-generated rsvg-convert not being able to find coreutils # It wants to add loaders and update the loaders.cache in gdk-pixbuf # Patching the Makefiles to it creates rsvg specific loaders and the @@ -63,8 +95,6 @@ stdenv.mkDerivation rec { -i gdk-pixbuf-loader/librsvg.thumbnailer.in ''; - doCheck = false; # fails 20 of 145 tests, very likely to be buggy - # Merge gdkpixbuf and librsvg loaders postInstall = '' mv $GDK_PIXBUF/loaders.cache $GDK_PIXBUF/loaders.cache.tmp diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 89586589245b..d90d10a438c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16232,7 +16232,10 @@ in libroxml = callPackage ../development/libraries/libroxml { }; - librsvg = callPackage ../development/libraries/librsvg { }; + librsvg = callPackage ../development/libraries/librsvg { + inherit (darwin) libobjc; + inherit (darwin.apple_sdk.frameworks) ApplicationServices Foundation; + }; librsync = callPackage ../development/libraries/librsync { };