git: 265ac9a3a68f - main - science/chemicalfun: update 0.1.8 → 0.1.13
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 07 Oct 2026 17:14:44 UTC
The branch main has been updated by yuri:
URL: https://cgit.FreeBSD.org/ports/commit/?id=265ac9a3a68fedcdad2ac811287707bc3fba6b5d
commit 265ac9a3a68fedcdad2ac811287707bc3fba6b5d
Author: Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-10-07 16:17:54 +0000
Commit: Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-10-07 17:14:42 +0000
science/chemicalfun: update 0.1.8 → 0.1.13
---
science/chemicalfun/Makefile | 31 ++++------
science/chemicalfun/distinfo | 6 +-
.../chemicalfun/files/patch-python_CMakeLists.txt | 66 ++++++++++++++++++++++
.../files/patch-python_chemicalfun_CMakeLists.txt | 20 -------
.../files/patch-python_pyproject.toml.in | 10 ++++
science/chemicalfun/pkg-plist | 7 ---
6 files changed, 90 insertions(+), 50 deletions(-)
diff --git a/science/chemicalfun/Makefile b/science/chemicalfun/Makefile
index 5c237e49c3de..11fad6e43962 100644
--- a/science/chemicalfun/Makefile
+++ b/science/chemicalfun/Makefile
@@ -1,13 +1,14 @@
PORTNAME= chemicalfun
-DISTVERSION= 0.1.8
-PORTREVISION= 5
+DISTVERSIONPREFIX= v
+DISTVERSION= 0.1.13
CATEGORIES= science # chemistry
-MASTER_SITES= https://bitbucket.org/${BB_ACCOUNT}/${PORTNAME}/get/${BB_COMMIT}${EXTRACT_SUFX}?dummy=/:src
-DISTFILES= ${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX}:src
MAINTAINER= yuri@FreeBSD.org
COMMENT= C++ library for working with chemical reactions and formulas
-WWW= https://bitbucket.org/gems4/chemicalfun/src/master/
+WWW= https://github.com/thermohub/chemicalfun
+
+LICENSE= LGPL21
+LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= nlohmann-json>0:devel/nlohmann-json \
${PY_SETUPTOOLS} \
@@ -16,20 +17,15 @@ BUILD_DEPENDS= nlohmann-json>0:devel/nlohmann-json \
LIB_DEPENDS= libfmt.so:devel/libfmt # due to SPDLOG_FMT_EXTERNAL
LIB_DEPENDS+= libspdlog.so:devel/spdlog
-USES= cmake:testing compiler:c++17-lang eigen:3 localbase
-
-BB_ACCOUNT= gems4
-BB_COMMIT= 46c628fef376
+USES= cmake:testing compiler:c++20-lang eigen:3 localbase
-WRKSRC= ${WRKDIR}/${BB_ACCOUNT}-${PORTNAME}-${BB_COMMIT}
+USE_GITHUB= yes
+GH_ACCOUNT= thermohub
-CMAKE_ARGS= -DFREEBSD_PREFIX=${PREFIX} -DFREEBSD_STAGEDIR=${STAGEDIR} \
- -DPython_EXECUTABLE=${PYTHON_CMD}
CMAKE_TESTING_ON= CHEMICALFUN_BUILD_TESTS # tests fail to compile, BitBucket offers no easy way to report this
CMAKE_TESTING_TARGET= ${ALL_TARGET} # hack to prevent test run
-CXXFLAGS+= -DSPDLOG_FMT_EXTERNAL # see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258073#c3
-LDFLAGS+= -L${LOCALBASE}/lib -lfmt # due to SPDLOG_FMT_EXTERNAL
+LDFLAGS+= -L${LOCALBASE}/lib -lfmt # due to SPDLOG_FMT_EXTERNAL
OPTIONS_DEFINE= PYTHON
OPTIONS_DEFAULT= PYTHON
@@ -40,12 +36,7 @@ PYTHON_CMAKE_BOOL= CHEMICALFUN_BUILD_PYTHON
PYTHON_CMAKE_ON= -DFREEBSD_PREFIX=${PREFIX}
PYTHON_BUILD_DEPENDS= pybind11>0:devel/pybind11
-post-install-PYTHON-on:
- # remove wrong *.pyc, see related bug https://bitbucket.org/gems4/chemicalfun/issues/1/please-support-stagedir
- @${FIND} ${STAGEDIR} -name "*.pyc" -delete
- @${FIND} ${STAGEDIR} -name __pycache__ -delete
- # strip binary
- @${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/chemicalfun/PyChemicalFun${PYTHON_TAG}.so
+TEST_ENV= LD_LIBRARY_PATH=${STAGEDIR}${PREFIX}/lib:${STAGEDIR}${LOCALBASE}/lib
post-test:
@${ECHO} "==> run C++ tests"
diff --git a/science/chemicalfun/distinfo b/science/chemicalfun/distinfo
index 677b1b6d4fb2..2c4f7b537b60 100644
--- a/science/chemicalfun/distinfo
+++ b/science/chemicalfun/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1678175797
-SHA256 (chemicalfun-0.1.8.tar.gz) = c260f2b23a0bd75019eb35ced4db8ec6f88627f839fde64ad2b87ec629c272c2
-SIZE (chemicalfun-0.1.8.tar.gz) = 939981
+TIMESTAMP = 1791387561
+SHA256 (thermohub-chemicalfun-v0.1.13_GH0.tar.gz) = fe009d0b9ed491f57fe48048fd677e4746c32422c466bd1b61013782a7e58654
+SIZE (thermohub-chemicalfun-v0.1.13_GH0.tar.gz) = 955892
diff --git a/science/chemicalfun/files/patch-python_CMakeLists.txt b/science/chemicalfun/files/patch-python_CMakeLists.txt
new file mode 100644
index 000000000000..6503b174e5fa
--- /dev/null
+++ b/science/chemicalfun/files/patch-python_CMakeLists.txt
@@ -0,0 +1,66 @@
+-- replace broken installation code with a clean one
+
+--- python/CMakeLists.txt.orig 2025-12-03 16:37:32 UTC
++++ python/CMakeLists.txt
+@@ -12,49 +12,21 @@ add_subdirectory(src/chemicalfun)
+
+ #set(CHEMICALFUN_PYTHON_MODULE_FILENAME PyChemicalFun${PYTHON_MODULE_EXTENSION})
+
+-# Install where the python package is installed to CMAKE_INSTALL_PREFIX if not given
+-if(NOT DEFINED CHEMICALFUN_PYTHON_INSTALL_PREFIX)
+
+-# Install the ChemicalFun python package using setuptools
+-install(CODE
+-"
+- if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
+- execute_process(
+- COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:PyChemicalFun>
+- ${CMAKE_CURRENT_BINARY_DIR}/src/chemicalfun/$<TARGET_FILE_NAME:PyChemicalFun>
+- )
+- endif()
++# In your CMakeLists.txt (Remove the execute_process(pip) lines completely)
+
+- execute_process(
+- COMMAND ${Python3_EXECUTABLE} -m pip install ${CMAKE_CURRENT_BINARY_DIR}
+- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+-"
+-)
++if(NOT DEFINED CHEMICALFUN_PYTHON_INSTALL_PREFIX)
++ set(CHEMICALFUN_PYTHON_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
++endif()
+
+-else()
+-
+-# If the path is already in Windows format (with backslashes), it can't be added directly
+-# to the string below, otherwise CMake will later complain about "Invalid escape sequence".
+-file(TO_CMAKE_PATH "${CHEMICALFUN_PYTHON_INSTALL_PREFIX}" CHEMICALFUN_PYTHON_INSTALL_PREFIX)
+-message(STATUS "CHEMICALFUN_PYTHON_INSTALL_PREFIX: ${CHEMICALFUN_PYTHON_INSTALL_PREFIX}")
+-
+-# Install the ChemicalFun python package using setuptools
+-install(CODE
+-"
+- file(TO_NATIVE_PATH \"${CHEMICALFUN_PYTHON_INSTALL_PREFIX}\" CHEMICALFUN_PYTHON_INSTALL_PREFIX_NATIVE)
+-
+- if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
+- execute_process(
+- COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:PyChemicalFun>
+- ${CMAKE_CURRENT_BINARY_DIR}/src/chemicalfun/$<TARGET_FILE_NAME:PyChemicalFun>
+- )
+- endif()
+-
+- execute_process(
+- COMMAND ${Python3_EXECUTABLE} -m pip install --prefix \${CHEMICALFUN_PYTHON_INSTALL_PREFIX_NATIVE} ${CMAKE_CURRENT_BINARY_DIR}
+- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+-"
++# Just install the shared object library built by pybind11 natively
++install(TARGETS PyChemicalFun
++ DESTINATION "${CHEMICALFUN_PYTHON_INSTALL_PREFIX}/lib/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/chemicalfun"
+ )
+
+-endif()
++# Install the Python source wrapper files natively
++install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/chemicalfun/
++ DESTINATION "${CHEMICALFUN_PYTHON_INSTALL_PREFIX}/lib/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/chemicalfun"
++ FILES_MATCHING PATTERN "*.py"
++)
+
diff --git a/science/chemicalfun/files/patch-python_chemicalfun_CMakeLists.txt b/science/chemicalfun/files/patch-python_chemicalfun_CMakeLists.txt
deleted file mode 100644
index cf20bea619f2..000000000000
--- a/science/chemicalfun/files/patch-python_chemicalfun_CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
---- python/chemicalfun/CMakeLists.txt.orig 2023-03-01 15:14:05 UTC
-+++ python/chemicalfun/CMakeLists.txt
-@@ -31,7 +31,7 @@ add_custom_target(chemicalfun ALL
- COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:PyChemicalFun>
- ${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_FILE_NAME:PyChemicalFun>
- #COMMAND ${PYTHON_EXECUTABLE} -m pip install ${_PIP_ARG} -e ${CMAKE_CURRENT_BINARY_DIR}
-- COMMAND ${PYTHON_EXECUTABLE} -m pip install --prefix ${CMAKE_BINARY_DIR} --ignore-installed .
-+ COMMAND ${PYTHON_EXECUTABLE} -m pip install --root ${FREEBSD_STAGEDIR} --prefix ${FREEBSD_PREFIX} --ignore-installed .
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-
- # Set dependencies of PyChemicalFun target
-@@ -60,7 +60,7 @@ install(CODE
- endif()
-
- execute_process(
-- COMMAND ${PYTHON_EXECUTABLE} -m pip install --prefix \${CHEMICALFUN_PYTHON_INSTALL_PREFIX_NATIVE} ${CMAKE_CURRENT_BINARY_DIR}
-+ COMMAND ${PYTHON_EXECUTABLE} -m pip install --root ${FREEBSD_STAGEDIR} --prefix ${FREEBSD_PREFIX} ${CMAKE_CURRENT_BINARY_DIR}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
- "
- )
diff --git a/science/chemicalfun/files/patch-python_pyproject.toml.in b/science/chemicalfun/files/patch-python_pyproject.toml.in
new file mode 100644
index 000000000000..5141c9dd8784
--- /dev/null
+++ b/science/chemicalfun/files/patch-python_pyproject.toml.in
@@ -0,0 +1,10 @@
+--- python/pyproject.toml.in.orig 2026-10-07 16:01:35 UTC
++++ python/pyproject.toml.in
+@@ -17,7 +17,6 @@ description = "C++ and Python API for Chemical Formula
+ {name = "G.D. Miron", email = "dan.miron@psi.ch"}
+ ]
+ description = "C++ and Python API for Chemical Formula Parser and Reactions Generator."
+-license = "GPL-3.0-or-later"
+ keywords = ["element", "valence", "entropy", "atomic mass", "heat capacity", "reactions"]
+
+ [project.urls]
diff --git a/science/chemicalfun/pkg-plist b/science/chemicalfun/pkg-plist
index d0fd869ad428..0457082c486e 100644
--- a/science/chemicalfun/pkg-plist
+++ b/science/chemicalfun/pkg-plist
@@ -13,12 +13,5 @@ lib/cmake/ChemicalFun/ChemicalFunConfigVersion.cmake
lib/cmake/ChemicalFun/ChemicalFunTargets-%%CMAKE_BUILD_TYPE%%.cmake
lib/cmake/ChemicalFun/ChemicalFunTargets.cmake
lib/libChemicalFun.so
-%%PYTHON_SITELIBDIR%%/chemicalfun-0.1.8.dist-info/INSTALLER
-%%PYTHON_SITELIBDIR%%/chemicalfun-0.1.8.dist-info/METADATA
-%%PYTHON_SITELIBDIR%%/chemicalfun-0.1.8.dist-info/RECORD
-%%PYTHON_SITELIBDIR%%/chemicalfun-0.1.8.dist-info/REQUESTED
-%%PYTHON_SITELIBDIR%%/chemicalfun-0.1.8.dist-info/WHEEL
-%%PYTHON_SITELIBDIR%%/chemicalfun-0.1.8.dist-info/direct_url.json
-%%PYTHON_SITELIBDIR%%/chemicalfun-0.1.8.dist-info/top_level.txt
%%PYTHON_SITELIBDIR%%/chemicalfun/PyChemicalFun%%PYTHON_TAG%%.so
%%PYTHON_SITELIBDIR%%/chemicalfun/__init__.py