diff options
Diffstat (limited to 'pkgs/development/libraries/librsvg/default.nix')
-rw-r--r-- | pkgs/development/libraries/librsvg/default.nix | 55 |
1 files changed, 48 insertions, 7 deletions
diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix index 91e0033cd2746..19f75110c13ba 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; |