From 2a8bd9ba3e81ba6022bcf3d99594656a6f5683b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Fri, 17 May 2024 09:25:03 -0400 Subject: [PATCH] _7zz: 23.01 -> 24.05 --- pkgs/tools/archivers/7zz/default.nix | 8 +- .../archivers/7zz/fix-cross-mingw-build.patch | 104 ++++++---- .../archivers/7zz/fix-empty-expr-stmt.patch | 184 ------------------ 3 files changed, 69 insertions(+), 227 deletions(-) delete mode 100644 pkgs/tools/archivers/7zz/fix-empty-expr-stmt.patch diff --git a/pkgs/tools/archivers/7zz/default.nix b/pkgs/tools/archivers/7zz/default.nix index a10283dc59f8..7cd6897837d1 100644 --- a/pkgs/tools/archivers/7zz/default.nix +++ b/pkgs/tools/archivers/7zz/default.nix @@ -26,13 +26,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "7zz"; - version = "23.01"; + version = "24.05"; src = fetchurl { url = "https://7-zip.org/a/7z${lib.replaceStrings [ "." ] [ "" ] finalAttrs.version}-src.tar.xz"; hash = { - free = "sha256-F1ybQsyReF2NBR/3eMZySvxVEntpwq2VUlRCHp/5nZs="; - unfree = "sha256-NWBxAHNg5aGCTZkEmT6LJIC1G1cOjJ+vfA9Y6+S/n3Q="; + free = "sha256-yYq3IEV2GeDWwW6KrdpgK2/QOsmDcBpIZvbk6VKZETY="; + unfree = "sha256-Y/NBz4C40ofG6UVRmz2g+nVVPIVXKkcbf6bmj5qQt5A="; }.${if enableUnfree then "unfree" else "free"}; downloadToTemp = (!enableUnfree); # remove the unRAR related code from the src drv @@ -55,8 +55,6 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./fix-cross-mingw-build.patch - # remove unneeded semicolons related to -Wextra-semi-stmt, caused by upstream - ./fix-empty-expr-stmt.patch ]; postPatch = lib.optionalString stdenv.hostPlatform.isMinGW '' diff --git a/pkgs/tools/archivers/7zz/fix-cross-mingw-build.patch b/pkgs/tools/archivers/7zz/fix-cross-mingw-build.patch index 4b0ccb6f2b0f..4d77b1bb1024 100644 --- a/pkgs/tools/archivers/7zz/fix-cross-mingw-build.patch +++ b/pkgs/tools/archivers/7zz/fix-cross-mingw-build.patch @@ -1,14 +1,3 @@ ---- a/C/7zVersion.rc -+++ b/C/7zVersion.rc -@@ -5,7 +5,7 @@ - #define MY_VFT_APP 0x00000001L - #define MY_VFT_DLL 0x00000002L - --// #include -+// #include - - #ifndef MY_VERSION - #include "7zVersion.h" --- a/C/7zip_gcc_c.mak +++ b/C/7zip_gcc_c.mak @@ -106,7 +106,7 @@ @@ -20,9 +9,68 @@ CFLAGS_EXTRA = -DUNICODE -D_UNICODE # -Wno-delete-non-virtual-dtor +--- a/C/7zVersion.rc ++++ b/C/7zVersion.rc +@@ -5,7 +5,7 @@ + #define MY_VFT_APP 0x00000001L + #define MY_VFT_DLL 0x00000002L + +-// #include ++// #include + + #ifndef MY_VERSION + #include "7zVersion.h" +--- a/C/Util/7zipInstall/resource.rc ++++ b/C/Util/7zipInstall/resource.rc +@@ -1,7 +1,7 @@ + #include + // #include + // #include +-#include ++#include + + #define USE_COPYRIGHT_CR + #include "../../7zVersion.rc" +--- a/C/Util/7zipInstall/resource.rc.rej ++++ b/C/Util/7zipInstall/resource.rc.rej +@@ -0,0 +1,10 @@ ++--- C/Util/7zipInstall/resource.rc +++++ C/Util/7zipInstall/resource.rc ++@@ -1,6 +1,6 @@ ++ #include ++ #include ++-#include +++#include ++ ++ #define USE_COPYRIGHT_CR ++ #include "../../7zVersion.rc" +--- a/C/Util/7zipUninstall/resource.rc ++++ b/C/Util/7zipUninstall/resource.rc +@@ -1,7 +1,7 @@ + #include + // #include + // #include +-#include ++#include + + #define USE_COPYRIGHT_CR + #include "../../7zVersion.rc" +--- a/C/Util/7zipUninstall/resource.rc.rej ++++ b/C/Util/7zipUninstall/resource.rc.rej +@@ -0,0 +1,10 @@ ++--- C/Util/7zipUninstall/resource.rc +++++ C/Util/7zipUninstall/resource.rc ++@@ -1,6 +1,6 @@ ++ #include ++ #include ++-#include +++#include ++ ++ #define USE_COPYRIGHT_CR ++ #include "../../7zVersion.rc" --- a/CPP/7zip/7zip_gcc.mak +++ b/CPP/7zip/7zip_gcc.mak -@@ -124,8 +124,8 @@ +@@ -142,8 +142,8 @@ DEL_OBJ_EXE = -$(RM) $(O)\*.o $(O)\$(PROG).exe $(O)\$(PROG).dll endif @@ -31,28 +79,8 @@ +LIB2_GUI = -lole32 -lgdi32 -lcomctl32 -lcomdlg32 -lshell32 $(LIB_HTMLHELP) +LIB2 = -loleaut32 -luuid -ladvapi32 -luser32 $(LIB2_GUI) - CXXFLAGS_EXTRA = -DUNICODE -D_UNICODE - # -Wno-delete-non-virtual-dtor ---- a/C/Util/7zipInstall/resource.rc -+++ b/C/Util/7zipInstall/resource.rc -@@ -1,6 +1,6 @@ - #include - #include --#include -+#include - - #define USE_COPYRIGHT_CR - #include "../../7zVersion.rc" ---- a/C/Util/7zipUninstall/resource.rc -+++ b/C/Util/7zipUninstall/resource.rc -@@ -1,6 +1,6 @@ - #include - #include --#include -+#include - - #define USE_COPYRIGHT_CR - #include "../../7zVersion.rc" + # v24.00: -DUNICODE and -D_UNICODE are defined in precompilation header files + # CXXFLAGS_EXTRA = -DUNICODE -D_UNICODE --- a/CPP/7zip/Crypto/RandGen.cpp +++ b/CPP/7zip/Crypto/RandGen.cpp @@ -19,7 +19,7 @@ @@ -111,8 +139,8 @@ --- a/CPP/Windows/Control/ImageList.h +++ b/CPP/Windows/Control/ImageList.h @@ -3,7 +3,7 @@ - #ifndef __WINDOWS_CONTROL_IMAGE_LIST_H - #define __WINDOWS_CONTROL_IMAGE_LIST_H + #ifndef ZIP7_INC_WINDOWS_CONTROL_IMAGE_LIST_H + #define ZIP7_INC_WINDOWS_CONTROL_IMAGE_LIST_H -#include +#include @@ -144,8 +172,8 @@ --- a/CPP/Windows/SecurityUtils.h +++ b/CPP/Windows/SecurityUtils.h @@ -3,7 +3,7 @@ - #ifndef __WINDOWS_SECURITY_UTILS_H - #define __WINDOWS_SECURITY_UTILS_H + #ifndef ZIP7_INC_WINDOWS_SECURITY_UTILS_H + #define ZIP7_INC_WINDOWS_SECURITY_UTILS_H -#include +#include diff --git a/pkgs/tools/archivers/7zz/fix-empty-expr-stmt.patch b/pkgs/tools/archivers/7zz/fix-empty-expr-stmt.patch deleted file mode 100644 index 7583482d5d38..000000000000 --- a/pkgs/tools/archivers/7zz/fix-empty-expr-stmt.patch +++ /dev/null @@ -1,184 +0,0 @@ -diff -Naur a/C/7zCrc.c b/C/7zCrc.c ---- a/C/7zCrc.c -+++ b/C/7zCrc.c -@@ -174,7 +174,7 @@ - UInt32 Z7_FASTCALL CrcUpdateT0_32(UInt32 v, const void *data, size_t size, const UInt32 *table) - { - const Byte *p = (const Byte *)data; -- UNUSED_VAR(table); -+ UNUSED_VAR(table) - - for (; size != 0 && ((unsigned)(ptrdiff_t)p & (T0_32_UNROLL_BYTES - 1)) != 0; size--) - v = __crc32b(v, *p++); -@@ -206,7 +206,7 @@ - UInt32 Z7_FASTCALL CrcUpdateT0_64(UInt32 v, const void *data, size_t size, const UInt32 *table) - { - const Byte *p = (const Byte *)data; -- UNUSED_VAR(table); -+ UNUSED_VAR(table) - - for (; size != 0 && ((unsigned)(ptrdiff_t)p & (T0_64_UNROLL_BYTES - 1)) != 0; size--) - v = __crc32b(v, *p++); -diff -Naur a/C/AesOpt.c b/C/AesOpt.c ---- a/C/AesOpt.c -+++ b/C/AesOpt.c -@@ -639,7 +639,7 @@ - const v128 k_z0 = w[2]; - for (; numBlocks != 0; numBlocks--, data++) - { -- MM_XOR_m (*data); -+ MM_XOR_m (*data) - AES_E_MC_m (k0) - AES_E_MC_m (k1) - AES_E_MC_m (k2) -@@ -660,7 +660,7 @@ - } - } - AES_E_m (k_z1) -- MM_XOR_m (k_z0); -+ MM_XOR_m (k_z0) - *data = m; - } - *p = m; -@@ -745,7 +745,7 @@ - while (w != p); - WOP_KEY (AES_D, 1) - WOP_KEY (AES_XOR, 0) -- MM_XOR (m0, iv); -+ MM_XOR (m0, iv) - WOP_M1 (XOR_data_M1) - iv = data[NUM_WAYS - 1]; - WOP (STORE_data) -@@ -759,14 +759,14 @@ - AES_D_IMC_m (w[2]) - do - { -- AES_D_IMC_m (w[1]); -- AES_D_IMC_m (w[0]); -+ AES_D_IMC_m (w[1]) -+ AES_D_IMC_m (w[0]) - w -= 2; - } - while (w != p); -- AES_D_m (w[1]); -- MM_XOR_m (w[0]); -- MM_XOR_m (iv); -+ AES_D_m (w[1]) -+ MM_XOR_m (w[0]) -+ MM_XOR_m (iv) - iv = *data; - *data = m; - } -@@ -809,11 +809,11 @@ - { - const v128 *w = p; - v128 m; -- CTR_START (m, 0); -+ CTR_START (m, 0) - do - { -- AES_E_MC_m (w[0]); -- AES_E_MC_m (w[1]); -+ AES_E_MC_m (w[0]) -+ AES_E_MC_m (w[1]) - w += 2; - } - while (w != wEnd); -diff -Naur a/C/LzmaEnc.c b/C/LzmaEnc.c ---- a/C/LzmaEnc.c -+++ b/C/LzmaEnc.c -@@ -195,11 +195,11 @@ - unsigned GetPosSlot1(UInt32 pos) - { - unsigned res; -- BSR2_RET(pos, res); -+ BSR2_RET(pos, res) - return res; - } --#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } --#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); } -+#define GetPosSlot2(pos, res) { BSR2_RET(pos, res) } -+#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res) } - - - #else // ! LZMA_LOG_BSR -diff -Naur a/C/Sha1Opt.c b/C/Sha1Opt.c ---- a/C/Sha1Opt.c -+++ b/C/Sha1Opt.c -@@ -300,26 +300,26 @@ - LOAD_SHUFFLE (m2, 2) - LOAD_SHUFFLE (m3, 3) - -- T(m0, c0); H(e1); C(e0); -- T(m1, c0); SU0(m0, m1, m2); H(e0); C(e1); -- T(m2, c0); SU0(m1, m2, m3); SU1(m0, m3); H(e1); C(e0); -- T(m3, c0); SU0(m2, m3, m0); SU1(m1, m0); H(e0); C(e1); -- T(m0, c0); SU0(m3, m0, m1); SU1(m2, m1); H(e1); C(e0); -- T(m1, c1); SU0(m0, m1, m2); SU1(m3, m2); H(e0); P(e1); -- T(m2, c1); SU0(m1, m2, m3); SU1(m0, m3); H(e1); P(e0); -- T(m3, c1); SU0(m2, m3, m0); SU1(m1, m0); H(e0); P(e1); -- T(m0, c1); SU0(m3, m0, m1); SU1(m2, m1); H(e1); P(e0); -- T(m1, c1); SU0(m0, m1, m2); SU1(m3, m2); H(e0); P(e1); -- T(m2, c2); SU0(m1, m2, m3); SU1(m0, m3); H(e1); M(e0); -- T(m3, c2); SU0(m2, m3, m0); SU1(m1, m0); H(e0); M(e1); -- T(m0, c2); SU0(m3, m0, m1); SU1(m2, m1); H(e1); M(e0); -- T(m1, c2); SU0(m0, m1, m2); SU1(m3, m2); H(e0); M(e1); -- T(m2, c2); SU0(m1, m2, m3); SU1(m0, m3); H(e1); M(e0); -- T(m3, c3); SU0(m2, m3, m0); SU1(m1, m0); H(e0); P(e1); -- T(m0, c3); SU0(m3, m0, m1); SU1(m2, m1); H(e1); P(e0); -- T(m1, c3); SU1(m3, m2); H(e0); P(e1); -- T(m2, c3); H(e1); P(e0); -- T(m3, c3); H(e0); P(e1); -+ T(m0, c0); H(e1); C(e0) -+ T(m1, c0); SU0(m0, m1, m2) H(e0); C(e1) -+ T(m2, c0); SU0(m1, m2, m3) SU1(m0, m3) H(e1); C(e0) -+ T(m3, c0); SU0(m2, m3, m0) SU1(m1, m0) H(e0); C(e1) -+ T(m0, c0); SU0(m3, m0, m1) SU1(m2, m1) H(e1); C(e0) -+ T(m1, c1); SU0(m0, m1, m2) SU1(m3, m2) H(e0); P(e1) -+ T(m2, c1); SU0(m1, m2, m3) SU1(m0, m3) H(e1); P(e0) -+ T(m3, c1); SU0(m2, m3, m0) SU1(m1, m0) H(e0); P(e1) -+ T(m0, c1); SU0(m3, m0, m1) SU1(m2, m1) H(e1); P(e0) -+ T(m1, c1); SU0(m0, m1, m2) SU1(m3, m2) H(e0); P(e1) -+ T(m2, c2); SU0(m1, m2, m3) SU1(m0, m3) H(e1); M(e0) -+ T(m3, c2); SU0(m2, m3, m0) SU1(m1, m0) H(e0); M(e1) -+ T(m0, c2); SU0(m3, m0, m1) SU1(m2, m1) H(e1); M(e0) -+ T(m1, c2); SU0(m0, m1, m2) SU1(m3, m2) H(e0); M(e1) -+ T(m2, c2); SU0(m1, m2, m3) SU1(m0, m3) H(e1); M(e0) -+ T(m3, c3); SU0(m2, m3, m0) SU1(m1, m0) H(e0); P(e1) -+ T(m0, c3); SU0(m3, m0, m1) SU1(m2, m1) H(e1); P(e0) -+ T(m1, c3); SU1(m3, m2) H(e0); P(e1) -+ T(m2, c3); H(e1); P(e0) -+ T(m3, c3); H(e0); P(e1) - - abcd = vaddq_u32(abcd, abcd_save); - e0 += e0_save; -diff -Naur a/C/Sha256Opt.c b/C/Sha256Opt.c ---- a/C/Sha256Opt.c -+++ b/C/Sha256Opt.c -@@ -316,10 +316,10 @@ - LOAD_SHUFFLE (m2, 2) - LOAD_SHUFFLE (m3, 3) - -- R16 ( 0, NNN, NNN, SM1, NNN, SM1, SM2, SM1, SM2 ); -- R16 ( 1, SM1, SM2, SM1, SM2, SM1, SM2, SM1, SM2 ); -- R16 ( 2, SM1, SM2, SM1, SM2, SM1, SM2, SM1, SM2 ); -- R16 ( 3, SM1, SM2, NNN, SM2, NNN, NNN, NNN, NNN ); -+ R16 ( 0, NNN, NNN, SM1, NNN, SM1, SM2, SM1, SM2 ) -+ R16 ( 1, SM1, SM2, SM1, SM2, SM1, SM2, SM1, SM2 ) -+ R16 ( 2, SM1, SM2, SM1, SM2, SM1, SM2, SM1, SM2 ) -+ R16 ( 3, SM1, SM2, NNN, SM2, NNN, NNN, NNN, NNN ) - - state0 = vaddq_u32(state0, state0_save); - state1 = vaddq_u32(state1, state1_save); -diff -Naur a/CPP/Windows/System.h b/CPP/Windows/System.h ---- a/CPP/Windows/System.h -+++ b/CPP/Windows/System.h -@@ -105,7 +105,7 @@ - } - - void CpuZero() { } -- void CpuSet(unsigned cpuIndex) { UNUSED_VAR(cpuIndex); } -+ void CpuSet(unsigned cpuIndex) { UNUSED_VAR(cpuIndex) } - int IsCpuSet(unsigned cpuIndex) const { return (cpuIndex < numSysThreads) ? 1 : 0; } - - BOOL SetProcAffinity() const