Skip to content

Commit 83e0a2b

Browse files
authored
Merge pull request #29706 from carterbox/libsbml-plus-packages
add libsml-plus-packages for libSBML C++ library
2 parents 69cbdf8 + 86e1138 commit 83e0a2b

File tree

4 files changed

+121
-0
lines changed

4 files changed

+121
-0
lines changed

recipes/libsbml/bld.bat

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
echo on
2+
3+
xcopy LICENSE.txt %PREFIX%\
4+
5+
cmake -G"Ninja" -S . -B build ^
6+
%CMAKE_ARGS% ^
7+
-DCMAKE_BUILD_TYPE=Release ^
8+
-DBUILD_SHARED_LIBS=ON ^
9+
-DCMAKE_CXX_STANDARD_LIBRARIES=-lxml2 ^
10+
-DLIBXML_LIBRARY="%PREFIX%"/Library/lib/libxml2.lib ^
11+
-DLIBXML_INCLUDE_DIR="%PREFIX%"/Library/include/libxml2 ^
12+
-DWITH_SWIG=OFF ^
13+
-DWITH_STABLE_PACKAGES=ON ^
14+
-DWITH_CPP_NAMESPACE=ON
15+
16+
cmake --build build --parallel %CPU_COUNT% --config Release
17+
cmake --build build --target install
18+
19+
del /q %PREFIX%\Library\share\cmake\Modules\FindLIBXML.cmake
20+
del /q %PREFIX%\Library\share\cmake\Modules\FindBZ2.cmake
21+
del /q %PREFIX%\Library\share\cmake\Modules\FindZLIB.cmake

recipes/libsbml/build.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
cp LICENSE.txt ${PREFIX}
4+
5+
mkdir build
6+
cd build
7+
8+
declare -a CMAKE_LIBXML_LIBRARY
9+
if [[ ${target_platform} == osx-*64 ]]; then
10+
CMAKE_LIBXML_LIBRARY+=(-DLIBXML_LIBRARY="${PREFIX}"/lib/libxml2.dylib)
11+
elif [[ ${target_platform} == linux-*64 ]]; then
12+
CMAKE_LIBXML_LIBRARY+=(-DLIBXML_LIBRARY="${PREFIX}"/lib/libxml2.so)
13+
fi
14+
15+
cmake ${CMAKE_ARGS} \
16+
-DCMAKE_BUILD_TYPE=Release \
17+
-DBUILD_SHARED_LIBS=ON \
18+
-DCMAKE_CXX_STANDARD_LIBRARIES=-lxml2 \
19+
"${CMAKE_LIBXML_LIBRARY[@]}" \
20+
-DLIBXML_INCLUDE_DIR=${PREFIX}/include/libxml2 \
21+
-DWITH_SWIG=OFF \
22+
-DWITH_STABLE_PACKAGES=ON \
23+
-DWITH_CPP_NAMESPACE=ON \
24+
..
25+
26+
make -j"${CPU_COUNT}"
27+
make install
28+
29+
rm ${PREFIX}/share/cmake/Modules/FindLIBXML.cmake
30+
rm ${PREFIX}/share/cmake/Modules/FindBZ2.cmake
31+
rm ${PREFIX}/share/cmake/Modules/FindZLIB.cmake
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
libxml2:
2+
- 2.9 # [linux]
3+
- 2.10 # [linux]
4+
- 2.11 # [linux]
5+
- 2.12
6+
- 2.13
7+
pin_run_as_build:
8+
libxml2: x.x

recipes/libsbml/meta.yaml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{% set name = "libsbml" %}
2+
{% set version = "5.20.4" %}
3+
4+
package:
5+
name: {{ name|lower }}
6+
version: {{ version }}
7+
8+
source:
9+
url: https://github.com/sbmlteam/libsbml/archive/refs/tags/v{{ version }}.tar.gz
10+
sha256: 02c225d3513e1f5d6e3c0168456f568e67f006eddaab82f09b4bdf0d53d2050e
11+
12+
build:
13+
number: 0
14+
run_exports:
15+
- {{ pin_subpackage('libsbml', max_pin='x.x') }}
16+
17+
requirements:
18+
build:
19+
- {{ compiler('c') }}
20+
- {{ stdlib('c') }}
21+
- {{ compiler('cxx') }}
22+
- cmake
23+
- make # [not win]
24+
- ninja # [win]
25+
26+
host:
27+
- zlib
28+
- bzip2
29+
- libxml2
30+
31+
test:
32+
commands:
33+
- test -f "${PREFIX}/lib/libsbml${SHLIB_EXT-.so}" # [linux]
34+
- test -f "${PREFIX}/lib/libsbml${SHLIB_EXT-.dylib}" # [osx]
35+
- if not exist %PREFIX%/Library/bin/libsbml.dll exit 1 # [win]
36+
- test -f "${PREFIX}/include/sbml/SBase.h" # [not win]
37+
- if not exist %PREFIX%/Library/include/sbml/SBase.h exit 1 # [win]
38+
- test -f "${PREFIX}/lib/cmake/sbml-config.cmake" # [not win]
39+
- if not exist %PREFIX%/Library/lib/cmake/libsbml-config.cmake exit 1 # [win]
40+
- test -f "${PREFIX}/lib/pkgconfig/libsbml.pc" # [not win]
41+
42+
43+
about:
44+
home: http://sbml.org/software/libsbml/
45+
summary: 'Non-official conda package of libSBML with all available packages'
46+
description: |
47+
LibSBML is a free, open-source programming library to help you read, write, manipulate, translate, and validate SBML files and data streams.
48+
This is a non-official conda package of libSBML with all available packages, working for linux-64, linux-aarch64, osx-64, osx-arm64 and win-64.
49+
This version was compiled with CPP namespace ON.
50+
51+
license: LGPL-2.1-only
52+
license_family: LGPL
53+
54+
license_file: LICENSE.txt
55+
56+
doc_url: https://sbml.org/software/libsbml/libsbml-docs/api/c++/
57+
dev_url: https://github.com/sbmlteam/libsbml/
58+
59+
extra:
60+
recipe-maintainers:
61+
- vincent-noel

0 commit comments

Comments
 (0)