diff options
author | Vinicius Monego <monego@posteo.net> | 2025-03-31 01:49:43 +0000 |
---|---|---|
committer | Andreas Enge <andreas@enge.fr> | 2025-03-31 16:53:27 +0200 |
commit | 61f8719366c7f71d59117f0ebb1009c8a784e045 (patch) | |
tree | 08232ffd1c96c90a286d8bf67a0f512540c66fc7 | |
parent | 3489c0995c983a3ccb6e2aca1637be9a9d641be4 (diff) |
gnu: grass: Improve package style.
* gnu/packages/geo.scm (grass)[arguments]: Use gexps.
<#:phases>: Use #:configure-flags instead of overriding the 'configure
phase.
Change-Id: I52b39f0cd5ad507dfe5dbb5c8040dfe4eb69b18c
-rw-r--r-- | gnu/packages/geo.scm | 127 |
1 files changed, 62 insertions, 65 deletions
diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm index 432256b970..e2d67cda18 100644 --- a/gnu/packages/geo.scm +++ b/gnu/packages/geo.scm @@ -3261,74 +3261,71 @@ orienteering sport.") flex pkg-config)) (arguments - `(#:tests? #f ; No tests - #:modules ((guix build gnu-build-system) + (list + #:tests? #f ; No tests + #:modules `((guix build gnu-build-system) ((guix build python-build-system) #:prefix python:) (guix build utils)) - #:imported-modules (,@%default-gnu-imported-modules + #:imported-modules `(,@%default-gnu-imported-modules (guix build python-build-system)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'fix-lapack - (lambda _ - (substitute* "./configure" - (("-lblas") "-lopenblas") - (("-llapack") "-lopenblas")))) - (replace 'configure - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((shell (search-input-file inputs "/bin/bash"))) - (setenv "SHELL" shell) - (setenv "CONFIG_SHELL" shell) - (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl," - (assoc-ref outputs "out") - "/" ,grassxx "/lib"))) - (invoke "./configure" - (string-append "--prefix=" - (assoc-ref outputs "out")) - "--with-blas" - "--with-bzlib" - (string-append - "--with-freetype-includes=" - (search-input-directory inputs "/include/freetype2")) - (string-append - "--with-freetype-libs=" - (dirname - (search-input-file inputs "/lib/libfreetype.so"))) - "--with-geos" - "--with-lapack" - "--with-mysql" - (string-append - "--with-mysql-includes=" - (search-input-directory inputs "/include/mysql")) - (string-append - "--with-mysql-libs=" - (dirname - (search-input-file inputs "/lib/libmariadb.so"))) - "--with-netcdf" - "--with-postgres" - (string-append - "--with-proj-share=" - (search-input-directory inputs "/share/proj")) - "--with-pthread" - "--with-readline" - "--with-sqlite" - "--with-wxwidgets"))) - (add-after 'install 'install-links - (lambda* (#:key outputs #:allow-other-keys) - ;; Put links for includes and libraries in the standard places. - (let* ((out (assoc-ref outputs "out")) - (dir (string-append out "/" ,grassxx))) - (symlink (string-append dir "/include") - (string-append out "/include")) - (symlink (string-append dir "/lib") - (string-append out "/lib"))))) - (add-after 'install-links 'python:wrap - (assoc-ref python:%standard-phases 'wrap)) - (add-after 'python:wrap 'wrap-with-python-interpreter - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (wrap-program (string-append out "/bin/" ,grassxx) - `("GRASS_PYTHON" = (,(which "python3")))))))))) + #:configure-flags + #~(list "--with-blas" + "--with-bzlib" + (string-append + "--with-freetype-includes=" + (search-input-directory %build-inputs "/include/freetype2")) + (string-append + "--with-freetype-libs=" + (dirname + (search-input-file %build-inputs "/lib/libfreetype.so"))) + "--with-geos" + "--with-lapack" + "--with-mysql" + (string-append + "--with-mysql-includes=" + (search-input-directory %build-inputs "/include/mysql")) + (string-append + "--with-mysql-libs=" + (dirname + (search-input-file %build-inputs "/lib/libmariadb.so"))) + "--with-netcdf" + "--with-postgres" + (string-append + "--with-proj-share=" + (search-input-directory %build-inputs "/share/proj")) + "--with-pthread" + "--with-readline" + "--with-sqlite" + "--with-wxwidgets" + (string-append + "SHELL=" + (search-input-file %build-inputs "/bin/bash")) + (string-append + "CONFIG_SHELL=" + (search-input-file %build-inputs "/bin/bash")) + (string-append "LDFLAGS=-Wl,-rpath -Wl," + #$output "/" #$grassxx "/lib")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-lapack + (lambda _ + (substitute* "./configure" + (("-lblas") "-lopenblas") + (("-llapack") "-lopenblas")))) + (add-after 'install 'install-links + (lambda _ + ;; Put links for includes and libraries in the standard places. + (let ((dir (string-append #$output "/" #$grassxx))) + (symlink (string-append dir "/include") + (string-append #$output "/include")) + (symlink (string-append dir "/lib") + (string-append #$output "/lib"))))) + (add-after 'install-links 'python:wrap + (assoc-ref python:%standard-phases 'wrap)) + (add-after 'python:wrap 'wrap-with-python-interpreter + (lambda _ + (wrap-program (string-append #$output "/bin/" #$grassxx) + `("GRASS_PYTHON" = (,(which "python3"))))))))) (synopsis "GRASS Geographic Information System") (description "GRASS (Geographic Resources Analysis Support System), is a Geographic |