From 5598806428df6214cc6bcb4a24e684374827181e Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Sat, 25 Feb 2023 13:08:26 +0800 Subject: [PATCH] 7zip: import from aports --- 7zip/7-zip-flags.patch | 28 +++++++++++++++++++ 7zip/7-zip-musl.patch | 63 ++++++++++++++++++++++++++++++++++++++++++ 7zip/APKBUILD | 53 +++++++++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 7zip/7-zip-flags.patch create mode 100644 7zip/7-zip-musl.patch create mode 100644 7zip/APKBUILD diff --git a/7zip/7-zip-flags.patch b/7zip/7-zip-flags.patch new file mode 100644 index 0000000..963037c --- /dev/null +++ b/7zip/7-zip-flags.patch @@ -0,0 +1,28 @@ +diff -ru a/CPP/7zip/7zip_gcc.mak b/CPP/7zip/7zip_gcc.mak +--- a/CPP/7zip/7zip_gcc.mak 2021-11-20 04:00:00.000000000 -0500 ++++ b/CPP/7zip/7zip_gcc.mak 2021-12-16 11:01:16.236763027 -0500 +@@ -14,13 +14,13 @@ + + + ifneq ($(CC), xlc) +-CFLAGS_WARN_WALL = -Wall -Werror -Wextra ++CFLAGS_WARN_WALL = -Wall -Wextra + endif + + # for object file + CFLAGS_BASE_LIST = -c + # CFLAGS_BASE_LIST = -S +-CFLAGS_BASE = -O2 $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) \ ++CFLAGS_BASE = $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) \ + -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ + -fPIC + +@@ -162,7 +162,7 @@ + $(O): + $(MY_MKDIR) $(O) + +-LFLAGS_ALL = -s $(MY_ARCH_2) $(LDFLAGS) $(LD_arch) $(OBJS) $(MY_LIBS) $(LIB2) ++LFLAGS_ALL = $(MY_ARCH_2) $(LDFLAGS) $(LD_arch) $(OBJS) $(MY_LIBS) $(LIB2) + $(PROGPATH): $(OBJS) + $(CXX) -o $(PROGPATH) $(LFLAGS_ALL) + diff --git a/7zip/7-zip-musl.patch b/7zip/7-zip-musl.patch new file mode 100644 index 0000000..d184e45 --- /dev/null +++ b/7zip/7-zip-musl.patch @@ -0,0 +1,63 @@ +diff -ru a/C/CpuArch.c b/C/CpuArch.c +--- a/C/CpuArch.c 2021-07-13 05:10:00.000000000 -0400 ++++ b/C/CpuArch.c 2022-03-05 11:08:23.363390656 -0500 +@@ -421,8 +421,6 @@ + + #ifdef USE_HWCAP + +-#include +- + #define MY_HWCAP_CHECK_FUNC_2(name1, name2) \ + BoolInt CPU_IsSupported_ ## name1() { return (getauxval(AT_HWCAP) & (HWCAP_ ## name2)) ? 1 : 0; } + +diff -ru a/C/Threads.c b/C/Threads.c +--- a/C/Threads.c 2021-12-21 08:00:00.000000000 -0500 ++++ b/C/Threads.c 2022-03-05 11:07:47.203504536 -0500 +@@ -257,7 +257,7 @@ + */ + + // ret2 = +- pthread_attr_setaffinity_np(&attr, sizeof(*cpuSet), cpuSet); ++ //pthread_attr_setaffinity_np(&attr, sizeof(*cpuSet), cpuSet); + // if (ret2) ret = ret2; + #endif + } +@@ -267,14 +267,12 @@ + if (!ret) + { + p->_created = 1; +- /* + if (cpuSet) + { + // ret2 = + pthread_setaffinity_np(p->_tid, sizeof(*cpuSet), cpuSet); + // if (ret2) ret = ret2; + } +- */ + } + } + // ret2 = +diff -ru a/C/Threads.h b/C/Threads.h +--- a/C/Threads.h 2021-12-21 08:00:00.000000000 -0500 ++++ b/C/Threads.h 2022-03-05 11:07:47.203504536 -0500 +@@ -19,6 +19,7 @@ + #endif + + #include ++#include + + #endif + +diff -ru a/CPP/Windows/SystemInfo.cpp b/CPP/Windows/SystemInfo.cpp +--- a/CPP/Windows/SystemInfo.cpp 2021-11-06 04:19:39.000000000 -0400 ++++ b/CPP/Windows/SystemInfo.cpp 2022-03-05 11:26:27.178812388 -0500 +@@ -36,9 +36,6 @@ + #endif + */ + +-#ifdef MY_CPU_ARM_OR_ARM64 +-#include +-#endif + #endif + + #ifdef __linux__ diff --git a/7zip/APKBUILD b/7zip/APKBUILD new file mode 100644 index 0000000..8955c1a --- /dev/null +++ b/7zip/APKBUILD @@ -0,0 +1,53 @@ +# Maintainer: Alex Xu (Hello71) +pkgname=7zip +pkgver=22.01 +_pkgver=${pkgver//./} +pkgrel=1 +pkgdesc="File archiver with a high compression ratio" +url="https://7-zip.org/" +arch="all" +license="LGPL-2.0-only" +subpackages="$pkgname-doc" +source="https://7-zip.org/a/7z$_pkgver-src.tar.xz + 7-zip-flags.patch + 7-zip-musl.patch + " +depends="!p7zip" # conflicts /usr/bin/7z +builddir="$srcdir" + +provides="7zip-virtual" +provider_priority=10 + +build() { + cd CPP/7zip/Bundles/Alone2 + mkdir -p b/g + # TODO: enable asm (requires jwasm or uasm) + # DISABLE_RAR: RAR codec is non-free + # -D_GNU_SOURCE: broken sched.h defines + make -f ../../cmpl_gcc.mak \ + CC="${CC:-cc} $CFLAGS $LDFLAGS -D_GNU_SOURCE" \ + CXX="${CXX:-c++} $CXXFLAGS $LDFLAGS -D_GNU_SOURCE" \ + DISABLE_RAR=1 +} + +check() { + # no proper test suite so just try to compress and decompress some files + mkdir tmp + CPP/7zip/Bundles/Alone2/b/g/7zz a tmp/7z$_pkgver-src.7z Asm C CPP DOC + cd tmp + ../CPP/7zip/Bundles/Alone2/b/g/7zz x 7z$_pkgver-src.7z + # TODO: check if extracted result is identical +} + +package() { + install -Dm755 CPP/7zip/Bundles/Alone2/b/g/7zz "$pkgdir"/usr/bin/7zz + ln -s 7zz "$pkgdir"/usr/bin/7z + + install -Dm644 "$builddir"/DOC/* -t "$pkgdir"/usr/share/doc/$pkgname/ +} + +sha512sums=" +3f391b1bd65a0654eb5b31b50f1d400f0ec38ab191d88e15849a6e4d164b7bf2ce4a6d70ec8b6e27bde1b83bb2d45b65c03129499334669e05ee025784be455a 7z2201-src.tar.xz +1b6928f62f62e27cc948a0c1fe44c085a2e49f85e5a14bef186c613335ed67ccc63649162cef55ab4431e4fec70be5bd9d61f4c76bf702dd9c2c08cd1993e7be 7-zip-flags.patch +c652a87ad95f61901820adb61f3d1ceacedcb8aeaf9e89b2b728b7372eff67d9669eb363d5b2d2fb848ff2d8c5a727134fe13cc77d1215df7b2d32fe87711ebf 7-zip-musl.patch +" -- 2.43.0