Merge commit 'a34a885031fcb1797621e8968497561a4837e06a' as 'third_party/mason'

This commit is contained in:
Dane Springmeyer
2016-10-28 12:21:21 -07:00
707 changed files with 29942 additions and 0 deletions
@@ -0,0 +1,24 @@
language: cpp
sudo: false
matrix:
include:
- os: osx
compiler: clang
- os: linux
compiler: clang
env:
global:
- secure: "clCFM3prHnDocZ8lXlimPxAogvFirD1Zx8cMcFJ/XpkTA/0pCgnhpArM4y/NzLHR57pNZTSCr3p6XZI1c1iTG4Zm8x0sK2A4aTFRahypXNy/e+LzAbtd1y1+dEEDwlJvNNGxizQX4frhOgSNQFDFnWLtmF3stlft5YWyc2kI+FI="
- secure: "jKJErCng8Sk8YJ0IN2FX3lhv7G1LeudMfFBAXViZaXn8w/gWPs+SlfXQmIJ5SruU7U2GQKnAhzbjwXjVAgAh8OAblzny0DDm5Lh5WmwkgAP8JH1LpsBwCYx2S/v8qyR4DX1RVhHS8mQu298180ZDVgGccw+hd8xrE/S5TEQcNfQ="
before_install:
- source ./scripts/setup_cpp11_toolchain.sh
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
+147
View File
@@ -0,0 +1,147 @@
#!/usr/bin/env bash
BOOST_VERSION1="1.49.0"
BOOST_VERSION2="1_49_0"
BOOST_LIBRARY="regex"
BOOST_ARCH="x86"
if [[ $(uname -s) == 'Darwin' ]]; then
BOOST_TOOLSET="darwin"
else
BOOST_TOOLSET="gcc"
fi
MASON_NAME=boost_liball
MASON_VERSION=1.49.0
# this boost package has multiple libraries to we
# reference this empty file as a placeholder for all of them
MASON_LIB_FILE=lib/libboost_placeholder.txt
. ${MASON_DIR}/mason.sh
function mason_load_source {
mason_download \
http://downloads.sourceforge.net/project/boost/boost/${BOOST_VERSION1}/boost_${BOOST_VERSION2}.tar.bz2 \
1175031e7689f17591363d907f9dad3be0559dee
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 mason_prepare_compile {
${MASON_DIR}/mason install icu 54.1
MASON_ICU=$(${MASON_DIR}/mason prefix icu 54.1)
BOOST_LDFLAGS="-L${MASON_ICU}/lib -licuuc -licui18n -licudata"
}
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 {
if [[ -f ../../../patch.diff ]]; then
patch -N -p0 < ../../../patch.diff
else
# 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
fi
gen_config ${BOOST_TOOLSET} g++
perl -i -p -e "s/\-march=i386/\-m64/g;" ./tools/build/v2/tools/gcc.jam
write_python_config user-config.jam "2.7" "/System" ""
if [[ ! -f ./b2 ]] ; then
./bootstrap.sh
fi
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
./b2 \
--with-regex \
--with-system \
--with-thread \
--with-filesystem \
--with-program_options \
--with-python \
--prefix=${MASON_PREFIX} \
-j${MASON_CONCURRENCY} \
-sHAVE_ICU=1 -sICU_PATH=${MASON_ICU} \
linkflags="${BOOST_LDFLAGS}" \
cxxflags="${CXXFLAGS:-" "}" \
-d0 \
--ignore-site-config --user-config=user-config.jam \
architecture="${BOOST_ARCH}" \
address-model=64 \
toolset="${BOOST_TOOLSET}" \
link=static \
variant=release \
install
mkdir -p ${MASON_PREFIX}/lib/
touch ${MASON_PREFIX}/lib/libboost_placeholder.txt
}
function mason_ldflags {
echo "-lboost_regex -lboost_system -lboost_thread -lboost_filesystem -lboost_program_options -lboost_python"
}
function mason_clean {
make clean
}
mason_run "$@"
@@ -0,0 +1,24 @@
language: cpp
sudo: false
matrix:
include:
- os: osx
compiler: clang
- os: linux
compiler: clang
env:
global:
- secure: "clCFM3prHnDocZ8lXlimPxAogvFirD1Zx8cMcFJ/XpkTA/0pCgnhpArM4y/NzLHR57pNZTSCr3p6XZI1c1iTG4Zm8x0sK2A4aTFRahypXNy/e+LzAbtd1y1+dEEDwlJvNNGxizQX4frhOgSNQFDFnWLtmF3stlft5YWyc2kI+FI="
- secure: "jKJErCng8Sk8YJ0IN2FX3lhv7G1LeudMfFBAXViZaXn8w/gWPs+SlfXQmIJ5SruU7U2GQKnAhzbjwXjVAgAh8OAblzny0DDm5Lh5WmwkgAP8JH1LpsBwCYx2S/v8qyR4DX1RVhHS8mQu298180ZDVgGccw+hd8xrE/S5TEQcNfQ="
before_install:
- source ./scripts/setup_cpp11_toolchain.sh
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
+140
View File
@@ -0,0 +1,140 @@
#!/usr/bin/env bash
BOOST_VERSION1="1.58.0"
BOOST_VERSION2="1_58_0"
BOOST_LIBRARY="regex"
BOOST_TOOLSET="clang"
BOOST_ARCH="x86"
MASON_NAME=boost_liball
MASON_VERSION=1.58.0
# this boost package has multiple libraries to we
# reference this empty file as a placeholder for all of them
MASON_LIB_FILE=lib/libboost_placeholder.txt
. ${MASON_DIR}/mason.sh
function mason_load_source {
mason_download \
http://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.tar.bz2 \
43e46651e762e4daf72a5d21dca86ae151e65378
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 mason_prepare_compile {
${MASON_DIR}/mason install icu 54.1
MASON_ICU=$(${MASON_DIR}/mason prefix icu 54.1)
BOOST_LDFLAGS="-L${MASON_ICU}/lib -licuuc -licui18n -licudata"
}
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 {
if [[ -f ../../../patch.diff ]]; then
patch -N -p0 < ../../../patch.diff
else
# 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
fi
gen_config ${BOOST_TOOLSET} clang++
if [[ ! -f ./b2 ]] ; then
./bootstrap.sh
fi
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
./b2 \
--with-regex \
--with-system \
--with-thread \
--with-filesystem \
--with-program_options \
--with-python \
--prefix=${MASON_PREFIX} \
-j${MASON_CONCURRENCY} \
-sHAVE_ICU=1 -sICU_PATH=${MASON_ICU} \
linkflags="${LDFLAGS:-" "} ${BOOST_LDFLAGS}" \
cxxflags="${CXXFLAGS:-" "}" \
-d0 \
--ignore-site-config --user-config=user-config.jam \
architecture="${BOOST_ARCH}" \
toolset="${BOOST_TOOLSET}" \
link=static \
variant=release \
install
mkdir -p ${MASON_PREFIX}/lib/
touch ${MASON_PREFIX}/lib/libboost_placeholder.txt
}
function mason_ldflags {
:
}
function mason_clean {
make clean
}
mason_run "$@"
@@ -0,0 +1,28 @@
language: cpp
sudo: false
matrix:
include:
- os: osx
osx_image: xcode6
compiler: clang
- os: osx
osx_image: xcode7
compiler: clang
- os: linux
compiler: clang
env:
global:
- secure: "clCFM3prHnDocZ8lXlimPxAogvFirD1Zx8cMcFJ/XpkTA/0pCgnhpArM4y/NzLHR57pNZTSCr3p6XZI1c1iTG4Zm8x0sK2A4aTFRahypXNy/e+LzAbtd1y1+dEEDwlJvNNGxizQX4frhOgSNQFDFnWLtmF3stlft5YWyc2kI+FI="
- secure: "jKJErCng8Sk8YJ0IN2FX3lhv7G1LeudMfFBAXViZaXn8w/gWPs+SlfXQmIJ5SruU7U2GQKnAhzbjwXjVAgAh8OAblzny0DDm5Lh5WmwkgAP8JH1LpsBwCYx2S/v8qyR4DX1RVhHS8mQu298180ZDVgGccw+hd8xrE/S5TEQcNfQ="
before_install:
- source ./scripts/setup_cpp11_toolchain.sh
script:
- ./mason build ${MASON_NAME} ${MASON_VERSION}
after_success:
- ./mason publish ${MASON_NAME} ${MASON_VERSION}
@@ -0,0 +1,22 @@
--- 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
--- libs/filesystem/src/operations.cpp 2015-05-01 18:49:26.000000000 -0700
+++ libs/filesystem/src/operations.cpp 2015-05-01 18:49:22.000000000 -0700
@@ -1416,6 +1416,7 @@
// - See the fchmodat() Linux man page:
// "http://man7.org/linux/man-pages/man2/fchmodat.2.html"
# if defined(AT_FDCWD) && defined(AT_SYMLINK_NOFOLLOW) \
+ && !(defined(__APPLE__)) \
&& !(defined(__SUNPRO_CC) || defined(__sun) || defined(sun)) \
&& !(defined(linux) || defined(__linux) || defined(__linux__))
if (::fchmodat(AT_FDCWD, p.c_str(), mode_cast(prms),
+140
View File
@@ -0,0 +1,140 @@
#!/usr/bin/env bash
BOOST_VERSION1="1.59.0"
BOOST_VERSION2="1_59_0"
BOOST_LIBRARY="regex"
BOOST_TOOLSET="clang"
BOOST_ARCH="x86"
MASON_NAME=boost_liball
MASON_VERSION=1.59.0
# this boost package has multiple libraries to we
# reference this empty file as a placeholder for all of them
MASON_LIB_FILE=lib/libboost_placeholder.txt
. ${MASON_DIR}/mason.sh
function mason_load_source {
mason_download \
http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.bz2 \
ff2e48f4d7e3c4b393d41e07a2f5d923b990967d
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 mason_prepare_compile {
${MASON_DIR}/mason install icu 55.1
MASON_ICU=$(${MASON_DIR}/mason prefix icu 55.1)
BOOST_LDFLAGS="-L${MASON_ICU}/lib -licuuc -licui18n -licudata"
}
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 {
if [[ -f ../../../patch.diff ]]; then
patch -N -p0 < ../../../patch.diff
else
# 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
fi
gen_config ${BOOST_TOOLSET} clang++
if [[ ! -f ./b2 ]] ; then
./bootstrap.sh
fi
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
./b2 \
--with-regex \
--with-system \
--with-thread \
--with-filesystem \
--with-program_options \
--with-python \
--prefix=${MASON_PREFIX} \
-j${MASON_CONCURRENCY} \
-sHAVE_ICU=1 -sICU_PATH=${MASON_ICU} \
linkflags="${LDFLAGS:-" "} ${BOOST_LDFLAGS}" \
cxxflags="${CXXFLAGS:-" "}" \
-d0 \
--ignore-site-config --user-config=user-config.jam \
architecture="${BOOST_ARCH}" \
toolset="${BOOST_TOOLSET}" \
link=static \
variant=release \
install
mkdir -p ${MASON_PREFIX}/lib/
touch ${MASON_PREFIX}/lib/libboost_placeholder.txt
}
function mason_ldflags {
:
}
function mason_clean {
make clean
}
mason_run "$@"