Subject: [bug#44967] [PATCH 1/2] gnu: Add librttopo.

From: Felix Gruber <[email-masked]>
Date: Mon, 30 Nov 2020 20:42:33 +0100

* gnu/packages/geo.scm (librttopo): New variable.
---
 gnu/packages/geo.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 5908ef4b66..1c8e6c8cfa 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2019 Hartmut Goebel <[email-masked]>
 ;;; Copyright © 2020 Marius Bakke <[email-masked]>
 ;;; Copyright © 2020 Christopher Baines <[email-masked]>
+;;; Copyright © 2020 Felix Gruber <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -365,6 +366,55 @@ writing GeoTIFF information tags.")
                    (license:non-copyleft "file://LICENSE"
                                          "See LICENSE in the distribution.")))))
 
+(define-public librttopo
+  (package
+    (name "librttopo")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.osgeo.org/gitea/rttopo/librttopo")
+             (commit (string-append "librttopo-" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0h7lzlkn9g4xky6h81ndy0aa6dxz8wb6rnl8v3987jy1i6pr072p"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-autogen
+           (lambda _
+             (let ((autoconf (which "autoconf"))
+                   (autoheader (which "autoheader"))
+                   (aclocal (which "aclocal"))
+                   (automake (which "automake"))
+                   (libtoolize (which "libtoolize"))
+                   )
+               (substitute* "autogen.sh"
+                            (("`which autoconf 2>/dev/null`") autoconf)
+                            (("`which autoheader 2>/dev/null`") autoheader)
+                            (("ACLOCAL=.*$")
+                             (string-append "ACLOCAL=" aclocal "\n"))
+                            (("AUTOMAKE=.*$")
+                             (string-append "AUTOMAKE=" automake "\n"))
+                            (("LIBTOOLIZE=.*$")
+                             (string-append "LIBTOOLIZE=" libtoolize "\n"))))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("geos" ,geos)))
+    (synopsis "Library to handle SQL/MM topologies")
+    (description
+     "The RT Topology Library exposes an API to create and manage standard
+(ISO 13249 aka SQL/MM) topologies using user-provided data stores.")
+    (home-page "https://git.osgeo.org/gitea/rttopo/librttopo")
+    (license license:gpl2+)))
+
 (define-public libspatialite
   (package
     (name "libspatialite")
-- 
2.29.2