~xdavidwu/apkbuilds

ref: 7b3be652afcd8c9df1cf12026e3cc3db61db2abd apkbuilds/7zip-unrar/APKBUILD -rw-r--r-- 1.7 KiB
7b3be652Pinghao Wu build: trust myself 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Maintainer: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
pkgname=7zip-unrar
pkgver=23.01
_pkgver=${pkgver//./}
pkgrel=0
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
	"
builddir="$srcdir"

provides="7zip-virtual p7zip=$pkgver-r$pkgrel"
replaces="p7zip"
provider_priority=100

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"
}

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="
e39f660c023aa65e55388be225b5591fe2a5c9138693f3c9107e2eb4ce97fafde118d3375e01ada99d29de9633f56221b5b3d640c982178884670cd84c8aa986  7z2301-src.tar.xz
dfecb69861d00ee47311d83930adf80321b3c95ae01ce325677bde7aee6aa880a1979b0aa2909d9acb7a88ff31f910ac545ac218a0b5fd9e1270df2276b46d44  7-zip-flags.patch
c652a87ad95f61901820adb61f3d1ceacedcb8aeaf9e89b2b728b7372eff67d9669eb363d5b2d2fb848ff2d8c5a727134fe13cc77d1215df7b2d32fe87711ebf  7-zip-musl.patch
"