Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
science/chemicalfun: Update g20220104 -> 0.1.3
- Loading branch information
Showing
5 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,47 @@ | ||
PORTNAME= chemicalfun | ||
DISTVERSION= g20220104 | ||
DISTVERSION= 0.1.3 | ||
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 | ||
|
||
BUILD_DEPENDS= nlohmann-json>0:devel/nlohmann-json | ||
BUILD_DEPENDS= nlohmann-json>0:devel/nlohmann-json \ | ||
spdlog>0:devel/spdlog | ||
LIB_DEPENDS= libfmt.so:devel/libfmt # due to SPDLOG_FMT_EXTERNAL | ||
|
||
USES= cmake:testing eigen:3 | ||
USES= cmake:testing compiler:c++17-lang eigen:3 localbase | ||
|
||
BB_ACCOUNT= gems4 | ||
BB_COMMIT= dd673f906517 | ||
BB_COMMIT= 0e0edc84688c | ||
|
||
WRKSRC= ${WRKDIR}/${BB_ACCOUNT}-${PORTNAME}-${BB_COMMIT} | ||
|
||
CMAKE_OFF= CHEMICALFUN_BUILD_PYTHON | ||
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 | ||
|
||
OPTIONS_DEFINE= PYTHON | ||
OPTIONS_DEFAULT= PYTHON | ||
OPTIONS_SUB= yes | ||
|
||
PYTHON_USES= python | ||
PYTHON_CMAKE_BOOL= CHEMICALFUN_BUILD_PYTHON | ||
PYTHON_CMAKE_ON= -DFREEBSD_STAGEDIR=${STAGEDIR} | ||
PYTHON_BUILD_DEPENDS= pybind11>0:devel/pybind11 | ||
|
||
post-install-PYTHON-on: | ||
@${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/chemicalfun/PyChemicalFun${PYTHON_EXT_SUFFIX}.so | ||
|
||
post-test: | ||
@${ECHO} "==> run C++ tests" | ||
@cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} tests/test_main | ||
|
||
post-test-PYTHON-on: | ||
@${ECHO} "==> run Python tests" | ||
@cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} ${PYTHON_CMD} ${FILESDIR}/test.py | ||
|
||
.include <bsd.port.mk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
TIMESTAMP = 1642530020 | ||
SHA256 (chemicalfun-g20220104.tar.gz) = 2944e24ceda906511f7837ae29298d10aee47a0a9440f6955ff4be39899233c8 | ||
SIZE (chemicalfun-g20220104.tar.gz) = 931249 | ||
TIMESTAMP = 1658079527 | ||
SHA256 (chemicalfun-0.1.3.tar.gz) = ad6cbd46bb75fe5811f4fcae7966d7717bf30f4f0f4749783e09a9f53780e6e6 | ||
SIZE (chemicalfun-0.1.3.tar.gz) = 933523 |
11 changes: 11 additions & 0 deletions
11
science/chemicalfun/files/patch-python_chemicalfun_CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- python/chemicalfun/CMakeLists.txt.orig 2022-07-17 18:29:23 UTC | ||
+++ python/chemicalfun/CMakeLists.txt | ||
@@ -43,7 +43,7 @@ install(CODE | ||
endif() | ||
|
||
execute_process( | ||
- COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} install --prefix=\${CHEMICALFUN_PYTHON_INSTALL_PREFIX_NATIVE} | ||
+ COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} install --root=${FREEBSD_STAGEDIR} --prefix=\${CHEMICALFUN_PYTHON_INSTALL_PREFIX_NATIVE} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) | ||
" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# test from README | ||
|
||
import chemicalfun as cf | ||
|
||
formulas = ['Ca+2', 'CO3-2', 'H+', 'OH-', 'HCO3-', 'CaCO3', 'H2O'] | ||
|
||
chemicalReactions = cf.ChemicalReactions(formulas) | ||
|
||
reactions = chemicalReactions.generateReactions() # returns the reactions list as a list of tuples ('substance', coefficient) | ||
|
||
# can be transformed to a list of dictionaries, with reaction substances as keys and the reaction coefficients as values | ||
reactions_dic = [{el[0]: el[1] for el in r} for r in reactions] | ||
|
||
print(chemicalReactions.printReactions()) | ||
print(reactions_dic) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters