archivers/7-zip: Update to 21.07

Merge patches to fix build on arm64 [1].

PR:		260329 [1]
Reported by:	diizzy@
Submitted by:	mikael@
This commit is contained in:
Max Brazhnikov 2021-12-28 17:32:52 +03:00
parent 5119132254
commit b6bf306d87
4 changed files with 50 additions and 7 deletions

View file

@ -1,6 +1,5 @@
PORTNAME= 7-zip
DISTVERSION= 21.06
PORTREVISION= 1
DISTVERSION= 21.07
CATEGORIES= archivers
MASTER_SITES= https://www.7-zip.org/a/
DISTNAME= 7z${DISTVERSION:S/.//}-src
@ -28,7 +27,8 @@ MAKE_ARGS= LOCAL_FLAGS="${CFLAGS}" \
NO_WRKSUBDIR= yes
BUILD_WRKSRC= ${WRKSRC}/CPP/7zip/Bundles/Alone2
DOS2UNIX_FILES= CPP/7zip/7zip_gcc.mak \
DOS2UNIX_FILES= C/CpuArch.c \
CPP/7zip/7zip_gcc.mak \
CPP/7zip/var_gcc.mak \
CPP/Windows/SystemInfo.cpp

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1639126647
SHA256 (7z2106-src.7z) = 675eaa90de3c6a3cd69f567bba4faaea309199ca75a6ad12bac731dcdae717ac
SIZE (7z2106-src.7z) = 1215031
TIMESTAMP = 1640701508
SHA256 (7z2107-src.7z) = d1074d56f415aab99d99e597a7b66dc455dba6349ae8a4c89df76475b6a1284c
SIZE (7z2107-src.7z) = 1219373

View file

@ -1,4 +1,4 @@
--- CPP/Windows/SystemInfo.cpp.orig 2021-12-10 11:30:40 UTC
--- CPP/Windows/SystemInfo.cpp.orig 2021-12-28 14:08:56 UTC
+++ CPP/Windows/SystemInfo.cpp
@@ -20,6 +20,15 @@
@ -16,3 +16,12 @@
// #undef AT_HWCAP // to debug
// #undef AT_HWCAP2 // to debug
@@ -36,7 +45,7 @@
#endif
*/
-#ifdef MY_CPU_ARM_OR_ARM64
+#if defined(MY_CPU_ARM_OR_ARM64) && !defined(__FreeBSD__)
#include <asm/hwcap.h>
#endif
#endif

View file

@ -0,0 +1,34 @@
--- C/CpuArch.c.orig 2021-12-12 14:45:15 UTC
+++ C/CpuArch.c
@@ -417,6 +417,23 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYP
#include <sys/auxv.h>
+#if defined(__FreeBSD__)
+static UInt64 get_hwcap() {
+ unsigned long hwcap;
+ if(elf_aux_info(AT_HWCAP, &hwcap, sizeof(unsigned long)) != 0) {
+ return(0);
+ }
+ return hwcap;
+}
+
+BoolInt CPU_IsSupported_CRC32(void) { return get_hwcap() & HWCAP_CRC32; }
+BoolInt CPU_IsSupported_NEON(void) { return 1; }
+BoolInt CPU_IsSupported_SHA1(void){ return get_hwcap() & HWCAP_SHA1; }
+BoolInt CPU_IsSupported_SHA2(void) { return get_hwcap() & HWCAP_SHA2; }
+BoolInt CPU_IsSupported_AES(void) { return get_hwcap() & HWCAP_AES; }
+
+#else // __FreeBSD__
+
#define USE_HWCAP
#ifdef USE_HWCAP
@@ -450,6 +467,7 @@ MY_HWCAP_CHECK_FUNC (SHA1)
MY_HWCAP_CHECK_FUNC (SHA2)
MY_HWCAP_CHECK_FUNC (AES)
+#endif // FreeBSD
#endif // __APPLE__
#endif // _WIN32