From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Danckaert Subject: [PATCH] gnu: Add hdf4 Date: Tue, 11 Oct 2016 10:57:44 +0200 (CEST) Message-ID: <20161011.105744.1519945377775544087.post@thomasdanckaert.be> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Tue_Oct_11_10_57_44_2016_564)--" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btsss-0002vX-5W for guix-devel@gnu.org; Tue, 11 Oct 2016 04:58:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btssm-0007LR-Oz for guix-devel@gnu.org; Tue, 11 Oct 2016 04:58:01 -0400 Received: from s02-out.spamexperts.axc.nl ([159.253.1.2]:60067 helo=s02.spamexperts.axc.nl) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btssm-0007K1-GV for guix-devel@gnu.org; Tue, 11 Oct 2016 04:57:56 -0400 Received: from vserver42.axc.nl ([159.253.0.80]) by s02.spamexperts.axc.nl with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86) (envelope-from ) id 1btsse-00013d-TW for guix-devel@gnu.org; Tue, 11 Oct 2016 10:57:50 +0200 Received: from mail.axc.nl ([159.253.0.157]:44990) by vserver42.axc.nl with esmtp (Exim 4.87) (envelope-from ) id 1btssd-0007o3-Sa for guix-devel@gnu.org; Tue, 11 Oct 2016 10:57:48 +0200 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org ----Next_Part(Tue_Oct_11_10_57_44_2016_564)-- Content-Type: Text/Plain; charset=utf-8 Content-Transfer-Encoding: base64 SGkgR3VpeCwNCg0KdGhp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tZGlzYWJsZS1uZXRjZGbigJ0gY29uZmlndXJlIGZsYWcNCiAgIHRvIGF2b2lkIHRoaXMuICBX ZSBjb3VsZCBjYWxsIGl0IOKAnGhkZjQtbm9uZXRjZGbigJ0sIGJ1dCB0aGUgbmFtZQ0KICAg4oCc aGRmNC1hbHTigJ0gaXMgdXNlZCBieSBEZWJpYW4sIHNvIG1heWJlIGl0J3MgZ29vZCB0byB1c2Ug dGhlIHNhbWU/DQoNCmJlc3QsDQoNClRob21hcw0K ----Next_Part(Tue_Oct_11_10_57_44_2016_564)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0001-gnu-Add-hdf4.patch" >From dd7eca9a3cfec364a05aa0f52b941f09b4dea039 Mon Sep 17 00:00:00 2001 From: Thomas Danckaert Date: Wed, 28 Sep 2016 10:34:58 +0200 Subject: [PATCH] gnu: Add hdf4 * gnu/packages/maths.scm (hdf4, hdf4-alt): New variables. * gnu/packages/patches/hdf4-reproducibility.patch: New file. * gnu/packages/patches/hdf4-shared-fortran.patch: New file. * gnu/local.mk (dist_patch_DATA): Add patches. --- gnu/local.mk | 2 + gnu/packages/maths.scm | 65 +++++++++++++++++++++++++ gnu/packages/patches/hdf4-reproducibility.patch | 47 ++++++++++++++++++ gnu/packages/patches/hdf4-shared-fortran.patch | 25 ++++++++++ 4 files changed, 139 insertions(+) create mode 100644 gnu/packages/patches/hdf4-reproducibility.patch create mode 100644 gnu/packages/patches/hdf4-shared-fortran.patch diff --git a/gnu/local.mk b/gnu/local.mk index 1ce95f2..1b65e74 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -570,6 +570,8 @@ dist_patch_DATA = \ %D%/packages/patches/gtk3-respect-GUIX_GTK3_PATH.patch \ %D%/packages/patches/gtk3-respect-GUIX_GTK3_IM_MODULE_FILE.patch \ %D%/packages/patches/gtkglext-disable-disable-deprecated.patch \ + %D%/packages/patches/hdf4-shared-fortran.patch \ + %D%/packages/patches/hdf4-reproducibility.patch \ %D%/packages/patches/hdf5-config-date.patch \ %D%/packages/patches/hdf-eos5-build-shared.patch \ %D%/packages/patches/hdf-eos5-remove-gctp.patch \ diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index d5e82bb..72abe58 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -445,6 +445,71 @@ computations.") (home-page "https://github.com/OkoSanto/GCTP") (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html +(define-public hdf4 + (package + (name "hdf4") + (version "4.2.11") + (source + (origin + (method url-fetch) + (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF" + version "/src/hdf-" version ".tar.bz2")) + (sha256 + (base32 "16yr50j845zlfx20skmw3y75ww77akk9gg0affjqkg66ih5r03mv")) + (patches (search-patches "hdf4-reproducibility.patch" + "hdf4-shared-fortran.patch")))) + (build-system gnu-build-system) + (native-inputs + `(("gfortran" ,gfortran) + ("bison" ,bison) + ("flex" ,flex))) + (inputs + `(("zlib" ,zlib) + ("libjpeg" ,libjpeg))) + (arguments + `(#:parallel-tests? #f + #:configure-flags '("--enable-shared") + #:phases + (modify-phases %standard-phases + (add-before 'configure 'patchbuild + (lambda _ + (substitute* + '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in") + (("/bin/rm") "rm") + (("/bin/mkdir") "mkdir")) + (substitute* + (map (lambda (dir) (string-append dir "/Makefile.in")) + '("hdf" "hdf/examples" "hdf/fortran" "hdf/src" + "hdf/test" "hdf/util" "mfhdf" "mfhdf/dumper" + "mfhdf/examples" "mfhdf/fortran" "mfhdf/hdfimport" + "mfhdf/hdiff" "mfhdf/hrepack" "mfhdf/libsrc" + "mfhdf/ncgen" "mfhdf/ncdump" "mfhdf/nctest" + "mfhdf/test" "mfhdf/xdr")) + (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \ +-R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "") + (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \ +-R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \ +-R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))))))) + (home-page "https://www.hdfgroup.org/products/hdf4/") + (synopsis + "Library and multi-object file format for storing and managing data") + (description "HDF4 is a library and multi-object file format for storing +and managing data between machines. HDF4 is an older hierarchical data format, +incompatible with HDF5.") + (license + (license:non-copyleft + "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING")))) + +(define-public hdf4-alt + (package + (inherit hdf4) + (name "hdf4-alt") + (arguments + (substitute-keyword-arguments (package-arguments hdf4) + ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags)))) + (synopsis + "HDF4 without netCDF API, can be combined with the regular netCDF library"))) + (define-public hdf5 (package (name "hdf5") diff --git a/gnu/packages/patches/hdf4-reproducibility.patch b/gnu/packages/patches/hdf4-reproducibility.patch new file mode 100644 index 0000000..2c66bec --- /dev/null +++ b/gnu/packages/patches/hdf4-reproducibility.patch @@ -0,0 +1,47 @@ +Remove/patch unreproducible config data. +--- + configure | 9 ++++++++- + libhdf4.settings.in | 6 +++--- + 2 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/configure b/configure +index eb9f346..ebab94d 100755 +--- a/configure ++++ b/configure +@@ -23163,7 +23163,14 @@ H4_VERSION="`cut -d' ' -f3 $srcdir/README.txt | head -1`" + + + ## Configuration date +- CONFIG_DATE="`date`" ++CONFIG_DATE="`date -u`" ++if test -n "$SOURCE_DATE_EPOCH"; then ++ CONFIG_DATE=`date -u -d "@$SOURCE_DATE_EPOCH" 2>/dev/null \ ++ || date -u -r "$SOURCE_DATE_EPOCH" 2>/dev/null` ++ if test -z "$CONFIG_DATE"; then ++ as_fn_error $? "malformed SOURCE_DATE_EPOCH" "$LINENO" 5 ++ fi ++fi + + ## User doing the configuration + CONFIG_USER="`whoami`@`hostname`" +diff --git a/libhdf4.settings.in b/libhdf4.settings.in +index 1d9bbb9..4180d72 100644 +--- a/libhdf4.settings.in ++++ b/libhdf4.settings.in +@@ -5,10 +5,10 @@ General Information: + ------------------- + HDF4 Version: @H4_VERSION@ + Configured on: @CONFIG_DATE@ +- Configured by: @CONFIG_USER@ ++ Configured by: guix + Configure mode: @CONFIG_MODE@ +- Host system: @host_cpu@-@host_vendor@-@host_os@ +- Uname information: @UNAME_INFO@ ++ Host system: guix ++ Uname information: guix + Libraries: @STATIC_SHARED@ + Installation point: @prefix@ + +-- +2.10.0 + diff --git a/gnu/packages/patches/hdf4-shared-fortran.patch b/gnu/packages/patches/hdf4-shared-fortran.patch new file mode 100644 index 0000000..60db355 --- /dev/null +++ b/gnu/packages/patches/hdf4-shared-fortran.patch @@ -0,0 +1,25 @@ +Allow building a shared library with Fortran. +--- + configure | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/configure b/configure +index f37d2fa..eb9f346 100755 +--- a/configure ++++ b/configure +@@ -6141,12 +6141,6 @@ if test "X${enable_shared}" != "Xyes"; then + enable_shared="no" + fi + +-if test "X${enable_shared}" = "Xyes"; then +- if test "X${BUILD_FORTRAN}" = "Xyes"; then +- as_fn_error $? "Cannot build shared fortran libraries. Please configure with --disable-fortran flag." "$LINENO" 5 +- fi +-fi +- + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 + $as_echo_n "checking whether ln -s works... " >&6; } +-- +2.10.0 + -- 2.10.0 ----Next_Part(Tue_Oct_11_10_57_44_2016_564)----