1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-06-10 12:58:55 +02:00

gnu: r-rhdf5lib: Use G-expressions and fix test instead of disabling it.

* gnu/packages/bioconductor.scm (r-rhdf5lib)[arguments]: Use G-expressions;
fix library version check instead of disabling the test.

Change-Id: I78e8cfd9d2588517b0911dde5fc8aa53d4f67892
This commit is contained in:
Ricardo Wurmus
2026-04-07 10:29:42 +02:00
parent 958d5387bb
commit dc4c04a435
+57 -52
View File
@@ -25662,59 +25662,64 @@ block processing.")
. ("r-mockery"))))
(build-system r-build-system)
(arguments
`(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'do-not-use-bundled-hdf5
(lambda* (#:key inputs #:allow-other-keys)
(for-each delete-file '("configure" "configure.ac"))
(substitute* "R/zzz.R"
(("return\\(links\\)") "return(\" -lz\")"))
(with-directory-excursion "src"
(invoke "tar" "xvf" (assoc-ref inputs "hdf5-source"))
(rename-file (string-append "hdf5-" ,(package-version hdf5-1.10))
"hdf5")
;; Remove timestamp and host system information to make
;; the build reproducible.
(substitute* "hdf5/src/libhdf5.settings.in"
(("Configured on: @CONFIG_DATE@")
"Configured on: Guix")
(("Uname information:.*")
"Uname information: Linux\n")
;; Remove unnecessary store reference.
(("C Compiler:.*")
"C Compiler: GCC\n"))
(rename-file "hdf5/src/libhdf5.settings.in"
"hdf5/src/libhdf5.settings")
(rename-file "Makevars.in" "Makevars")
(substitute* "Makevars"
(("@BUILD_HDF5@") "")
(("@COPY_SZIP@") "")
(("HDF5_CXX_LIB=.*")
(string-append "HDF5_CXX_LIB="
(assoc-ref inputs "hdf5") "/lib/libhdf5_cpp.a\n"))
(("HDF5_LIB=.*")
(string-append "HDF5_LIB="
(assoc-ref inputs "hdf5") "/lib/libhdf5.a\n"))
(("HDF5_CXX_INCLUDE=.*") "HDF5_CXX_INCLUDE=./hdf5/c++/src\n")
(("HDF5_INCLUDE=.*") "HDF5_INCLUDE=./hdf5/src\n")
(("HDF5_HL_INCLUDE=.*") "HDF5_HL_INCLUDE=./hdf5/hl/src\n")
(("HDF5_HL_CXX_INCLUDE=.*") "HDF5_HL_CXX_INCLUDE=./hdf5/hl/c++/src\n")
(("HDF5_HL_LIB=.*")
(string-append "HDF5_HL_LIB="
(assoc-ref inputs "hdf5") "/lib/libhdf5_hl.a\n"))
(("HDF5_HL_CXX_LIB=.*")
(string-append "HDF5_HL_CXX_LIB="
(assoc-ref inputs "hdf5") "/lib/libhdf5_hl_cpp.a\n"))
(("@ZLIB_LIB_PATH@") "-lz")
(("@ZLIB_INCLUDE_PATH@") "")
(list
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'do-not-use-bundled-hdf5
(lambda* (#:key inputs #:allow-other-keys)
(for-each delete-file '("configure" "configure.ac"))
(substitute* "R/zzz.R"
(("return\\(links\\)") "return(\" -lz\")"))
(with-directory-excursion "src"
(invoke "tar" "xvf" (assoc-ref inputs "hdf5-source"))
(rename-file (string-append "hdf5-" #$(package-version hdf5-1.10))
"hdf5")
;; Remove timestamp and host system information to make
;; the build reproducible.
(substitute* "hdf5/src/libhdf5.settings.in"
(("Configured on: @CONFIG_DATE@")
"Configured on: Guix")
(("Uname information:.*")
"Uname information: Linux\n")
;; Remove unnecessary store reference.
(("C Compiler:.*")
"C Compiler: GCC\n"))
(rename-file "hdf5/src/libhdf5.settings.in"
"hdf5/src/libhdf5.settings")
(rename-file "Makevars.in" "Makevars")
(substitute* "Makevars"
(("@BUILD_HDF5@") "")
(("@COPY_SZIP@") "")
(("HDF5_CXX_LIB=.*")
(string-append "HDF5_CXX_LIB="
#$(this-package-input "hdf5") "/lib/libhdf5_cpp.a\n"))
(("HDF5_LIB=.*")
(string-append "HDF5_LIB="
#$(this-package-input "hdf5") "/lib/libhdf5.a\n"))
(("HDF5_CXX_INCLUDE=.*") "HDF5_CXX_INCLUDE=./hdf5/c++/src\n")
(("HDF5_INCLUDE=.*") "HDF5_INCLUDE=./hdf5/src\n")
(("HDF5_HL_INCLUDE=.*") "HDF5_HL_INCLUDE=./hdf5/hl/src\n")
(("HDF5_HL_CXX_INCLUDE=.*") "HDF5_HL_CXX_INCLUDE=./hdf5/hl/c++/src\n")
(("HDF5_HL_LIB=.*")
(string-append "HDF5_HL_LIB="
#$(this-package-input "hdf5")
"/lib/libhdf5_hl.a\n"))
(("HDF5_HL_CXX_LIB=.*")
(string-append "HDF5_HL_CXX_LIB="
#$(this-package-input "hdf5")
"/lib/libhdf5_hl_cpp.a\n"))
(("@ZLIB_LIB_PATH@") "-lz")
(("@ZLIB_INCLUDE_PATH@") "")
;; szip is non-free software
(("cp \"\\$\\{SZIP_LIB\\}.*") "")
(("PKG_LIBS =.*") "PKG_LIBS = -lz -lhdf5\n")))))
(add-after 'unpack 'disable-bad-test
(lambda _
;; This tests for a specific minor version of HDF5.
(delete-file "inst/tinytest/test_library_version.R"))))))
;; szip is non-free software
(("cp \"\\$\\{SZIP_LIB\\}.*") "")
(("PKG_LIBS =.*") "PKG_LIBS = -lz -lhdf5\n")))))
(add-after 'unpack 'fix-bad-test
(lambda _
;; This tests for a specific minor version of HDF5.
(substitute* "inst/tinytest/test_library_version.R"
(("1.10.7")
#$(package-version (this-package-input "hdf5")))))))))
(propagated-inputs
(list hdf5-1.10 zlib))
(native-inputs