aboutsummaryrefslogtreecommitdiff
path: root/math/py-cryptominisat
diff options
context:
space:
mode:
Diffstat (limited to 'math/py-cryptominisat')
-rw-r--r--math/py-cryptominisat/Makefile24
-rw-r--r--math/py-cryptominisat/distinfo2
-rw-r--r--math/py-cryptominisat/files/patch-pycryptosat.cpp19
-rw-r--r--math/py-cryptominisat/files/patch-setup.py.in29
-rw-r--r--math/py-cryptominisat/pkg-descr5
5 files changed, 52 insertions, 27 deletions
diff --git a/math/py-cryptominisat/Makefile b/math/py-cryptominisat/Makefile
index 8cf25e213920..7c6bb2aa4e87 100644
--- a/math/py-cryptominisat/Makefile
+++ b/math/py-cryptominisat/Makefile
@@ -1,24 +1,32 @@
# $FreeBSD$
+PORTNAME= cryptominisat
+PORTVERSION= 4.5.3
CATEGORIES= math python
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
-COMMENT= Python bindings to CryptoMiniSat
+MAINTAINER= 6yearold@gmail.com
+COMMENT= Bindings to CryptoMiniSat (a SAT solver)
LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
LIB_DEPENDS= libcryptominisat4.so:${PORTSDIR}/math/cryptominisat
-USES= compiler:c++11-lib python:2.7 tar:bzip2
+USES= compiler:c++11-lang python:-2.7
USE_PYTHON= autoplist distutils
+USE_GITHUB= yes
+
+GH_ACCOUNT= msoos
+
WRKSRC_SUBDIR= python
-MASTERDIR= ${.CURDIR}/../cryptominisat
-PATCHDIR= ${.CURDIR}/files
-PLIST= ${.CURDIR}/pkg-plist
+PYDISTUTILS_BUILDTARGET= build_ext --include-dirs=${LOCALBASE}/include
+
+post-patch:
+ ${CP} ${WRKSRC}/setup.py.in ${WRKSRC}/setup.py
post-install:
- ${FIND} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} -name \*.so \
- -exec ${STRIP_CMD} {} +
+ ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/pycryptosat.so
-.include "${MASTERDIR}/Makefile"
+.include <bsd.port.mk>
diff --git a/math/py-cryptominisat/distinfo b/math/py-cryptominisat/distinfo
new file mode 100644
index 000000000000..0991145bbc4c
--- /dev/null
+++ b/math/py-cryptominisat/distinfo
@@ -0,0 +1,2 @@
+SHA256 (msoos-cryptominisat-4.5.3_GH0.tar.gz) = 114da20e25734dc368dada47afd8cb7d44717f2159ad66d5bac742062fa3eb4c
+SIZE (msoos-cryptominisat-4.5.3_GH0.tar.gz) = 467221
diff --git a/math/py-cryptominisat/files/patch-pycryptosat.cpp b/math/py-cryptominisat/files/patch-pycryptosat.cpp
deleted file mode 100644
index 7d6b9d31f49c..000000000000
--- a/math/py-cryptominisat/files/patch-pycryptosat.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-On FreeBSD -std=c++11 turns NULL into nullptr which sometimes breaks:
-
- pycryptosat.cpp:393:12: error: cannot initialize return object of type 'int' with an rvalue of type 'nullptr_t'
- return NULL;
- ^~~~
- /usr/include/sys/_null.h:35:14: note: expanded from macro 'NULL'
- #define NULL nullptr
- ^~~~~~~
---- pycryptosat.cpp.orig 2014-07-06 23:41:16 UTC
-+++ pycryptosat.cpp
-@@ -390,7 +390,7 @@ Solver_init(Solver *self, PyObject *args
- if (!self->cmsat) {
- return -1;
- }
-- return NULL;
-+ return 0;
- }
-
- static PyMemberDef Solver_members[] = {
diff --git a/math/py-cryptominisat/files/patch-setup.py.in b/math/py-cryptominisat/files/patch-setup.py.in
new file mode 100644
index 000000000000..660ac75c2a82
--- /dev/null
+++ b/math/py-cryptominisat/files/patch-setup.py.in
@@ -0,0 +1,29 @@
+--- setup.py.in.orig 2015-08-26 23:32:30 UTC
++++ setup.py.in
+@@ -51,15 +51,15 @@ def _init_posix(init):
+ return wrapper
+ sysconfig._init_posix = _init_posix(sysconfig._init_posix)
+
+-__version__ = '@PROJECT_VERSION@'
++__version__ = '4.5.3'
+
+ ext_kwds = dict(
+ name = "pycryptosat",
+- sources = ["${CMAKE_CURRENT_SOURCE_DIR}/pycryptosat.cpp"],
++ sources = ["pycryptosat.cpp"],
+ define_macros = [],
+- extra_compile_args = ['-I${PROJECT_SOURCE_DIR}', '-I${PROJECT_BINARY_DIR}/cmsat4-src'],
++ extra_compile_args = ['-I/usr/local/include', '-I..cmsat4-src'],
+ language = "c++",
+- library_dirs=['.', '/usr/local/lib', '${PROJECT_BINARY_DIR}/lib'],
++ library_dirs=['.', '/usr/local/lib'],
+ libraries = ['cryptominisat4']
+ )
+
+@@ -84,5 +84,5 @@ setup(
+ ext_modules = [Extension(**ext_kwds)],
+ py_modules = ['test_pycryptosat'],
+ description = "bindings to CryptoMiniSat (a SAT solver)",
+- long_description = open('${CMAKE_CURRENT_SOURCE_DIR}/README.rst').read(),
++ long_description = open('README.rst').read(),
+ )
diff --git a/math/py-cryptominisat/pkg-descr b/math/py-cryptominisat/pkg-descr
new file mode 100644
index 000000000000..a4f83e514c8c
--- /dev/null
+++ b/math/py-cryptominisat/pkg-descr
@@ -0,0 +1,5 @@
+This package provides Python bindings to CryptoMiniSat on the C++ level,
+i.e. when importing pycryptosat, the CryptoMiniSat solver becomes part of the
+Python process itself.
+
+WWW: https://github.com/msoos/cryptominisat