blob: 515486e0301b89f1c2991206de67e1bfea029f5f (
plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=abuild
pkgver=3.12.0
_ver=${pkgver%_git*}
pkgrel=4
pkgdesc="Script to build Alpine Packages"
url="https://git.alpinelinux.org/cgit/abuild/"
arch="all"
license="GPL-2.0-only"
depends="
apk-tools>=2.0.7-r1
attr
cmd:getcap
fakeroot
musl-utils
lzip
openssl>3
patch
pkgconf
scanelf
tar
"
makedepends_build="pkgconfig scdoc"
makedepends_host="openssl-dev>3 zlib-dev"
makedepends="$makedepends_host $makedepends_build"
checkdepends="cmd:setcap kyua git"
install="$pkgname.pre-install $pkgname.pre-upgrade"
subpackages="
apkbuild-cpan:cpan:noarch
apkbuild-gem-resolver:gems:noarch
apkbuild-pypi:pypi:noarch
abuild-rootbld:_rootbld:noarch
$pkgname-doc
"
options="suid"
pkggroups="abuild"
source="https://gitlab.alpinelinux.org/alpine/abuild/-/archive/$pkgver/abuild-$pkgver.tar.gz
abuild-fix-subpackage-setting-arch-to-all-explicitly.patch
abuild.in-update-autoconf-test-for-loongarch64.patch
"
builddir="$srcdir"/abuild-$pkgver
build() {
make VERSION="$pkgver-r$pkgrel"
}
check() {
make check
}
package() {
make install VERSION="$pkgver-r$pkgrel" DESTDIR="$pkgdir"
install -m 644 abuild.conf "$pkgdir"/etc/abuild.conf
case "$CARCH" in
x86*|ppc64le)
# binutils only supports it here
cat >>"$pkgdir"/usr/share/abuild/default.conf <<-EOF
# binutils ld.bfd supports this on this architecture; default to it
export RUSTFLAGS="\$RUSTFLAGS -Clink-arg=-Wl,-z,pack-relative-relocs"
export LDFLAGS="\$LDFLAGS -Wl,-z,pack-relative-relocs"
EOF
esac
case "$CARCH" in
x86_64)
# https://lists.alpinelinux.org/~alpine/devel/%3C1628515011.zujvcn248v.none%40localhost%3E
# note that this is x86-exclusive. on other architectures, this is pretty much always bad
# https://github.com/rust-lang/rust/pull/106380
cat >>"$pkgdir"/usr/share/abuild/default.conf <<-EOF
# -fno-plt has very slight improvements to general code size and speed on x86-only,
# for the common system dynamic linking case
export CFLAGS="\$CFLAGS -fno-plt"
export CXXFLAGS="\$CXXFLAGS -fno-plt"
EOF
;;
esac
install -d -m 775 -g abuild "$pkgdir"/var/cache/distfiles
}
cpan() {
pkgdesc="Script to generate perl APKBUILD from CPAN"
depends="perl perl-libwww perl-json perl-module-build perl-module-build-tiny
perl-lwp-protocol-https"
amove usr/bin/apkbuild-cpan
}
gems() {
pkgdesc="APKBUILD dependency resolver for RubyGems"
depends="ruby ruby-augeas"
amove usr/bin/apkbuild-gem-resolver
}
pypi() {
pkgdesc="Script to generate python3 APKBUILD from PYPI"
depends="perl perl-libwww perl-json perl-module-build-tiny perl-lwp-protocol-https
perl-ipc-system-simple"
amove usr/bin/apkbuild-pypi
}
_rootbld() {
pkgdesc="Build packages in chroot"
depends="abuild bubblewrap cmd:envsubst git"
mkdir -p "$subpkgdir"
}
sha512sums="
00fac67aa96a83f33406dde60bd9526bfa5fdff690b84dbe867b6ed197f147b2afafcdfbda900c005e00a64a42bcb98ca425ffc8bf2158b9540cbb67d935577d abuild-3.12.0.tar.gz
b1b75cce7fe86f5183e68ab37ed1b4742927b0617fac2b200837cacd759443315d0cbcae137cb1fe0b6f0a25ed81c90b33e8ec64cd1033aba6016ec6ea0d68ee abuild-fix-subpackage-setting-arch-to-all-explicitly.patch
601beff5722a2356a9025a1a7ea7b955ea9bdd5016369c055414e4e254dfba2cf0b2ccfc2be7225555aa630c98a1e19afc7e6b4fe769e22c0cbe10edca42eedd abuild.in-update-autoconf-test-for-loongarch64.patch
"
|