unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Thomas Danckaert <thomas.danckaert@gmail.com>
To: guix-devel@gnu.org
Subject: Re: [PATCH] Add gctp
Date: Tue, 21 Jun 2016 08:35:22 +0200 (CEST)	[thread overview]
Message-ID: <20160621.083522.189628123526233508.thomas.danckaert@gmail.com> (raw)
In-Reply-To: <20160618.110540.2110350506362048689.thomas.danckaert@gmail.com>

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

Hi Guix,

here's a new patch for gctp.  This one takes the source for gctp 2.0, and patches it to add an autotools build configuration.  I also had to add a patch to remove an override of 'sincos', which leads to an infinite recursion when calling sin/cos/sincos on my system.

Thomas

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

From 8b03b2edbaf26ed73001ab13ce2e51a3b9a4df53 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
Date: Fri, 17 Jun 2016 10:41:50 +0200
Subject: [PATCH] gnu: Add gctp.

* gnu/packages/maths.cm (gctp): New variable.
* gnu/packages/patches/gctp-autoconfiscate.patch: New file.
* gnu/packages/patches/gctp-sincos.patch: New file.
---
 gnu/packages/maths.scm                         | 38 +++++++++++++
 gnu/packages/patches/gctp-autoconfiscate.patch | 77 ++++++++++++++++++++++++++
 gnu/packages/patches/gctp-sincos.patch         | 22 ++++++++
 3 files changed, 137 insertions(+)
 create mode 100644 gnu/packages/patches/gctp-autoconfiscate.patch
 create mode 100644 gnu/packages/patches/gctp-sincos.patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 3b860a9..0601619 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -42,6 +42,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system r)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
@@ -408,6 +409,43 @@ plotting engine by third-party applications like Octave.")
     (license (license:fsf-free
               "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
 
+(define-public gctp
+  (package
+    (name "gctp")
+    (version "2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri "http://www.nco.ncep.noaa.gov\
+/pmb/codes/nwprod/util/sorc/wgrib2.cd/grib2/gctpc20.tar.Z")
+       (sha256
+        (base32
+         "0sx69yljdy7r1v4idk7c19vlzplzqnpqf6z1p825l5w0ym1awzi1"))
+       (patches (search-patches "gctp-autoconfiscate.patch"
+                                "gctp-sincos.patch"))
+       ))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before
+             'configure 'autogen
+           (lambda _ (zero? (system* "autoreconf" "--install")))))))
+    (synopsis "General Cartographic Transformation Package (GCTP)")
+    (description
+     "The General Cartographic Transformation Package (GCTP) is a system of
+software routines designed to permit the transformation of coordinate pairs
+from one map projection to another.  The GCTP is the standard computer
+software used by the National Mapping Division for map projection
+computations.")
+    (home-page "http://gcmd.nasa.gov/records/USGS-GCTP.html")
+    (license (license:bsd-style
+              "http://gcmd.nasa.gov/records/USGS-GCTP.html"))))
+
 (define-public hdf5
   (package
     (name "hdf5")
diff --git a/gnu/packages/patches/gctp-autoconfiscate.patch b/gnu/packages/patches/gctp-autoconfiscate.patch
new file mode 100644
index 0000000..83db0bf
--- /dev/null
+++ b/gnu/packages/patches/gctp-autoconfiscate.patch
@@ -0,0 +1,77 @@
+From 3f3c27f97edf864d7312e5f43daa386903b839c9 Mon Sep 17 00:00:00 2001
+From: Thomas Danckaert <thomas.danckaert@gmail.com>
+Date: Sat, 18 Jun 2016 17:58:47 +0200
+Subject: [PATCH] Minimal autotools build.
+
+---
+ Makefile.am        |  1 +
+ configure.ac       | 23 +++++++++++++++++++++++
+ source/Makefile.am | 18 ++++++++++++++++++
+ 3 files changed, 42 insertions(+)
+ create mode 100644 Makefile.am
+ create mode 100644 configure.ac
+ create mode 100644 source/Makefile.am
+
+diff --git a/Makefile.am b/Makefile.am
+new file mode 100644
+index 0000000..4b48b24
+--- /dev/null
++++ b/Makefile.am
+@@ -0,0 +1 @@
++SUBDIRS = source
+diff --git a/configure.ac b/configure.ac
+new file mode 100644
+index 0000000..e35d418
+--- /dev/null
++++ b/configure.ac
+@@ -0,0 +1,23 @@
++AC_PREREQ([2.69])
++AC_INIT([gctp], [2.0], [guix-devel@gnu.org])
++AM_INIT_AUTOMAKE(foreign)
++LT_INIT
++AC_CONFIG_SRCDIR([source/cproj.c])
++AC_CONFIG_HEADERS([config.h])
++
++# Checks for programs.
++AC_PROG_CC
++
++# Checks for libraries.
++AC_CHECK_LIB([m], [sin])
++
++# Checks for header files.
++AC_CHECK_HEADERS([stdlib.h string.h])
++
++# Checks for library functions.
++AC_CHECK_FUNCS([pow sqrt])
++
++AC_CONFIG_FILES([Makefile
++        source/Makefile])
++       #          test/test_proj/Makefile])
++AC_OUTPUT
+diff --git a/source/Makefile.am b/source/Makefile.am
+new file mode 100644
+index 0000000..6de94ae
+--- /dev/null
++++ b/source/Makefile.am
+@@ -0,0 +1,18 @@
++lib_LTLIBRARIES = libgctp.la
++
++libgctp_la_SOURCES = gctp.c alberfor.c alberinv.c alconfor.c alconinv.c azimfor.c \
++	  aziminv.c eqconfor.c eqconinv.c equifor.c equiinv.c gnomfor.c \
++	  gnominv.c goodfor.c goodinv.c gvnspfor.c gvnspinv.c hamfor.c \
++	  haminv.c imolwfor.c imolwinv.c lamazfor.c lamazinv.c merfor.c \
++	  merinv.c millfor.c millinv.c molwfor.c molwinv.c obleqfor.c  \
++	  obleqinv.c omerfor.c omerinv.c orthfor.c orthinv.c polyfor.c \
++	  polyinv.c psfor.c psinv.c robfor.c robinv.c sinfor.c sininv.c \
++	  somfor.c sominv.c sterfor.c sterinv.c stplnfor.c stplninv.c \
++	  tmfor.c tminv.c utmfor.c utminv.c vandgfor.c vandginv.c \
++	  wivfor.c wivinv.c wviifor.c wviiinv.c for_init.c inv_init.c \
++	  cproj.c report.c lamccfor.c lamccinv.c paksz.c untfz.c sphdz.c \
++	  br_gctp.c
++
++include_HEADERS = cproj.h proj.h
++
++libgctp_la_LDFLAGS = -release 2.0.0
+-- 
+2.5.0
+
diff --git a/gnu/packages/patches/gctp-sincos.patch b/gnu/packages/patches/gctp-sincos.patch
new file mode 100644
index 0000000..b188fcb
--- /dev/null
+++ b/gnu/packages/patches/gctp-sincos.patch
@@ -0,0 +1,22 @@
+Don't override standard math function sincos.
+
+--- a/source/cproj.c	2016-06-20 12:29:19.746105496 +0200
++++ b/source/cproj.c	2016-06-20 12:29:11.782083820 +0200
+@@ -46,7 +46,7 @@
+    than calling each function separately.  It is provided here for those
+    computer systems which don`t implement this function
+   ----------------------------------------------------*/
+-void sincos(val, sin_val, cos_val)
++/*void sincos(val, sin_val, cos_val)
+ double val;
+ double *sin_val;
+ double *cos_val;
+@@ -54,7 +54,7 @@
+ *sin_val = sin(val);
+ *cos_val = cos(val);
+ return;
+-}
++}*/
+ 
+ /* Function to eliminate roundoff errors in asin
+ ----------------------------------------------*/
-- 
2.5.0


  reply	other threads:[~2016-06-21  6:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17 12:40 [PATCH] Add gctp Thomas Danckaert
2016-06-18  1:39 ` Leo Famulari
2016-06-18  9:05   ` Thomas Danckaert
2016-06-21  6:35     ` Thomas Danckaert [this message]
2016-06-25 17:21     ` Leo Famulari
2016-06-27 19:07       ` Thomas Danckaert
2016-07-01 20:33         ` Leo Famulari
2016-07-07  7:40           ` Thomas Danckaert
2016-07-18 13:02             ` Ludovic Courtès
2016-07-18 21:47             ` Leo Famulari
2016-09-15 17:08               ` Thomas Danckaert
2016-09-24  1:08                 ` Leo Famulari
2016-09-24 19:49                   ` Thomas Danckaert
2016-09-27 17:38                     ` Leo Famulari
  -- strict thread matches above, loose matches on Subject: below --
2016-06-17 12:41 Thomas Danckaert
2016-06-17  9:29 Thomas Danckaert

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=20160621.083522.189628123526233508.thomas.danckaert@gmail.com \
    --to=thomas.danckaert@gmail.com \
    --cc=guix-devel@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).