~xdavidwu/apkbuilds

ref: 7056b36d034d545964fea6ae89dcf80593f990c2 apkbuilds/7zip/APKBUILD -rw-r--r-- 1.7 KiB
7056b36dxdavidwu nvimpager: drop, alpine has it at testing 1 year, 9 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=22.01
_pkgver=${pkgver//./}
pkgrel=2
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"
}

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
"