unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#38150] [WIP] gnu: Add grass.
@ 2019-11-09 11:31 Wiktor Żelazny
  2019-11-09 22:46 ` Marius Bakke
  0 siblings, 1 reply; 9+ messages in thread
From: Wiktor Żelazny @ 2019-11-09 11:31 UTC (permalink / raw)
  To: 38150

From: Wiktor Żelazny <wzelazny@vurv.cz>

* 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))
 
 (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 like
+         ;; 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=" out)
+                             ,(string-append "--build=" build)
+                             ;; Fix `Unable to locate FreeType includes.'
+                             ,(string-append
+                                  "--with-freetype-includes="
+                                  (assoc-ref %build-inputs "freetype")
+                                  "/include/freetype2")
+                             ;; Fix `Unable to locate PROJ data files.'
+                             ,(string-append
+                                  "--with-proj-share="
+                                  (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) software
+suite used for geospatial data management and analysis, image processing,
+graphics and maps production, spatial modeling, and visualization.")
+    (license license:gpl2+)))
-- 
2.24.0

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

end of thread, other threads:[~2020-03-24 21:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-09 11:31 [bug#38150] [WIP] gnu: Add grass Wiktor Żelazny
2019-11-09 22:46 ` Marius Bakke
2019-11-12 15:04   ` [bug#38178] [WIP v2] " Wiktor Żelazny
     [not found]     ` <handler.38178.B.15735711166598.ack@debbugs.gnu.org>
2019-11-14 15:30       ` Wiktor Żelazny
2020-03-21 20:21         ` Marius Bakke
2020-03-22  8:57           ` Guillaume Le Vaillant
2020-03-24 10:57             ` bug#38178: " Guillaume Le Vaillant
2020-03-24 21:16           ` [bug#38178] " Wiktor Żelazny
2020-03-24 21:19             ` Wiktor Żelazny

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