_7zz: replace fetchurl with fetchzip for stabler hashes

This commit is contained in:
éclairevoyant 2024-07-03 09:28:03 -04:00
parent 3c89ee1b7b
commit 29cfb900f7
No known key found for this signature in database
GPG Key ID: E3813AEAA02DB54B

View File

@ -1,6 +1,6 @@
{ stdenv { stdenv
, lib , lib
, fetchurl , fetchzip
# Only used for Linux's x86/x86_64 # Only used for Linux's x86/x86_64
, uasm , uasm
@ -27,31 +27,22 @@ stdenv.mkDerivation (finalAttrs: {
pname = "7zz"; pname = "7zz";
version = "24.07"; version = "24.07";
src = fetchurl { src = fetchzip {
url = "https://7-zip.org/a/7z${lib.replaceStrings [ "." ] [ "" ] finalAttrs.version}-src.tar.xz"; url = "https://7-zip.org/a/7z${lib.replaceStrings [ "." ] [ "" ] finalAttrs.version}-src.tar.xz";
hash = { hash = {
free = "sha256-qVX4CViXsODmPZIPdHzG3xgCVDVb0qZ+1l3+I9wJg2o="; free = "sha256-D41Sf437WYRQMdVW7hwcnZI0UG67IJsTTMfxlpkk36M=";
unfree = "sha256-0bCHSj8cJt8hx2GkowaR3BIT6Fd/GO54MmwUyk1oPis="; unfree = "sha256-iKCs893IFG0I6a2kpUe0qiuCX+YUxIgMIBRykc9XYjA=";
}.${if enableUnfree then "unfree" else "free"}; }.${if enableUnfree then "unfree" else "free"};
downloadToTemp = (!enableUnfree); stripRoot = false;
# remove the unRAR related code from the src drv # remove the unRAR related code from the src drv
# > the license requires that you agree to these use restrictions, # > the license requires that you agree to these use restrictions,
# > or you must remove the software (source and binary) from your hard disks # > or you must remove the software (source and binary) from your hard disks
# https://fedoraproject.org/wiki/Licensing:Unrar # https://fedoraproject.org/wiki/Licensing:Unrar
postFetch = lib.optionalString (!enableUnfree) '' postFetch = lib.optionalString (!enableUnfree) ''
mkdir tmp rm -r $out/CPP/7zip/Compress/Rar*
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
'';
}; };
sourceRoot = ".";
patches = [ patches = [
./fix-cross-mingw-build.patch ./fix-cross-mingw-build.patch
]; ];