Skip to content

Commit

Permalink
re-parse boost [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed Aug 18, 2017
1 parent 4f67b8d commit 0dfa9e0
Show file tree
Hide file tree
Showing 7 changed files with 385 additions and 0 deletions.
32 changes: 32 additions & 0 deletions recipes/boost-cpp-feedstock/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
:: Start with bootstrap
call bootstrap.bat
if errorlevel 1 exit 1

:: Build step
.\b2 install ^
--build-dir=buildboost ^
--prefix=%LIBRARY_PREFIX% ^
toolset=msvc-%VS_MAJOR%.0 ^
address-model=%ARCH% ^
variant=release ^
threading=multi ^
link=static,shared ^
-j%CPU_COUNT% ^
--without-python
if errorlevel 1 exit 1

:: Get the major minor version info (e.g. `1_61`)
python -c "import os; print('_'.join(os.environ['PKG_VERSION'].split('.')[:2]))" > temp.txt
set /p MAJ_MIN_VER=<temp.txt

:: Install fix-up for a non version-specific boost include
move %LIBRARY_INC%\boost-%MAJ_MIN_VER%\boost %LIBRARY_INC%
if errorlevel 1 exit 1

:: Remove Python headers as we don't build Boost.Python.
del %LIBRARY_INC%\boost\python.hpp
rmdir /s /q %LIBRARY_INC%\boost\python

:: Move dll's to LIBRARY_BIN
move %LIBRARY_LIB%\*vc%VS_MAJOR%0-mt-%MAJ_MIN_VER%.dll "%LIBRARY_BIN%"
if errorlevel 1 exit 1
51 changes: 51 additions & 0 deletions recipes/boost-cpp-feedstock/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

# Hints:
# http://boost.2283326.n4.nabble.com/how-to-build-boost-with-bzip2-in-non-standard-location-td2661155.html
# http://www.gentoo.org/proj/en/base/amd64/howtos/?part=1&chap=3
# http://www.boost.org/doc/libs/1_55_0/doc/html/bbv2/reference.html

# Hints for OSX:
# http://stackoverflow.com/questions/20108407/how-do-i-compile-boost-for-os-x-64b-platforms-with-stdlibc

set -x -e

INCLUDE_PATH="${PREFIX}/include"
LIBRARY_PATH="${PREFIX}/lib"

# Always build PIC code for enable static linking into other shared libraries
CXXFLAGS="${CXXFLAGS} -fPIC"

if [ "$(uname)" == "Darwin" ]; then
TOOLSET=clang
elif [ "$(uname)" == "Linux" ]; then
TOOLSET=gcc
fi

LINKFLAGS="${LINKFLAGS} -L${LIBRARY_PATH}"

./bootstrap.sh \
--prefix="${PREFIX}" \
--without-libraries=python \
--with-icu="${PREFIX}" \
| tee bootstrap.log 2>&1

./b2 -q \
variant=release \
address-model="${ARCH}" \
architecture=x86 \
debug-symbols=off \
threading=multi \
runtime-link=shared \
link=static,shared \
toolset=${TOOLSET} \
include="${INCLUDE_PATH}" \
cxxflags="${CXXFLAGS}" \
linkflags="${LINKFLAGS}" \
--layout=system \
-j"${CPU_COUNT}" \
install | tee b2.log 2>&1

# Remove Python headers as we don't build Boost.Python.
rm "${PREFIX}/include/boost/python.hpp"
rm -r "${PREFIX}/include/boost/python"
113 changes: 113 additions & 0 deletions recipes/boost-cpp-feedstock/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{% set version = "1.63.0" %}
{% set filename = "boost_%s.tar.bz2" % version.replace(".", "_") %}

package:
name: boost-cpp
version: {{ version }}

source:
fn: {{ filename }}
url: http://sourceforge.net/projects/boost/files/boost/{{ version }}/{{ filename }}
sha256: beae2529f759f6b3bf3f4969a19c2e9d6f0c503edcb2de4a61d1428519fcb3b0

build:
number: 2
skip: true # [win and py>35]
features:
- vc9 # [win and py27]
- vc10 # [win and py34]
- vc14 # [win and py35]

requirements:
build:
- toolchain
- python # [win]
- icu 58.* # [unix]
- bzip2 1.0.* # [unix]
- zlib 1.2.*
- vc 9 # [win and py27]
- vc 10 # [win and py34]
- vc 14 # [win and py35]

run:
- icu 58.* # [unix]
- bzip2 1.0.* # [unix]
- zlib 1.2.*
- vc 9 # [win and py27]
- vc 10 # [win and py34]
- vc 14 # [win and py35]

test:
commands:
# Verify Python headers are removed.
- "! test -f $PREFIX/include/boost/python.hpp" # [unix]
- "! test -d $PREFIX/include/boost/python" # [unix]
- if exist %PREFIX%\\Library\\include\\boost\\python.hpp exit 1 # [win]
- if exist %PREFIX%\\Library\\include\\boost\\python exit 1 # [win]

# Verify static-only libraries.
- test -f $PREFIX/lib/libboost_exception.a # [unix]
- test -f $PREFIX/lib/libboost_test_exec_monitor.a # [unix]

# Verify libraries.
{% set win_vstr = "_".join(version.split(".")[:2]) %}
{% set boost_libs = [
"atomic",
"chrono",
"container",
"context",
"coroutine",
"date_time",
"filesystem",
"graph",
"iostreams",
"locale",
"log",
"log_setup",
"math_c99",
"math_c99f",
"math_c99l",
"math_tr1",
"math_tr1f",
"math_tr1l",
"prg_exec_monitor",
"program_options",
"random",
"regex",
"serialization",
"signals",
"system",
"thread",
"timer",
"type_erasure",
"unit_test_framework",
"wave",
"wserialization"
] %}
{% for each_boost_lib in boost_libs %}
- test -f $PREFIX/lib/libboost_{{ each_boost_lib }}.a # [unix]
- test -f $PREFIX/lib/libboost_{{ each_boost_lib }}.dylib # [osx]
- test -f $PREFIX/lib/libboost_{{ each_boost_lib }}.so # [linux]
- if not exist %PREFIX%\\Library\\bin\\boost_{{ each_boost_lib }}-vc90-mt-{{ win_vstr }}.dll exit 1 # [win and py27]
- if not exist %PREFIX%\\Library\\bin\\boost_{{ each_boost_lib }}-vc100-mt-{{ win_vstr }}.dll exit 1 # [win and py34]
- if not exist %PREFIX%\\Library\\bin\\boost_{{ each_boost_lib }}-vc140-mt-{{ win_vstr }}.dll exit 1 # [win and py35]
- if not exist %PREFIX%\\Library\\lib\\boost_{{ each_boost_lib }}-vc90-mt-{{ win_vstr }}.lib exit 1 # [win and py27]
- if not exist %PREFIX%\\Library\\lib\\boost_{{ each_boost_lib }}-vc100-mt-{{ win_vstr }}.lib exit 1 # [win and py34]
- if not exist %PREFIX%\\Library\\lib\\boost_{{ each_boost_lib }}-vc140-mt-{{ win_vstr }}.lib exit 1 # [win and py35]
{% endfor %}
- conda inspect linkages -p $PREFIX boost-cpp # [not win]
- conda inspect objects -p $PREFIX boost-cpp # [osx]

about:
home: http://www.boost.org/
license: Boost-1.0
summary: Free peer-reviewed portable C++ source libraries.

extra:
recipe-maintainers:
- ccordoba12
- jakirkham
- msarahan
- ocefpaf
- jschueller
- isuruf
17 changes: 17 additions & 0 deletions recipes/boost/PR_135.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git include/boost/python/detail/config.hpp include/boost/python/detail/config.hpp
index c92ecb32b..3e4b7c9e5 100644
--- include/boost/python/detail/config.hpp
+++ include/boost/python/detail/config.hpp
@@ -105,7 +105,11 @@
// Set the name of our library, this will get undef'ed by auto_link.hpp
// once it's done with it:
//
-#define BOOST_LIB_NAME boost_python
+#if PY_MAJOR_VERSION == 2
+# define BOOST_LIB_NAME boost_python
+#elif PY_MAJOR_VERSION == 3
+# define BOOST_LIB_NAME boost_python3
+#endif
//
// If we're importing code from a dll, then tell auto_link.hpp about it:
//
38 changes: 38 additions & 0 deletions recipes/boost/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
:: Write python configuration, see https://github.com/boostorg/build/issues/194
@echo using python > user-config.jam
@echo : %PY_VER% >> user-config.jam
@echo : %PYTHON:\=\\% >> user-config.jam
@echo : %PREFIX:\=\\%\\include >> user-config.jam
@echo : %PREFIX:\=\\%\\libs >> user-config.jam
@echo ; >> user-config.jam
xcopy user-config.jam C:\Users\appveyor

:: Start with bootstrap
call bootstrap.bat
if errorlevel 1 exit 1

:: Build step
.\b2 install ^
--build-dir=buildboost ^
--prefix=%LIBRARY_PREFIX% ^
toolset=msvc-%VS_MAJOR%.0 ^
address-model=%ARCH% ^
variant=release ^
threading=multi ^
link=static,shared ^
--with-python ^
-j%CPU_COUNT%
if errorlevel 1 exit 1

:: Get the major minor version info (e.g. `1_61`)
python -c "import os; print('_'.join(os.environ['PKG_VERSION'].split('.')[:2]))" > temp.txt
set /p MAJ_MIN_VER=<temp.txt

:: Install fix-up for a non version-specific boost include
xcopy /E/Y %LIBRARY_INC%\boost-%MAJ_MIN_VER%\boost\* %LIBRARY_INC%\boost\
rmdir /s /q %LIBRARY_INC%\boost-%MAJ_MIN_VER%\boost

:: Move dll's to LIBRARY_BIN
move %LIBRARY_LIB%\*vc%VS_MAJOR%0-mt-%MAJ_MIN_VER%.dll "%LIBRARY_BIN%"
if errorlevel 1 exit 1

49 changes: 49 additions & 0 deletions recipes/boost/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

# Hints:
# http://boost.2283326.n4.nabble.com/how-to-build-boost-with-bzip2-in-non-standard-location-td2661155.html
# http://www.gentoo.org/proj/en/base/amd64/howtos/?part=1&chap=3
# http://www.boost.org/doc/libs/1_55_0/doc/html/bbv2/reference.html

# Hints for OSX:
# http://stackoverflow.com/questions/20108407/how-do-i-compile-boost-for-os-x-64b-platforms-with-stdlibc

set -x -e
set -o pipefail

LIBRARY_PATH="${PREFIX}/lib"

# Always build PIC code for enable static linking into other shared libraries
CXXFLAGS="${CXXFLAGS} -fPIC"

if [ "$(uname)" == "Darwin" ]; then
TOOLSET=clang
elif [ "$(uname)" == "Linux" ]; then
TOOLSET=gcc
fi

LINKFLAGS="${LINKFLAGS} -L${LIBRARY_PATH}"

./bootstrap.sh \
--prefix="${PREFIX}" \
--with-icu="${PREFIX}" \
--with-python="${PYTHON}" \
--with-python-root="${PREFIX} : ${PREFIX}/include/python${PY_VER}m ${PREFIX}/include/python${PY_VER}" \
2>&1 | tee bootstrap.log

./b2 -q \
variant=release \
address-model="${ARCH}" \
architecture=x86 \
debug-symbols=off \
threading=multi \
runtime-link=shared \
link=static,shared \
toolset=${TOOLSET} \
python="${PY_VER}" \
cxxflags="${CXXFLAGS}" \
linkflags="${LINKFLAGS}" \
--layout=system \
--with-python \
-j"${CPU_COUNT}" \
install 2>&1 | tee b2.log
85 changes: 85 additions & 0 deletions recipes/boost/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{% set version = "1.64.0" %}
{% set filename = "boost_%s.tar.bz2" % version.replace(".", "_") %}

package:
name: boost
version: {{ version }}

source:
fn: {{ filename }}
url: https://dl.bintray.com/boostorg/release/{{ version }}/source/{{ filename }}
sha256: 7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332
patches:
# Applies a patch to correct `BOOST_LIB_NAME` on Python 3.
#
# xref: https://github.com/boostorg/python/pull/135
#
- PR_135.diff

build:
number: 3
features:
- vc9 # [win and py27]
- vc14 # [win and py>=35]

requirements:
build:
- toolchain
- python
- numpy 1.7.* # [py27]
- numpy 1.9.* # [py35]
- numpy 1.11.* # [py36]
- vc 9 # [win and py27]
- vc 14 # [win and py>=35]
- boost-cpp {{ version }}

run:
- python
- numpy >=1.7 # [py27]
- numpy >=1.9 # [py35]
- numpy >=1.11 # [py36]
- vc 9 # [win and py27]
- vc 14 # [win and py>=35]
- boost-cpp {{ version }}

test:
commands:
# Verify Python headers are installed.
- test -f $PREFIX/include/boost/python.hpp # [unix]
- test -d $PREFIX/include/boost/python # [unix]
- if not exist %LIBRARY_INC%\\boost\\python.hpp exit 1 # [win]
- if not exist %LIBRARY_INC%\\boost\\python exit 1 # [win]

# Verify libraries.
{% set win_vstr = "_".join(version.split(".")[:2]) %}
{% set py3k_suffix = "3" if py3k else "" %}
{% set boost_libs = [
"python%s" % py3k_suffix,
"numpy%s" % py3k_suffix
] %}
{% for each_boost_lib in boost_libs %}
- test -f $PREFIX/lib/libboost_{{ each_boost_lib }}.a # [unix]
- test -f $PREFIX/lib/libboost_{{ each_boost_lib }}.dylib # [osx]
- test -f $PREFIX/lib/libboost_{{ each_boost_lib }}.so # [linux]
- if not exist %PREFIX%\\Library\\bin\\boost_{{ each_boost_lib }}-vc90-mt-{{ win_vstr }}.dll exit 1 # [win and py27]
- if not exist %PREFIX%\\Library\\bin\\boost_{{ each_boost_lib }}-vc140-mt-{{ win_vstr }}.dll exit 1 # [win and py >= 35]
- if not exist %PREFIX%\\Library\\lib\\boost_{{ each_boost_lib }}-vc90-mt-{{ win_vstr }}.lib exit 1 # [win and py27]
- if not exist %PREFIX%\\Library\\lib\\boost_{{ each_boost_lib }}-vc140-mt-{{ win_vstr }}.lib exit 1 # [win and py >= 35]
{% endfor %}
- conda inspect linkages -p $PREFIX boost # [not win]
- conda inspect objects -p $PREFIX boost # [osx]

about:
home: http://www.boost.org/
license: Boost-1.0
summary: Free peer-reviewed portable C++ source libraries.

extra:
recipe-maintainers:
- ccordoba12
- jakirkham
- msarahan
- ocefpaf
- jschueller
- scopatz
- isuruf

0 comments on commit 0dfa9e0

Please sign in to comment.