diff lib/boost/boost.sh @ 696:f30dfd412657

lib/boost: initial import, closes #1103
author David Demelier <markand@malikania.fr>
date Thu, 01 Aug 2019 18:49:55 +0200
parents
children a133976e0783
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/boost/boost.sh	Thu Aug 01 18:49:55 2019 +0200
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# Copyright (c) 2019 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+PKGNAME=boost
+PKGVERSION=1.70.0
+_VERSION=$(echo $PKGVERSION | tr "." "_")
+PKGREVISION=1
+PKGLICENSE="peer-reviewed C++ libraries"
+PKGSUMMARY="short summary"
+PKGDOWNLOAD="https://dl.bintray.com/boostorg/release/$PKGVERSION/source/${PKGNAME}_$_VERSION.tar.gz"
+PKGDEPENDS=""
+PKGOPTIONS="ICU PYTHON"
+
+: ${CXX:=clang++}
+: ${CXXFLAGS:=-O2}
+: ${LDFLAGS:=}
+: ${ICU:=yes}
+: ${PYTHON:=yes}
+
+if [ -n "$CXXFLAGS" ]; then
+	with_cxxflags="cxxflags=\"$CXXFLAGS\""
+fi
+
+if [ -n "$LDFLAGS" ]; then
+	with_linkflags="linkflags=\"$LDFLAGS\""
+fi
+
+if [ "$ICU" = "yes" ]; then
+	PKGDEPENDS="lib/icu $PKGDEPENDS"
+	with_bootstrap_icu="--with-icu"
+else
+	with_bootstrap_icu="--without-icu"
+	with_icu="--without-icu"
+fi
+
+if [ "$PYTHON" = "yes" ]; then
+	PKGDEPENDS="python/python $PKGDEPENDS"
+	with_bootstrap_python="--with-python=/bin/python"
+else
+	with_python="--without-python"
+fi
+
+case "$CXX" in
+"clang++")
+	with_toolset="clang"
+	;;
+"g++")
+	with_toolset="g++"
+	;;
+esac
+
+build()
+{
+	rm -rf ${PKGNAME}_$_VERSION
+	tar xvf ${PKGNAME}_$_VERSION.tar.gz
+	cd ${PKGNAME}_$_VERSION
+
+	touch user-config.jam
+
+	if [ "$PYTHON" = "yes" ]; then
+		echo "using python : 3.7 : /bin/python : /include/python3.7m : : : : ;" >> user-config.jam
+	fi
+
+	./bootstrap.sh \
+		--with-toolset=$with_toolset \
+		$with_bootstrap_icu \
+		$with_bootstrap_python
+
+	# --layout=system: generate simple libraries names (no suffixes).
+	./b2 \
+		--user-config=user-config.jam \
+		--layout=system \
+		--prefix=$DESTDIR \
+		link=shared \
+		debug-symbols=off \
+		runtime-link=shared \
+		threading=multi \
+		variant=release \
+		toolset=$with_toolset \
+		$with_cxxflags \
+		$with_linkflags \
+		$with_python \
+		$with_icu \
+		install
+
+	cd ..
+	rm -rf ${PKGNAME}_$_VERSION
+}