about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2024-07-03 19:14:16 +0200
committerVladimír Čunát <v@cunat.cz>2024-07-03 19:14:16 +0200
commit2d6c0ef1369a99c37c88f3376fe15614ab76a90f (patch)
treef70d69fd378c24f5d60b4b4fc452e0b5a6004997
parentc76085b3a9d817912d1a00d2d20696e3a8089de3 (diff)
parent29cfb900f749627783bc0d0f260ef4d0f842758c (diff)
Merge #324339: _7zz: replace fetchurl with fetchzip for stabler hashes
...into staging-next
-rw-r--r--pkgs/tools/archivers/7zz/default.nix23
1 files changed, 7 insertions, 16 deletions
diff --git a/pkgs/tools/archivers/7zz/default.nix b/pkgs/tools/archivers/7zz/default.nix
index 2cb28910982d3..3408ce8c08d1a 100644
--- a/pkgs/tools/archivers/7zz/default.nix
+++ b/pkgs/tools/archivers/7zz/default.nix
@@ -1,6 +1,6 @@
 { stdenv
 , lib
-, fetchurl
+, fetchzip
 
   # Only used for Linux's x86/x86_64
 , uasm
@@ -27,31 +27,22 @@ stdenv.mkDerivation (finalAttrs: {
   pname = "7zz";
   version = "24.07";
 
-  src = fetchurl {
+  src = fetchzip {
     url = "https://7-zip.org/a/7z${lib.replaceStrings [ "." ] [ "" ] finalAttrs.version}-src.tar.xz";
     hash = {
-      free = "sha256-qVX4CViXsODmPZIPdHzG3xgCVDVb0qZ+1l3+I9wJg2o=";
-      unfree = "sha256-0bCHSj8cJt8hx2GkowaR3BIT6Fd/GO54MmwUyk1oPis=";
+      free = "sha256-D41Sf437WYRQMdVW7hwcnZI0UG67IJsTTMfxlpkk36M=";
+      unfree = "sha256-iKCs893IFG0I6a2kpUe0qiuCX+YUxIgMIBRykc9XYjA=";
     }.${if enableUnfree then "unfree" else "free"};
-    downloadToTemp = (!enableUnfree);
+    stripRoot = false;
     # remove the unRAR related code from the src drv
     # > the license requires that you agree to these use restrictions,
     # > or you must remove the software (source and binary) from your hard disks
     # https://fedoraproject.org/wiki/Licensing:Unrar
     postFetch = lib.optionalString (!enableUnfree) ''
-      mkdir tmp
-      tar xf $downloadedFile -C ./tmp
-      rm -r ./tmp/CPP/7zip/Compress/Rar*
-      tar cfJ $out -C ./tmp . \
-        --sort=name \
-        --mtime="@$SOURCE_DATE_EPOCH" \
-        --owner=0 --group=0 --numeric-owner \
-        --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime
-    '';
+      rm -r $out/CPP/7zip/Compress/Rar*
+   '';
   };
 
-  sourceRoot = ".";
-
   patches = [
     ./fix-cross-mingw-build.patch
   ];