Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Sep 2021 18:16:42 GMT
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: d8c851df599b - main - biology/py-libsedml: New port: SED-ML library for Python
Message-ID:  <202109191816.18JIGgbO027697@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d8c851df599b59e45eea03ee8a16af78602be1f0

commit d8c851df599b59e45eea03ee8a16af78602be1f0
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2021-09-19 18:14:45 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2021-09-19 18:15:36 +0000

    biology/py-libsedml: New port: SED-ML library for Python
---
 biology/Makefile                               |  1 +
 biology/py-libsedml/Makefile                   | 34 ++++++++++++++++++++++++++
 biology/py-libsedml/distinfo                   |  3 +++
 biology/py-libsedml/files/patch-CMakeLists.txt | 22 +++++++++++++++++
 biology/py-libsedml/files/quick-test.py        | 20 +++++++++++++++
 biology/py-libsedml/pkg-descr                  |  6 +++++
 biology/py-libsedml/pkg-plist                  |  3 +++
 7 files changed, 89 insertions(+)

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109191816.18JIGgbO027697>