From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:35882) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTZWW-0004kx-B9 for guix-patches@gnu.org; Sat, 09 Nov 2019 17:48:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iTZWU-0004fV-NU for guix-patches@gnu.org; Sat, 09 Nov 2019 17:48:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41605) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iTZWU-0004fL-H6 for guix-patches@gnu.org; Sat, 09 Nov 2019 17:48:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iTZWU-0000Vu-CK for guix-patches@gnu.org; Sat, 09 Nov 2019 17:48:02 -0500 Subject: [bug#38150] [WIP] gnu: Add grass. Resent-Message-ID: From: Marius Bakke In-Reply-To: <20191109113154.20481-1-wz@freeshell.de> References: <20191109113154.20481-1-wz@freeshell.de> 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" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Wiktor =?UTF-8?Q?=C5=BBelazny?= , 38150@debbugs.gnu.org --=-=-= 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----- --=-=-=--