1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

gnu: python-brille: Switch to pyproject.

* gnu/packages/physics.scm (python-brille):
[arguments]<#:modules>: Switch to pyproject-build-system.
<#:phases>: Remove with-extensions wrapper.

Change-Id: I2f02c1a1b3ef5c5b5c92e6db5e4a075111b3a5b1
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Nicolas Graves
2026-03-24 00:27:46 +01:00
committed by Sharlatan Hellseher
parent 34efd7d3b4
commit 143e5e0c15

View File

@@ -186,41 +186,40 @@ such components.")
(list
#:configure-flags
#~(list
;; Boost.System is header-only since 1.69, but FindBoost looks for
;; libboost_system.so which doesn't exist.
"-DHIGHFIVE_USE_BOOST=OFF"
;; Pretend we're doing a scikit-build build to skip Conan.
"-DSKBUILD=ON"
(string-append "-DSKBUILD_PROJECT_NAME=brille")
(string-append "-DSKBUILD_PROJECT_VERSION=" #$version))
#:imported-modules `(,@%cmake-build-system-modules
,@%pyproject-build-system-modules)
;; Boost.System is header-only since 1.69, but FindBoost looks for
;; libboost_system.so which doesn't exist.
"-DHIGHFIVE_USE_BOOST=OFF"
;; Pretend we're doing a scikit-build build to skip Conan.
"-DSKBUILD=ON"
(string-append "-DSKBUILD_PROJECT_NAME=brille")
(string-append "-DSKBUILD_PROJECT_VERSION=" #$version))
#:imported-modules (append %cmake-build-system-modules
%pyproject-build-system-modules)
#:modules '((guix build cmake-build-system)
((guix build python-build-system) #:select (site-packages))
((guix build pyproject-build-system) #:select (site-packages))
(guix build utils))
#:phases
(with-extensions (list (pyproject-guile-json))
#~(modify-phases %standard-phases
(add-after 'unpack 'create-pkg-info
(lambda _
;; Create PKG-INFO so DynamicVersion.cmake finds version without git.
(call-with-output-file "PKG-INFO"
(lambda (port)
(format port "Metadata-Version: 2.1
#~(modify-phases %standard-phases
(add-after 'unpack 'create-pkg-info
(lambda _
;; Create PKG-INFO so DynamicVersion.cmake finds version without git.
(call-with-output-file "PKG-INFO"
(lambda (port)
(format port "Metadata-Version: 2.1
Name: brille
Version: ~a
" #$version)))))
(add-after 'install 'install-python
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((site-packages (site-packages inputs outputs)))
(mkdir-p (string-append site-packages "/brille"))
;; Install Python source files and compiled extension module.
(for-each (lambda (file)
(install-file file
(string-append site-packages "/brille")))
(append
(find-files "../source/brille" "\\.py$")
(find-files "." "^_brille\\..*\\.so$"))))))))))
(add-after 'install 'install-python
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((site-packages (site-packages inputs outputs)))
(mkdir-p (string-append site-packages "/brille"))
;; Install Python source files and compiled extension module.
(for-each (lambda (file)
(install-file file
(string-append site-packages "/brille")))
(append
(find-files "../source/brille" "\\.py$")
(find-files "." "^_brille\\..*\\.so$")))))))))
(native-inputs
(list catch2-3
cmake-minimal