forked from pyodide/pyodide-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeta.yaml
More file actions
47 lines (41 loc) · 1.96 KB
/
meta.yaml
File metadata and controls
47 lines (41 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package:
name: boost-python
version: 1.90.0
tag:
- library
- static_library
source:
url: https://github.com/boostorg/boost/releases/download/boost-1.90.0/boost-1.90.0-b2-nodocs.tar.gz
sha256: e848446c6fec62d8a96b44ed7352238b3de040b8b9facd4d6963b32f541e00f5
extract_dir: boost-1.90.0
build:
type: static_library
script: |
export INSTALL_DIR=${WASM_LIBRARY_DIR}
./bootstrap.sh --prefix=${INSTALL_DIR} --with-libraries=python \
--with-python=python$PYMAJOR.$PYMINOR
# https://github.com/emscripten-core/emscripten/issues/17052
# Without this, boost outputs WASM modules not static library archives as an output.
# I don't understand why... the jam file used by boost is quite hard to understand.
printf "using clang : emscripten : emcc : <archiver>emar <ranlib>emranlib <linker>emlink ;\n" | tee -a ./project-config.jam
# Bypass the standard python detection in the build system
sed -i 's/using python/#using python/' ./project-config.jam
printf "using python : $PYMAJOR.$PYMINOR : python$PYMAJOR.$PYMINOR : $PYTHONINCLUDE : $HOSTINSTALLDIR/lib/python$PYMAJOR.$PYMINOR.a ;\n" | tee -a ./project-config.jam
# Work around emscripten limited support in boost-container
# https://github.com/boostorg/container/issues/276
sed -i 's/#if defined(BOOST_HAS_PTHREADS)/#if 1/' ./boost/container/detail/thread_mutex.hpp
./b2 variant=release toolset=clang-emscripten link=static threading=single \
address-model=32 --disable-icu \
cxxflags="$SIDE_MODULE_CXXFLAGS -fwasm-exceptions -DBOOST_SP_DISABLE_THREADS=1" \
cflags="$SIDE_MODULE_CFLAGS -fwasm-exceptions -DBOOST_SP_DISABLE_THREADS=1" \
linkflags="-fpic $SIDE_MODULE_LDFLAGS" \
python=$PYMAJOR.$PYMINOR \
--layout=system -j"${PYODIDE_JOBS:-3}" --prefix=${INSTALL_DIR} \
-d2 install
about:
home: https://www.boost.org/
summary: Free peer-reviewed portable C++ source libraries.
license: Boost
extra:
recipe-maintainers:
- johnwason