From unknown Mon Jun 23 23:53:41 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#38150] [WIP] gnu: Add grass. Resent-From: Wiktor =?UTF-8?Q?=C5=BBelazny?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 09 Nov 2019 11:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38150 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 38150@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15732991968296 (code B ref -1); Sat, 09 Nov 2019 11:34:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Nov 2019 11:33:16 +0000 Received: from localhost ([127.0.0.1]:48316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iTOzU-00029k-18 for submit@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 ) id 1iTOzT-00029d-2j for submit@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 ) id 1iTOzR-0001vh-Kj for guix-patches@gnu.org; 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 ) id 1iTOzQ-000419-6F for guix-patches@gnu.org; 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 ) id 1iTOzP-00040X-SJ for guix-patches@gnu.org; Sat, 09 Nov 2019 06:33:12 -0500 From: Wiktor =?UTF-8?Q?=C5=BBelazny?= Date: Sat, 9 Nov 2019 12:31:54 +0100 Message-Id: <20191109113154.20481-1-wz@freeshell.de> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) From: Wiktor =C5=BBelazny * 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 From unknown Mon Jun 23 23:53:41 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#38150] [WIP] gnu: Add grass. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 09 Nov 2019 22:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38150 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Wiktor =?UTF-8?Q?=C5=BBelazny?= , 38150@debbugs.gnu.org Received: via spool by 38150-submit@debbugs.gnu.org id=B38150.15733396341910 (code B ref 38150); Sat, 09 Nov 2019 22:48:02 +0000 Received: (at 38150) by debbugs.gnu.org; 9 Nov 2019 22:47:14 +0000 Received: from localhost ([127.0.0.1]:50426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iTZVh-0000Uk-T9 for submit@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 ) id 1iTZVZ-0000U7-Ew for 38150@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: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddvgedgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehgtderredtreejnecuhfhrohhmpeforghrihhu shcuuegrkhhkvgcuoehmsggrkhhkvgesfhgrshhtmhgrihhlrdgtohhmqeenucffohhmrg hinhepohhsghgvohdrohhrghdpghhnuhdrohhrghenucfkphepkeegrdehvddrvddviedr uddtvdenucfrrghrrghmpehmrghilhhfrhhomhepmhgsrghkkhgvsehfrghsthhmrghilh drtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: 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 In-Reply-To: <20191109113154.20481-1-wz@freeshell.de> References: <20191109113154.20481-1-wz@freeshell.de> 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@devup.no> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Wiktor, Wiktor =C5=BBelazny writes: > From: Wiktor =C5=BBelazny > > * 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 ). 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----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 19 04:36:13 2019 Received: (at control) by debbugs.gnu.org; 19 Nov 2019 09:36:14 +0000 Received: from localhost ([127.0.0.1]:46585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iWzvf-0005M3-7z for submit@debbugs.gnu.org; Tue, 19 Nov 2019 04:36:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iWzve-0005Lq-By for control@debbugs.gnu.org; Tue, 19 Nov 2019 04:36:10 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iWzvZ-0006a8-7d for control@debbugs.gnu.org; Tue, 19 Nov 2019 04:36:05 -0500 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=56562 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iWzvX-0004Dh-Pu for control@debbugs.gnu.org; Tue, 19 Nov 2019 04:36:05 -0500 Date: Tue, 19 Nov 2019 10:36:02 +0100 Message-Id: <87r224rywt.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #38150 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) merge 38150 38178 quit