Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / geo.scm
index bb9f897..b5b6d91 100644 (file)
@@ -4,11 +4,14 @@
 ;;; Copyright © 2017, 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
-;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
-;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
+;;; Copyright © 2018, 2019 Julien Lepiller <julien@lepiller.eu>
+;;; Copyright © 2019, 2020 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019 Wiktor Żelazny <wzelazny@vurv.cz>
+;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages geo)
+  #:use-module (guix build-system ant)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix build-system scons)
   #:use-module (guix build-system r)
   #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (guix svn-download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix utils)
+  #:use-module (gnu packages)
   #:use-module (gnu packages astronomy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages icu4c)
+  #:use-module (gnu packages java)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages maths)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages sqlite)
@@ -71,7 +81,7 @@
 (define-public geos
   (package
     (name "geos")
-    (version "3.7.1")
+    (version "3.8.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://download.osgeo.org/geos/geos-"
@@ -79,7 +89,7 @@
                                   ".tar.bz2"))
               (sha256
                (base32
-                "1312m02xk4sp6f1xdpb9w0ic0zbxg90p5y66qnwidl5fksscf1h0"))))
+                "1mb2v9fy1gnbjhcgv0xny11ggfb17vkzsajdyibigwsxr4ylq4cr"))))
     (build-system gnu-build-system)
     (arguments `(#:phases
                  (modify-phases %standard-phases
@@ -108,7 +118,7 @@ topology functions.")
 (define-public gnome-maps
   (package
     (name "gnome-maps")
-    (version "3.30.3.1")
+    (version "3.32.2.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://gnome/sources/" name "/"
@@ -116,12 +126,18 @@ topology functions.")
                                   name "-" version ".tar.xz"))
               (sha256
                (base32
-                "0xqk3yrds0w8bjmpf4jw0370phvm65av82nqrx7fp1648h9nq7xi"))))
+                "1m191iq1gjaqz79ci3dkbmwrkxp7pzknngimlf5bqib5x8yairlb"))))
     (build-system meson-build-system)
     (arguments
      `(#:glib-or-gtk? #t
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'skip-gtk-update-icon-cache
+           ;; Don't create 'icon-theme.cache'.
+           (lambda _
+             (substitute* "meson_post_install.py"
+               (("gtk-update-icon-cache") "true"))
+             #t))
          (add-after 'install 'wrap
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out"))
@@ -151,8 +167,7 @@ topology functions.")
                                                  ,geocode-glib-path)))
                #t))))))
     (native-inputs
-     `(("gtk+" ,gtk+ "bin") ; gtk-update-icon-cache
-       ("gobject-introspection" ,gobject-introspection)
+     `(("gobject-introspection" ,gobject-introspection)
        ("intltool" ,intltool)
        ("pkg-config" ,pkg-config)))
     (inputs
@@ -216,37 +231,37 @@ and driving.")
 (define-public libgeotiff
   (package
     (name "libgeotiff")
-    (version "1.4.3")
+    (version "1.5.1")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
                            version ".tar.gz"))
+       (patches (search-patches
+                 ;; See libgeotiff 1.5.1 issue
+                 ;; https://github.com/OSGeo/libgeotiff/issues/22
+                 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
        (sha256
-        (base32 "0rbjqixi4c8yz19larlzq6jda0px2gpmpp9c52cyhplbjsdhsldq"))
+        (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
        (modules '((guix build utils)))
        (snippet
         '(begin
            ;; Remove .csv files, distributed from EPSG under a restricted
            ;; license. See LICENSE for full license text.
            (for-each delete-file (find-files "." "\\.csv$"))
-           ;; Now that we have removed the csv files, we need to modify the Makefile.
-           (substitute* "Makefile.in"
-             (("^all-am: .*$")
-              "all-am: Makefile $(LTLIBRARIES) $(HEADERS) geo_config.h\n")
-             (("^install-data-am: .*$")
-              "install-data-am: install-includeHEADERS"))
            #t))))
     (build-system gnu-build-system)
     (inputs
      `(("libjpeg-turbo" ,libjpeg-turbo)
        ("libtiff" ,libtiff)
-       ("proj.4" ,proj.4)
        ("zlib" ,zlib)))
+    (propagated-inputs
+     `(;; libgeotiff headers include proj headers, so ensure those are available.
+       ("proj" ,proj)))
     (arguments
      `(#:configure-flags
-       (list (string-append "--with-zlib")
-             (string-append "--with-jpeg")
+       (list "--disable-static"
+             "--with-zlib" "--with-jpeg"
              (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
     (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
     (description "libgeotiff is a library on top of libtiff for reading and
@@ -310,6 +325,39 @@ fully fledged Spatial SQL capabilities.")
                    license:mpl1.1
                    license:public-domain))))
 
+(define-public proj
+  (package
+    (name "proj")
+    (version "6.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "http://download.osgeo.org/proj/proj-"
+                           version ".tar.gz"))
+       (sha256
+        (base32
+         "0l1as8f4zfg74fms6h5p5psziw0lpznja1xnirzsscpnfbwc005k"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("sqlite" ,sqlite)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (home-page "https://proj.org/")
+    (synopsis "Coordinate transformation software")
+    (description
+     "Proj is a generic coordinate transformation software that transforms
+geospatial coordinates from one coordinate reference system (CRS) to another.
+This includes cartographic projections as well as geodetic transformations.
+PROJ includes command line applications for easy conversion of coordinates
+from text files or directly from user input.  In addition, proj also exposes
+an application programming interface that lets developers use the
+functionality of proj in their own software.")
+    (license (list license:expat
+                   ;; src/projections/patterson.cpp
+                   license:asl2.0
+                   ;; src/geodesic.*, src/tests/geodtest.cpp
+                   license:x11))))
+
 (define-public proj.4
   (package
     (name "proj.4")
@@ -523,7 +571,7 @@ development.")
 (define-public gdal
   (package
     (name "gdal")
-    (version "2.2.4")
+    (version "3.0.2")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -531,7 +579,7 @@ development.")
                      version ".tar.gz"))
               (sha256
                (base32
-                "1951f7b69x3d1vic0rmq92q8f4bj3hbxnxmj5jl0cc3zg0isgmdr"))
+                "0f80izh9wshrsw55kg9abpip74hk6frk3hgqrkqbyn3f6i8g2z3q"))
               (modules '((guix build utils)))
               (snippet
                 `(begin
@@ -565,6 +613,8 @@ development.")
            (with "--with-libtiff" "libtiff")
            (with "--with-geotiff" "libgeotiff")
            (with "--with-libz" "zlib")
+           (with "--with-expat" "expat")
+           (with "--with-sqlite3" "sqlite")
            "--with-pcre"))
        #:phases
        (modify-phases %standard-phases
@@ -573,7 +623,8 @@ development.")
              (substitute* "frmts/mrf/mrf_band.cpp"
                (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
     (inputs
-     `(("freexl" ,freexl)
+     `(("expat" ,expat)
+       ("freexl" ,freexl)
        ("geos" ,geos)
        ("giflib" ,giflib)
        ("json-c" ,json-c)
@@ -582,9 +633,12 @@ development.")
        ("libpng" ,libpng)
        ("libtiff" ,libtiff)
        ("libwebp" ,libwebp)
+       ("netcdf" ,netcdf)
        ("pcre" ,pcre)
+       ("proj" ,proj)
+       ("sqlite" ,sqlite)
        ("zlib" ,zlib)))
-    (home-page "http://www.gdal.org/")
+    (home-page "https://gdal.org/")
     (synopsis "Raster and vector geospatial data format library")
     (description "GDAL is a translator library for raster and vector geospatial
 data formats.  As a library, it presents a single raster abstract data model
@@ -634,14 +688,14 @@ utilities for data translation and processing.")
 (define-public postgis
   (package
     (name "postgis")
-    (version "2.4.4")
+    (version "3.0.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
                                   version ".tar.gz"))
               (sha256
                (base32
-                "1hm8migjb53cymp4qvg1h20yqllmy9f7x0awv5450391i6syyqq6"))))
+                "15557fbk0xkngihwhqsbdyz2ng49blisf5zydw81j0gabk6x4vy0"))))
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f
@@ -660,10 +714,12 @@ utilities for data translation and processing.")
     (inputs
      `(("gdal" ,gdal)
        ("geos" ,geos)
+       ("json-c" ,json-c)
+       ("libjpeg" ,libjpeg-turbo)
        ("libxml2" ,libxml2)
        ("pcre" ,pcre)
        ("postgresql" ,postgresql)
-       ("proj.4" ,proj.4)))
+       ("proj" ,proj)))
     (native-inputs
      `(("perl" ,perl)
        ("pkg-config" ,pkg-config)))
@@ -997,3 +1053,409 @@ XyGrib is the continuation of the zyGrib software package with a new team of
 volunteers.")
     (home-page "https://opengribs.org")
     (license license:gpl3+)))
+
+(define-public libspatialindex
+  (package
+    (name "libspatialindex")
+    (version "1.9.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
+                           "releases/download/" version "/spatialindex-src-"
+                           version ".tar.bz2"))
+       (sha256
+        (base32
+         "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
+    (build-system cmake-build-system)
+    (home-page "https://libspatialindex.org")
+    (synopsis "Spatial indexing library")
+    (description "The purpose of this library is to provide:
+
+@itemize
+ @item An extensible framework that will support robust spatial indexing
+methods.
+ @item Support for sophisticated spatial queries.  Range, point location,
+ nearest neighbor and k-nearest neighbor as well as parametric queries (defined
+by spatial constraints) should be easy to deploy and run.
+ @item Easy to use interfaces for inserting, deleting and updating information.
+ @item Wide variety of customization capabilities.  Basic index and storage
+characteristics like the page size, node capacity, minimum fan-out, splitting
+algorithm, etc. should be easy to customize.
+ @item Index persistence.  Internal memory and external memory structures
+should be supported.  Clustered and non-clustered indices should be easy to be
+persisted.
+@end itemize
+")
+    (license license:expat)))
+
+(define-public java-jmapviewer
+  (package
+    (name "java-jmapviewer")
+    (version "2.12")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://svn.openstreetmap.org/applications/"
+                                  "viewer/jmapviewer/releases/" version
+                                  "/JMapViewer-" version "-Source.zip"))
+              (sha256
+               (base32
+                "08hbqsbs859v4m5d90560fdifavd1apnpz9v9iry1v31dsvy5707"))))
+    (build-system ant-build-system)
+    (native-inputs
+     `(("unzip" ,unzip)))
+    (arguments
+     `(#:build-target "pack"
+       #:tests? #f; No tests
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'clean
+           (lambda* _
+             (invoke "ant" "clean")))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
+               (mkdir-p dir)
+               (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))))))))
+    (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
+    (synopsis "OSM map integration in Java")
+    (description "JMapViewer is a Java component which allows to easily
+integrate an OSM map view into your Java application.  It is maintained as
+an independent project by the JOSM team.")
+    (license license:gpl2)))
+
+(define-public josm
+  (package
+    (name "josm")
+    (version "15553")
+    (source (origin
+              (method svn-fetch)
+              (uri (svn-reference
+                     (url "https://josm.openstreetmap.de/svn/trunk")
+                     (revision (string->number version))
+                     (recursive? #f)))
+              (sha256
+               (base32
+                "091pbcn4fnmk42fmxplhis3nw5dbljf6ws8acyhx5dflyn49xzmx"))
+              (file-name (string-append name "-" version "-checkout"))
+              (modules '((guix build utils)))
+            (snippet
+             '(begin
+               (for-each delete-file (find-files "." ".*.jar$"))
+                #t))))
+    (build-system ant-build-system)
+    (native-inputs
+     `(("javacc" ,javacc)))
+    (inputs
+     `(("java-commons-jcs" ,java-commons-jcs)
+       ("java-commons-compress" ,java-commons-compress)
+       ("java-jmapviewer" ,java-jmapviewer)
+       ("java-jsonp-api" ,java-jsonp-api)
+       ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
+       ("java-metadata-extractor" ,java-metadata-extractor)
+       ("java-openjfx-media" ,java-openjfx-media)
+       ("java-signpost-core" ,java-signpost-core)
+       ("java-svg-salamander" ,java-svg-salamander)))
+    (arguments
+     `(#:tests? #f
+       #:jar-name "josm.jar"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'rm-build.xml
+           (lambda* _
+             (delete-file "build.xml")
+             #t))
+         (add-before 'build 'fix-revision
+           (lambda* _
+             (with-output-to-file "REVISION.XML"
+               (lambda _
+                 (display
+                   (string-append "<info><entry><commit revision=\"" ,version "\">"
+                                  "<date>1970-01-01 00:00:00 +0000</date>"
+                                  "</commit></entry></info>"))))
+             #t))
+         (add-before 'build 'fix-classpath
+           (lambda* (#:key inputs #:allow-other-keys)
+             (setenv "CLASSPATH"
+                     (string-join
+                       (filter
+                         (lambda (s)
+                           (let ((source (assoc-ref inputs "source")))
+                             (not (equal? (substring s 0 (string-length source)) source))))
+                         (string-split (getenv "CLASSPATH") #\:))
+                       ":"))
+             #t))
+         (add-before 'build 'generate-parser
+           (lambda* _
+             (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
+                    (out (string-append dir "/parsergen"))
+                    (file (string-append dir "/MapCSSParser.jj")))
+               (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
+               (invoke "javacc" "-DEBUG_PARSER=false"
+                       "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
+                       "-GRAMMAR_ENCODING=UTF-8"
+                       (string-append "-OUTPUT_DIRECTORY=" out)
+                       file))
+             #t))
+         (add-after 'build 'generate-epsg
+           (lambda _
+             (system* "javac" "scripts/BuildProjectionDefinitions.java"
+                      "-cp" "build/classes")
+             (mkdir-p "data/projection")
+             (with-output-to-file "data/projection/custom-epsg"
+               (lambda _ (display "")))
+             (invoke "java" "-cp" "build/classes:scripts:."
+                     "BuildProjectionDefinitions" ".")
+             #t))
+         (add-after 'generate-epsg 'copy-data
+           (lambda _
+             (mkdir-p "build/classes")
+             (rename-file "data" "build/classes/data")
+             #t))
+         (add-before 'install 'regenerate-jar
+           (lambda _
+             ;; We need to regenerate the jar file to add data.
+             (delete-file "build/jar/josm.jar")
+             (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
+                     "build/classes" ".")
+             #t))
+         (add-before 'build 'copy-styles
+           (lambda _
+             (mkdir-p "build/classes")
+             (rename-file "styles" "build/classes/styles")
+             #t))
+         (add-before 'build 'copy-images
+           (lambda _
+             (mkdir-p "build/classes")
+             (rename-file "images" "build/classes/images")
+             #t))
+         (add-before 'build 'copy-revision
+           (lambda _
+             (mkdir-p "build/classes")
+             (with-output-to-file "build/classes/REVISION"
+               (lambda _
+                 (display
+                   (string-append "Revision: " ,version "\n"
+                                  "Is-Local-Build: true\n"
+                                  "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
+             #t))
+         (add-after 'install 'install-bin
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (mkdir-p bin)
+               (with-output-to-file (string-append bin "/josm")
+                 (lambda _
+                   (display
+                     (string-append "#!/bin/sh\n"
+                                    (assoc-ref inputs "jdk") "/bin/java"
+                                    " -cp " out "/share/java/josm.jar:"
+                                    (getenv "CLASSPATH")
+                                    " org.openstreetmap.josm.gui.MainApplication"))))
+               (chmod (string-append bin "/josm") #o755))
+             #t)))))
+    (home-page "https://josm.openstreetmap.de")
+    (synopsis "OSM editor")
+    (description "JOSM is an extensible editor for OpenStreetMap (OSM).  It
+supports loading GPX tracks, background imagery and OSM data from local
+sources as well as from online sources and allows to edit the OSM data (nodes,
+ways, and relations) and their metadata tags.")
+    (license license:gpl2+)))
+
+(define-public libmaxminddb
+  (package
+    (name "libmaxminddb")
+    (version "1.4.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/maxmind/libmaxminddb"
+                           "/releases/download/" version "/"
+                           "/libmaxminddb-" version ".tar.gz"))
+       (sha256
+        (base32 "0mnimbaxnnarlw7g1rh8lpxsyf7xnmzwcczcc3lxw8xyf6ljln6x"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'set-cc-to-gcc
+           (lambda _
+             (setenv "CC" "gcc"))))))
+    (native-inputs
+     `(("perl" ,perl)))
+    (home-page "https://maxmind.github.io/libmaxminddb/")
+    (synopsis "C library for the MaxMind DB file format")
+    (description "The libmaxminddb library provides a C library for reading
+MaxMind DB files, including the GeoIP2 databases from MaxMind.  The MaxMind DB
+format is a custom, but open, binary format designed to facilitate fast
+lookups of IP addresses while allowing flexibility in the type of data
+associated with an address.")
+    (license license:asl2.0)))
+
+(define-public python-maxminddb
+  (package
+    (name "python-maxminddb")
+    (version "1.5.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "maxminddb" version))
+       (sha256
+        (base32
+         "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f)) ;; Tests require a copy of the maxmind database
+    (inputs
+     `(("libmaxminddb" ,libmaxminddb)))
+    (home-page "https://www.maxmind.com/")
+    (synopsis "Reader for the MaxMind DB format")
+    (description "MaxMind DB is a binary file format that stores data indexed
+by IP address subnets (IPv4 or IPv6).  This is a Python module for reading
+MaxMind DB files.")
+    (license license:asl2.0)))
+
+(define-public python-geoip2
+  (package
+    (name "python-geoip2")
+    (version "2.9.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "geoip2" version))
+       (sha256
+        (base32
+         "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f)) ;; Tests require a copy of the maxmind database
+    (inputs
+     `(("python-maxminddb" ,python-maxminddb)
+       ("python-requests" ,python-requests)))
+    (home-page "https://www.maxmind.com/")
+    (synopsis "MaxMind GeoIP2 API")
+    (description "Provides an API for the GeoIP2 web services and databases.
+The API also works with MaxMind’s free GeoLite2 databases.")
+    (license license:asl2.0)))
+
+(define-public routino
+  (package
+   (name "routino")
+   (version "3.3.2")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (string-append "http://www.routino.org/download/routino-"
+                         version ".tgz"))
+     (sha256
+      (base32
+       "1ccx3s99j8syxc1gqkzsaqkmyf44l7h3adildnc5iq2md7bp8wab"))))
+   (build-system gnu-build-system)
+   (native-inputs
+    `(("perl" ,perl)))
+   (inputs
+    `(("bzip2" ,bzip2)
+      ("xz" ,xz)
+      ("zlib" ,zlib)))
+   (arguments
+    `(#:test-target "test"
+      #:phases
+      (modify-phases %standard-phases
+        (replace 'configure
+          (lambda* (#:key outputs #:allow-other-keys)
+            (substitute* "Makefile.conf"
+              (("prefix=/usr/local")
+               (string-append "prefix=" (assoc-ref outputs "out")))
+              (("LDFLAGS_LDSO=-Wl,-R\\.")
+               "LDFLAGS_LDSO=-Wl,-R$(libdir)")
+              (("#CFLAGS\\+=-DUSE_XZ")
+               "CFLAGS+=-DUSE_XZ")
+              (("#LDFLAGS\\+=-llzma")
+               "LDFLAGS+=-llzma"))
+            #t)))))
+   (synopsis "Routing application for OpenStreetMap data")
+   (description
+    "Routino is an application for finding a route between two points
+using the dataset of topographical information collected by
+@url{https://www.OpenStreetMap.org}.")
+   (home-page "https://www.routino.org/")
+   (license license:agpl3+)))
+
+(define-public qmapshack
+  (package
+    (name "qmapshack")
+    (version "1.14.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Maproom/qmapshack.git")
+             (commit (string-append "V_" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
+    (build-system qt-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("qttools" ,qttools)))
+    (inputs
+     `(("gdal" ,gdal)
+       ("libjpeg-turbo" ,libjpeg-turbo)
+       ("proj" ,proj)
+       ("qtbase" ,qtbase)
+       ("qtdeclarative" ,qtdeclarative)
+       ("qtlocation" ,qtlocation)
+       ("qtwebchannel" ,qtwebchannel)
+       ("qtwebengine" ,qtwebengine)
+       ("quazip" ,quazip)
+       ("routino" ,routino)
+       ("sqlite" ,sqlite)                      ; See wrap phase
+       ("zlib" ,zlib)))
+    (arguments
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-cmake-modules
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "CMakeLists.txt"
+               (("find_package\\(Qt5PrintSupport        REQUIRED\\)" all)
+                (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
+             (substitute* "cmake/Modules/FindROUTINO.cmake"
+               (("/usr/local")
+                (assoc-ref inputs "routino")))
+             ;; The following fixes are included as patches in the sources
+             ;; of QMapShack, but they are not applied by default, for
+             ;; some reason...
+             (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
+             (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
+             #t))
+         (add-after 'install 'wrap
+           ;; The program fails to run with the error:
+           ;;   undefined symbol: sqlite3_column_table_name16
+           ;; Forcing the program to use sqlite-with-column-metadata instead
+           ;; of sqlite using LD_LIBRARY_PATH solves the problem.
+           ;;
+           ;; The program also fails to find the QtWebEngineProcess program,
+           ;; so we set QTWEBENGINEPROCESS_PATH to help it.
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
+                   (qtwebengineprocess (string-append
+                                        (assoc-ref inputs "qtwebengine")
+                                        "/lib/qt5/libexec/QtWebEngineProcess"))
+                   (sqlite-lib (string-append (assoc-ref inputs "sqlite")
+                                              "/lib")))
+               (for-each (lambda (program)
+                           (wrap-program program
+                             `("LD_LIBRARY_PATH" ":" prefix (,sqlite-lib))
+                             `("QTWEBENGINEPROCESS_PATH" =
+                               (,qtwebengineprocess))))
+                         (find-files bin ".*")))
+             #t)))))
+    (synopsis "GPS mapping application")
+    (description
+     "QMapShack can be used to plan your next outdoor trip or to visualize and
+archive all the GPS recordings of your past trips.  It is the successor of the
+QLandkarte GT application.")
+    (home-page "https://github.com/Maproom/qmapshack/wiki")
+    (license license:gpl3+)))