unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Thomas Danckaert <post@thomasdanckaert.be>
To: ludo@gnu.org
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: Add coda.
Date: Tue, 25 Oct 2016 11:15:26 +0200 (CEST)	[thread overview]
Message-ID: <20161025.111526.2061537021575714460.post@thomasdanckaert.be> (raw)
In-Reply-To: <87inshxwxq.fsf@gnu.org>

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

Thanks for applying!

From: ludo@gnu.org (Ludovic Courtès)
Subject: Re: [PATCH] gnu: Add coda.
Date: Mon, 24 Oct 2016 23:24:17 +0200

> However I noticed that Coda bundles copies of zlib, pcre, and expat.

I hadn't noticed that. I've attached a patch.

cheers,

Thomas

[-- Attachment #2: 0001-gnu-coda-Remove-bundled-libraries.patch --]
[-- Type: Text/X-Patch, Size: 5719 bytes --]

From 56ba046e6c176e8f1109bb28ab75a586daa287db Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
Date: Tue, 25 Oct 2016 10:56:46 +0200
Subject: [PATCH] gnu: coda: Remove bundled libraries.

* gnu/packages/maths.scm (coda): Remove bundled libraries.
[source]: Add patch and snippet to remove bundled zlib, pcre and expat.
[inputs]: Add system zlib, pcre and expat.
* gnu/packages/patches/coda-use-system-libs.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                    |  1 +
 gnu/packages/maths.scm                          | 13 +++++--
 gnu/packages/patches/coda-use-system-libs.patch | 46 +++++++++++++++++++++++++
 3 files changed, 58 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/coda-use-system-libs.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 51849f4..4ffd37a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -484,6 +484,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/clucene-pkgconfig.patch			\
   %D%/packages/patches/clx-remove-demo.patch			\
   %D%/packages/patches/cmake-fix-tests.patch			\
+  %D%/packages/patches/coda-use-system-libs.patch		\
   %D%/packages/patches/cpio-CVE-2016-2037.patch			\
   %D%/packages/patches/cpufrequtils-fix-aclocal.patch		\
   %D%/packages/patches/cracklib-CVE-2016-6318.patch		\
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 2928cb6..70a6212 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -123,18 +123,27 @@ interactive dialogs to guide them.")
        (uri (string-append "https://github.com/stcorp/coda/releases/download/"
                            version "/coda-" version ".tar.gz"))
        (sha256
-        (base32 "04b9l3wzcix0mnfq77mwnil6cbr8h2mki8myvy0lzn236qcwaq1h"))))
+        (base32 "04b9l3wzcix0mnfq77mwnil6cbr8h2mki8myvy0lzn236qcwaq1h"))
+       (patches (search-patches "coda-use-system-libs.patch"))
+       (modules '((guix build utils)))
+       (snippet ;; Make sure we don't use the bundled software.
+        '(map (lambda (d)
+                (delete-file-recursively (string-append "libcoda/" d) ))
+              '("zlib" "pcre" "expat")))))
     (native-inputs
      `(("fortran" ,gfortran)
        ("python" ,python)
        ("python-numpy" ,python-numpy)))
     (inputs
      `(("zlib" ,zlib)
+       ("pcre" ,pcre)
+       ("expat" ,expat)
        ("hdf4" ,hdf4-alt)
        ("hdf5" ,hdf5)))
     (build-system gnu-build-system)
     (arguments
-     '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python")))
+     '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
+                           "LIBS= -lz -lpcre -lexpat")))
     (synopsis "A common interface to various earth observation data formats")
     (description
      "The Common Data Access toolbox (CODA) provides a set of interfaces for
diff --git a/gnu/packages/patches/coda-use-system-libs.patch b/gnu/packages/patches/coda-use-system-libs.patch
new file mode 100644
index 0000000..fbf8441
--- /dev/null
+++ b/gnu/packages/patches/coda-use-system-libs.patch
@@ -0,0 +1,46 @@
+Remove dependencies on bundled zlib, pcre and expat.
+
+diff --git a/Makefile.in b/Makefile.in
+index 4360a26..80f9f59 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -210,8 +210,7 @@ coda_matlab_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ @BUILD_MATLAB_TRUE@@SUBPACKAGE_MODE_FALSE@	-rpath \
+ @BUILD_MATLAB_TRUE@@SUBPACKAGE_MODE_FALSE@	$(matlabmexexecdir)
+ am__DEPENDENCIES_1 =
+-libcoda_la_DEPENDENCIES = @LTLIBOBJS@ libexpat_internal.la \
+-	libpcre_internal.la libz_internal.la $(am__DEPENDENCIES_1) \
++libcoda_la_DEPENDENCIES = @LTLIBOBJS@ $(am__DEPENDENCIES_1) \
+ 	$(am__DEPENDENCIES_1)
+ am__libcoda_la_SOURCES_DIST = libcoda/coda-ascbin-cursor.c \
+ 	libcoda/coda-ascbin.h libcoda/coda-ascii-cursor.c \
+@@ -306,8 +305,7 @@ libcoda_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ 	$(libcoda_la_LDFLAGS) $(LDFLAGS) -o $@
+ @SUBPACKAGE_MODE_FALSE@am_libcoda_la_rpath = -rpath $(libdir)
+-am__DEPENDENCIES_2 = @LTLIBOBJS@ libexpat_internal.la \
+-	libpcre_internal.la libz_internal.la $(am__DEPENDENCIES_1) \
++am__DEPENDENCIES_2 = @LTLIBOBJS@ $(am__DEPENDENCIES_1) \
+ 	$(am__DEPENDENCIES_1)
+ libcoda_internal_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+ am__libcoda_internal_la_SOURCES_DIST = libcoda/coda-ascbin-cursor.c \
+@@ -898,8 +896,8 @@ INSTALL_DATA_HOOK_TARGETS = $(am__append_1)
+ UNINSTALL_HOOK_TARGETS = 
+ CLEAN_LOCAL_TARGETS = $(am__append_11)
+ ALL_LOCAL_TARGETS = 
+-@SUBPACKAGE_MODE_FALSE@noinst_LTLIBRARIES = libcoda_internal.la libexpat_internal.la libpcre_internal.la libz_internal.la
+-@SUBPACKAGE_MODE_TRUE@noinst_LTLIBRARIES = libcoda_internal.la libexpat_internal.la libpcre_internal.la libz_internal.la
++@SUBPACKAGE_MODE_FALSE@noinst_LTLIBRARIES = libcoda_internal.la
++@SUBPACKAGE_MODE_TRUE@noinst_LTLIBRARIES = libcoda_internal.la
+ 
+ # libraries (+ related files)
+ @SUBPACKAGE_MODE_FALSE@lib_LTLIBRARIES = libcoda.la
+@@ -1048,7 +1046,7 @@ libcoda_hdf5_files = \
+ 
+ libcoda_la_CPPFLAGS = -Ilibcoda/expat -I$(srcdir)/libcoda/expat -Ilibcoda/pcre -I$(srcdir)/libcoda/pcre -Ilibcoda/zlib -I$(srcdir)/libcoda/zlib $(AM_CPPFLAGS)
+ libcoda_la_LDFLAGS = -no-undefined -version-info $(LIBCODA_CURRENT):$(LIBCODA_REVISION):$(LIBCODA_AGE)
+-libcoda_la_LIBADD = @LTLIBOBJS@ libexpat_internal.la libpcre_internal.la libz_internal.la $(HDF4LIBS) $(HDF5LIBS)
++libcoda_la_LIBADD = @LTLIBOBJS@ $(HDF4LIBS) $(HDF5LIBS)
+ libcoda_internal_la_SOURCES = libcoda/coda-ascbin-cursor.c \
+ 	libcoda/coda-ascbin.h libcoda/coda-ascii-cursor.c \
+ 	libcoda/coda-ascii-internal.h libcoda/coda-ascii.c \
-- 
2.7.4


  reply	other threads:[~2016-10-25  9:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-19  9:59 [PATCH] gnu: Add coda Thomas Danckaert
2016-10-19 20:13 ` Ludovic Courtès
2016-10-21  7:26   ` Thomas Danckaert
2016-10-24 21:24     ` Ludovic Courtès
2016-10-25  9:15       ` Thomas Danckaert [this message]
2016-10-25 12:58         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161025.111526.2061537021575714460.post@thomasdanckaert.be \
    --to=post@thomasdanckaert.be \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).