summaryrefslogtreecommitdiff
path: root/main/boost1.80/APKBUILD
blob: e0deb747833c5f537456a6639071e7f1aec56540 (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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=boost1.80
pkgver=1.80.0
_pkgver="${pkgver//./_}"
pkgrel=4
pkgdesc="Free peer-reviewed portable C++ source libraries"
url="https://www.boost.org/"
arch="all"
license="BSL-1.0"
depends="$pkgname-libs"
depends_dev="$pkgname linux-headers bzip2-dev icu-dev xz-dev zlib-dev"
makedepends="$depends_dev python3-dev>=3.8 flex bison"
subpackages="
	$pkgname-static
	$pkgname-dev
	$pkgname-doc
	boost-dev:_dev
	"
source="https://boostorg.jfrog.io/artifactory/main/release/$pkgver/source/boost_$_pkgver.tar.bz2
	aligned-alloc.patch
	boost-python-311.patch
	boost-1.57.0-python-abi_letters.patch
	boost-1.57.0-python-libpython_dep.patch
	0001-revert-cease-dependence-on-range.patch
	boost-1.80-filesystem-win-fix-dir-it-net-share.patch
	boost-1.80-filesystem-fix-weakly-canonical-long-paths.patch
	boost-1.80-boost-unordered.patch
	"
builddir="$srcdir/boost_$_pkgver"
options="!check" # some tests fail now, figure it out later

_enginedir="tools/build/src/engine"
_bjam="$builddir"/$_enginedir/b2

_libs="
	atomic
	chrono
	container
	context
	contract
	coroutine
	date_time
	fiber
	filesystem
	graph
	iostreams
	locale
	log_setup
	log
	math
	prg_exec_monitor
	program_options
	python3
	random
	regex
	serialization
	stacktrace_basic
	stacktrace_noop
	system
	thread
	timer
	type_erasure
	unit_test_framework
	wave
	wserialization
	json
	nowide
	"
for _lib in $_libs; do
	subpackages="$subpackages $pkgname-${_lib}:_boostlib"
done; unset -v _lib
subpackages="$subpackages $pkgname-libs"

# Claim the unversioned name, this must be removed once we switch our
# boost to a new version
provides="boost=$pkgver-r$pkgrel"
replaces="boost boost1.79"

_set_options() {
	local _python="$(_pyversion python3)"
	export PY3_VERSION="$_python"
	export BOOST_ROOT="$builddir"

	_options="
		--user-config=\"$builddir/user-config.jam\"
		--prefix=\"$pkgdir/usr\"
		variant=release
		python=$PY3_VERSION
		toolset=gcc
		debug-symbols=off
		threading=multi
		runtime-link=shared
		link=shared,static
		cflags=-fno-strict-aliasing
		--layout=system
		-q
		-j${JOBS:-2}
		"
}

prepare() {
	default_prepare
	_set_options

	local abiflags="$(python3-config --abiflags)"

	# create user-config.jam
	cat > user-config.jam <<-__EOF__

	using gcc : : $CC : <cxxflags>"$CXXFLAGS" <linkflags>"$LDFLAGS" ;
	using python : $PY3_VERSION : /usr/bin/python3 : /usr/include/python${PY3_VERSION}$abiflags : : : : $abiflags ;

	__EOF__
}

build() {
	_set_options

	msg "Building bjam"
	cd "$builddir"/$_enginedir
	CC= ./build.sh gcc

	msg "Building bcp"
	cd "$builddir"/tools/bcp
	"$_bjam" -j${JOBS:-2}

	msg "Building boost"
	cd "$builddir"

	"$_bjam" $_options
}

check() {
	cd "$builddir"/tools/build/test

	PATH="${_bjam%/*}:$PATH" python3 test_all.py --default-bjam
}

package() {
	_set_options

	install -Dm755 "$_bjam" \
		"$pkgdir"/usr/bin/b2
	ln -s b2 "$pkgdir"/usr/bin/bjam # old name for b2 binary

	install -Dm755 dist/bin/bcp "$pkgdir"/usr/bin/bcp

	install -Dm644 LICENSE_1_0.txt \
		"$pkgdir"/usr/share/licenses/$pkgname/LICENSE_1_0.txt

	"$pkgdir"/usr/bin/bjam $_options \
		--includedir="$pkgdir"/usr/include \
		--libdir="$pkgdir"/usr/lib \
		install
}

static() {
	pkgdesc="Boost static libraries"
	depends="$depends_static"

	# Claim the unversioned name, this must be removed once we switch our
	# boost to a new version
	provides="boost-static=$pkgver-r$pkgrel"
	replaces="boost-static"

	amove usr/lib/lib*.a
}

_boostlib() {
	local name="${subpkgname#$pkgname-}"
	pkgdesc="Boost $name shared library"
	depends="$depends__boostlib"

	# Claim the unversioned name, this must be removed once we switch our
	# boost to a new version
	provides="boost-$name=$pkgver-r$pkgrel"
	replaces="boost-$name"

	amove usr/lib/libboost_$name*.so.[0-9]*
}

libs() {
	default_libs

	# Claim the unversioned name, this must be removed once we switch our
	# boost to a new version
	provides="boost-libs=$pkgver-r$pkgrel"
	replaces="boost-libs"

	pkgdesc="Boost shared libraries"
	depends="$depends_libs"
	local _pkg; for _pkg in $origsubpackages; do
		case "$_pkg" in
			*:_boostlib) depends="$depends ${_pkg%%:*}" ;;
		esac
	done

	mkdir -p "$subpkgdir"
	rmdir "$pkgdir"/usr/lib >/dev/null 2>&1 || :
}

dev() {
	# Claim the unversioned name, this must be removed once we switch our
	# boost to a new version. Replace previous boost version for clean -dev
	# upgrade
	default_dev
	replaces="boost1.79-dev"
}

_dev() {
	# This makes boost-dev be a metapackage that depends on boostX.Y-dev
	mkdir -p "$subpkgdir"
	depends="$pkgname-dev=$pkgver-r$pkgrel"
}

doc() {
	# Claim the unversioned name, this must be removed once we switch our
	# boost to a new version
	provides="boost-doc=$pkgver-r$pkgrel"
	replaces="boost-doc"

	default_doc
}

_pyversion() {
	"$1" -c 'import sys; print("%i.%i" % (sys.version_info.major, sys.version_info.minor))'
}

sha512sums="
829a95b463473d69ff79ea41799c68429bb79d3b2321fbdb71df079af237ab01de9ad7e9612d8783d925730acada010068d2d1aa856c34244ee5c0ece16f208f  boost_1_80_0.tar.bz2
6254b4cc92d091aef9e8fdea375c0779f47bc3ea7965f6d93cab8bf76d2a502d9593d860228d2313ea133ee4f7935c4813d39df4bcb29bdf380628474ce4dcd6  aligned-alloc.patch
085cf0424f4737bdfab246ac97a6d804aa06239c733bfe499d60b7b4a1550fd62171d3d9564e38f88d915153fc7a84b08564e2c358034abbceaac2651d518675  boost-python-311.patch
d96d4d37394a31764ed817d0bc4a99cffa68a75ff1ecfd4417b9e1e5ae2c31a96ed24f948c6f2758ffdac01328d2402c4cf0d33a37107e4f5f721e636daebd66  boost-1.57.0-python-abi_letters.patch
132c4b62815d605c2d3c9038427fa4f422612a33711d47b2862f2311516af8a371d6b75bf078a7bffe20be863f8d21fb9fe74dc1a1bac3a10d061e9768ec3e02  boost-1.57.0-python-libpython_dep.patch
9b53d2fe2dddd592e43db03c26fadd6c07d4c45a980ae4c775b7a914346a3914f6e0c3ef42dad5e2ea4568afb86c9967e09444ff609cfba1e1d39f4980b22ad6  0001-revert-cease-dependence-on-range.patch
bfc055c63191379b6db91a5c862cea3ce9e0856d6b8efdb31869a4b684a30319880f7033cd90f9c5493d9fd69765e62f858a0710e1cf5364777061d6eace1f78  boost-1.80-filesystem-win-fix-dir-it-net-share.patch
0fe46226870bede3bd5a90a137e6ea406d217aa7de0582e6b08223bd0634b3640b93dfd6f7f6054f25edd42d815f313c20268e8f10fd3d520a287ac90b27d789  boost-1.80-filesystem-fix-weakly-canonical-long-paths.patch
a8184bb2301f63ee918b5f392890ecf1af13d9b5e0eb35e431e7d7bef40a6fb505f9f2bf718239f8446fb096bf97fbf21b94cd2ed3c0eb44c4394450c2dae2de  boost-1.80-boost-unordered.patch
"