diff mbox series

[bug#50812,v2,2/5] gnu: Add python-pyproj.

Message ID 20210926174150.26146-3-felgru@posteo.net
State Accepted
Headers show
Series None | expand

Commit Message

Felix Gruber Sept. 26, 2021, 5:41 p.m. UTC
* gnu/packages/geo.scm (python-pyproj): New variable.
---
 gnu/packages/geo.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

Comments

Xinglu Chen Sept. 26, 2021, 8:41 p.m. UTC | #1
On Sun, Sep 26 2021, Felix Gruber wrote:

> * gnu/packages/geo.scm (python-pyproj): New variable.
> ---
>  gnu/packages/geo.scm | 41 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 41 insertions(+)
>
> diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
> index c10b93d83f..ee1c9c5674 100644
> --- a/gnu/packages/geo.scm
> +++ b/gnu/packages/geo.scm
> @@ -93,6 +93,7 @@
>    #:use-module (gnu packages pulseaudio)
>    #:use-module (gnu packages python)
>    #:use-module (gnu packages python-check)
> +  #:use-module (gnu packages python-crypto)
>    #:use-module (gnu packages python-science)
>    #:use-module (gnu packages python-web)
>    #:use-module (gnu packages python-xyz)
> @@ -633,6 +634,46 @@ projections.")
>                     ;; cmake/*
>                     license:boost1.0))))
>  
> +(define-public python-pyproj
> +  (package
> +    (name "python-pyproj")
> +    (version "3.2.1")
> +    (source
> +      (origin
> +        (method url-fetch)
> +        (uri (pypi-uri "pyproj" version))
> +        (sha256
> +          (base32
> +            "0xrqpy708qlyd7nqjra0dl7nvkqzaj9w0v7wq4j5pxazha9n14sa"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'set-proj-path
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (let ((proj (assoc-ref inputs "proj")))
> +               (setenv "PROJ_DIR" proj)
> +               (substitute* "pyproj/datadir.py"
> +                 (("(internal_datadir = ).*$" all var)
> +                  (string-append var "Path(\"" proj "/share/proj\")\n")))
> +               ))))))

These brackets should not be on their own line.

> +    (inputs
> +      `(("proj" ,proj.7)))
> +    (propagated-inputs
> +      `(("python-certifi" ,python-certifi)))
> +    (native-inputs
> +      `(("python-cython" ,python-cython)
> +        ("python-numpy" ,python-numpy)
> +        ("python-pandas" ,python-pandas)
> +        ("python-pytest" ,python-pytest)
> +        ("python-xarray" ,python-xarray)))
> +    (home-page "https://github.com/pyproj4/pyproj")
> +    (synopsis
> +      "Python interface to PROJ")
> +    (description
> +      "Python interface to PROJ (cartographic projections and coordinate transformations library)")

Please keep lines to <=80 characters.  The sentence is lacking a
subject and a period.  I suggest

  This package provides a Python interface to PROJ, a cartographic
  projections and coordinate transformations library.
diff mbox series

Patch

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index c10b93d83f..ee1c9c5674 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -93,6 +93,7 @@ 
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-check)
+  #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-science)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
@@ -633,6 +634,46 @@  projections.")
                    ;; cmake/*
                    license:boost1.0))))
 
+(define-public python-pyproj
+  (package
+    (name "python-pyproj")
+    (version "3.2.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "pyproj" version))
+        (sha256
+          (base32
+            "0xrqpy708qlyd7nqjra0dl7nvkqzaj9w0v7wq4j5pxazha9n14sa"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'set-proj-path
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((proj (assoc-ref inputs "proj")))
+               (setenv "PROJ_DIR" proj)
+               (substitute* "pyproj/datadir.py"
+                 (("(internal_datadir = ).*$" all var)
+                  (string-append var "Path(\"" proj "/share/proj\")\n")))
+               ))))))
+    (inputs
+      `(("proj" ,proj.7)))
+    (propagated-inputs
+      `(("python-certifi" ,python-certifi)))
+    (native-inputs
+      `(("python-cython" ,python-cython)
+        ("python-numpy" ,python-numpy)
+        ("python-pandas" ,python-pandas)
+        ("python-pytest" ,python-pytest)
+        ("python-xarray" ,python-xarray)))
+    (home-page "https://github.com/pyproj4/pyproj")
+    (synopsis
+      "Python interface to PROJ")
+    (description
+      "Python interface to PROJ (cartographic projections and coordinate transformations library)")
+    (license license:expat)))
+
 (define-public mapnik
   (package
     (name "mapnik")