unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add hdf4
@ 2016-10-11  8:57 Thomas Danckaert
  2016-10-12 12:54 ` Ludovic Courtès
  0 siblings, 1 reply; 19+ messages in thread
From: Thomas Danckaert @ 2016-10-11  8:57 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: Text/Plain, Size: 999 bytes --]

Hi Guix,

this patch continues the work done by Jeremy Robst to package HDF4

(https://lists.gnu.org/archive/html/guix-devel/2016-06/msg00069.html)

 - Back then, people reported occasional build failures. I've disabled
   parallel tests and don't have any problems on my system anymore
   (maybe someone else can test?).

 - I've added a patch to allow a shared build with Fortran interface,
   and some substitutions to remove bogus RPATH settings from the
   Makefiles (otherwise, build directories are included in the RPATH).

 - I've also added a variant “hdf4-alt”: by default, HDF4 includes a
   netCDF API to access HDF4 files, which clashes with the symbols in
   the real netCDF library when you try to use both libraries in your
   program.  This variant uses the “--disable-netcdf” configure flag
   to avoid this.  We could call it “hdf4-nonetcdf”, but the name
   “hdf4-alt” is used by Debian, so maybe it's good to use the same?

best,

Thomas

[-- Attachment #2: 0001-gnu-Add-hdf4.patch --]
[-- Type: Text/X-Patch, Size: 7159 bytes --]

From dd7eca9a3cfec364a05aa0f52b941f09b4dea039 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
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


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [PATCH]     gnu: Add hdf4
@ 2016-05-23 17:22 Jeremy Robst
  2016-05-23 18:17 ` Leo Famulari
  0 siblings, 1 reply; 19+ messages in thread
From: Jeremy Robst @ 2016-05-23 17:22 UTC (permalink / raw)
  To: guix-devel

     * gnu/packages/maths.scm (hdf4): New variable
---
  gnu/packages/maths.scm |   35 +++++++++++++++++++++++++++++++++++
  1 file changed, 35 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 19ed44f..570cc32 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -408,6 +408,41 @@ plotting engine by third-party applications like Octave.")
      (license (license:fsf-free
                "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))

+(define-public hdf4
+  (package
+    (name "hdf4")
+    (version "4.2.11")
+    (source 
+     (origin 
+       (method url-fetch)
+       (uri (string-append
+             "http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/hdf-"
+             version
+             ".tar.bz2"))
+       (sha256
+        (base32
+         "16yr50j845zlfx20skmw3y75ww77akk9gg0affjqkg66ih5r03mv"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("gfortran" ,gfortran)
+       ("bison" ,bison)
+       ("flex" ,flex)))
+    (inputs
+     `(("zlib" ,zlib)
+       ("libjpeg" ,libjpeg)))
+    (arguments '(#:tests? #f))
+ 
+    (home-page "https://www.hdfgroup.org/products/hdf4/")
+    (synopsis
+     "Library and multi-object file format for storing and managing data")
+    (description "At its lowest level, HDF is a physical file format for
+storing scientific data.  At its highest level, HDF is a collection of
+utilities and applications for manipulating, viewing, and analyzing data
+in HDF files.  Between these levels, HDF is a software library that provides
+high-level APIs and a low-level data interface. ")
+    (license (license:x11-style
+              "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
+
  (define-public hdf5
    (package
      (name "hdf5")
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-10-16 15:05 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-11  8:57 [PATCH] gnu: Add hdf4 Thomas Danckaert
2016-10-12 12:54 ` Ludovic Courtès
2016-10-12 18:50   ` Thomas Danckaert
2016-10-12 20:28     ` Ludovic Courtès
2016-10-14  8:11     ` Andreas Enge
2016-10-14 11:13       ` Thomas Danckaert
     [not found]       ` <20161014.110029.603260973900204345.post@thomasdanckaert.be>
2016-10-16 15:05         ` Andreas Enge
  -- strict thread matches above, loose matches on Subject: below --
2016-05-23 17:22 Jeremy Robst
2016-05-23 18:17 ` Leo Famulari
2016-05-24 13:20   ` Jeremy Robst
2016-05-24 19:06     ` Eric Bavier
2016-05-25 17:42       ` Jeremy Robst
2016-05-27 17:19         ` Leo Famulari
2016-05-28 14:32           ` Ludovic Courtès
2016-05-29 17:36             ` Jeremy Robst
2016-05-29 22:07               ` Ludovic Courtès
2016-06-02 14:43                 ` Eric Bavier
2016-06-02 14:58                   ` Jeremy Robst
2016-06-03  8:37                     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).