GNU bug report logs - #38150
[WIP] gnu: Add grass.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Wiktor Żelazny <wz@HIDDEN>; merged with #38178; dated Sat, 9 Nov 2019 11:34:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.
Merged 38150 38178. Request was from Ludovic Courtès <ludo@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 38150 <at> debbugs.gnu.org:


Received: (at 38150) by debbugs.gnu.org; 9 Nov 2019 22:47:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 09 17:47:14 2019
Received: from localhost ([127.0.0.1]:50426 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iTZVh-0000Uk-T9
	for submit <at> debbugs.gnu.org; Sat, 09 Nov 2019 17:47:14 -0500
Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:55095)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mbakke@HIDDEN>) id 1iTZVZ-0000U7-Ew
 for 38150 <at> debbugs.gnu.org; Sat, 09 Nov 2019 17:47:08 -0500
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.west.internal (Postfix) with ESMTP id 811A3452;
 Sat,  9 Nov 2019 17:46:59 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute5.internal (MEProxy); Sat, 09 Nov 2019 17:46:59 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h=
 from:to:subject:in-reply-to:references:date:message-id
 :mime-version:content-type; s=fm1; bh=wxckM064Fq9dmi9SfQKx8w2piF
 oFuiM/BbS+6eO4p+k=; b=IA9ptmsGnPQPPrhjn4eJg066CORQZljwjPix1T0nm1
 2QDeAf2GxmcFxGsSRMyAiXT5NUkikIF4lcwg3siouumXiyQltIjSE17uswXGoNH7
 mriFii6fgYe7804tzqyaBU9OYlDkT+WB3KxtQmh2UCTq0IeP6kahdmK3ARN8QJy4
 UlkDoVmFaN4E+FZdqNsssHKL/LsWKqdAkwduhJdLWyZCOpPvj5VXzcX52D3vKZtP
 eSuvYpgmuzbT/4P4n1+xsGSYEFqoiLn6ITzjP36g46QvVAK5esyqevFJs4aX1Njx
 tlMkThG9zk/YIUS3/9ydPpXiXgAdF5h1pv0N8yV85r9g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=wxckM0
 64Fq9dmi9SfQKx8w2piFoFuiM/BbS+6eO4p+k=; b=ElGUOtgBZQKy7YlRit8ZM9
 y+QtvXk2J5rfi6FBrxY7aUotEvEyiACU1FGrAwSFcXljRnMMVncf8oj24aN4cqsx
 4o//Lqa+ZF2AAnaeS1xpndRiwkClGKb57qMvJ3utG4ioL2JnCOnlgqcQ9XOUJqpm
 /XoZg2h2UdcHkIDYS3sD9aOEJCtrsP+M48GK7ygM+Tjqgu9I2l272Nsm2OQiHyj1
 wC3R1eQNo4DkfB+/sNQzeddL2sHgEOIc5s9DOp24V3Xrwy14OBthX+mKN7GDKa0u
 JgQfDk0tZsJZIOdSj9wfsRa+BjcALW+QXIN5J0WBrNPipMyItKuoTkFYOW79L+ig
 ==
X-ME-Sender: <xms:4kHHXesP26DMN6acjh0erM5sb_T7KlMddJV4m74V0KZmKIRRn4n91w>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddvgedgtdduucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufgjfhgffffkgggtsehgtderredtreejnecuhfhrohhmpeforghrihhu
 shcuuegrkhhkvgcuoehmsggrkhhkvgesfhgrshhtmhgrihhlrdgtohhmqeenucffohhmrg
 hinhepohhsghgvohdrohhrghdpghhnuhdrohhrghenucfkphepkeegrdehvddrvddviedr
 uddtvdenucfrrghrrghmpehmrghilhhfrhhomhepmhgsrghkkhgvsehfrghsthhmrghilh
 drtghomhenucevlhhushhtvghrufhiiigvpedt
X-ME-Proxy: <xmx:4kHHXTJX72VOd9uAi74A8sbcywJcCuc_UrYaDak8S63wJQYr2n-6oA>
 <xmx:4kHHXfu-9BuDp2yI7JB4LDcmVR2yNrnBtA0k2hymOTSqNpJMc78rgw>
 <xmx:4kHHXTeP1rtoEpcxUgS5M1YumlJFlYdCr-rPmcFrDHQ-KPz7_HPfHw>
 <xmx:40HHXUWiuMEqAN9B6P2__-Fm90J9TOppfF05k-0tz2ScXZu6pu1Vfg>
Received: from localhost (84-52-226.102.3p.ntebredband.no [84.52.226.102])
 by mail.messagingengine.com (Postfix) with ESMTPA id 661EA306005E;
 Sat,  9 Nov 2019 17:46:58 -0500 (EST)
From: Marius Bakke <mbakke@HIDDEN>
To: Wiktor =?utf-8?Q?=C5=BBelazny?= <wz@HIDDEN>, 38150 <at> debbugs.gnu.org
Subject: Re: [bug#38150] [WIP] gnu: Add grass.
In-Reply-To: <20191109113154.20481-1-wz@HIDDEN>
References: <20191109113154.20481-1-wz@HIDDEN>
User-Agent: Notmuch/0.29.1 (https://notmuchmail.org) Emacs/26.3
 (x86_64-pc-linux-gnu)
Date: Sat, 09 Nov 2019 23:46:55 +0100
Message-ID: <87d0e0mzvk.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 38150
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello Wiktor,

Wiktor =C5=BBelazny <wz@HIDDEN> writes:

> From: Wiktor =C5=BBelazny <wzelazny@HIDDEN>
>
> * gnu/packages/geo.scm (grass): New variable.
> No GUI due to wxpython not found on runtime.
> ---
> Another GIS beast. This one builds, at least on my machine, but
>    $ grass78
>    Starting GRASS GIS...
>    ERROR: wxGUI requires wxPython. No module named 'wx'
> Perhaps this is something specific to Python module treatment by Guix.

No doubt!

> Only one of these
>    guix environment python python-wxpython
>    guix environment python --ad-hoc python-wxpython
>    guix environment --ad-hoc python python-wxpython
> , for instance, gives a desired result.

I'm guessing it's the latter?  :-)

The issue has to do with how Python modules are located at run-time.
Adding 'python' to the environment will populate the PYTHONPATH variable
with all packages in the profile that have a
'/lib/python3.7/site-packages' directory in its output.  Without
'python', Guix does not know that this variable should exist (see
<https://bugs.gnu.org/22138>).

To overcome this, the common approach is to wrap the executable with the
required variables, along these lines:

(wrap-program (string-append out "/bin/grass")
  `("PYTHONPATH" ":" prefix (,(string-append wxpython "/lib/python"
                                             (python-version python)
                                             "/site-packages"))))

Can you try that?

Some comments on the patch itself:

> +(define-public grass
> +  (package
> +    (name "grass")
> +    (version "7.8.0")
> +    (source
> +      (origin
> +        (method url-fetch)
> +        (uri (string-append
> +               "https://grass.osgeo.org/" name
> +               (match (string-split version #\.)
> +                      ((major minor _ ...)
> +                       (string-append major minor)))
> +               "/source/" name "-" version ".tar.gz"))
> +        ;; md5sum checked

We don't really need to acknowledge that we've verified checksums; it's
explicitly part of the packaging process per the "Submitting patches"
section of the manual.  Besides, MD5SUMs are not useful for security
these days, as it has become trivial to forge.

> +        (sha256
> +          (base32
> +            "1ynclznkpnm18vi0brmbfcplgi15yd7lwd424abgv7wm9qlr44ab"))))

Indentation seems to be off here.  If you are not using Emacs, please
run ./etc/indent-code.el on this file.

> +    (build-system gnu-build-system)
> +    (arguments
> +     '(#:phases
> +       (modify-phases %standard-phases
> +         ;; Replace configure phase as the ./configure script does not l=
ike
> +         ;; CONFIG_SHELL and SHELL passed as parameters
> +         (replace 'configure
> +           (lambda* (#:key outputs build target #:allow-other-keys)
> +             (let* ((out   (assoc-ref outputs "out"))
> +                    (bash  (which "bash"))
> +                    (flags `(,(string-append "--prefix=3D" out)

Note: you can use (list (string-append ...) ...) here instead of
quote/unquote.

> +                             ,(string-append "--build=3D" build)
> +                             ;; Fix `Unable to locate FreeType includes.'
> +                             ,(string-append
> +                                  "--with-freetype-includes=3D"
> +                                  (assoc-ref %build-inputs "freetype")
> +                                  "/include/freetype2")
> +                             ;; Fix `Unable to locate PROJ data files.'

I'm not sure this (and the previous) comment add anything: it's fairly
obvious that these flags are here to tell the build system where to find
these files.

> +                             ,(string-append
> +                                  "--with-proj-share=3D"
> +                                  (assoc-ref %build-inputs "proj.4")
> +                                  "/share/proj")
> +                             ,"--with-postgres")))
                                ^
This line does not need to be unquoted.

> +               (setenv "CONFIG_SHELL" bash)
> +               (apply invoke bash "./configure" flags)))))
> +        #:tests? #f))  ;no check target
> +    (native-inputs
> +      `(("flex" ,flex)
> +        ("bison" ,bison)
> +        ("pkg-config" ,pkg-config)
> +        ("python" ,python)
> +        ("python-six" ,python-six)))

I'm surprised to see python-six as a native-input, do you know what it's
used for?

> +    (inputs
> +      `(("proj.4" ,proj.4)
> +        ("gdal" ,gdal)
> +        ("zlib" ,zlib)
> +        ("zstd:lib" ,zstd "lib")
> +        ("libtiff" ,libtiff)
> +        ("libpng" ,libpng)
> +        ("sqlite" ,sqlite)
> +        ("freeglut" ,freeglut)
> +        ("fftw" ,fftw)
> +        ("cairo" ,cairo)
> +        ("freetype" ,freetype)
> +        ("libxt" ,libxt)
> +        ("python-wxpython" ,python-wxpython) ;; for gui
                                                ^
Nit-pick: Only one semicolon in margin comments.

Apart from these minor remarks, the patch looks great :-)

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl3HQd8ACgkQoqBt8qM6
VPrLGQf+J7914L+8EchuzkO600Wi2Ybi1Ozt5JUk94SPobzhnJ+U/sWLqm0e6n7f
i3HKuQ0kN/KBPzRNRobJqBOYIk2CGfPxfreYNO6e6PUmKDERkxsb1OFMXdB4hIM4
6CteGCjViaWaCPm8UIgBEfP0WYVODU2T0uGLVIyfbvpJQlbCE0t38SpmJ/7kRa+2
zfy9mGjOErdrMb2yItJnONGb9A4c9MHDsNY0BRYd/VFeQ62L/mg+sZRpcyjSnqyL
TdH2DRGMjU1i99v5CcUAO7U+MKPxupWwMxjrHEcIbCtBBGy647YsKhsuy703w1wv
pS5Vp9nPvROA8pBHCnOjBNcXOEy4LQ==
=SKdR
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#38150; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 9 Nov 2019 11:33:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 09 06:33:16 2019
Received: from localhost ([127.0.0.1]:48316 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iTOzU-00029k-18
	for submit <at> debbugs.gnu.org; Sat, 09 Nov 2019 06:33:16 -0500
Received: from lists.gnu.org ([209.51.188.17]:35170)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <wz@HIDDEN>) id 1iTOzT-00029d-2j
 for submit <at> debbugs.gnu.org; Sat, 09 Nov 2019 06:33:15 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:55103)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <wz@HIDDEN>) id 1iTOzR-0001vh-Kj
 for guix-patches@HIDDEN; Sat, 09 Nov 2019 06:33:14 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <wz@HIDDEN>) id 1iTOzQ-000419-6F
 for guix-patches@HIDDEN; Sat, 09 Nov 2019 06:33:13 -0500
Received: from freeshell.de ([2a01:360:106::2]:57252)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <wz@HIDDEN>) id 1iTOzP-00040X-SJ
 for guix-patches@HIDDEN; Sat, 09 Nov 2019 06:33:12 -0500
From: =?UTF-8?q?Wiktor=20=C5=BBelazny?= <wz@HIDDEN>
To: guix-patches@HIDDEN
Subject: [WIP] gnu: Add grass.
Date: Sat,  9 Nov 2019 12:31:54 +0100
Message-Id: <20191109113154.20481-1-wz@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2a01:360:106::2
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

From: Wiktor =C5=BBelazny <wzelazny@HIDDEN>

* gnu/packages/geo.scm (grass): New variable.
No GUI due to wxpython not found on runtime.
---
Another GIS beast. This one builds, at least on my machine, but
   $ grass78
   Starting GRASS GIS...
   ERROR: wxGUI requires wxPython. No module named 'wx'
Perhaps this is something specific to Python module treatment by Guix.
Only one of these
   guix environment python python-wxpython
   guix environment python --ad-hoc python-wxpython
   guix environment --ad-hoc python python-wxpython
, for instance, gives a desired result.
 gnu/packages/geo.scm | 79 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 78 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index dfb00c7547..7d3dea9d79 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -40,16 +40,20 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix utils)
+  #:use-module (gnu packages algebra)
   #:use-module (gnu packages astronomy)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages datastructures)
   #:use-module (gnu packages documentation)
+  #:use-module (gnu packages flex)
   #:use-module (gnu packages fonts)
   #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
@@ -67,7 +71,9 @@
   #:use-module (gnu packages web)
   #:use-module (gnu packages webkit)
   #:use-module (gnu packages wxwidgets)
-  #:use-module (gnu packages xml))
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages xorg)
+  #:use-module (ice-9 match))
=20
 (define-public geos
   (package
@@ -1037,3 +1043,74 @@ persisted.
 @end itemize
 ")
     (license license:expat)))
+
+(define-public grass
+  (package
+    (name "grass")
+    (version "7.8.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+               "https://grass.osgeo.org/" name
+               (match (string-split version #\.)
+                      ((major minor _ ...)
+                       (string-append major minor)))
+               "/source/" name "-" version ".tar.gz"))
+        ;; md5sum checked
+        (sha256
+          (base32
+            "1ynclznkpnm18vi0brmbfcplgi15yd7lwd424abgv7wm9qlr44ab"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         ;; Replace configure phase as the ./configure script does not l=
ike
+         ;; CONFIG_SHELL and SHELL passed as parameters
+         (replace 'configure
+           (lambda* (#:key outputs build target #:allow-other-keys)
+             (let* ((out   (assoc-ref outputs "out"))
+                    (bash  (which "bash"))
+                    (flags `(,(string-append "--prefix=3D" out)
+                             ,(string-append "--build=3D" build)
+                             ;; Fix `Unable to locate FreeType includes.=
'
+                             ,(string-append
+                                  "--with-freetype-includes=3D"
+                                  (assoc-ref %build-inputs "freetype")
+                                  "/include/freetype2")
+                             ;; Fix `Unable to locate PROJ data files.'
+                             ,(string-append
+                                  "--with-proj-share=3D"
+                                  (assoc-ref %build-inputs "proj.4")
+                                  "/share/proj")
+                             ,"--with-postgres")))
+               (setenv "CONFIG_SHELL" bash)
+               (apply invoke bash "./configure" flags)))))
+        #:tests? #f))  ;no check target
+    (native-inputs
+      `(("flex" ,flex)
+        ("bison" ,bison)
+        ("pkg-config" ,pkg-config)
+        ("python" ,python)
+        ("python-six" ,python-six)))
+    (inputs
+      `(("proj.4" ,proj.4)
+        ("gdal" ,gdal)
+        ("zlib" ,zlib)
+        ("zstd:lib" ,zstd "lib")
+        ("libtiff" ,libtiff)
+        ("libpng" ,libpng)
+        ("sqlite" ,sqlite)
+        ("freeglut" ,freeglut)
+        ("fftw" ,fftw)
+        ("cairo" ,cairo)
+        ("freetype" ,freetype)
+        ("libxt" ,libxt)
+        ("python-wxpython" ,python-wxpython) ;; for gui
+        ("postgresql" ,postgresql)))
+    (home-page "https://grass.osgeo.org/")
+    (synopsis "Geographic Resources Analysis Support System")
+    (description "GRASS is a @dfn{Geographic Information System} (GIS) s=
oftware
+suite used for geospatial data management and analysis, image processing=
,
+graphics and maps production, spatial modeling, and visualization.")
+    (license license:gpl2+)))
--=20
2.24.0





Acknowledgement sent to Wiktor Żelazny <wz@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#38150; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.