unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: add proj4.
@ 2017-01-15 22:21 Björn Höfling
  2017-01-15 22:24 ` Björn Höfling
  0 siblings, 1 reply; 6+ messages in thread
From: Björn Höfling @ 2017-01-15 22:21 UTC (permalink / raw)
  To: guix-devel


* gnu/packages/geo.scm (proj4): New variable.
---
 gnu/packages/geo.scm | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 56 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 86828e717..06321932d 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
+;;; Copyright © 2017 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -19,8 +20,9 @@
 
 (define-module (gnu packages geo)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system gnu)
   #:use-module (guix download)
-  #:use-module (guix licenses)
+  #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix utils)
   #:use-module (gnu packages glib)
@@ -92,4 +94,56 @@
 the OpenStreetMap project.  It can provide directions for walking, bicycling,
 and driving.")
     (home-page "https://wiki.gnome.org/Apps/Maps")
-    (license gpl2+)))
+    (license license:gpl2+)))
+
+(define-public proj4
+  (package
+    (name "proj.4")
+    (version "4.9.3")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://download.osgeo.org/proj/proj-"
+                                  version
+                                  ".tar.gz"))
+              (sha256
+               (base32
+                "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
+    (build-system gnu-build-system)
+    (arguments `(#:phases
+                 (modify-phases %standard-phases
+                   (add-after
+                       'unpack 'patch-test-shebangs
+                     (lambda _
+                       (substitute* '("nad/test27"
+                                      "nad/test83"
+                                      "nad/testvarious"
+                                      "nad/testdatumfile"
+                                      "nad/testflaky"
+                                      "nad/testIGNF")
+                         (("/bin/rm") (which "rm")))))
+                   ;; Precision problems on i686 and other platforms. See:
+                   ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
+                   ;; Disable failing test.
+                   (add-after
+                       'patch-test-shebangs 'ignore-failing-tests
+                     (lambda _
+                       (substitute* '("nad/Makefile.in")
+                         (("\tPROJ_LIB.*" all) (string-append  "#" all))))))))
+    (inputs
+     `(("glib" ,glib)))
+    (home-page "http://proj4.org/")
+    (synopsis "Cartographic Projections Library")
+    (description
+     "Proj.4 is a library for converting coordinates between cartographic projections.
+")
+    (license '(license:expat
+               ;; config.guess, config.sub
+               license:gpl3+
+               ;; libtool
+               license:gpl2+
+               ;; src/PJ_patterson.c
+               license:asl2.0
+               ;; src/geodesic.c/h
+               license:x11
+               ;; cmake/*
+               license:boost1.0))))
-- 
2.11.0

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

* Re: [PATCH] gnu: add proj4.
  2017-01-15 22:21 [PATCH] gnu: add proj4 Björn Höfling
@ 2017-01-15 22:24 ` Björn Höfling
  2017-01-15 23:21   ` Danny Milosavljevic
  0 siblings, 1 reply; 6+ messages in thread
From: Björn Höfling @ 2017-01-15 22:24 UTC (permalink / raw)
  To: guix-devel

Hi list,

this im my first patch to Guix, so please tell me what you think.

Here are my remarks:

Linter complains:

* gnu/packages/geo.scm:139:13: proj4-4.9.3: invalid license field

But the documentation explicitly speaks about list values. What's wrong?

* /home/bjoern/guix/gnu/packages/geo.scm:100:2: proj4-4.9.3: line 125 is way too long (102 characters)

Yes, this is very long. But it's a URL. Is there any rule on how to break it? Or leave it?

About the package name: The official name is "proj.4", so I left it as that.
As variable name, I chose "proj4". Is that correct?

Björn



On Sun, 15 Jan 2017 23:21:47 +0100
Björn Höfling <bjoern.hoefling@bjoernhoefling.de> wrote:

> * gnu/packages/geo.scm (proj4): New variable.
> ---
>  gnu/packages/geo.scm | 58
> ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed,
> 56 insertions(+), 2 deletions(-)
> 
> diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
> index 86828e717..06321932d 100644
> --- a/gnu/packages/geo.scm
> +++ b/gnu/packages/geo.scm
> @@ -1,6 +1,7 @@
>  ;;; GNU Guix --- Functional package management for GNU
>  ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
>  ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
> +;;; Copyright © 2017 Björn Höfling
> <bjoern.hoefling@bjoernhoefling.de> ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -19,8 +20,9 @@
>  
>  (define-module (gnu packages geo)
>    #:use-module (guix build-system glib-or-gtk)
> +  #:use-module (guix build-system gnu)
>    #:use-module (guix download)
> -  #:use-module (guix licenses)
> +  #:use-module ((guix licenses) #:prefix license:)
>    #:use-module (guix packages)
>    #:use-module (guix utils)
>    #:use-module (gnu packages glib)
> @@ -92,4 +94,56 @@
>  the OpenStreetMap project.  It can provide directions for walking,
> bicycling, and driving.")
>      (home-page "https://wiki.gnome.org/Apps/Maps")
> -    (license gpl2+)))
> +    (license license:gpl2+)))
> +
> +(define-public proj4
> +  (package
> +    (name "proj.4")
> +    (version "4.9.3")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> "http://download.osgeo.org/proj/proj-"
> +                                  version
> +                                  ".tar.gz"))
> +              (sha256
> +               (base32
> +
> "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
> +    (build-system gnu-build-system)
> +    (arguments `(#:phases
> +                 (modify-phases %standard-phases
> +                   (add-after
> +                       'unpack 'patch-test-shebangs
> +                     (lambda _
> +                       (substitute* '("nad/test27"
> +                                      "nad/test83"
> +                                      "nad/testvarious"
> +                                      "nad/testdatumfile"
> +                                      "nad/testflaky"
> +                                      "nad/testIGNF")
> +                         (("/bin/rm") (which "rm")))))
> +                   ;; Precision problems on i686 and other
> platforms. See:
> +                   ;;
> https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
> +                   ;; Disable failing test.
> +                   (add-after
> +                       'patch-test-shebangs 'ignore-failing-tests
> +                     (lambda _
> +                       (substitute* '("nad/Makefile.in")
> +                         (("\tPROJ_LIB.*" all) (string-append  "#"
> all))))))))
> +    (inputs
> +     `(("glib" ,glib)))
> +    (home-page "http://proj4.org/")
> +    (synopsis "Cartographic Projections Library")
> +    (description
> +     "Proj.4 is a library for converting coordinates between
> cartographic projections. +")
> +    (license '(license:expat
> +               ;; config.guess, config.sub
> +               license:gpl3+
> +               ;; libtool
> +               license:gpl2+
> +               ;; src/PJ_patterson.c
> +               license:asl2.0
> +               ;; src/geodesic.c/h
> +               license:x11
> +               ;; cmake/*
> +               license:boost1.0))))

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

* Re: [PATCH] gnu: add proj4.
  2017-01-15 22:24 ` Björn Höfling
@ 2017-01-15 23:21   ` Danny Milosavljevic
  2017-01-16 20:05     ` Björn Höfling
  0 siblings, 1 reply; 6+ messages in thread
From: Danny Milosavljevic @ 2017-01-15 23:21 UTC (permalink / raw)
  To: Björn Höfling; +Cc: guix-devel

Hi,

> * gnu/packages/geo.scm:139:13: proj4-4.9.3: invalid license field
> 
> But the documentation explicitly speaks about list values. What's wrong?

You quoted the list. That means that all the symbols in it stay symbols and are not resolved. Instead of substituting the actual license license:asl2.0, it will literally put 'license:asl2.0 into the list.

I'd just use something like (list license:a license:b) .

It would also be possible to use quasiquote but I'd not do that in this case. It's too obtuse. `(,license:a ,license:b)

> * /home/bjoern/guix/gnu/packages/geo.scm:100:2: proj4-4.9.3: line 125 is way too long (102 characters)

It's an URL in a comment - I'd be fine with it as-is and I wouldn't break it anywhere.

> About the package name: The official name is "proj.4", so I left it as that.

Seems reasonable.

> As variable name, I chose "proj4". Is that correct?

Why not use the variable name "proj.4" too then? *scratches head*

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

* Re: [PATCH] gnu: add proj4.
  2017-01-15 23:21   ` Danny Milosavljevic
@ 2017-01-16 20:05     ` Björn Höfling
  2017-01-16 22:46       ` Leo Famulari
  2017-01-17 13:42       ` Marius Bakke
  0 siblings, 2 replies; 6+ messages in thread
From: Björn Höfling @ 2017-01-16 20:05 UTC (permalink / raw)
  To: guix-devel

On Mon, 16 Jan 2017 00:21:28 +0100
Danny Milosavljevic <dannym@scratchpost.org> wrote:

> Hi,
> 
> > * gnu/packages/geo.scm:139:13: proj4-4.9.3: invalid license field
> > 
> > But the documentation explicitly speaks about list values. What's
> > wrong?  
> 
> You quoted the list. That means that all the symbols in it stay
> symbols and are not resolved. Instead of substituting the actual
> license license:asl2.0, it will literally put 'license:asl2.0 into
> the list.
> 
> I'd just use something like (list license:a license:b) .

It's a list of records, not of symbols, of cause! Thanks.

> 
> It would also be possible to use quasiquote but I'd not do that in
> this case. It's too obtuse. `(,license:a ,license:b)
> 
> > * /home/bjoern/guix/gnu/packages/geo.scm:100:2: proj4-4.9.3: line
> > 125 is way too long (102 characters)  
> 
> It's an URL in a comment - I'd be fine with it as-is and I wouldn't
> break it anywhere.
> 
> > About the package name: The official name is "proj.4", so I left it
> > as that.  
> 
> Seems reasonable.
> 
> > As variable name, I chose "proj4". Is that correct?  
> 
> Why not use the variable name "proj.4" too then? *scratches head*


Because my Scheme-time is far too long ago, and I'm used to languages
where "dot" in variable names is bad.

Here is the new patch with the two corrections.

Björn




* gnu/packages/geo.scm (proj4): New variable.
---
 gnu/packages/geo.scm | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 56 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 86828e717..0e63fe8c7 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
+;;; Copyright © 2017 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -19,8 +20,9 @@
 
 (define-module (gnu packages geo)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system gnu)
   #:use-module (guix download)
-  #:use-module (guix licenses)
+  #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix utils)
   #:use-module (gnu packages glib)
@@ -92,4 +94,56 @@
 the OpenStreetMap project.  It can provide directions for walking, bicycling,
 and driving.")
     (home-page "https://wiki.gnome.org/Apps/Maps")
-    (license gpl2+)))
+    (license license:gpl2+)))
+
+(define-public proj.4
+  (package
+    (name "proj.4")
+    (version "4.9.3")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://download.osgeo.org/proj/proj-"
+                                  version
+                                  ".tar.gz"))
+              (sha256
+               (base32
+                "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
+    (build-system gnu-build-system)
+    (arguments `(#:phases
+                 (modify-phases %standard-phases
+                   (add-after
+                       'unpack 'patch-test-shebangs
+                     (lambda _
+                       (substitute* '("nad/test27"
+                                      "nad/test83"
+                                      "nad/testvarious"
+                                      "nad/testdatumfile"
+                                      "nad/testflaky"
+                                      "nad/testIGNF")
+                         (("/bin/rm") (which "rm")))))
+                   ;; Precision problems on i686 and other platforms. See:
+                   ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
+                   ;; Disable failing test.
+                   (add-after
+                       'patch-test-shebangs 'ignore-failing-tests
+                     (lambda _
+                       (substitute* '("nad/Makefile.in")
+                         (("\tPROJ_LIB.*" all) (string-append  "#" all))))))))
+    (inputs
+     `(("glib" ,glib)))
+    (home-page "http://proj4.org/")
+    (synopsis "Cartographic Projections Library")
+    (description
+     "Proj.4 is a library for converting coordinates between cartographic projections.
+")
+    (license (list license:expat
+               ;; config.guess, config.sub
+               license:gpl3+
+               ;; libtool
+               license:gpl2+
+               ;; src/PJ_patterson.c
+               license:asl2.0
+               ;; src/geodesic.c/h
+               license:x11
+               ;; cmake/*
+               license:boost1.0))))
-- 
2.11.0

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

* Re: [PATCH] gnu: add proj4.
  2017-01-16 20:05     ` Björn Höfling
@ 2017-01-16 22:46       ` Leo Famulari
  2017-01-17 13:42       ` Marius Bakke
  1 sibling, 0 replies; 6+ messages in thread
From: Leo Famulari @ 2017-01-16 22:46 UTC (permalink / raw)
  To: Björn Höfling; +Cc: guix-devel

On Mon, Jan 16, 2017 at 09:05:12PM +0100, Björn Höfling wrote:
> > > About the package name: The official name is "proj.4", so I left it
> > > as that.  
> > 
> > Seems reasonable.
> > 
> > > As variable name, I chose "proj4". Is that correct?  
> > 
> > Why not use the variable name "proj.4" too then? *scratches head*
> 
> 
> Because my Scheme-time is far too long ago, and I'm used to languages
> where "dot" in variable names is bad.

The convention seems to be that all punctuation is replaced by a hyphen,
although the manual section 7.6.2 Package Naming doesn't specify this.
There are a few packages with 'dots' in the name.

Either way, I think it's not that important. It's probably more
useful to stay close to the "upstream" name so that users can find
packages quickly. Do as you see fit :)

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

* Re: [PATCH] gnu: add proj4.
  2017-01-16 20:05     ` Björn Höfling
  2017-01-16 22:46       ` Leo Famulari
@ 2017-01-17 13:42       ` Marius Bakke
  1 sibling, 0 replies; 6+ messages in thread
From: Marius Bakke @ 2017-01-17 13:42 UTC (permalink / raw)
  To: Björn Höfling, guix-devel

[-- Attachment #1: Type: text/plain, Size: 4573 bytes --]

Björn Höfling <bjoern.hoefling@bjoernhoefling.de> writes:

> Hi list,
>
> this im my first patch to Guix, so please tell me what you think.

Hello Björn!

Welcome to the list! Pretty impressive for a first patch :-)

I've committed it with a few cosmetic improvements, described below.

> * gnu/packages/geo.scm (proj4): New variable.
> ---
>  gnu/packages/geo.scm | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 56 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
> index 86828e717..0e63fe8c7 100644
> --- a/gnu/packages/geo.scm
> +++ b/gnu/packages/geo.scm
> @@ -1,6 +1,7 @@
>  ;;; GNU Guix --- Functional package management for GNU
>  ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
>  ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
> +;;; Copyright © 2017 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -19,8 +20,9 @@
>  
>  (define-module (gnu packages geo)
>    #:use-module (guix build-system glib-or-gtk)
> +  #:use-module (guix build-system gnu)
>    #:use-module (guix download)
> -  #:use-module (guix licenses)
> +  #:use-module ((guix licenses) #:prefix license:)
>    #:use-module (guix packages)
>    #:use-module (guix utils)
>    #:use-module (gnu packages glib)
> @@ -92,4 +94,56 @@
>  the OpenStreetMap project.  It can provide directions for walking, bicycling,
>  and driving.")
>      (home-page "https://wiki.gnome.org/Apps/Maps")
> -    (license gpl2+)))
> +    (license license:gpl2+)))

While trivial, this change should be mentioned in the commit log
according to the GNU ChangeLog style. This way, if it did break
anything, it would be found with "git log --grep gnome-maps" :-)

> +(define-public proj.4
> +  (package
> +    (name "proj.4")
> +    (version "4.9.3")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "http://download.osgeo.org/proj/proj-"
> +                                  version
> +                                  ".tar.gz"))
> +              (sha256
> +               (base32
> +                "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
> +    (build-system gnu-build-system)
> +    (arguments `(#:phases

I moved the '`(#:phases..' down one line and indented again. Now the URL fits
nicely on a horizontally split 1920x1080 screen.

> +                 (modify-phases %standard-phases
> +                   (add-after
> +                       'unpack 'patch-test-shebangs
> +                     (lambda _
> +                       (substitute* '("nad/test27"
> +                                      "nad/test83"
> +                                      "nad/testvarious"
> +                                      "nad/testdatumfile"
> +                                      "nad/testflaky"
> +                                      "nad/testIGNF")
> +                         (("/bin/rm") (which "rm")))))
> +                   ;; Precision problems on i686 and other platforms. See:
> +                   ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
> +                   ;; Disable failing test.
> +                   (add-after
> +                       'patch-test-shebangs 'ignore-failing-tests
> +                     (lambda _
> +                       (substitute* '("nad/Makefile.in")
> +                         (("\tPROJ_LIB.*" all) (string-append  "#" all))))))))

'substitute*' has an undefined return value, so we add an explicit #t at
the end of such phases to make sure they succeed.

> +    (inputs
> +     `(("glib" ,glib)))
> +    (home-page "http://proj4.org/")
> +    (synopsis "Cartographic Projections Library")
> +    (description
> +     "Proj.4 is a library for converting coordinates between cartographic projections.
> +")
> +    (license (list license:expat
> +               ;; config.guess, config.sub
> +               license:gpl3+
> +               ;; libtool
> +               license:gpl2+

Autotools generated files do not need to be mentioned here AFAIA.

> +               ;; src/PJ_patterson.c
> +               license:asl2.0
> +               ;; src/geodesic.c/h
> +               license:x11
> +               ;; cmake/*
> +               license:boost1.0))))

I also added a license entry for the embedded EPSG database:

http://www.epsg.org/TermsOfUse

Pushed as 0e159a1a09970c72603d08a028d0bb531ab6ab61 !

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

end of thread, other threads:[~2017-01-17 13:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-15 22:21 [PATCH] gnu: add proj4 Björn Höfling
2017-01-15 22:24 ` Björn Höfling
2017-01-15 23:21   ` Danny Milosavljevic
2017-01-16 20:05     ` Björn Höfling
2017-01-16 22:46       ` Leo Famulari
2017-01-17 13:42       ` Marius Bakke

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).