From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Danckaert Subject: Re: [PATCH] Add gctp Date: Tue, 21 Jun 2016 08:35:22 +0200 (CEST) Message-ID: <20160621.083522.189628123526233508.thomas.danckaert@gmail.com> References: <20160617.144017.336729442489418576.post@thomasdanckaert.be> <20160618013926.GA1823@jasmine> <20160618.110540.2110350506362048689.thomas.danckaert@gmail.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Tue_Jun_21_08_35_22_2016_985)--" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFFHd-0008KI-EP for guix-devel@gnu.org; Tue, 21 Jun 2016 02:35:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFFHZ-0005UK-31 for guix-devel@gnu.org; Tue, 21 Jun 2016 02:35:36 -0400 Received: from mail-lb0-x229.google.com ([2a00:1450:4010:c04::229]:33857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFFHY-0005U5-LU for guix-devel@gnu.org; Tue, 21 Jun 2016 02:35:33 -0400 Received: by mail-lb0-x229.google.com with SMTP id oe3so3659717lbb.1 for ; Mon, 20 Jun 2016 23:35:32 -0700 (PDT) Received: from localhost (ptr-178-50-75-74.dyn.mobistar.be. [178.50.75.74]) by smtp.gmail.com with ESMTPSA id el4sm34375178wjd.23.2016.06.20.23.35.29 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Jun 2016 23:35:29 -0700 (PDT) In-Reply-To: <20160618.110540.2110350506362048689.thomas.danckaert@gmail.com> 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_Jun_21_08_35_22_2016_985)-- Content-Type: Text/Plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 ----Next_Part(Tue_Jun_21_08_35_22_2016_985)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0001-gnu-Add-gctp.patch" >From 8b03b2edbaf26ed73001ab13ce2e51a3b9a4df53 Mon Sep 17 00:00:00 2001 From: Thomas Danckaert 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 +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 ----Next_Part(Tue_Jun_21_08_35_22_2016_985)----