gnu: netcdf: Remove input labels and use gexps.

* gnu/packages/maths.scm (netcdf)[inputs]: Remove labels.
[arguments]: Use gexps.
(netcdf-parallel-openmpi): Use ‘package/inherit’.
[inputs]: Remove labels.
[arguments]: Use gexps.

Change-Id: Ibf133cd3eea20cbaf7c3d2e407370225f8716d10
This commit is contained in:
Ludovic Courtès 2024-10-04 13:44:18 +02:00 committed by Ludovic Courtès
parent a227a6efb5
commit 51868735f3
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -2303,44 +2303,45 @@ similar to MATLAB, GNU Octave or SciPy.")
(native-inputs (native-inputs
(list m4 doxygen graphviz)) (list m4 doxygen graphviz))
(inputs (inputs
`(("curl" ,curl) (list curl
("hdf4" ,hdf4-alt) hdf4-alt
("hdf5" ,hdf5) hdf5
("libjpeg" ,libjpeg-turbo) libjpeg-turbo
("libxml2" ,libxml2) libxml2
("unzip" ,unzip) unzip
("zlib" ,zlib))) zlib))
(arguments (arguments
`(#:configure-flags '("--enable-doxygen" (list #:configure-flags
"--enable-dot" #~'("--enable-doxygen" "--enable-dot"
"--enable-hdf4" "--enable-hdf4" "--disable-dap-remote-tests")
"--disable-dap-remote-tests")
#:phases (modify-phases %standard-phases #:phases
(add-before 'configure 'fix-source-date #~(modify-phases %standard-phases
(lambda _ (add-before 'configure 'fix-source-date
;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build (lambda _
;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
;; to '1st hour of the current day', and therefore makes the ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
;; package not reproducible. ;; to '1st hour of the current day', and therefore makes the
(substitute* "./configure" ;; package not reproducible.
(("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"") (substitute* "./configure"
"date --date='@0'")))) (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
(add-after 'configure 'patch-settings "date --date='@0'"))))
(lambda _ (add-after 'configure 'patch-settings
;; libnetcdf.settings contains the full filename of the compilers (lambda _
;; used to build the library. We truncate the hashes of those ;; libnetcdf.settings contains the full filename of the compilers
;; filenames to avoid unnecessary references to the corresponding ;; used to build the library. We truncate the hashes of those
;; store items. ;; filenames to avoid unnecessary references to the corresponding
(substitute* "libnetcdf.settings" ;; store items.
(("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash) (substitute* "libnetcdf.settings"
(string-append prefix (string-take hash 10) "..."))))) (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash)
(add-before 'check 'fix-test-rcmerge (string-append prefix
(lambda _ (string-take hash 10) "...")))))
;; Set HOME, to fix the test-rcmerge test. (add-before 'check 'fix-test-rcmerge
(setenv "HOME" "/tmp")))) (lambda _
;; Set HOME, to fix the test-rcmerge test.
(setenv "HOME" "/tmp"))))
#:parallel-tests? #f)) ;various race conditions #:parallel-tests? #f)) ;various race conditions
(home-page "https://www.unidata.ucar.edu/software/netcdf/") (home-page "https://www.unidata.ucar.edu/software/netcdf/")
(synopsis "Library for scientific data") (synopsis "Library for scientific data")
(description "NetCDF is an interface for scientific data access and a (description "NetCDF is an interface for scientific data access and a
@ -2382,29 +2383,29 @@ Unidata's NetCDF, files in classic formats, specifically the formats of CDF-1, 2
(license (license:x11-style "file://COPYRIGHT")))) (license (license:x11-style "file://COPYRIGHT"))))
(define-public netcdf-parallel-openmpi (define-public netcdf-parallel-openmpi
(package (inherit netcdf) (package/inherit netcdf
(name "netcdf-parallel-openmpi") (name "netcdf-parallel-openmpi")
(inputs (inputs (modify-inputs (package-inputs netcdf)
`(("mpi" ,openmpi) (append openmpi pnetcdf)
("pnetcdf" ,pnetcdf) (replace "hdf5" hdf5-parallel-openmpi)))
,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
(package-inputs netcdf))))
;; TODO: Replace pkg-config references in nc-config with absolute references ;; TODO: Replace pkg-config references in nc-config with absolute references
(arguments (arguments
(substitute-keyword-arguments (package-arguments netcdf) (substitute-keyword-arguments (package-arguments netcdf)
((#:configure-flags flags) ((#:configure-flags flags)
`(cons* "CC=mpicc" "CXX=mpicxx" #~(cons* "CC=mpicc"
"--enable-parallel-tests" "CXX=mpicxx"
;; Enable support of CDF-1, 2 and 5 formats. "--enable-parallel-tests"
"--enable-pnetcdf" ;; Enable support of CDF-1, 2 and 5 formats.
;; NetCDF supports both parallel and shared library building "--enable-pnetcdf"
;; See https://docs.unidata.ucar.edu/nug/current/getting_and_building_netcdf.html#build_parallel ;; NetCDF supports both parallel and shared library building
"--enable-shared" "--with-pic" ;; See https://docs.unidata.ucar.edu/nug/current/getting_and_building_netcdf.html#build_parallel
,flags)) "--enable-shared"
((#:phases phases '%standard-phases) "--with-pic"
`(modify-phases ,phases #$flags))
(add-after 'build 'mpi-setup ((#:phases phases #~%standard-phases)
,%openmpi-setup))))))) #~(modify-phases #$phases
(add-after 'build 'mpi-setup
#$%openmpi-setup)))))))
(define-public netcdf-fortran (define-public netcdf-fortran
(package (package