aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2021-09-19 18:14:45 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2021-09-19 18:15:36 +0000
commitd8c851df599b59e45eea03ee8a16af78602be1f0 (patch)
tree3bb3b32fbaafc27c8ac03b2c6670d293daeec4c5
parentdd804e98719a5c2376d15b79e6b745f45ab1de40 (diff)
downloadports-d8c851df599b59e45eea03ee8a16af78602be1f0.tar.gz
ports-d8c851df599b59e45eea03ee8a16af78602be1f0.zip
biology/py-libsedml: New port: SED-ML library for Python
-rw-r--r--biology/Makefile1
-rw-r--r--biology/py-libsedml/Makefile34
-rw-r--r--biology/py-libsedml/distinfo3
-rw-r--r--biology/py-libsedml/files/patch-CMakeLists.txt22
-rw-r--r--biology/py-libsedml/files/quick-test.py20
-rw-r--r--biology/py-libsedml/pkg-descr6
-rw-r--r--biology/py-libsedml/pkg-plist3
7 files changed, 89 insertions, 0 deletions
diff --git a/biology/Makefile b/biology/Makefile
index f57fe3e300fd..5e85d456e039 100644
--- a/biology/Makefile
+++ b/biology/Makefile
@@ -152,6 +152,7 @@
SUBDIR += py-macs2
SUBDIR += py-multiqc
SUBDIR += py-libnuml
+ SUBDIR += py-libsedml
SUBDIR += py-ont-fast5-api
SUBDIR += py-orange3-bioinformatics
SUBDIR += py-orange3-single-cell
diff --git a/biology/py-libsedml/Makefile b/biology/py-libsedml/Makefile
new file mode 100644
index 000000000000..d1432f390993
--- /dev/null
+++ b/biology/py-libsedml/Makefile
@@ -0,0 +1,34 @@
+PORTNAME= libsedml
+DISTVERSIONPREFIX= v
+DISTVERSION= 2.0.26
+CATEGORIES= biology devel
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= SED-ML library for Python
+
+LICENSE= BSD2CLAUSE
+LICENSE_FILE= ${WRKSRC}/../../../LICENSE.txt
+
+BUILD_DEPENDS= swig:devel/swig
+LIB_DEPENDS= libsedml.so:biology/libsedml \
+ libsbml.so:biology/libsbml \
+ libnuml.so:biology/libnuml
+
+USES= cmake localbase:ldflags python
+USE_PYTHON= flavors
+
+USE_GITHUB= yes
+GH_ACCOUNT= fbergmann
+GH_PROJECT= libSEDML
+
+CMAKE_ARGS= -DCMAKE_INSTALL_LIBDIR=lib
+
+LDFLAGS+= -lsedml -lsbml -lnuml # otherwise it builds a broken shared object, see https://github.com/NuML/NuML/issues/21
+
+WRKSRC_SUBDIR= src/bindings/python
+
+do-test: install
+ @${PYTHON_CMD} ${FILESDIR}/quick-test.py
+
+.include <bsd.port.mk>
diff --git a/biology/py-libsedml/distinfo b/biology/py-libsedml/distinfo
new file mode 100644
index 000000000000..305ade0a4d35
--- /dev/null
+++ b/biology/py-libsedml/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1632069547
+SHA256 (fbergmann-libSEDML-v2.0.26_GH0.tar.gz) = 74334f2d2e0f4aae2f58f4013c432220ba12a6a6be4cf9478adbbefab7441b41
+SIZE (fbergmann-libSEDML-v2.0.26_GH0.tar.gz) = 956845
diff --git a/biology/py-libsedml/files/patch-CMakeLists.txt b/biology/py-libsedml/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..0a8f6e634f59
--- /dev/null
+++ b/biology/py-libsedml/files/patch-CMakeLists.txt
@@ -0,0 +1,22 @@
+--- CMakeLists.txt.orig 2021-09-19 17:41:37 UTC
++++ CMakeLists.txt
+@@ -49,6 +49,7 @@ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libsedml_wrap.cpp
+ COMMAND "${SWIG_EXECUTABLE}"
+ ARGS -I${CMAKE_CURRENT_SOURCE_DIR}/../swig/
++ -I${CMAKE_INSTALL_PREFIX}/include
+ -I${CMAKE_CURRENT_SOURCE_DIR}/../../
+ -I${CMAKE_CURRENT_BINARY_DIR}/../../
+ -I${CMAKE_CURRENT_SOURCE_DIR}/../../sedml
+@@ -125,9 +126,9 @@ if (PYTHON_USE_DYNAMIC_LOOKUP)
+ if (APPLE)
+ set_target_properties (binding_python_lib PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
+ endif()
+- target_link_libraries(binding_python_lib ${LIBSEDML_LIBRARY}-static)
++ target_link_libraries(binding_python_lib ${LIBSEDML_LIBRARY})
+ else()
+- target_link_libraries(binding_python_lib ${LIBSEDML_LIBRARY}-static ${PYTHON_LIBRARIES})
++ target_link_libraries(binding_python_lib ${LIBSEDML_LIBRARY} ${PYTHON_LIBRARIES})
+ endif()
+
+ #
diff --git a/biology/py-libsedml/files/quick-test.py b/biology/py-libsedml/files/quick-test.py
new file mode 100644
index 000000000000..59be4485ce6d
--- /dev/null
+++ b/biology/py-libsedml/files/quick-test.py
@@ -0,0 +1,20 @@
+# from https://github.com/fbergmann/libSEDML/issues/152
+
+import libsedml
+
+# create data set
+data_set = libsedml.SedDataSet()
+
+# set id
+assert data_set.setId('obj') == 0
+
+# check id set
+assert data_set.getId() == 'obj'
+
+# set empty name
+assert data_set.setName('') == 0
+
+# id is no longer set!
+assert data_set.getId() == 'obj'
+
+print("Test passed");
diff --git a/biology/py-libsedml/pkg-descr b/biology/py-libsedml/pkg-descr
new file mode 100644
index 000000000000..c84d1db60018
--- /dev/null
+++ b/biology/py-libsedml/pkg-descr
@@ -0,0 +1,6 @@
+Python binding libSEDML.
+
+The libSEDML project makes use of libSBML XML layer as well as code generation
+as starting point to produce a library for reading and writing of SED-ML models.
+
+WWW: https://github.com/fbergmann/libSEDML
diff --git a/biology/py-libsedml/pkg-plist b/biology/py-libsedml/pkg-plist
new file mode 100644
index 000000000000..81ce476b7592
--- /dev/null
+++ b/biology/py-libsedml/pkg-plist
@@ -0,0 +1,3 @@
+%%PYTHON_SITELIBDIR%%/libsedml.pth
+%%PYTHON_SITELIBDIR%%/libsedml/_libsedml.so
+%%PYTHON_SITELIBDIR%%/libsedml/libsedml.py