diff --git a/packages/boost-python/meta.yaml b/packages/boost-python/meta.yaml new file mode 100644 index 00000000..fecf4537 --- /dev/null +++ b/packages/boost-python/meta.yaml @@ -0,0 +1,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 : emar emranlib 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 diff --git a/packages/rdkit/meta.yaml b/packages/rdkit/meta.yaml new file mode 100644 index 00000000..ac7111be --- /dev/null +++ b/packages/rdkit/meta.yaml @@ -0,0 +1,76 @@ +package: + name: rdkit + version: 2025.9.5 +source: + url: https://github.com/rdkit/rdkit/archive/refs/tags/Release_2025_09_5.tar.gz + sha256: 1ac784a5f83a7db10aa50be0cd213eba7c1f3436ed4da12363e57589b571db46 +requirements: + host: + - boost-python + - matplotlib + - numpy + - pandas + run: + - matplotlib + - numpy + - pandas + +build: + script: | + export INSTALL_DIR=${WASM_LIBRARY_DIR} + export NUMPY_INCLUDE_DIR="$HOSTINSTALLDIR/lib/python$PYMAJOR.$PYMINOR/site-packages/numpy/_core/include/" + + wget https://gitlab.com/libeigen/eigen/-/archive/3.4.1/eigen-3.4.1.tar.gz && tar -zxvf eigen-3.4.1.tar.gz + + sed -i 's/OR RDK_BUILD_MINIMAL_LIB)/OR EMSCRIPTEN OR RDK_BUILD_MINIMAL_LIB)/' \ + CMakeLists.txt + + emcmake cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ + -DCMAKE_BUILD_TYPE=Release \ + -DRDK_INSTALL_INTREE=ON \ + -DRDK_INSTALL_STATIC_LIBS=ON \ + -DRDK_BUILD_STATIC_LIBS_ONLY=ON \ + -DRDK_BUILD_AVALON_SUPPORT=OFF \ + -DRDK_BUILD_CAIRO_SUPPORT=OFF \ + -DRDK_BUILD_COORDGEN_SUPPORT=OFF \ + -DRDK_BUILD_CPP_TESTS=ON \ + -DRDK_BUILD_FREESASA_SUPPORT=OFF \ + -DRDK_BUILD_INCHI_SUPPORT=OFF \ + -DRDK_BUILD_MAEPARSER_SUPPORT=ON \ + -DRDK_BUILD_PYTHON_WRAPPERS=ON \ + -DRDK_BUILD_SWIG_WRAPPERS=OFF \ + -DRDK_BUILD_TEST_GZIP=ON \ + -DRDK_BUILD_XYZ2MOL_SUPPORT=ON \ + -DRDK_BUILD_YAEHMOP_SUPPORT=OFF \ + -DRDK_SWIG_STATIC=OFF \ + -DRDK_BUILD_THREADSAFE_SSS=ON \ + -DRDK_TEST_MULTITHREADED=ON \ + -DRDK_BUILD_CFFI_LIB=ON \ + -DRDK_BUILD_FREETYPE_SUPPORT=OFF \ + -DRDK_USE_BOOST_IOSTREAMS=OFF \ + -DRDK_USE_BOOST_SERIALIZATION=OFF \ + -DRDK_USE_BOOST_STACKTRACE=OFF \ + -DEIGEN3_INCLUDE_DIR=$PWD/eigen-3.4.1 \ + -DPython3_INCLUDE_DIR=$PYTHONINCLUDE \ + -DPython3_NumPy_INCLUDE_DIR=$NUMPY_INCLUDE_DIR \ + -DPython3_EXECUTABLE=python$PYMAJOR.$PYMINOR \ + -DPython3_LIBRARY=$HOSTINSTALLDIR/lib/python$PYMAJOR.$PYMINOR.a \ + -DCMAKE_INCLUDE_PATH="$WASM_LIBRARY_DIR/include" \ + -DCMAKE_LIBRARY_PATH="$WASM_LIBRARY_DIR/lib" + + # -DBoost_INCLUDE_DIR=$WASM_LIBRARY_DIR/include \ + # -DBoost_LIBRARY_DIR=$WASM_LIBRARY_DIR/lib \ + # -DBoost_NO_SYSTEM_PATHS=ON \ + # -DRDK_BOOST_PYTHON3_NAME=python$PYMAJOR.$PYMINOR \ + + emmake make -j ${PYODIDE_JOBS:-3} + emmake make -j ${PYODIDE_JOBS:-3} install + +about: + home: https://github.com/rdkit/rdkit + PyPI: https://pypi.org/project/rdkit + summary: A collection of chemoinformatics and machine-learning software written in C++ and Python + license: BSD-3-Clause +extra: + recipe-maintainers: + - fxcoudert