Merge commit 'f8dd96543542220181c76afb8c084f4908213fb5' as 'third_party/mason'
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
language: cpp
|
||||
|
||||
sudo: false
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: osx
|
||||
compiler: clang
|
||||
- os: linux
|
||||
compiler: clang
|
||||
|
||||
script:
|
||||
- ./mason build ${MASON_NAME} ${MASON_VERSION}
|
||||
|
||||
after_success:
|
||||
- ./mason publish ${MASON_NAME} ${MASON_VERSION}
|
||||
@@ -0,0 +1,12 @@
|
||||
--- libs/python/src/converter/builtin_converters.cpp 2012-12-07 11:51:06.000000000 -0800
|
||||
+++ libs/python/src/converter/builtin_converters.cpp 2014-04-01 17:24:37.000000000 -0700
|
||||
@@ -32,7 +32,9 @@
|
||||
|
||||
void shared_ptr_deleter::operator()(void const*)
|
||||
{
|
||||
+ PyGILState_STATE gil = PyGILState_Ensure();
|
||||
owner.reset();
|
||||
+ PyGILState_Release(gil);
|
||||
}
|
||||
|
||||
namespace
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BOOST_VERSION1="1.57.0"
|
||||
BOOST_VERSION2="1_57_0"
|
||||
BOOST_LIBRARY="python"
|
||||
BOOST_TOOLSET="clang"
|
||||
BOOST_ARCH="x86"
|
||||
|
||||
MASON_NAME=boost_lib${BOOST_LIBRARY}
|
||||
MASON_VERSION=1.57.0
|
||||
MASON_LIB_FILE=lib/libboost_${BOOST_LIBRARY}.a
|
||||
|
||||
. ${MASON_DIR}/mason.sh
|
||||
|
||||
function mason_load_source {
|
||||
mason_download \
|
||||
http://downloads.sourceforge.net/project/boost/boost/${BOOST_VERSION1}/boost_${BOOST_VERSION2}.tar.bz2 \
|
||||
397306fa6d0858c4885fbba7d43a0164dcb7f53e
|
||||
|
||||
export MASON_BUILD_PATH=${MASON_ROOT}/.build/boost_${BOOST_VERSION2}
|
||||
|
||||
mason_extract_tar_bz2
|
||||
}
|
||||
|
||||
function gen_config() {
|
||||
echo "using $1 : : $(which $2)" > user-config.jam
|
||||
if [[ "${AR:-false}" != false ]] || [[ "${RANLIB:-false}" != false ]]; then
|
||||
echo ' : ' >> user-config.jam
|
||||
if [[ "${AR:-false}" != false ]]; then
|
||||
echo "<archiver>${AR} " >> user-config.jam
|
||||
fi
|
||||
if [[ "${RANLIB:-false}" != false ]]; then
|
||||
echo "<ranlib>${RANLIB} " >> user-config.jam
|
||||
fi
|
||||
fi
|
||||
echo ' ;' >> user-config.jam
|
||||
}
|
||||
|
||||
function write_python_config() {
|
||||
# usage:
|
||||
# write_python_config <user-config.jam> <version> <base> <variant>
|
||||
PYTHON_VERSION=$2
|
||||
# note: apple pythons need '/System'
|
||||
PYTHON_BASE=$3
|
||||
# note: python 3 uses 'm'
|
||||
PYTHON_VARIANT=$4
|
||||
if [[ ${UNAME} == 'Darwin' ]]; then
|
||||
echo "
|
||||
using python
|
||||
: ${PYTHON_VERSION} # version
|
||||
: ${PYTHON_BASE}/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}${PYTHON_VARIANT} # cmd-or-prefix
|
||||
: ${PYTHON_BASE}/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION}${PYTHON_VARIANT} # includes
|
||||
: ${PYTHON_BASE}/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config${PYTHON_VARIANT} # a lib actually symlink
|
||||
: <toolset>${BOOST_TOOLSET} # condition
|
||||
;
|
||||
" >> $1
|
||||
else
|
||||
if [[ ${UNAME} == 'FreeBSD' ]]; then
|
||||
echo "
|
||||
using python
|
||||
: ${PYTHON_VERSION} # version
|
||||
: /usr/local/bin/python${PYTHON_VERSION}${PYTHON_VARIANT} # cmd-or-prefix
|
||||
: /usr/local/include/python${PYTHON_VERSION} # includes
|
||||
: /usr/local/lib/python${PYTHON_VERSION}/config${PYTHON_VARIANT}
|
||||
: <toolset>${BOOST_TOOLSET} # condition
|
||||
;
|
||||
" >> $1
|
||||
else
|
||||
echo "
|
||||
using python
|
||||
: ${PYTHON_VERSION} # version
|
||||
: /usr/bin/python${PYTHON_VERSION}${PYTHON_VARIANT} # cmd-or-prefix
|
||||
: /usr/include/python${PYTHON_VERSION} # includes
|
||||
: /usr/lib/python${PYTHON_VERSION}/config${PYTHON_VARIANT}
|
||||
: <toolset>${BOOST_TOOLSET} # condition
|
||||
;
|
||||
" >> $1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function mason_compile {
|
||||
# patch to workaround crashes in python.input
|
||||
# https://github.com/mapnik/mapnik/issues/1968
|
||||
mason_step "Loading patch 'https://github.com/mapbox/mason/blob/${MASON_SLUG}/patch.diff'..."
|
||||
curl --retry 3 -s -f -# -L \
|
||||
https://raw.githubusercontent.com/mapbox/mason/${MASON_SLUG}/patch.diff \
|
||||
-O || (mason_error "Could not find patch for ${MASON_SLUG}" && exit 1)
|
||||
patch -N -p0 < ./patch.diff
|
||||
|
||||
gen_config ${BOOST_TOOLSET} clang++
|
||||
write_python_config user-config.jam "2.7" "/System" ""
|
||||
if [[ ! -f ./b2 ]] ; then
|
||||
./bootstrap.sh
|
||||
fi
|
||||
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
|
||||
./b2 \
|
||||
--with-${BOOST_LIBRARY} \
|
||||
--prefix=${MASON_PREFIX} \
|
||||
-j${MASON_CONCURRENCY} \
|
||||
-d0 \
|
||||
--ignore-site-config --user-config=user-config.jam \
|
||||
architecture="${BOOST_ARCH}" \
|
||||
toolset="${BOOST_TOOLSET}" \
|
||||
link=static \
|
||||
variant=release \
|
||||
linkflags="${LDFLAGS:-" "}" \
|
||||
cxxflags="${CXXFLAGS:-" "}" \
|
||||
stage
|
||||
mkdir -p $(dirname ${MASON_PREFIX}/${MASON_LIB_FILE})
|
||||
mv stage/${MASON_LIB_FILE} ${MASON_PREFIX}/${MASON_LIB_FILE}
|
||||
}
|
||||
|
||||
function mason_ldflags {
|
||||
echo "-lboost_${BOOST_LIBRARY}"
|
||||
}
|
||||
|
||||
function mason_clean {
|
||||
make clean
|
||||
}
|
||||
|
||||
mason_run "$@"
|
||||
@@ -0,0 +1,22 @@
|
||||
language: generic
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: osx
|
||||
osx_image: xcode7.3
|
||||
- os: linux
|
||||
sudo: false
|
||||
env: CXX=clang++-3.5 CC=clang-3.5
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.5
|
||||
packages:
|
||||
- clang-3.5
|
||||
|
||||
script:
|
||||
- ./mason build ${MASON_NAME} ${MASON_VERSION}
|
||||
|
||||
after_success:
|
||||
- ./mason publish ${MASON_NAME} ${MASON_VERSION}
|
||||
@@ -0,0 +1,12 @@
|
||||
--- libs/python/src/converter/builtin_converters.cpp 2012-12-07 11:51:06.000000000 -0800
|
||||
+++ libs/python/src/converter/builtin_converters.cpp 2014-04-01 17:24:37.000000000 -0700
|
||||
@@ -32,7 +32,9 @@
|
||||
|
||||
void shared_ptr_deleter::operator()(void const*)
|
||||
{
|
||||
+ PyGILState_STATE gil = PyGILState_Ensure();
|
||||
owner.reset();
|
||||
+ PyGILState_Release(gil);
|
||||
}
|
||||
|
||||
namespace
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# dynamically determine the path to this package
|
||||
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
|
||||
|
||||
# key properties unique to this library
|
||||
THIS_DIR=$(basename $(dirname $HERE))
|
||||
BOOST_LIBRARY=${THIS_DIR#boost_lib}
|
||||
MASON_NAME=boost_lib${BOOST_LIBRARY}
|
||||
MASON_LIB_FILE=lib/libboost_${BOOST_LIBRARY}.a
|
||||
# hack for inconsistently named test lib
|
||||
if [[ ${MASON_LIB_FILE} == "lib/libboost_test.a" ]]; then
|
||||
MASON_LIB_FILE=lib/libboost_unit_test_framework.a
|
||||
fi
|
||||
|
||||
# inherit from boost base (used for all boost library packages)
|
||||
BASE_PATH=${HERE}/../../boost/$(basename $HERE)
|
||||
source ${BASE_PATH}/base.sh
|
||||
|
||||
# setup mason env
|
||||
. ${MASON_DIR}/mason.sh
|
||||
|
||||
# source common build functions
|
||||
source ${BASE_PATH}/common.sh
|
||||
|
||||
function write_python_config() {
|
||||
# usage:
|
||||
# write_python_config <user-config.jam> <version> <base> <variant>
|
||||
PYTHON_VERSION=$2
|
||||
# note: apple pythons need '/System'
|
||||
PYTHON_BASE=$3
|
||||
# note: python 3 uses 'm'
|
||||
PYTHON_VARIANT=$4
|
||||
if [[ ${UNAME} == 'Darwin' ]]; then
|
||||
echo "
|
||||
using python
|
||||
: ${PYTHON_VERSION} # version
|
||||
: ${PYTHON_BASE}/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}${PYTHON_VARIANT} # cmd-or-prefix
|
||||
: ${PYTHON_BASE}/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION}${PYTHON_VARIANT} # includes
|
||||
: ${PYTHON_BASE}/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config${PYTHON_VARIANT} # a lib actually symlink
|
||||
: <toolset>${BOOST_TOOLSET} # condition
|
||||
;
|
||||
" >> $1
|
||||
else
|
||||
if [[ ${UNAME} == 'FreeBSD' ]]; then
|
||||
echo "
|
||||
using python
|
||||
: ${PYTHON_VERSION} # version
|
||||
: /usr/local/bin/python${PYTHON_VERSION}${PYTHON_VARIANT} # cmd-or-prefix
|
||||
: /usr/local/include/python${PYTHON_VERSION} # includes
|
||||
: /usr/local/lib/python${PYTHON_VERSION}/config${PYTHON_VARIANT}
|
||||
: <toolset>${BOOST_TOOLSET} # condition
|
||||
;
|
||||
" >> $1
|
||||
else
|
||||
echo "
|
||||
using python
|
||||
: ${PYTHON_VERSION} # version
|
||||
: /usr/bin/python${PYTHON_VERSION}${PYTHON_VARIANT} # cmd-or-prefix
|
||||
: /usr/include/python${PYTHON_VERSION} # includes
|
||||
: /usr/lib/python${PYTHON_VERSION}/config${PYTHON_VARIANT}
|
||||
: <toolset>${BOOST_TOOLSET} # condition
|
||||
;
|
||||
" >> $1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function mason_compile {
|
||||
# patch to workaround crashes in python.input
|
||||
# https://github.com/mapnik/mapnik/issues/1968
|
||||
mason_step "Loading patch ${MASON_DIR}/scripts/${MASON_NAME}/${MASON_VERSION}/patch.diff"
|
||||
patch -N -p0 < ${MASON_DIR}/scripts/${MASON_NAME}/${MASON_VERSION}/patch.diff
|
||||
write_python_config user-config.jam "2.7" "/System" ""
|
||||
gen_config ${BOOST_TOOLSET} ${BOOST_TOOLSET_CXX}
|
||||
if [[ ! -f ./b2 ]] ; then
|
||||
./bootstrap.sh
|
||||
fi
|
||||
./b2 \
|
||||
--with-${BOOST_LIBRARY} \
|
||||
--prefix=${MASON_PREFIX} \
|
||||
-j${MASON_CONCURRENCY} \
|
||||
-d0 \
|
||||
--ignore-site-config --user-config=user-config.jam \
|
||||
architecture="${BOOST_ARCH}" \
|
||||
toolset="${BOOST_TOOLSET}" \
|
||||
link=static \
|
||||
variant=release \
|
||||
linkflags="${LDFLAGS:-" "}" \
|
||||
cxxflags="${CXXFLAGS:-" "}" \
|
||||
stage
|
||||
mkdir -p $(dirname ${MASON_PREFIX}/${MASON_LIB_FILE})
|
||||
mv stage/${MASON_LIB_FILE} ${MASON_PREFIX}/${MASON_LIB_FILE}
|
||||
}
|
||||
|
||||
mason_run "$@"
|
||||
@@ -0,0 +1,19 @@
|
||||
language: generic
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: osx
|
||||
osx_image: xcode8
|
||||
compiler: clang
|
||||
- os: linux
|
||||
sudo: false
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- libstdc++-5-dev
|
||||
|
||||
script:
|
||||
- ./mason build ${MASON_NAME} ${MASON_VERSION}
|
||||
- ./mason publish ${MASON_NAME} ${MASON_VERSION}
|
||||
@@ -0,0 +1,12 @@
|
||||
--- libs/python/src/converter/builtin_converters.cpp 2012-12-07 11:51:06.000000000 -0800
|
||||
+++ libs/python/src/converter/builtin_converters.cpp 2014-04-01 17:24:37.000000000 -0700
|
||||
@@ -32,7 +32,9 @@
|
||||
|
||||
void shared_ptr_deleter::operator()(void const*)
|
||||
{
|
||||
+ PyGILState_STATE gil = PyGILState_Ensure();
|
||||
owner.reset();
|
||||
+ PyGILState_Release(gil);
|
||||
}
|
||||
|
||||
namespace
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# dynamically determine the path to this package
|
||||
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
|
||||
|
||||
# key properties unique to this library
|
||||
THIS_DIR=$(basename $(dirname $HERE))
|
||||
BOOST_LIBRARY=${THIS_DIR#boost_lib}
|
||||
MASON_NAME=boost_lib${BOOST_LIBRARY}
|
||||
MASON_LIB_FILE=lib/libboost_${BOOST_LIBRARY}.a
|
||||
# hack for inconsistently named test lib
|
||||
if [[ ${MASON_LIB_FILE} == "lib/libboost_test.a" ]]; then
|
||||
MASON_LIB_FILE=lib/libboost_unit_test_framework.a
|
||||
fi
|
||||
|
||||
# inherit from boost base (used for all boost library packages)
|
||||
BASE_PATH=${HERE}/../../boost/$(basename $HERE)
|
||||
source ${BASE_PATH}/base.sh
|
||||
|
||||
# setup mason env
|
||||
. ${MASON_DIR}/mason.sh
|
||||
|
||||
# source common build functions
|
||||
source ${BASE_PATH}/common.sh
|
||||
|
||||
function write_python_config() {
|
||||
# usage:
|
||||
# write_python_config <user-config.jam> <version> <base> <variant>
|
||||
PYTHON_VERSION=$2
|
||||
# note: apple pythons need '/System'
|
||||
PYTHON_BASE=$3
|
||||
# note: python 3 uses 'm'
|
||||
PYTHON_VARIANT=$4
|
||||
if [[ ${UNAME} == 'Darwin' ]]; then
|
||||
echo "
|
||||
using python
|
||||
: ${PYTHON_VERSION} # version
|
||||
: ${PYTHON_BASE}/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}${PYTHON_VARIANT} # cmd-or-prefix
|
||||
: ${PYTHON_BASE}/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION}${PYTHON_VARIANT} # includes
|
||||
: ${PYTHON_BASE}/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config${PYTHON_VARIANT} # a lib actually symlink
|
||||
: <toolset>${BOOST_TOOLSET} # condition
|
||||
;
|
||||
" >> $1
|
||||
else
|
||||
if [[ ${UNAME} == 'FreeBSD' ]]; then
|
||||
echo "
|
||||
using python
|
||||
: ${PYTHON_VERSION} # version
|
||||
: /usr/local/bin/python${PYTHON_VERSION}${PYTHON_VARIANT} # cmd-or-prefix
|
||||
: /usr/local/include/python${PYTHON_VERSION} # includes
|
||||
: /usr/local/lib/python${PYTHON_VERSION}/config${PYTHON_VARIANT}
|
||||
: <toolset>${BOOST_TOOLSET} # condition
|
||||
;
|
||||
" >> $1
|
||||
else
|
||||
echo "
|
||||
using python
|
||||
: ${PYTHON_VERSION} # version
|
||||
: /usr/bin/python${PYTHON_VERSION}${PYTHON_VARIANT} # cmd-or-prefix
|
||||
: /usr/include/python${PYTHON_VERSION} # includes
|
||||
: /usr/lib/python${PYTHON_VERSION}/config${PYTHON_VARIANT}
|
||||
: <toolset>${BOOST_TOOLSET} # condition
|
||||
;
|
||||
" >> $1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function mason_compile {
|
||||
# patch to workaround crashes in python.input
|
||||
# https://github.com/mapnik/mapnik/issues/1968
|
||||
mason_step "Loading patch ${MASON_DIR}/scripts/${MASON_NAME}/${MASON_VERSION}/patch.diff"
|
||||
patch -N -p0 < ${MASON_DIR}/scripts/${MASON_NAME}/${MASON_VERSION}/patch.diff
|
||||
write_python_config user-config.jam "2.7" "/System" ""
|
||||
gen_config ${BOOST_TOOLSET} ${BOOST_TOOLSET_CXX}
|
||||
if [[ ! -f ./b2 ]] ; then
|
||||
./bootstrap.sh
|
||||
fi
|
||||
./b2 \
|
||||
--with-${BOOST_LIBRARY} \
|
||||
--prefix=${MASON_PREFIX} \
|
||||
-j${MASON_CONCURRENCY} \
|
||||
-d0 \
|
||||
--ignore-site-config --user-config=user-config.jam \
|
||||
architecture="${BOOST_ARCH}" \
|
||||
toolset="${BOOST_TOOLSET}" \
|
||||
link=static \
|
||||
variant=release \
|
||||
linkflags="${LDFLAGS:-" "}" \
|
||||
cxxflags="${CXXFLAGS:-" "}" \
|
||||
stage
|
||||
mkdir -p $(dirname ${MASON_PREFIX}/${MASON_LIB_FILE})
|
||||
mv stage/${MASON_LIB_FILE} ${MASON_PREFIX}/${MASON_LIB_FILE}
|
||||
}
|
||||
|
||||
mason_run "$@"
|
||||
Reference in New Issue
Block a user