From 4a44f20744b33efe6e4cc72bdc08fcdbedae779b Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Thu, 13 Jan 2022 23:06:07 +0000
Subject: user/boost: Update to 1.79.0

Add more libraries.

Boost.Context is now available (it is fixed on z and SPARC, too).

Enable test suite (thanks @z).

Closes: #469
---
 user/boost/APKBUILD                                | 54 +++++++++++--------
 user/boost/boost-1.57.0-python-abi_letters.patch   | 62 ----------------------
 user/boost/boost-1.57.0-python-libpython_dep.patch | 13 -----
 user/boost/dual-python.patch                       | 27 ----------
 4 files changed, 31 insertions(+), 125 deletions(-)
 delete mode 100644 user/boost/boost-1.57.0-python-abi_letters.patch
 delete mode 100644 user/boost/boost-1.57.0-python-libpython_dep.patch
 delete mode 100644 user/boost/dual-python.patch

diff --git a/user/boost/APKBUILD b/user/boost/APKBUILD
index 619f65577..2d013729c 100644
--- a/user/boost/APKBUILD
+++ b/user/boost/APKBUILD
@@ -1,29 +1,27 @@
 # Contributor: Natanael Copa <ncopa@alpinelinux.org>
-# Maintainer: 
+# Maintainer: Zach van Rijn <me@zv.io>
 pkgname=boost
-pkgver=1.72.0
+pkgver=1.79.0
 _pkgver=$(printf '%s' "$pkgver" | tr . _)
 pkgrel=0
 pkgdesc="Free peer-reviewed portable C++ source libraries"
 url="https://www.boost.org/"
 arch="all"
 license="BSL-1.0"
-options="!check"  # No test suite.
 depends=""
 depends_dev="linux-headers"
 makedepends="$depends_dev byacc bzip2-dev flex python3-dev xz-dev zlib-dev
 	zstd-dev"
 subpackages="$pkgname-dev $pkgname-doc"
-source="http://downloads.sourceforge.net/$pkgname/${pkgname}_$_pkgver.tar.bz2
-	boost-1.57.0-python-abi_letters.patch
-	boost-1.57.0-python-libpython_dep.patch
-	"
+source="https://boostorg.jfrog.io/artifactory/main/release/${pkgver}/source/${pkgname}_${_pkgver}.tar.bz2"
+
 builddir="$srcdir/${pkgname}_${_pkgver}"
 
 _libs="
 	atomic
 	chrono
 	container
+	context
 	contract
 	coroutine
 	date_time
@@ -31,35 +29,43 @@ _libs="
 	filesystem
 	graph
 	iostreams
+	json
+	locale
+	log_setup
+	log
 	math
+	nowide
 	prg_exec_monitor
 	program_options
 	python3
 	random
 	regex
 	serialization
+	stacktrace_basic
+	stacktrace_noop
 	system
 	thread
+	timer
+	type_erasure
 	unit_test_framework
 	wave
 	wserialization
 	"
 for _lib in $_libs; do
-	subpackages="$subpackages $pkgname-$_lib:_boostlib"
+	subpackages="$subpackages $pkgname-${_lib}:_boostlib"
 done
 
 prepare() {
 	default_prepare
 
 	PY3_VERSION="$(_pyversion python3)"
-	abiflags=$(python3-config --abiflags)
-
+	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}m : : : : $abiflags ;
+	using gcc : : $CC : <cxxflags>"$CXXFLAGS" <linkflags>"$LDFLAGS" ;
+	using python : ${PY3_VERSION} : /usr/bin/python3 : /usr/include/python${PY3_VERSION}${abiflags} : "$(python3-config --libs)" : : $abiflags ;
 
 	__EOF__
 }
@@ -71,11 +77,9 @@ esac
 _enginedir=tools/build/src/engine
 _bjam="${builddir}/$_enginedir/bjam"
 
-# context is broken on at least s390 and sparc
 _options="--user-config=\"$builddir/user-config.jam\"
 	--prefix=\"$pkgdir/usr\"
 	release
-	debug-symbols=off
 	runtime-link=shared
 	link=shared,static
 	cflags=-fno-strict-aliasing
@@ -83,7 +87,7 @@ _options="--user-config=\"$builddir/user-config.jam\"
 	-sTOOLS=gcc
 	--layout=system
 	-q
-	--without-context
+	--without-mpi
 	-j${JOBS:-2}
 	${_options_s390}
 	"
@@ -104,6 +108,12 @@ build() {
 	"$_bjam" $_options
 }
 
+check() {
+	cd "$builddir"/tools/build/test
+
+	PATH="${_bjam%/*}:$PATH" python3 test_all.py --default-bjam
+}
+
 package() {
 	export BOOST_ROOT="$builddir"
 
@@ -122,20 +132,18 @@ package() {
 }
 
 _boostlib() {
-	local name="${subpkgname#$pkgname-}"
-	pkgdesc="Boost $name library"
-	case "$name" in
-	python*) depends="$depends $name"
+	libname="${subpkgname#$pkgname-}"
+	pkgdesc="Boost library - $libname"
+	case "$subpkgname" in
+	boost-python3) depends="$depends python3"
 	esac
 
 	mkdir -p "$subpkgdir"/usr/lib
-	mv "$pkgdir"/usr/lib/libboost_$name* "$subpkgdir"/usr/lib/
+	mv "$pkgdir"/usr/lib/libboost_$libname* "$subpkgdir"/usr/lib/
 }
 
 _pyversion() {
 	$1 -c 'import sys; print("%i.%i" % (sys.version_info.major, sys.version_info.minor))'
 }
 
-sha512sums="63bbd1743e7c904b2e69fdc2eafd1c2a8a30fd70d960dcd366059d0100f000cb605d56cbd9397bb18421631f1c9552a772c434d0f0caddbe56302273f51fd1f6  boost_1_72_0.tar.bz2
-d96d4d37394a31764ed817d0bc4a99cffa68a75ff1ecfd4417b9e1e5ae2c31a96ed24f948c6f2758ffdac01328d2402c4cf0d33a37107e4f5f721e636daebd66  boost-1.57.0-python-abi_letters.patch
-132c4b62815d605c2d3c9038427fa4f422612a33711d47b2862f2311516af8a371d6b75bf078a7bffe20be863f8d21fb9fe74dc1a1bac3a10d061e9768ec3e02  boost-1.57.0-python-libpython_dep.patch"
+sha512sums="70909e0561c213d10a1fdd692f9ae7b293d3cdc63e925bdc207da9e9bba6e86474341100e7ee5de6d94f9561196b1a3a1597055a7b7382babf8931131170a312  boost_1_79_0.tar.bz2"
diff --git a/user/boost/boost-1.57.0-python-abi_letters.patch b/user/boost/boost-1.57.0-python-abi_letters.patch
deleted file mode 100644
index 7df3ee704..000000000
--- a/user/boost/boost-1.57.0-python-abi_letters.patch
+++ /dev/null
@@ -1,62 +0,0 @@
---- boost_1_57_0/tools/build/src/tools/python.jam	2013-05-21 06:14:18.000000000 +0200
-+++ boost_1_55_0/tools/build/src/tools/python.jam	2014-05-29 19:09:12.115413877 +0200
-@@ -94,7 +94,7 @@ feature.feature pythonpath : : free opti
- #   using python : 2.3 : /usr/local/bin/python ;
- #
- rule init ( version ? : cmd-or-prefix ? : includes * : libraries ?
--    : condition * : extension-suffix ? )
-+    : condition * : extension-suffix ? : abi-letters ? )
- {
-     project.push-current $(.project) ;
- 
-@@ -107,7 +107,7 @@ rule init ( version ? : cmd-or-prefix ? 
-         }
-     }
- 
--    configure $(version) : $(cmd-or-prefix) : $(includes) : $(libraries) : $(condition) : $(extension-suffix) ;
-+    configure $(version) : $(cmd-or-prefix) : $(includes) : $(libraries) : $(condition) : $(extension-suffix) : $(abi-letters) ;
- 
-     project.pop-current ;
- }
-@@ -653,7 +653,7 @@ local rule system-library-dependencies (
- 
- # Declare a target to represent Python's library.
- #
--local rule declare-libpython-target ( version ? : requirements * )
-+local rule declare-libpython-target ( version ? : requirements * : abi-letters ? )
- {
-     # Compute the representation of Python version in the name of Python's
-     # library file.
-@@ -677,13 +677,13 @@ local rule declare-libpython-target ( ve
-     }
- 
-     # Declare it.
--    lib python.lib : : <name>python$(lib-version) $(requirements) ;
-+    lib python.lib : : <name>python$(lib-version)$(abi-letters) $(requirements) ;
- }
- 
- 
- # Implementation of init.
- local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? :
--    condition * : extension-suffix ? )
-+    condition * : extension-suffix ? : abi-letters ? )
- {
-     local prefix ;
-     local exec-prefix ;
-@@ -699,6 +699,7 @@ local rule configure ( version ? : cmd-o
-         extension-suffix ?= _d ;
-     }
-     extension-suffix ?= "" ;
-+    abi-letters ?= "" ;
- 
-     # Normalize and dissect any version number.
-     local major-minor ;
-@@ -922,7 +923,7 @@ local rule configure ( version ? : cmd-o
-     }
-     else
-     {
--        declare-libpython-target $(version) : $(target-requirements) ;
-+        declare-libpython-target $(version) : $(target-requirements) : $(abi-letters) ;
- 
-         # This is an evil hack.  On, Windows, when Python is embedded, nothing
-         # seems to set up sys.path to include Python's standard library
diff --git a/user/boost/boost-1.57.0-python-libpython_dep.patch b/user/boost/boost-1.57.0-python-libpython_dep.patch
deleted file mode 100644
index 57bfc2677..000000000
--- a/user/boost/boost-1.57.0-python-libpython_dep.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: boost_1_57_0/tools/build/src/tools/python.jam
-===================================================================
---- boost_1_57_0/tools/build/src/tools/python.jam	(revision 50406)
-+++ boost_1_57_0/tools/build/src/tools/python.jam	(working copy)
-@@ -994,7 +994,7 @@
-     else
-     {
-         alias python_for_extensions
--            :
-+            : python
-             : $(target-requirements)
-             :
-             : $(usage-requirements)
diff --git a/user/boost/dual-python.patch b/user/boost/dual-python.patch
deleted file mode 100644
index 6a0647888..000000000
--- a/user/boost/dual-python.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam
-index cbd6419..0c29df6 100644
---- a/tools/build/src/tools/python.jam
-+++ b/tools/build/src/tools/python.jam
-@@ -907,14 +907,14 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? :
-     # for a particular target OS as the default. This makes it so that we can
-     # select a python interpreter with only knowledge of the target OS. And hence
-     # can configure different Pythons based on the target OS only.
--    local toolset-requirements = [ toolset.requirements ] ;
--    local toolset-target-os-requirements
--        = [ property.evaluate-conditionals-in-context
--            [ $(toolset-requirements).raw ] : <target-os>$(target-os) ] ;
--    if ! <python> in $(toolset-target-os-requirements:G)
--    {
--        toolset.add-requirements <target-os>$(target-os):<python>$(version:E=default) ;
--    }
-+#    local toolset-requirements = [ toolset.requirements ] ;
-+#    local toolset-target-os-requirements
-+#        = [ property.evaluate-conditionals-in-context
-+#            [ $(toolset-requirements).raw ] : <target-os>$(target-os) ] ;
-+#    if ! <python> in $(toolset-target-os-requirements:G)
-+#    {
-+#        toolset.add-requirements <target-os>$(target-os):<python>$(version:E=default) ;
-+#    }
- 
-     # Register the right suffix for extensions.
-     register-extension-suffix $(extension-suffix) : $(target-requirements) ;
-- 
cgit v1.2.3-70-g09d2