~xdavidwu/apkbuilds

5598806428df6214cc6bcb4a24e684374827181e — xdavidwu 1 year, 2 months ago 0c8367b
7zip: import from aports
3 files changed, 144 insertions(+), 0 deletions(-)

A 7zip/7-zip-flags.patch
A 7zip/7-zip-musl.patch
A 7zip/APKBUILD
A 7zip/7-zip-flags.patch => 7zip/7-zip-flags.patch +28 -0
@@ 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)
 

A 7zip/7-zip-musl.patch => 7zip/7-zip-musl.patch +63 -0
@@ 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 <asm/hwcap.h>
-
   #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 <pthread.h>
+#include <sched.h>
 
 #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 <asm/hwcap.h>
-#endif
 #endif
 
 #ifdef __linux__

A 7zip/APKBUILD => 7zip/APKBUILD +53 -0
@@ 0,0 1,53 @@
# Maintainer: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
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
"