diff options
| author | Nicolas Graves <ngraves@ngraves.fr> | 2026-01-28 11:35:11 +0100 |
|---|---|---|
| committer | Andreas Enge <andreas@enge.fr> | 2026-02-07 12:28:51 +0100 |
| commit | f3997b9a0f4920e10ccca6ae616bb3ff151d954c (patch) | |
| tree | 8010abe9d1f81bdff70b90411650d92586e4e6ed | |
| parent | 32a4f0613b6602f1f077887f0fca191553c33ddf (diff) | |
gnu: optizelle: Improve style and switch to pyproject.
* gnu/packages/maths.scm (optizelle):
[source]<snippet>: Improve style.
[arguments]<#:imported-modules, #:modules>: Switch to
pyproject-build-system.
<#:phases>: Rewrite phase 'set-numpy-path using the site-packages
procedure.
[inputs, native-inputs]: Drop labels.
Change-Id: I76db3d0353cf95e411cfd11a81b34cf6cd851d05
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
| -rw-r--r-- | gnu/packages/maths.scm | 77 |
1 files changed, 36 insertions, 41 deletions
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index fd8270bd8ad..bd744ae9399 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm | |||
| @@ -10869,55 +10869,50 @@ half-precision floating point formats.") | |||
| 10869 | (("file.*package.*$" all) | 10869 | (("file.*package.*$" all) |
| 10870 | (string-append "# " all)) | 10870 | (string-append "# " all)) |
| 10871 | ((".*[^l].[.]txt\\)\n") "") | 10871 | ((".*[^l].[.]txt\\)\n") "") |
| 10872 | (("add_license.*\"\n") "")) | 10872 | (("add_license.*\"\n") "")))))) |
| 10873 | #t)))) | ||
| 10874 | (build-system cmake-build-system) | 10873 | (build-system cmake-build-system) |
| 10875 | (arguments | 10874 | (arguments |
| 10876 | `(#:imported-modules ((guix build python-build-system) | 10875 | (list |
| 10877 | ,@%cmake-build-system-modules) | 10876 | #:imported-modules (append %cmake-build-system-modules |
| 10878 | #:modules (((guix build python-build-system) #:select | 10877 | %pyproject-build-system-modules) |
| 10879 | (python-version)) | 10878 | #:modules `(((guix build pyproject-build-system) #:prefix py:) |
| 10880 | (guix build cmake-build-system) | 10879 | (guix build cmake-build-system) |
| 10881 | (guix build utils)) | 10880 | (guix build utils)) |
| 10882 | #:configure-flags `("-DCMAKE_CXX_FLAGS:STRING=-pthread" | 10881 | #:configure-flags |
| 10883 | "-DENABLE_CPP_UNIT:BOOL=ON" | 10882 | #~(list "-DCMAKE_CXX_FLAGS:STRING=-pthread" |
| 10884 | "-DENABLE_CPP_EXAMPLES:BOOL=ON" | 10883 | "-DENABLE_CPP_UNIT:BOOL=ON" |
| 10885 | "-DENABLE_PYTHON:BOOL=ON" | 10884 | "-DENABLE_CPP_EXAMPLES:BOOL=ON" |
| 10886 | "-DENABLE_PYTHON_UNIT:BOOL=ON" | 10885 | "-DENABLE_PYTHON:BOOL=ON" |
| 10887 | "-DENABLE_PYTHON_EXAMPLES:BOOL=ON" | 10886 | "-DENABLE_PYTHON_UNIT:BOOL=ON" |
| 10888 | ,(string-append "-DBLAS_LIBRARY:FILEPATH=" | 10887 | "-DENABLE_PYTHON_EXAMPLES:BOOL=ON" |
| 10889 | (assoc-ref %build-inputs | 10888 | (string-append "-DBLAS_LIBRARY:FILEPATH=" |
| 10890 | "blas/lapack") | 10889 | (search-input-file %build-inputs |
| 10891 | "/lib/libopenblas.so") | 10890 | "/lib/libopenblas.so")) |
| 10892 | ,(string-append "-DLAPACK_LIBRARY:FILEPATH=" | 10891 | (string-append "-DLAPACK_LIBRARY:FILEPATH=" |
| 10893 | (assoc-ref %build-inputs | 10892 | (search-input-file %build-inputs |
| 10894 | "fortran:lib") | 10893 | "/lib/libgfortran.so") |
| 10895 | "/lib/libgfortran.so;" | 10894 | ";" (search-input-file %build-inputs |
| 10896 | (assoc-ref %build-inputs | 10895 | "/lib/libquadmath.so"))) |
| 10897 | "fortran:lib") | 10896 | #:phases |
| 10898 | "/lib/libquadmath.so")) | 10897 | #~(modify-phases %standard-phases |
| 10899 | #:phases | 10898 | (add-after 'unpack 'set-numpy-path ; Needed for the unit tests. |
| 10900 | (modify-phases %standard-phases | 10899 | (lambda* (#:key inputs #:allow-other-keys) |
| 10901 | (add-after 'unpack 'set-numpy-path ; Needed for the unit tests. | 10900 | (let* ((numpy-out (dirname (dirname (which "numpy-config")))) |
| 10902 | (lambda* (#:key inputs #:allow-other-keys) | 10901 | (outputs (list (cons "out" numpy-out)))) |
| 10903 | (let* ((pyver (python-version (assoc-ref inputs "python"))) | ||
| 10904 | (npdir (string-append (assoc-ref inputs "numpy") | ||
| 10905 | "/lib/python" pyver | ||
| 10906 | "/site-packages"))) | ||
| 10907 | (substitute* "src/cmake/Modules/Optizelle.cmake" | 10902 | (substitute* "src/cmake/Modules/Optizelle.cmake" |
| 10908 | (("PYTHONPATH=") | 10903 | (("PYTHONPATH=") |
| 10909 | (string-append "LD_LIBRARY_PATH=$ENV{LIBRARY_PATH};" | 10904 | (string-append |
| 10910 | "PYTHONPATH=" npdir ":")))))) | 10905 | "LD_LIBRARY_PATH=$ENV{LIBRARY_PATH};" |
| 10911 | (delete 'install-license-files)))) ; LICENSE.txt is installed. | 10906 | "PYTHONPATH=" (py:site-packages inputs outputs) ":")))))) |
| 10907 | (delete 'install-license-files)))) ; LICENSE.txt is installed. | ||
| 10912 | (inputs | 10908 | (inputs |
| 10913 | `(("blas/lapack" ,openblas) | 10909 | (list openblas |
| 10914 | ("fortran:lib" ,gfortran "lib") | 10910 | (list gfortran "lib") |
| 10915 | ("jsoncpp" ,jsoncpp) | 10911 | jsoncpp |
| 10916 | ("numpy" ,python-numpy) | 10912 | python-numpy |
| 10917 | ("python" ,python))) | 10913 | python)) |
| 10918 | (native-inputs | 10914 | (native-inputs |
| 10919 | `(("fortran" ,gfortran) | 10915 | (list gfortran pkg-config)) |
| 10920 | ("pkg-config" ,pkg-config))) | ||
| 10921 | (home-page "https://www.optimojoe.com/products/optizelle/") | 10916 | (home-page "https://www.optimojoe.com/products/optizelle/") |
| 10922 | (synopsis "Mathematical optimization library") | 10917 | (synopsis "Mathematical optimization library") |
| 10923 | (description "@code{optizelle} is a software library designed to | 10918 | (description "@code{optizelle} is a software library designed to |
