summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2025-06-29 14:19:58 -0700
committerYuri Victorovich <yuri@FreeBSD.org>2025-06-29 15:04:27 -0700
commit0d6503fabc223a576d6c677bd2b133387aafcf9d (patch)
tree1ace1e04e4f1ce4af2007e714adc66492ced3c76
parentaudio/faust: update 2.77.3 → 2.79.3 (diff)
math/py-pyrfr: New port: Python bindings for the extensible C++ library for random forests
-rw-r--r--math/Makefile1
-rw-r--r--math/py-pyrfr/Makefile26
-rw-r--r--math/py-pyrfr/distinfo3
-rw-r--r--math/py-pyrfr/files/patch-include_cereal_external_rapidjson_document.h13
-rw-r--r--math/py-pyrfr/pkg-descr2
5 files changed, 45 insertions, 0 deletions
diff --git a/math/Makefile b/math/Makefile
index 034758a97829..0ce380d6a43d 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1082,6 +1082,7 @@
SUBDIR += py-pyprobables
SUBDIR += py-pyreadr
SUBDIR += py-pyreadstat
+ SUBDIR += py-pyrfr
SUBDIR += py-pyrr
SUBDIR += py-pysmt
SUBDIR += py-pysym
diff --git a/math/py-pyrfr/Makefile b/math/py-pyrfr/Makefile
new file mode 100644
index 000000000000..f6b888d07f6a
--- /dev/null
+++ b/math/py-pyrfr/Makefile
@@ -0,0 +1,26 @@
+PORTNAME= pyrfr
+DISTVERSION= 0.9.0
+CATEGORIES= math
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Python bindings for the extensible C++ library for random forests
+WWW= https://github.com/automl/random_forest_run
+
+LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE.txt
+
+BUILD_DEPENDS= ${PY_SETUPTOOLS} \
+ swig:devel/swig \
+ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
+
+USES= compiler:c++11-lang python
+USE_PYTHON= pep517 autoplist pytest
+
+post-install:
+ @${STRIP_CMD} \
+ ${STAGEDIR}${PYTHON_SITELIBDIR}/pyrfr/_regression${PYTHON_TAG}.so \
+ ${STAGEDIR}${PYTHON_SITELIBDIR}/pyrfr/_util${PYTHON_TAG}.so
+
+.include <bsd.port.mk>
diff --git a/math/py-pyrfr/distinfo b/math/py-pyrfr/distinfo
new file mode 100644
index 000000000000..2442b3d9b0f1
--- /dev/null
+++ b/math/py-pyrfr/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1751228849
+SHA256 (pyrfr-0.9.0.tar.gz) = bc6e758317cf79579fe6b7ce5f01dd42f77c991bf707e33646e8c6a9112c186b
+SIZE (pyrfr-0.9.0.tar.gz) = 295099
diff --git a/math/py-pyrfr/files/patch-include_cereal_external_rapidjson_document.h b/math/py-pyrfr/files/patch-include_cereal_external_rapidjson_document.h
new file mode 100644
index 000000000000..86d71f96a4b3
--- /dev/null
+++ b/math/py-pyrfr/files/patch-include_cereal_external_rapidjson_document.h
@@ -0,0 +1,13 @@
+- https://github.com/automl/random_forest_run/issues/8
+
+--- include/cereal/external/rapidjson/document.h.orig 2025-06-29 20:57:03 UTC
++++ include/cereal/external/rapidjson/document.h
+@@ -322,7 +322,7 @@ struct GenericStringRef {
+ operator const Ch *() const { return s; }
+
+ const Ch* const s; //!< plain CharType pointer
+- const SizeType length; //!< length of the string (excluding the trailing NULL terminator)
++ SizeType length; //!< length of the string (excluding the trailing NULL terminator)
+
+ private:
+ //! Disallow construction from non-const array
diff --git a/math/py-pyrfr/pkg-descr b/math/py-pyrfr/pkg-descr
new file mode 100644
index 000000000000..082449e5a710
--- /dev/null
+++ b/math/py-pyrfr/pkg-descr
@@ -0,0 +1,2 @@
+pyrfr is a Python binding for the extensible C++ library
+for random forests.