From 51868735f343c487d3a1a66bc3ef49926749e424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 4 Oct 2024 13:44:18 +0200 Subject: gnu: netcdf: Remove input labels and use gexps. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- gnu/packages/maths.scm | 107 +++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 53 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index f4edd546e2..2106d73ef1 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2303,44 +2303,45 @@ similar to MATLAB, GNU Octave or SciPy.") (native-inputs (list m4 doxygen graphviz)) (inputs - `(("curl" ,curl) - ("hdf4" ,hdf4-alt) - ("hdf5" ,hdf5) - ("libjpeg" ,libjpeg-turbo) - ("libxml2" ,libxml2) - ("unzip" ,unzip) - ("zlib" ,zlib))) + (list curl + hdf4-alt + hdf5 + libjpeg-turbo + libxml2 + unzip + zlib)) (arguments - `(#:configure-flags '("--enable-doxygen" - "--enable-dot" - "--enable-hdf4" - "--disable-dap-remote-tests") + (list #:configure-flags + #~'("--enable-doxygen" "--enable-dot" + "--enable-hdf4" "--disable-dap-remote-tests") - #:phases (modify-phases %standard-phases - (add-before 'configure 'fix-source-date - (lambda _ - ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build - ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate - ;; to '1st hour of the current day', and therefore makes the - ;; package not reproducible. - (substitute* "./configure" - (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"") - "date --date='@0'")))) - (add-after 'configure 'patch-settings - (lambda _ - ;; libnetcdf.settings contains the full filename of the compilers - ;; used to build the library. We truncate the hashes of those - ;; filenames to avoid unnecessary references to the corresponding - ;; store items. - (substitute* "libnetcdf.settings" - (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash) - (string-append prefix (string-take hash 10) "..."))))) - (add-before 'check 'fix-test-rcmerge - (lambda _ - ;; Set HOME, to fix the test-rcmerge test. - (setenv "HOME" "/tmp")))) + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'fix-source-date + (lambda _ + ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build + ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate + ;; to '1st hour of the current day', and therefore makes the + ;; package not reproducible. + (substitute* "./configure" + (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"") + "date --date='@0'")))) + (add-after 'configure 'patch-settings + (lambda _ + ;; libnetcdf.settings contains the full filename of the compilers + ;; used to build the library. We truncate the hashes of those + ;; filenames to avoid unnecessary references to the corresponding + ;; store items. + (substitute* "libnetcdf.settings" + (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash) + (string-append prefix + (string-take hash 10) "..."))))) + (add-before 'check 'fix-test-rcmerge + (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/") (synopsis "Library for scientific data") (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")))) (define-public netcdf-parallel-openmpi - (package (inherit netcdf) + (package/inherit netcdf (name "netcdf-parallel-openmpi") - (inputs - `(("mpi" ,openmpi) - ("pnetcdf" ,pnetcdf) - ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi) - (package-inputs netcdf)))) + (inputs (modify-inputs (package-inputs netcdf) + (append openmpi pnetcdf) + (replace "hdf5" hdf5-parallel-openmpi))) ;; TODO: Replace pkg-config references in nc-config with absolute references (arguments (substitute-keyword-arguments (package-arguments netcdf) ((#:configure-flags flags) - `(cons* "CC=mpicc" "CXX=mpicxx" - "--enable-parallel-tests" - ;; Enable support of CDF-1, 2 and 5 formats. - "--enable-pnetcdf" - ;; NetCDF supports both parallel and shared library building - ;; See https://docs.unidata.ucar.edu/nug/current/getting_and_building_netcdf.html#build_parallel - "--enable-shared" "--with-pic" - ,flags)) - ((#:phases phases '%standard-phases) - `(modify-phases ,phases - (add-after 'build 'mpi-setup - ,%openmpi-setup))))))) + #~(cons* "CC=mpicc" + "CXX=mpicxx" + "--enable-parallel-tests" + ;; Enable support of CDF-1, 2 and 5 formats. + "--enable-pnetcdf" + ;; NetCDF supports both parallel and shared library building + ;; See https://docs.unidata.ucar.edu/nug/current/getting_and_building_netcdf.html#build_parallel + "--enable-shared" + "--with-pic" + #$flags)) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'build 'mpi-setup + #$%openmpi-setup))))))) (define-public netcdf-fortran (package -- cgit v1.2.3