From patchwork Sun Apr 6 23:26:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 41382 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1151B27BC4A; Mon, 7 Apr 2025 00:28:47 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AAE5527BC49 for ; Mon, 7 Apr 2025 00:28:45 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u1ZPk-0000BL-LD; Sun, 06 Apr 2025 19:28:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u1ZPH-0008Ub-6M for guix-patches@gnu.org; Sun, 06 Apr 2025 19:28:04 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u1ZPG-00034t-Rt for guix-patches@gnu.org; Sun, 06 Apr 2025 19:28:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=PkodX/EahN0PCcvOLrxxFwQi87meOCzt63DZP1NmI7o=; b=Mm2g8/7q/kpkT5d6xxv0EuCcLkmYeceHCM+pTOpPL9L2ZLPUYy8SiJAi0L1Nyz68yzqfAoSq/8dLTCW7m2cWf2mE2cJS7DlUAZztE61lu+e8mHVtaCED/bhPwcS9fP0ceg1Vwfl8YZZhNW7IyniwVV7hCCWhJKL5G0eAstqJy/K9ucBg3bEAgtY3bOPyBtReAx52yd1UhgCwxiXUeKi1KMEDwaNU/UMjl7qaeWumaCg5DlbL1kTs9VEp/GSmVrJAnf2+i9meMLCAx7Pr4yBgb6IkydQ6yLcOjwhBfBebg7aB9d0UoOWJXbWR+TeQAZPdsVKuW82Nsg9xSzn6LC45lQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u1ZPG-00050E-Kg for guix-patches@gnu.org; Sun, 06 Apr 2025 19:28:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77590] [PATCH 1/3] gnu: hdf5: Update to 1.14.6. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 06 Apr 2025 23:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77590 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77590@debbugs.gnu.org Cc: David Elsing Received: via spool by 77590-submit@debbugs.gnu.org id=B77590.174398204219080 (code B ref 77590); Sun, 06 Apr 2025 23:28:02 +0000 Received: (at 77590) by debbugs.gnu.org; 6 Apr 2025 23:27:22 +0000 Received: from localhost ([127.0.0.1]:50116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1ZOS-0004x5-L4 for submit@debbugs.gnu.org; Sun, 06 Apr 2025 19:27:22 -0400 Received: from mout02.posteo.de ([185.67.36.66]:54461) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1ZOM-0004vi-HX for 77590@debbugs.gnu.org; Sun, 06 Apr 2025 19:27:09 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 9FE08240101 for <77590@debbugs.gnu.org>; Mon, 7 Apr 2025 01:26:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1743982019; bh=m6H3bWVoTlmByrJHGI2I9w2KbrNgyQeWhtq8NJFAvY8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=R9cidCSEv0qKnQ8eA1txhT22fk6NHnwYMWAxp9BiTOxut0J4LVKta8VZmUXZIrlP9 kIFJHIFRpVsWo5uHu72AniNUGHA6rWcpWowo1GfCdJILXxowZM6oiCzfPAqjVcI43w hyp91KFI+IovesDRmNUFmfpLhu7aVrub1ZpV9e02kwiD2+bqIfHxYiXzQubNe+4wi4 Qs9Uvao4YP75k+N3XLSTtV6nkRBR6qJdJEegMc31iFaPza8U8ZCe6KZ6x7nBDrgt5i 02MBY++C0e1lf24oFEzPh7E+5UtR938AekmgtTgqwA5AO7moaQUUQHNeHg8GzUcy91 cRaU8VdZH9bLA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4ZW7lk4Xb5z6tlh; Mon, 7 Apr 2025 01:26:58 +0200 (CEST) From: David Elsing Date: Sun, 6 Apr 2025 23:26:40 +0000 Message-ID: <6baf0e901a9e8e4e6c784957cf92270e6e085149.1743980993.git.david.elsing@posteo.net> In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/maths.scm (hdf5): Update to 1.14.6. Do not inherit from hdf5-1.8. [source]: Switch to git-fetch. Add modules field and snippet. [outputs]: Remove field. [arguments]<#:phases>: Use gexps. Add 'hide-gfortran, 'make-gen-deterministic, 'generate-flexbison, 'patch-trace-shebang, 'patch-configure.ac, 'fix-fortran-i686-test, 'generate-headers, and 'remove-subfiling-cppflags phases. Adjust 'patch-configure, 'patch-settings and 'patch-references phases. Remove 'split phase. [license]: Adjust URL. --- gnu/packages/maths.scm | 208 ++++++++++++++++++++++++++++++++++------- 1 file changed, 176 insertions(+), 32 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 6910b32dae..e8258b681d 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -62,7 +62,7 @@ ;;; Copyright © 2022 Roman Scherer ;;; Copyright © 2023 Jake Leporte ;;; Copyright © 2023 Camilo Q.S. (Distopico) -;;; Copyright © 2023 David Elsing +;;; Copyright © 2023, 2025 David Elsing ;;; Copyright © 2024 Herman Rimm ;;; Copyright © 2024 Foundation Devices, Inc. ;;; Copyright © 2024, 2025 Artyom V. Poptsov @@ -1837,41 +1837,185 @@ (define-public hdf5-1.10 ;; When updating this package, please also update hdf-java. (define-public hdf5 (package - (inherit hdf5-1.8) - (version "1.14.3") + (name "hdf5") + (version "1.14.6") (source (origin - (method url-fetch) - (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/" - "hdf5-" (version-major+minor version) - "/hdf5-" version "/src/hdf5-" - version ".tar.bz2") - (string-append "https://support.hdfgroup.org/ftp/HDF5/" - "current" - (apply string-append - (take (string-split version #\.) 2)) - "/src/hdf5-" version ".tar.bz2"))) + (method git-fetch) + (uri (git-reference + (url "https://github.com/HDFGroup/hdf5") + (commit (string-append "hdf5_" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "05zr11y3bivfwrbvzbky1q2gjf6r7n92cvvdnh5jilbmxljg49cl")) - (patches (search-patches "hdf5-config-date.patch")))) + (base32 + "1f7yv0xra465c3qy8c79fzddib653wzj5dsakb0bs02nwp3xm54q")) + (patches (search-patches "hdf5-config-date.patch")) + (modules '((guix build utils))) + (snippet + '(for-each + delete-file + (append + (find-files "." "Makefile\\.in$") + (find-files "java/lib" "\\.jar$") + (list "aclocal.m4" + "bin/compile" + "bin/config.guess" + "bin/config.sub" + "bin/depcomp" + "bin/install-sh" + "bin/ltmain.sh" + "bin/missing" + "bin/test-driver" + "configure" + "HDF5Examples/aclocal.m4" + "HDF5Examples/compile" + "HDF5Examples/configure" + "HDF5Examples/depcomp" + "HDF5Examples/missing" + "HDF5Examples/test-driver" + "hl/src/H5LTanalyze.c" + "hl/src/H5LTparse.c" + "hl/src/H5LTparse.h" + "hl/tools/gif2h5/testfiles/ex_image2.h5" + "hl/tools/gif2h5/testfiles/h52giftst.h5" + "m4/ax_prog_doxygen.m4" + "m4/libtool.m4" + "m4/lt~obsolete.m4" + "m4/ltoptions.m4" + "m4/ltsugar.m4" + "m4/ltversion.m4" + "src/H5config.h.in" + "src/H5Edefin.h" + "src/H5Einit.h" + "src/H5Epubgen.h" + "src/H5Eterm.h" + "src/H5overflow.h" + "src/H5version.h")))))) + (build-system gnu-build-system) + (inputs + (list zlib)) + (native-inputs + (list autoconf-2.71 + autoconf-archive + automake + bison + flex + gfortran + libtool + ;; Needed to generate some headers and for tests + perl + which)) (arguments - (substitute-keyword-arguments (package-arguments hdf5-1.8) - ((#:phases phases #~%standard-phases) - #~(modify-phases #$phases - (add-after 'configure 'skip-version-test - (lambda _ - ;; Skip test_check_version since the 'patch-settings' phase - ;; modifies the test reference. - (substitute* "test/test_check_version.sh.in" - (("TESTING\\(\\).*" all) - (string-append all "\nSKIP; exit 0\n"))))) - (add-after 'patch-configure 'patch-configure-build-settings - (lambda _ - (substitute* "src/H5build_settings.autotools.c.in" - ;; Don't record the build-time kernel version to make the - ;; library file reproducible. - (("@UNAME_INFO@") - "Linux")))))))))) + (list + ;; Some of the users, notably Flann, need the C++ interface. + #:configure-flags + ''("--enable-cxx" + "--enable-fortran" + "--enable-fortran2003" + + ;; Build a thread-safe library. Unfortunately, + ;; 'configure' invites you to either turn off C++, + ;; Fortran, and the high-level interface (HL), or + ;; to pass '--enable-unsupported'. Debian + ;; packagers chose to pass '--enable-unsupported' + ;; and we follow their lead here. + "--enable-threadsafe" + "--with-pthread" + "--enable-unsupported") + ;; Use -fPIC to allow the R bindings to link with the static libraries + #:make-flags ''("CFLAGS=-fPIC" "CXXFLAGS=-fPIC") + #:phases + #~(modify-phases %standard-phases + ;; XXX: src/H5private.h includes and fails to find the + ;; stdlib types when the gfortran header is used. Remove gfortran + ;; from CPLUS_INCLUDE_PATH as a workaround. + (add-after 'set-paths 'hide-gfortran + (lambda _ + (let ((gfortran #$(this-package-native-input "gfortran"))) + (setenv "CPLUS_INCLUDE_PATH" + (string-join + (delete (string-append gfortran "/include/c++") + (string-split (getenv "CPLUS_INCLUDE_PATH") #\:)) + ":"))))) + (add-after 'unpack 'make-gen-deterministic + (lambda _ + (substitute* "bin/make_err" + (("keys %major" all) + (string-append "sort " all)) + (("while.*each \\(%section\\).*") + (string-append + "foreach $sect_name (sort keys %section) {\n" + " $sect_desc = $section{$sect_name};\n"))))) + (add-after 'unpack 'generate-flexbison + (lambda _ + (invoke "bash" "bin/genparser" "hl/src"))) + (add-after 'unpack 'patch-trace-shebang + (lambda _ + (for-each patch-shebang + (find-files "bin" (lambda (file stat) + (executable-file? file)))))) + ;; Fixes build on i686, see + ;; https://github.com/HDFGroup/hdf5/commit/0af668f4091f1c35f621d2acdeadd34db6756976 + (add-after 'unpack 'patch-configure.ac + (lambda _ + (substitute* "configure.ac" + (("AC_DEFINE.*HAVE_FLOAT128.*" orig) + (string-append orig "\nAC_CHECK_SIZEOF([__float128])\n"))))) + ;; This is a known issue on i686, see + ;; https://github.com/HDFGroup/hdf5/issues/4926 + (add-after 'unpack 'fix-fortran-i686-test + (lambda _ + (substitute* "fortran/test/tH5R.F90" + (((string-append + "CALL h5rget_obj_name_f\\(C_LOC\\(ref_ptr\\(2\\)\\)," + " \"\", error, name_len=buf_size \\)")) + (string-append + "CALL h5rget_obj_name_f(C_LOC(ref_ptr(2))," + " \"xxxxxxxxxxxxxx\", error, name_len=buf_size)"))))) + (add-before 'configure 'patch-configure + (lambda _ + (substitute* "configure" + (("/bin/mv") "mv")))) + (add-after 'configure 'patch-settings + (lambda _ + ;; libhdf5.settings contains the full path of the compilers + ;; used, and its contents are included in libhdf5.so. We + ;; truncate the hashes to avoid unnecessary store references to + ;; those compilers: + (substitute* '("src/H5build_settings.c" + "src/libhdf5.settings") + (("(/gnu/store/)([a-zA-Z0-9]*)" all prefix hash) + (string-append prefix (string-take hash 10) "...")) + ;; Don't record the build-time kernel version to make the + ;; settings file reproducible. + (("Uname information:[^\"\n\\\\]*") + "Uname information: Linux")))) + (add-after 'configure 'generate-headers + (lambda _ + (invoke "perl" "bin/make_err" "src/H5err.txt") + (invoke "perl" "bin/make_vers" "src/H5vers.txt") + (invoke "perl" "bin/make_overflow" "src/H5overflow.txt"))) + ;; Remove include flag to directory in source tree + (add-after 'configure 'remove-subfiling-cppflags + (lambda _ + (substitute* '("src/H5build_settings.c" + "src/libhdf5.settings" + "bin/h5cc" + "c++/src/h5c++") + (("-I.*/src/H5FDsubfiling") "")))) + (add-after 'install 'patch-references + (lambda _ + (let ((bin (string-append #$output "/bin")) + (zlib #$(this-package-input "zlib"))) + (substitute* (find-files bin "h5p?cc") + (("-lz" lib) + (string-append "-L" zlib "/lib " lib))))))))) + (home-page "https://www.hdfgroup.org") + (synopsis "Management suite for extremely large and complex data") + (description "HDF5 is a suite that makes possible the management of +extremely large and complex data collections.") + (license (license:x11-style + "https://support.hdfgroup.org/ftp/HDF5/releases/COPYING.html")))) ;; Keep this in sync with the current hdf5 package. (define-public hdf-java