~xdavidwu/apkbuilds

ref: 1d309dcaa3e53f958c01c914560372ede21e49ff apkbuilds/7zip-unrar/APKBUILD -rw-r--r-- 1.8 KiB
1d309dcaPinghao Wu 7zip-unrar: sync from aports to 24.08 4 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
53
54
55
56
57
58
59
60
61
62
63
# Maintainer: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
pkgname=7zip-unrar
pkgver=24.08
_pkgver=${pkgver//./}
pkgrel=0
pkgdesc="File archiver with a high compression ratio"
url="https://7-zip.org/"
arch="all"
license="LGPL-2.0-only"
makedepends="make build-base"
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

patch_args="-p1 --binary"

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
	rm -rf "$builddir"/tmp
	cd "$builddir"
	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

	# check if extracted result is identical
	diff -r ../Asm Asm
	diff -r ../C C
	diff -r ../CPP CPP
	diff -r ../DOC DOC
}

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="
889e9aeaa629d6474a609a15066b2fa7b1353fa5e7255e044297591f565b08b16b885d44f4c4a046f2f9da189599ace300cf61fd9ac0e7bc316fb9d96a18a039  7z2408-src.tar.xz
1bacb622842e48b12e7d0557b2cae11aa2a51119308857bfd3479e11d13410b7bbde2fdee74a3645459cf2ca9a9a98c56bde82beee79ec59a46a2f406f7310f5  7-zip-flags.patch
dd5c38548c348a850d6e82ed42ba2bdc4b9e363fa946e67158a1f042179d8155a8837c89d732f748ffd1ba948bf2b7cd456f6db50e122ebbd7ba9c8a1cd7b04b  7-zip-musl.patch
"