From patchwork Thu Apr 10 22:42:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 41562 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 04BF227BC4A; Thu, 10 Apr 2025 23:44:20 +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.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, 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 1C24927BC49 for ; Thu, 10 Apr 2025 23:44:18 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u30cw-0007y2-Jz; Thu, 10 Apr 2025 18:44:06 -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 1u30cs-0007x9-Mc for guix-patches@gnu.org; Thu, 10 Apr 2025 18:44:02 -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 1u30cs-0000r5-Dm for guix-patches@gnu.org; Thu, 10 Apr 2025 18:44: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=dO4UigqizpcllATGam8Bjsq540SJ+VGhc41aq/50NVo=; b=rXICvtYO2aKUm/0Fd/V8x84D6NWjKsiLtTzIP+U/qeLEnWI83oVMSCdmIT9/rsX9Fqpko2mJ72quAYz2UmGrN3lTeIyWUxNOeWPPzIJdpoclPgScXMUsZmAS145lDPwlfgMKhIOXCYGdnT/pD1n8O1YQJL93GzSLgailBauF38XeoI+dUd0wOS7P8k2heGOrlpMlmqt4QGjATLx9AR004GWTUxxFeFC2cNGOczsSVRz5pv9GZ1eCYCjunOlZzVtDCMvt37Zi+BKAaLKTMsxtZXuPCBmlHsnvBc34pe+E9URT13/klYsSpSk2kg7XuCclXwmCAMeuoHZpF4OTQ6nPMw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u30cs-0002dt-7f for guix-patches@gnu.org; Thu, 10 Apr 2025 18:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77590] [PATCH v3 1/2] gnu: hdf5: Update to 1.14.6. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 10 Apr 2025 22:44: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.174432502110106 (code B ref 77590); Thu, 10 Apr 2025 22:44:02 +0000 Received: (at 77590) by debbugs.gnu.org; 10 Apr 2025 22:43:41 +0000 Received: from localhost ([127.0.0.1]:47485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u30cP-0002ci-6M for submit@debbugs.gnu.org; Thu, 10 Apr 2025 18:43:40 -0400 Received: from mout01.posteo.de ([185.67.36.65]:52521) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u30cL-0002cL-R7 for 77590@debbugs.gnu.org; Thu, 10 Apr 2025 18:43:31 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id EB0E3240027 for <77590@debbugs.gnu.org>; Fri, 11 Apr 2025 00:43:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1744325002; bh=wtw5RnFAT8r30LGdo0Pwy+8UGJE9+LHWSTSMuruxII8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=PB5LfsyqvwFzlJ5w/GZOoP09akpFPmReQ1xYPB0dGfDjSNv/DQn4e3iAtOS8ZuV6M pxFsjbvXQMwoI2cbTXe2s8VCJ7ZESzXeqo5jzwn8n8LltIFphQk5ZLPxNXQO5WQTZ9 cymvrF1RYN8i/GqxTzO8Cf5c+6chLsa02j4JdWQEkXuljX/V1/4raDmj9ypJr+CgfM XktlG4vW/Kw3yvjates1NnWeeNDualulGMgXH+MvVKT/THsk2Tsq8TRv70XuKjbHg1 jHakEdQkx9ZlvsV+HMIIUrWt+69a0u8yN6DtDWeTdWFnuBNzLSmWnDinguBI7ZWVLj OUQCTlwSSJQRg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4ZYZbY6RSQz6txj; Fri, 11 Apr 2025 00:43:21 +0200 (CEST) From: David Elsing Date: Thu, 10 Apr 2025 22:42:55 +0000 Message-ID: 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. [name, version]: New field. [source]: Switch to git-fetch. Add modules and snippet fields. Use different patch file. [build-system]: New field. Use CMake. [inputs]: New field. [native-inputs]: New field. Add bison, flex and which. [arguments]: Do not inherit from hdf5-1.8. <#:configure-flags>: New field. <#:phases>: New field. Use gexps. Remove 'patch-configure, 'patch-settings, 'patch-references, 'split, 'skip-version-test and 'patch-configure-build-settings phases. Add 'make-gen-deterministic, 'generate-flexbison, 'patch-trace-shebang, 'fix-fortran-i686-test and 'generate-headers phases. [home-page, synopsis, description]: New fields. [license]: New field. Adjust URL. --- gnu/packages/maths.scm | 152 ++++++++++++++++++++++++++++++++--------- 1 file changed, 119 insertions(+), 33 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 11a86216aa..5b7398756c 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 @@ -1834,44 +1834,130 @@ (define-public hdf5-1.10 (base32 "14gih7kmjx4h3lc7pg4fwcl28hf1qqkf2x7rljpxqvzkjrqbxi00")) (patches (search-patches "hdf5-config-date.patch")))))) -;; 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")) + (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 cmake-build-system) + (inputs (list zlib)) + (native-inputs + (list bison + flex + gfortran + ;; 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 + ''("-DHD5F_ENABLE_THREADSAFE=ON" + "-DHDF5_BUILD_CPP_LIB=ON" + "-DHDF5_BUILD_DOC=ON" + "-DHDF5_BUILD_FORTRAN=ON") + #: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)))))) + ;; 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-after 'unpack '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")))))) + (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 From patchwork Thu Apr 10 22:42:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 41563 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 4114527BC49; Thu, 10 Apr 2025 23:44:21 +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.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, 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 2A5CA27BC4B for ; Thu, 10 Apr 2025 23:44:18 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u30cy-00080S-Hm; Thu, 10 Apr 2025 18:44:08 -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 1u30ct-0007xN-5V for guix-patches@gnu.org; Thu, 10 Apr 2025 18:44: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 1u30cs-0000rV-Rw for guix-patches@gnu.org; Thu, 10 Apr 2025 18:44: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=4KK7yLjviUawYz0JLGiHQzIgEpzmKFK9vNXLRLooDaA=; b=bTepP5kQ3kQ2+TIwOtNVVIEdelB/6N9NVn4WIxEZG+IH2zqPpOAGSiepmnS1R6zhxXX+S40VhPJpx7GDikYGdkSRsPKf5wH7zeiTU2Ua+z73HFh0/eMaZzEinRhhFej7ivxrmq/RSbimnCTzE//v+TcMVY5qtYx+kEdVxaDfmxvL8NAHLiVkdMby8LaHt5KZJ++GsNBEe5x/2nDDTTivObTcfyQT+ytHTeX4CYZdAHqHYJEgQBNTQRSecaZYWA/X7XP63o3lfHxos5Bv1OjPw6GiNrGo8Qa8/upDqGGzUUlPnp7WT5HsUZ9PRVOTmaH6Ya3radsr/7qnOYc3+d5jVw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u30cs-0002e0-MY for guix-patches@gnu.org; Thu, 10 Apr 2025 18:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77590] [PATCH v3 2/2] gnu: hdf-java: Update to 1.14.6 and rename to hdf5-java. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 10 Apr 2025 22:44: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.174432502210116 (code B ref 77590); Thu, 10 Apr 2025 22:44:02 +0000 Received: (at 77590) by debbugs.gnu.org; 10 Apr 2025 22:43:42 +0000 Received: from localhost ([127.0.0.1]:47488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u30cX-0002cx-1Y for submit@debbugs.gnu.org; Thu, 10 Apr 2025 18:43:42 -0400 Received: from mout01.posteo.de ([185.67.36.65]:33815) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u30cQ-0002cT-7J for 77590@debbugs.gnu.org; Thu, 10 Apr 2025 18:43:35 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 723D9240027 for <77590@debbugs.gnu.org>; Fri, 11 Apr 2025 00:43:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1744325008; bh=kl5krvfco+1f2D4bm9NRimePTIyBySNWMaPwIgDgu5A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=MApOp1woYP12byqHiDpwVixvBwzRc6XOpE580CqqLpIpcBeJxFaTWuu+RA1x5GcSO cYyWH64OXkfnYK4cZJHBIbuKEj7T5Y5qJW0qxKbuPt3oB4wfvzQ1KRnHknLg5X2YFU 5YTXU5TwceM1iRqXHPu6cuuqR7QIyAh1aHHFYU6OxdyLSgUw5oP881ypu+4j1W9UEa 4EjMnI0Xep/UkgRkrbhpDloTUQTPWphGk5O3ZEusciIo7HrkalGgKHPzkjQtpngfAC 43x2r6JMWn+Pxwj2lvI+8ZfzTeEbU3TgBbesBQSHw0dUlUvPXO3IA9kqONjSS7NB/J B+XIoRrqHWwSw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4ZYZbf6YKvz6txv; Fri, 11 Apr 2025 00:43:26 +0200 (CEST) From: David Elsing Date: Thu, 10 Apr 2025 22:42:56 +0000 Message-ID: <114970ab28171e1588baf7653c50d990d866cbb9.1744324264.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 (hdf-java): Update to 1.14.6. [name]: Rename to hdf5-java. [version]: Use the same as hdf5. [source]: Use the same as hdf5. [build-system]: Change to cmake-build-system. [arguments]: Adjust #:configure-flags. Add (guix build ant-build-system) to #:modules and #:imported-modules. Adjust 'unbundle phase. Add 'patch-trace-shebang, 'generate-flexbison, 'generate-headers and 'strip-jar-timestamps phases. [native-inputs]: Use modify-inputs. Add java-slf4j-nop and zip. [inputs]: Remove hdf4 and hdf5. [synopsis, description]: Remove mention of HDF4. [license]: Use the same as hdf5. --- gnu/packages/maths.scm | 118 ++++++++++++++++++++++------------------- 1 file changed, 64 insertions(+), 54 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 5b7398756c..e6e4008d53 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -1959,33 +1959,24 @@ (define-public hdf5 (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 +(define-public hdf5-java (package - (name "hdf-java") - (version "1.14.3") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/HDFGroup/hdf5") - (commit (string-append "hdf5-" - (string-map - (lambda (c) (if (char=? c #\.) #\_ c)) - version))))) - (file-name (git-file-name name version)) - (sha256 - (base32 "0lw9f62zxyjiv7vx9nvnashjj39i44j8d626i7b788zkxw58csvs")) - (modules '((guix build utils))) - (snippet ; Make sure we don't use the bundled sources and binaries. - '(for-each delete-file - (find-files "java/lib" "\\.jar$"))))) - (build-system gnu-build-system) + (name "hdf5-java") + (version (package-version hdf5)) + (source (package-source hdf5)) + (build-system cmake-build-system) (arguments (list #:configure-flags - #~(list "--enable-java" - "--disable-tools") + #~(list "-DHDF5_BUILD_JAVA=ON" + "-DHDF5_BUILD_TOOLS=OFF") + #:modules + '((guix build cmake-build-system) + ((guix build ant-build-system) #:prefix ant:) + (guix build utils)) + #:imported-modules + `((guix build ant-build-system) + ,@%cmake-build-system-modules) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'unbundle @@ -1996,27 +1987,35 @@ (define-public hdf-java (api (search-input-file inputs "/lib/m2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar")) + (nop + (search-input-file + inputs "/lib/m2/org/slf4j/slf4j-nop/1.7.25/slf4j-nop-1.7.25.jar")) (junit (search-input-file inputs "/lib/m2/junit/junit/4.12/junit-4.12.jar")) (hamcrest (search-input-file inputs "/lib/m2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"))) - (substitute* (append (find-files "java" "Makefile.am") - (find-files "java" "Makefile.in")) - (("\\$\\(top_srcdir\\)/java/lib/ext/slf4j-simple-2.0.6.jar") - simple) - (("\\$\\(top_srcdir\\)/java/lib/slf4j-api-2.0.6.jar") - api) - (("\\$\\(top_srcdir\\)/java/lib/junit.jar") + (substitute* "CMakeLists.txt" + (("(set *\\(HDF5_JAVA_LOGGING_JAR ).*" _ orig) + (string-append orig api ")\n")) + (("(set *\\(HDF5_JAVA_LOGGING_NOP_JAR ).*" _ orig) + (string-append orig nop ")\n")) + (("(set *\\(HDF5_JAVA_LOGGING_SIMPLE_JAR ).*" _ orig) + (string-append orig simple ")\n"))) + ;; Do not install copies of external libraries + (substitute* "java/CMakeLists.txt" + ((".*HDF5_JAVA_LOGGING.*_JAR.*") "")) + (substitute* "java/test/CMakeLists.txt" + (("\\$\\{HDF5_JAVA_LIB_DIR\\}/junit\\.jar") junit) - (("\\$\\(top_srcdir\\)/java/lib/hamcrest-core.jar") + (("\\$\\{HDF5_JAVA_LIB_DIR\\}/hamcrest-core\\.jar") hamcrest)) (substitute* '("java/test/junit.sh.in" - "java/examples/datatypes/JavaDatatypeExample.sh.in" - "java/examples/datasets/JavaDatasetExample.sh.in" - "java/examples/intro/JavaIntroExample.sh.in" - "java/examples/groups/JavaGroupExample.sh.in") + "HDF5Examples/JAVA/H5D/JavaDatasetExample.sh.in" + "HDF5Examples/JAVA/H5G/JavaGroupExample.sh.in" + "HDF5Examples/JAVA/H5T/JavaDatatypeExample.sh.in" + "HDF5Examples/JAVA/TUTR/runExample.sh.in") (("^LIST_JAR_TESTFILES=\"" m) (string-append m hamcrest "\n" junit "\n" @@ -2036,30 +2035,41 @@ (define-public hdf-java (("/usr/bin/uname") (search-input-file inputs "/bin/uname"))) (substitute* (find-files "java/test/testfiles/" ".*\\.txt$") - (("JUnit version 4.11") - "JUnit version 4.12-SNAPSHOT")))))))) + (("JUnit version 4.13.2") + "JUnit version 4.12-SNAPSHOT"))))) + (add-after 'unpack 'patch-trace-shebang + (lambda _ + (for-each patch-shebang + (find-files "bin" (lambda (file stat) + (executable-file? file)))))) + (add-after 'unpack 'generate-flexbison + (lambda _ + (invoke "bash" "bin/genparser" "hl/src"))) + (add-after 'unpack '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"))) + (add-after 'install 'strip-jar-timestamps + (assoc-ref ant:%standard-phases 'strip-jar-timestamps))))) (native-inputs - (list `(,icedtea "jdk") - ;; For tests: - java-hamcrest-core - java-junit - java-slf4j-simple)) + (modify-inputs (package-native-inputs hdf5) + (prepend `(,icedtea "jdk")) + (prepend java-hamcrest-core) + (prepend java-junit) + (prepend java-slf4j-nop) + (prepend java-slf4j-simple) + (prepend (@ (gnu packages compression) zip)) + (delete "gfortran"))) (inputs - (list hdf4 - hdf5 - java-slf4j-api + (list java-slf4j-api libjpeg-turbo zlib)) (home-page "https://www.hdfgroup.org") - (synopsis "Java interface for the HDF4 and HDF5 libraries") - (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use -the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are -implemented in C.") - - ;; BSD-style license: - (license (license:x11-style - "https://support.hdfgroup.org/ftp/HDF5/hdf-java\ -/current/src/unpacked/COPYING.html")))) + (synopsis "Java interface for the HDF5 library") + (description "The Java HDF5 Interface (JHI5) uses the Java Native +Interface to wrap the HDF5 library, which is implemented in C.") + (license (package-license hdf5)))) (define-public hdf-eos2 (package