From 2e7ae98c245ddb9fd2181260a4be7c47116bdc77 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Fri, 13 Feb 2026 11:05:28 +0000 Subject: [PATCH] gnu: python-brille: Move to (gnu packages physics). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/python-science.scm (python-brille): Move from here… * gnu/packages/physics.scm (python-brille): …to here. * gnu/local.mk (GNU_SYSTEM_MODULES): Add reference to that file. * etc/teams.scm (science): Add reference to that file. Change-Id: I207940441fb4406fb034d5582ba9f5517544179b --- CODEOWNERS | 1 + etc/teams.scm | 1 + gnu/local.mk | 1 + gnu/packages/physics.scm | 119 ++++++++++++++++++++++++++++++++ gnu/packages/python-science.scm | 77 --------------------- 5 files changed, 122 insertions(+), 77 deletions(-) create mode 100644 gnu/packages/physics.scm diff --git a/CODEOWNERS b/CODEOWNERS index 83b3dafbdd..66ffe55496 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -373,6 +373,7 @@ gnu/packages/graph\.scm @guix/science gnu/packages/lean\.scm @guix/science gnu/packages/maths\.scm @guix/science gnu/packages/medical\.scm @guix/science +gnu/packages/physics\.scm @guix/science gnu/packages/sagemath\.scm @guix/science gnu/packages/statistics\.scm @guix/science diff --git a/etc/teams.scm b/etc/teams.scm index 2445c25aa8..58c05282ef 100755 --- a/etc/teams.scm +++ b/etc/teams.scm @@ -1044,6 +1044,7 @@ packages (e.g. Astronomy, Chemistry, Math, Physics etc.)" "gnu/packages/lean.scm" "gnu/packages/maths.scm" "gnu/packages/medical.scm" + "gnu/packages/physics.scm" "gnu/packages/sagemath.scm" "gnu/packages/statistics.scm"))) diff --git a/gnu/local.mk b/gnu/local.mk index c7f45dd4d2..13d878373f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -549,6 +549,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/phabricator.scm \ %D%/packages/php.scm \ %D%/packages/php-xyz.scm \ + %D%/packages/physics.scm \ %D%/packages/piet.scm \ %D%/packages/diagram.scm \ %D%/packages/pkg-config.scm \ diff --git a/gnu/packages/physics.scm b/gnu/packages/physics.scm new file mode 100644 index 0000000000..4847e43095 --- /dev/null +++ b/gnu/packages/physics.scm @@ -0,0 +1,119 @@ +;;; Copyright © 2026 Danny Milosavljevic +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages physics) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system cmake) + #:use-module (guix build-system pyproject) + #:use-module ((guix build-system python) #:select (pypi-uri)) + #:use-module (guix build-system qt) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (gnu packages) + #:use-module (gnu packages check) + #:use-module (gnu packages cmake) + #:use-module (gnu packages maths) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-check) + #:use-module (gnu packages python-compression) + #:use-module (gnu packages python-crypto) + #:use-module (gnu packages python-graphics) + #:use-module (gnu packages python-science) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages qt)) + +(define-public python-brille + (package + (name "python-brille") + (version "0.8.3") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/brille/brille") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1vyxa7k6yrpxizbmljrv7bnsf7dzxsfbs4id36x09jjxwh7dysjj")))) + (build-system cmake-build-system) + (arguments + (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) + #:modules '((guix build cmake-build-system) + ((guix build python-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 +Name: brille +Version: ~a +" #$version))))) + (add-before 'configure 'set-version + (lambda _ + (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$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$")))))))))) + (native-inputs + (list catch2-3 + cmake-minimal + highfive + pybind11 + python-wrapper + python-setuptools + python-setuptools-scm)) + (inputs + (list hdf5)) + (propagated-inputs + (list python-numpy)) + (home-page "https://github.com/brille/brille") + (synopsis "Symmetry operations and interpolation in Brillouin zones") + (description + "Brille is a C++ library for symmetry operations and linear interpolation +within an irreducible part of the first Brillouin zone. It provides Python +bindings via pybind11 for use in phonon calculations and inelastic neutron +scattering simulations.") + (license license:agpl3+))) diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm index 798ad52e9e..aded33595f 100644 --- a/gnu/packages/python-science.scm +++ b/gnu/packages/python-science.scm @@ -6498,83 +6498,6 @@ Python style, together with a fast and comfortable execution environment.") python-setuptools python-wheel)))) -(define-public python-brille - (package - (name "python-brille") - (version "0.8.3") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/brille/brille") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "1vyxa7k6yrpxizbmljrv7bnsf7dzxsfbs4id36x09jjxwh7dysjj")))) - (build-system cmake-build-system) - (arguments - (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) - #:modules '((guix build cmake-build-system) - ((guix build python-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 -Name: brille -Version: ~a -" #$version))))) - (add-before 'configure 'set-version - (lambda _ - (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$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$")))))))))) - (native-inputs - (list catch2-3 - cmake-minimal - highfive - pybind11 - python-wrapper - python-setuptools - python-setuptools-scm)) - (inputs - (list hdf5)) - (propagated-inputs - (list python-numpy)) - (home-page "https://github.com/brille/brille") - (synopsis "Symmetry operations and interpolation in Brillouin zones") - (description - "Brille is a C++ library for symmetry operations and linear interpolation -within an irreducible part of the first Brillouin zone. It provides Python -bindings via pybind11 for use in phonon calculations and inelastic neutron -scattering simulations.") - (license license:agpl3+))) - (define-public python-spglib (package (name "python-spglib")