summary refs log tree commit diff
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2022-08-05 20:04:16 +0000
committerJan Tojnar <jtojnar@gmail.com>2022-10-11 18:52:13 +0200
commitb997f0625163b874eaf1c88349106b82a53c76d7 (patch)
treec31ecc8d1073abe6cc6d328601de95ff6b53927b
parent309a23daa47ca98beff76a1501f3b99c4349510f (diff)
downloadnixpkgs-b997f0625163b874eaf1c88349106b82a53c76d7.tar
nixpkgs-b997f0625163b874eaf1c88349106b82a53c76d7.tar.gz
nixpkgs-b997f0625163b874eaf1c88349106b82a53c76d7.tar.bz2
nixpkgs-b997f0625163b874eaf1c88349106b82a53c76d7.tar.lz
nixpkgs-b997f0625163b874eaf1c88349106b82a53c76d7.tar.xz
nixpkgs-b997f0625163b874eaf1c88349106b82a53c76d7.tar.zst
nixpkgs-b997f0625163b874eaf1c88349106b82a53c76d7.zip
librsvg: 2.54.4 → 2.55.0
https://gitlab.gnome.org/GNOME/librsvg/-/compare/2.54.4...2.55.0

- No longer vendoring Cargo dependencies https://gitlab.gnome.org/GNOME/librsvg/-/commit/7e5e7e5b76d06e38017c154f73d2e6afb93b5808

Changelog-Reviewed-By: Jan Tojnar <jtojnar@gmail.com>
-rw-r--r--pkgs/development/libraries/librsvg/default.nix55
1 files changed, 48 insertions, 7 deletions
diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix
index 91e0033cd27..19f75110c13 100644
--- a/pkgs/development/libraries/librsvg/default.nix
+++ b/pkgs/development/libraries/librsvg/default.nix
@@ -23,11 +23,15 @@
 , withIntrospection ? stdenv.hostPlatform == stdenv.buildPlatform
 , gobject-introspection
 , nixosTests
+, _experimental-update-script-combinators
+, common-updater-scripts
+, jq
+, nix
 }:
 
 stdenv.mkDerivation rec {
   pname = "librsvg";
-  version = "2.54.4";
+  version = "2.55.0";
 
   outputs = [ "out" "dev" "installedTests" ] ++ lib.optionals withIntrospection [
     "devdoc"
@@ -35,10 +39,16 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "6hUqJD9qQ8DgNqKMcN4/y83qVmTGgRx4WSvCKezCSDM=";
+    sha256 = "bmJsVk41S82MOEuQ+OTzCzA6+mweDLXMVroUkAxdtzA=";
   };
 
-  cargoVendorDir = "vendor";
+  cargoDeps = rustPlatform.fetchCargoTarball {
+    inherit src;
+    name = "${pname}-${version}";
+    hash = "sha256-tvfdRGyrEkEh6sb69f0ugfzR2bgGdWa05pSyovpXAF8=";
+    # TODO: move this to fetchCargoTarball
+    dontConfigure = true;
+  };
 
   strictDeps = true;
 
@@ -131,10 +141,41 @@ stdenv.mkDerivation rec {
   '';
 
   passthru = {
-    updateScript = gnome.updateScript {
-      packageName = pname;
-      versionPolicy = "odd-unstable";
-    };
+    updateScript =
+      let
+        updateSource = gnome.updateScript {
+          packageName = "librsvg";
+          versionPolicy = "odd-unstable";
+        };
+
+        updateLockfile = {
+          command = [
+            "sh"
+            "-c"
+            ''
+              PATH=${lib.makeBinPath [
+                common-updater-scripts
+                jq
+                nix
+              ]}
+              # update-source-version does not allow updating to the same version so we need to clear it temporarily.
+              # Get the current version so that we can restore it later.
+              latestVersion=$(nix-instantiate --eval -A librsvg.version | jq --raw-output)
+              # Clear the version. Provide hash so that we do not need to do pointless TOFU.
+              # Needs to be a fake SRI hash that is non-zero, since u-s-v uses zero as a placeholder.
+              # Also cannot be here verbatim or u-s-v would be confused what to replace.
+              update-source-version librsvg 0 "sha256-${lib.fixedWidthString 44 "B" "="}" --source-key=cargoDeps > /dev/null
+              update-source-version librsvg "$latestVersion" --source-key=cargoDeps > /dev/null
+            ''
+          ];
+          # Experimental feature: do not copy!
+          supportedFeatures = [ "silent" ];
+        };
+      in
+      _experimental-update-script-combinators.sequence [
+        updateSource
+        updateLockfile
+      ];
 
     tests = {
       installedTests = nixosTests.installed-tests.librsvg;