From nobody Mon Feb 12 20:07:36 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 4TYb94267Pz5BVFR; Mon, 12 Feb 2024 20:07:36 +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 4TYb941fz5z44sR; Mon, 12 Feb 2024 20:07:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707768456; 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=V3lDfNr5x+PIDRCthPzC6J95Et1QH9ZFdyEa9ZHBhAs=; b=GtJS2DoBgkwOSSfPnb0Hr97w4TaOg8s5KrdaAjxiRhF1h2/Wjr4Z2lP/Y/3dlClUrhM9wR 5iHlK1shzXOVFLVkcX3pG/Sa/7jNL7+9qGCDC4M2csdym8ll2dXPLCiB4sR1iJmH37t9++ 0lERyfrM1UY8XBtolkF2Q33ENfzQrbD1rJcw5qfvJMvRsWdFvpjEGV5DEWqaCcQ4cSexza YJpl6eYjluFjgliWJnLK0kXHgDwKyX8FKAwTtW4ntsNYcIKlpzk7a1k3laZzAv8sajBmQj 2BWiOIbFC0Qo3CQP0ip+cs154WVQpQ0fKA08wS1j/rxD6oPkMvionOhVACTp5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707768456; a=rsa-sha256; cv=none; b=JtgG+y93Kp+TVrvZE7yzPvU3yogg2yAciaN138iw2G4DGw0iKtwiqVUp8PoSPt0tAllLbk GxoUw4wOtF3slsqya4BQDzxRhdVkq7bvf2UO2s9hyv6oN2OABKFjbCIZGJ0tnaq4AeQkIn XFhgmmkiRb/8VMqeucsipHWbs0HPMa8t6zdFofTv5PpXgNQ1uQIDDuUoP+j2kRQNncZAD0 kZK/mjqT3f97AnxZm+O1y5+ZdPKK1CXajV19udJTooaO8/G2y5Q5SCDYx5PFUMj1wm0e/4 Ji3+leVwiZ8kIYK77YxYasGWr6HD/4gHYaIM0G0z3zXDxCbTao3EGVu6RlSeVQ== 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=1707768456; 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=V3lDfNr5x+PIDRCthPzC6J95Et1QH9ZFdyEa9ZHBhAs=; b=mSsIUmgg/dx/FSvVm5fbO9P2hBAsufiopl9MmgoHeBr99kHxXGA/tDvvYmp0P3B/tZKOF/ cKtLDRBhlXPboTog4jKYQLZvmvNHz1hI2HvGcBkPGTiEekS5EUqQXL5B1irqtW4GMf3EK6 6FDYVhQesFZE5ucg9aE5+gIwT9ndd0sX62HMsjMGpY+asPDxPFfofwF2P50xcUiQ9O5E/m aXDrANva4GbFaC8H4cseeLpJL6tORkeEDO5RF0pkuewXOT8kq7VauEEFkQPB+GKB1aUPZP ard9Q50U4oDoVi8Ut2C28ojaPbA9Bl4ZuJ0UE6kx/W6UNI+toe30I8EniDrRXw== 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 4TYb940kdSzlrc; Mon, 12 Feb 2024 20:07:36 +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 41CK7afN049362; Mon, 12 Feb 2024 20:07:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41CK7aih049359; Mon, 12 Feb 2024 20:07:36 GMT (envelope-from git) Date: Mon, 12 Feb 2024 20:07:36 GMT Message-Id: <202402122007.41CK7aih049359@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: 8aafb5f26d63 - main - science/py-spglib: Build using PEP517 tools instead of cmake 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: 8aafb5f26d638d8bfd4b14d4d83a5ce04f47e46f Auto-Submitted: auto-generated The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=8aafb5f26d638d8bfd4b14d4d83a5ce04f47e46f commit 8aafb5f26d638d8bfd4b14d4d83a5ce04f47e46f Author: Yuri Victorovich AuthorDate: 2024-02-12 08:08:37 +0000 Commit: Yuri Victorovich CommitDate: 2024-02-12 20:07:33 +0000 science/py-spglib: Build using PEP517 tools instead of cmake --- science/py-spglib/Makefile | 16 ++++------ science/py-spglib/files/patch-CMakeLists.txt | 42 -------------------------- science/py-spglib/files/patch-spglib_spglib.py | 31 ------------------- science/py-spglib/files/quick-test.py | 39 ------------------------ science/py-spglib/pkg-plist | 3 -- 5 files changed, 6 insertions(+), 125 deletions(-) diff --git a/science/py-spglib/Makefile b/science/py-spglib/Makefile index b9208a124902..044f6101b4ed 100644 --- a/science/py-spglib/Makefile +++ b/science/py-spglib/Makefile @@ -1,6 +1,7 @@ PORTNAME= spglib DISTVERSIONPREFIX= v DISTVERSION= 2.3.1 +PORTREVISION= 1 CATEGORIES= science python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -12,18 +13,17 @@ LICENSE= BSD3CLAUSE 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} \ + ${PYTHON_PKGNAMEPREFIX}pyproject-metadata>0:devel/py-pyproject-metadata@${PY_FLAVOR} \ + cmake:devel/cmake-core \ ${PYNUMPY} -LIB_DEPENDS= libsymspg.so:science/spglib RUN_DEPENDS= ${PYNUMPY} -USES= cmake python -USE_PYTHON= flavors pytest # tests fail to run, see https://github.com/spglib/spglib/issues/192 +USES= python +USE_PYTHON= pep517 autoplist pytest # tests fail to run, see https://github.com/spglib/spglib/issues/192 USE_GITHUB= yes CMAKE_ARGS= -DPython3_EXECUTABLE=${PYTHON_CMD} -WRKSRC_SUBDIR= python - MAKE_ENV= SETUPTOOLS_SCM_PRETEND_VERSION=${DISTVERSION} TEST_WRKSRC= ${WRKSRC} @@ -33,10 +33,6 @@ post-patch: ##@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 + @${REINPLACE_CMD} -i '' -e 's|^from ._version import|#&|' ${WRKSRC}/python/spglib/__init__.py .include diff --git a/science/py-spglib/files/patch-CMakeLists.txt b/science/py-spglib/files/patch-CMakeLists.txt deleted file mode 100644 index 7c42c23d1d4b..000000000000 --- a/science/py-spglib/files/patch-CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ ---- CMakeLists.txt.orig 2024-02-11 01:27:19 UTC -+++ CMakeLists.txt -@@ -1,8 +1,13 @@ -+cmake_minimum_required(VERSION 3.15) -+ -+find_package(Spglib REQUIRED) -+find_package(Python3 COMPONENTS REQUIRED Interpreter Development.Module NumPy) -+ - Python3_add_library(Spglib_python MODULE WITH_SOABI _spglib.c) - set_target_properties(Spglib_python PROPERTIES - OUTPUT_NAME _spglib) - target_link_libraries(Spglib_python PRIVATE -- Spglib_symspg Python3::NumPy) -+ Spglib::symspg Python3::NumPy) - if (NOT Python_INSTALL_DIR) - if (SKBUILD) - # If built with scikit-build-core, let it handle the installation -@@ -12,16 +17,16 @@ endif () - set(Python_INSTALL_DIR ${Python3_SITEARCH}/spglib) - endif () - endif () --if (SPGLIB_INSTALL) -+if (TRUE) - # 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 - ) diff --git a/science/py-spglib/files/patch-spglib_spglib.py b/science/py-spglib/files/patch-spglib_spglib.py deleted file mode 100644 index bbe9f70d0a64..000000000000 --- a/science/py-spglib/files/patch-spglib_spglib.py +++ /dev/null @@ -1,31 +0,0 @@ ---- 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 deleted file mode 100644 index c73b1e342b42..000000000000 --- a/science/py-spglib/files/quick-test.py +++ /dev/null @@ -1,39 +0,0 @@ -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/py-spglib/pkg-plist b/science/py-spglib/pkg-plist deleted file mode 100644 index 55a2e8a2dc92..000000000000 --- a/science/py-spglib/pkg-plist +++ /dev/null @@ -1,3 +0,0 @@ -%%PYTHON_SITELIBDIR%%/spglib/__init__.py -%%PYTHON_SITELIBDIR%%/spglib/_spglib%%PYTHON_EXT_SUFFIX%%.so -%%PYTHON_SITELIBDIR%%/spglib/spglib.py