math/py-ambit: New port: Library for tensor product calculations

This commit is contained in:
Yuri Victorovich 2023-05-20 22:24:34 -07:00
parent ab88b4e243
commit e4464e75cf
6 changed files with 63 additions and 0 deletions

View file

@ -875,6 +875,7 @@
SUBDIR += py-affine
SUBDIR += py-algopy
SUBDIR += py-altgraph
SUBDIR += py-ambit
SUBDIR += py-amply
SUBDIR += py-animatplot
SUBDIR += py-animatplot-ng

44
math/py-ambit/Makefile Normal file
View file

@ -0,0 +1,44 @@
PORTNAME= ambit
DISTVERSIONPREFIX= v
DISTVERSION= 0.7
CATEGORIES= math
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= yuri@FreeBSD.org
COMMENT= Library for tensor product calculations
WWW= https://github.com/jturney/ambit
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/../COPYING
PY_DEPENDS= ${PYNUMPY}
BUILD_DEPENDS= pybind11>0:devel/pybind11 \
${PY_DEPENDS}
LIB_DEPENDS= libambit.so:math/ambit \
libhdf5.so:science/hdf5 \
libopenblas.so:math/openblas
RUN_DEPENDS= ${PY_DEPENDS}
USES= cmake compiler:c++17-lang python:build
USE_PYTHON= flavors pytest
USE_GITHUB= yes
GH_ACCOUNT= jturney
WRKSRC_SUBDIR= pyambit
CMAKE_ARGS= -DPYMOD_INSTALL_LIBDIR:STRING=/python${_PYTHON_VERSION}/site-packages \
-DFREEBSD_PYTHON_VER=${PYTHON_VER}
TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
TEST_WRKSRC= ${WRKSRC}
post-install: # remove share/cmake/ambit/ambitTargets-Python-%%CMAKE_BUILD_TYPE%%.cmake, and tests
@${RM} -r \
${STAGEDIR}${PREFIX}/share \
${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/ambit/tests
pre-test:
@${RM} ${WRKSRC}/__init__.py # tests fail with __init__.py
.include <bsd.port.mk>

3
math/py-ambit/distinfo Normal file
View file

@ -0,0 +1,3 @@
TIMESTAMP = 1684643393
SHA256 (jturney-ambit-v0.7_GH0.tar.gz) = 97a4360db5cad6c9d2bc0932fc8641a3feb34a809c192c99886880073e87f8c2
SIZE (jturney-ambit-v0.7_GH0.tar.gz) = 336129

View file

@ -0,0 +1,11 @@
--- CMakeLists.txt.orig 2023-05-21 04:59:24 UTC
+++ CMakeLists.txt
@@ -23,7 +23,7 @@ set(CMAKECONFIG_INSTALL_DIR "${ambit_INSTALL_CMAKEDIR}
#if (NOT TARGET Python::Module)
set(Python_ADDITIONAL_VERSIONS 3.11 3.10 3.9 3.8 3.7) # adjust with CMake minimum FindPythonInterp
- find_package(Python 3.7 COMPONENTS Interpreter Development NumPy REQUIRED)
+ find_package(Python ${FREEBSD_PYTHON_VER} EXACT COMPONENTS Interpreter Development NumPy REQUIRED)
message(STATUS "Found Python ${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}: ${Python_EXECUTABLE} (found version ${Python_VERSION})")
#endif()

2
math/py-ambit/pkg-descr Normal file
View file

@ -0,0 +1,2 @@
Python bindings for the C++ library implementing the tensor product calculations
through a clean, concise user interface.

2
math/py-ambit/pkg-plist Normal file
View file

@ -0,0 +1,2 @@
%%PYTHON_SITELIBDIR%%/ambit/__init__.py
%%PYTHON_SITELIBDIR%%/ambit/pyambit%%PYTHON_EXT_SUFFIX%%.so