From nobody Sun Feb 11 19:02:59 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TXxmz5W10z5BFMf; Sun, 11 Feb 2024 19:02:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TXxmz4tbfz41Z5; Sun, 11 Feb 2024 19:02:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707678179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TkyZNkTLRzEOh2T1+mbcpGJSXtebq16yverIt8rb9lc=; b=IUOmk1zeVupIZYTyXF3glW5beHzHqlZgUV+mkx/kqFxoWYhRQy6NAtXjCkB5rDbiX7krNK sho7gKvUfWbTmfzDfP1l0BPbqiapPSfu2S89ca0c5cH19gttVZTkiTNvRD8Gkxz+x4anII bFyKgdxMhBumm2jLWuJKAODKGqEGiV3Grv5a2bzbb+oQeip+yEP8ZYUt0OHRd2ubIi4868 hlly2xjez102My8FbYPzt5wOCqGvYudvGmWjz9/CR7pGsIOqQDqZWy4Px1J50wQPvdkrhv 6CakzlxUHR1MyfHFzzzYqYIv4QKi8rcCMi8j64cRytqmrdD2O1f0qYij3+R7rA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707678179; a=rsa-sha256; cv=none; b=uvTr4Mqc5LjnpTV3n1BzTbM/6zHdezhrKgKMEHBSe3aFrS20Msn/B16eUZpYMa3B6+Lk+g IRnMmF60rUssjbqAyK4wWvQBnnTzGB2zf1puxI4ZhENe9Q/2kGS+rijw3LZL1gsSsFXt7L q0wNfHVtpteaoW9pGeyidB10dk0ppDrrWCT0i+7jKnwQfvweDsfUaoLV2zZ0I4d6qFtfJZ Un9kSslIVabBwXNPEQHu/U27q4PsHBr3+BsIsrYjGDbEOYiZ+U8GfDLW4L+gHZOzBSpL2q BjUwnBy9fA6a5i9eU/RPpa67KGWGI9lOdS+f0zHOmIEVJkOxGRPeOEx0ZtoMpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707678179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TkyZNkTLRzEOh2T1+mbcpGJSXtebq16yverIt8rb9lc=; b=ZZ+zdL4aiK69EmArexAKILycnK/BZrDVBYTENVaZwU/0JdOxjjQ/PvKwmKX5HjnneZr49R DWNGI/IMUIFg3XSTVTFGHjkvf8UUMjT2xd1zG0B6+tcNnBWcWbsl6ZFk6F6jbv/M7cd1FY mdu1lMgVvTtF3WiJuDPnmeyOVLI0C2/R6Zc7k3kxKktazYqB+ejXaT9mW7mmC2sWzhz/kG WaUYEFzVec+WK00TdxIa8hubASs9vzcp//QadrbvvN/3kYuvBQ3EppSBjnyJWSJZ6wh/v/ HSnjWOSQzy2T7zCSlKGKnw6hiEDR3SEgQ9+IteYPV7so1wN6dRl8ahmb0e1xBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TXxmz3xFKz19vX; Sun, 11 Feb 2024 19:02:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41BJ2xhP026667; Sun, 11 Feb 2024 19:02:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41BJ2xLl026664; Sun, 11 Feb 2024 19:02:59 GMT (envelope-from git) Date: Sun, 11 Feb 2024 19:02:59 GMT Message-Id: <202402111902.41BJ2xLl026664@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: e1e1584924ed - main - science/{,py-}spglib: update 2.3.0 =?utf-8?Q?=E2=86=92?= 2.3.1 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e1e1584924edc207c91ecb16ee6dad8468ff7b54 Auto-Submitted: auto-generated The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=e1e1584924edc207c91ecb16ee6dad8468ff7b54 commit e1e1584924edc207c91ecb16ee6dad8468ff7b54 Author: Yuri Victorovich AuthorDate: 2024-02-11 18:44:14 +0000 Commit: Yuri Victorovich CommitDate: 2024-02-11 19:02:55 +0000 science/{,py-}spglib: update 2.3.0 → 2.3.1 Reported by: portscout --- science/py-spglib/Makefile | 23 +++++++++++---- science/py-spglib/distinfo | 6 ++-- science/py-spglib/files/patch-CMakeLists.txt | 37 +++++++++++++----------- science/py-spglib/files/patch-spglib_spglib.py | 31 ++++++++++++++++++++ science/py-spglib/files/quick-test.py | 39 ++++++++++++++++++++++++++ science/spglib/Makefile | 2 +- science/spglib/distinfo | 6 ++-- science/spglib/pkg-plist | 5 ++-- 8 files changed, 118 insertions(+), 31 deletions(-) diff --git a/science/py-spglib/Makefile b/science/py-spglib/Makefile index e39cd68c2410..b9208a124902 100644 --- a/science/py-spglib/Makefile +++ b/science/py-spglib/Makefile @@ -1,16 +1,18 @@ PORTNAME= spglib DISTVERSIONPREFIX= v -DISTVERSION= 2.3.0 +DISTVERSION= 2.3.1 CATEGORIES= science python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= yuri@FreeBSD.org COMMENT= Library for finding and handling crystal symmetries (python binding) -WWW= https://atztogo.github.io/spglib/ +WWW= https://spglib.readthedocs.io/en/stable/ LICENSE= BSD3CLAUSE -BUILD_DEPENDS= ${PYNUMPY} +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools_scm>0:devel/py-setuptools_scm@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}scikit-build-core>0:devel/py-scikit-build-core@${PY_FLAVOR} \ + ${PYNUMPY} LIB_DEPENDS= libsymspg.so:science/spglib RUN_DEPENDS= ${PYNUMPY} @@ -22,8 +24,19 @@ CMAKE_ARGS= -DPython3_EXECUTABLE=${PYTHON_CMD} WRKSRC_SUBDIR= python +MAKE_ENV= SETUPTOOLS_SCM_PRETEND_VERSION=${DISTVERSION} + +TEST_WRKSRC= ${WRKSRC} +TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} + post-patch: - #@cd ${WRKSRC} && ${RLN} ../test . - @cd ${WRKSRC} && ${CP} -r ../test . + ##@cd ${WRKSRC} && ${RLN} ../test . + #@cd ${WRKSRC} && ${CP} -r ../test . + # workaround for https://github.com/spglib/spglib/issues/429 + @${REINPLACE_CMD} -i '' -e 's|^from ._version import|#&|' ${WRKSRC}/spglib/__init__.py + # patch in the correct symspg lib + @${REINPLACE_CMD} -i '' \ + -e 's|, bundled_lib)|, "${LOCALBASE}/lib/libsymspg.so")|' \ + ${WRKSRC}/spglib/spglib.py .include diff --git a/science/py-spglib/distinfo b/science/py-spglib/distinfo index a7dbde1d3c56..29c3fb3df15a 100644 --- a/science/py-spglib/distinfo +++ b/science/py-spglib/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1706473147 -SHA256 (spglib-spglib-v2.3.0_GH0.tar.gz) = 2fc3b42867d12a41b952ffd5896426797a39564e129c04c9c626d880371614ad -SIZE (spglib-spglib-v2.3.0_GH0.tar.gz) = 2910603 +TIMESTAMP = 1707671341 +SHA256 (spglib-spglib-v2.3.1_GH0.tar.gz) = 6eb977053b35cd80eb2b5c3fa506a538ff2dad7092a43a612f4f0d4dc2069253 +SIZE (spglib-spglib-v2.3.1_GH0.tar.gz) = 2910916 diff --git a/science/py-spglib/files/patch-CMakeLists.txt b/science/py-spglib/files/patch-CMakeLists.txt index ffabaf7a1e8c..7c42c23d1d4b 100644 --- a/science/py-spglib/files/patch-CMakeLists.txt +++ b/science/py-spglib/files/patch-CMakeLists.txt @@ -1,4 +1,4 @@ ---- CMakeLists.txt.orig 2023-09-10 07:23:28 UTC +--- CMakeLists.txt.orig 2024-02-11 01:27:19 UTC +++ CMakeLists.txt @@ -1,8 +1,13 @@ +cmake_minimum_required(VERSION 3.15) @@ -15,25 +15,28 @@ if (NOT Python_INSTALL_DIR) if (SKBUILD) # If built with scikit-build-core, let it handle the installation -@@ -12,7 +17,7 @@ if (NOT Python_INSTALL_DIR) +@@ -12,16 +17,16 @@ endif () set(Python_INSTALL_DIR ${Python3_SITEARCH}/spglib) endif () endif () -if (SPGLIB_INSTALL) +if (TRUE) - if (WIN32) - # Windows needs RUNTIME as well to install the .dll file to - install(TARGETS Spglib_symspg -@@ -22,9 +27,9 @@ if (SPGLIB_INSTALL) - else () - # TODO: Cmake forces to install PUBLIC_HEADER when defined - # https://gitlab.kitware.com/cmake/cmake/-/issues/24326 -- install(TARGETS Spglib_symspg -- LIBRARY DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Runtime -- PUBLIC_HEADER DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Runtime) -+ #install(TARGETS Spglib_symspg -+ # LIBRARY DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Runtime -+ # PUBLIC_HEADER DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Runtime) - endif () + # TODO: Cmake forces to install PUBLIC_HEADER when defined + # https://gitlab.kitware.com/cmake/cmake/-/issues/24326 +- install(TARGETS Spglib_symspg +- LIBRARY DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Runtime +- NAMELINK_COMPONENT Spglib_Development +- ARCHIVE DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Development +- PUBLIC_HEADER DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Development +- RUNTIME DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Runtime +- ) ++ #install(TARGETS Spglib_symspg ++ # LIBRARY DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Runtime ++ # NAMELINK_COMPONENT Spglib_Development ++ # ARCHIVE DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Development ++ # PUBLIC_HEADER DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Development ++ # RUNTIME DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Runtime ++ #) install(TARGETS Spglib_python - LIBRARY DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Runtime) + LIBRARY DESTINATION ${Python_INSTALL_DIR} COMPONENT Spglib_Runtime + ) diff --git a/science/py-spglib/files/patch-spglib_spglib.py b/science/py-spglib/files/patch-spglib_spglib.py new file mode 100644 index 000000000000..bbe9f70d0a64 --- /dev/null +++ b/science/py-spglib/files/patch-spglib_spglib.py @@ -0,0 +1,31 @@ +--- spglib/spglib.py.orig 2024-02-11 17:45:53 UTC ++++ spglib/spglib.py +@@ -46,17 +46,17 @@ except ImportError: + import re + from ctypes import cdll + +- bundled_lib = next( +- filter( +- lambda fl: re.match(".*symspg\\..*", fl), +- sorted(os.listdir(os.path.dirname(__file__))), +- ), +- None, +- ) +- if not bundled_lib: +- raise FileNotFoundError( +- "Spglib C library is not installed and no bundled version was detected" +- ) ++ #bundled_lib = next( ++ # filter( ++ # lambda fl: re.match(".*symspg\\..*", fl), ++ # sorted(os.listdir(os.path.dirname(__file__))), ++ # ), ++ # None, ++ #) ++ #if not bundled_lib: ++ # raise FileNotFoundError( ++ # "Spglib C library is not installed and no bundled version was detected" ++ # ) + cdll.LoadLibrary(os.path.join(os.path.dirname(__file__), bundled_lib)) + from spglib import _spglib as spg # type: ignore[attr-defined] + diff --git a/science/py-spglib/files/quick-test.py b/science/py-spglib/files/quick-test.py new file mode 100644 index 000000000000..c73b1e342b42 --- /dev/null +++ b/science/py-spglib/files/quick-test.py @@ -0,0 +1,39 @@ +import numpy as np +import spglib + +lattice = np.array([[0.0, 0.5, 0.5], + [0.5, 0.0, 0.5], + [0.5, 0.5, 0.0]]) * 5.4 +positions = [[0.875, 0.875, 0.875], + [0.125, 0.125, 0.125]] +numbers= [1,] * 2 +cell = (lattice, positions, numbers) +print(spglib.get_spacegroup(cell, symprec=1e-5)) +mesh = [8, 8, 8] + +# +# Gamma centre mesh +# +mapping, grid = spglib.get_ir_reciprocal_mesh(mesh, cell, is_shift=[0, 0, 0]) + +# All k-points and mapping to ir-grid points +for i, (ir_gp_id, gp) in enumerate(zip(mapping, grid)): + print("%3d ->%3d %s" % (i, ir_gp_id, gp.astype(float) / mesh)) + +# Irreducible k-points +print("Number of ir-kpoints: %d" % len(np.unique(mapping))) +print(grid[np.unique(mapping)] / np.array(mesh, dtype=float)) + +# +# With shift +# +mapping, grid = spglib.get_ir_reciprocal_mesh(mesh, cell, is_shift=[1, 1, 1]) + +# All k-points and mapping to ir-grid points +for i, (ir_gp_id, gp) in enumerate(zip(mapping, grid)): + print("%3d ->%3d %s" % (i, ir_gp_id, (gp + [0.5, 0.5, 0.5]) / mesh)) + +# Irreducible k-points +print("Number of ir-kpoints: %d" % len(np.unique(mapping))) +print((grid[np.unique(mapping)] + [0.5, 0.5, 0.5]) / mesh) + diff --git a/science/spglib/Makefile b/science/spglib/Makefile index 4dee78e7c396..637aceb28671 100644 --- a/science/spglib/Makefile +++ b/science/spglib/Makefile @@ -1,6 +1,6 @@ PORTNAME= spglib DISTVERSIONPREFIX= v -DISTVERSION= 2.3.0 +DISTVERSION= 2.3.1 CATEGORIES= science MAINTAINER= yuri@FreeBSD.org diff --git a/science/spglib/distinfo b/science/spglib/distinfo index 7d1221a1c958..922298e099b7 100644 --- a/science/spglib/distinfo +++ b/science/spglib/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1706472993 -SHA256 (spglib-spglib-v2.3.0_GH0.tar.gz) = 2fc3b42867d12a41b952ffd5896426797a39564e129c04c9c626d880371614ad -SIZE (spglib-spglib-v2.3.0_GH0.tar.gz) = 2910603 +TIMESTAMP = 1707671227 +SHA256 (spglib-spglib-v2.3.1_GH0.tar.gz) = 6eb977053b35cd80eb2b5c3fa506a538ff2dad7092a43a612f4f0d4dc2069253 +SIZE (spglib-spglib-v2.3.1_GH0.tar.gz) = 2910916 diff --git a/science/spglib/pkg-plist b/science/spglib/pkg-plist index e81892aca86c..6749e800c471 100644 --- a/science/spglib/pkg-plist +++ b/science/spglib/pkg-plist @@ -8,11 +8,12 @@ lib/cmake/Spglib/SpglibConfigVersion.cmake %%FORTRAN%%lib/cmake/Spglib/SpglibTargets_fortran.cmake lib/cmake/Spglib/SpglibTargets_shared-%%CMAKE_BUILD_TYPE%%.cmake lib/cmake/Spglib/SpglibTargets_shared.cmake +%%FORTRAN%%lib/cmake/Spglib/try_compile.f90 %%FORTRAN%%lib/libspglib_f08.so %%FORTRAN%%lib/libspglib_f08.so.2 -%%FORTRAN%%lib/libspglib_f08.so.2.3.0 +%%FORTRAN%%lib/libspglib_f08.so.2.3.1 lib/libsymspg.so lib/libsymspg.so.2 -lib/libsymspg.so.2.3.0 +lib/libsymspg.so.2.3.1 libdata/pkgconfig/spglib.pc %%FORTRAN%%libdata/pkgconfig/spglib_f08.pc