geo.scm 100 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
  3. ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
  4. ;;; Copyright © 2017, 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
  5. ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  6. ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
  7. ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
  8. ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
  9. ;;; Copyright © 2018, 2019, 2020 Julien Lepiller <julien@lepiller.eu>
  10. ;;; Copyright © 2019, 2020, 2021 Guillaume Le Vaillant <glv@posteo.net>
  11. ;;; Copyright © 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
  12. ;;; Copyright © 2019, 2021 Wiktor Żelazny <wzelazny@vurv.cz>
  13. ;;; Copyright © 2019, 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
  14. ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
  15. ;;; Copyright © 2020 Christopher Baines <mail@cbaines.net>
  16. ;;; Copyright © 2020, 2021 Felix Gruber <felgru@posteo.net>
  17. ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
  18. ;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
  19. ;;; Copyright © 2021 Clément Lassieur <clement@lassieur.org>
  20. ;;;
  21. ;;; This file is part of GNU Guix.
  22. ;;;
  23. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  24. ;;; under the terms of the GNU General Public License as published by
  25. ;;; the Free Software Foundation; either version 3 of the License, or (at
  26. ;;; your option) any later version.
  27. ;;;
  28. ;;; GNU Guix is distributed in the hope that it will be useful, but
  29. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  30. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  31. ;;; GNU General Public License for more details.
  32. ;;;
  33. ;;; You should have received a copy of the GNU General Public License
  34. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  35. (define-module (gnu packages geo)
  36. #:use-module (guix build-system ant)
  37. #:use-module (guix build-system cmake)
  38. #:use-module (guix build-system glib-or-gtk)
  39. #:use-module (guix build-system gnu)
  40. #:use-module (guix build-system go)
  41. #:use-module (guix build-system meson)
  42. #:use-module (guix build-system python)
  43. #:use-module (guix build-system qt)
  44. #:use-module (guix build-system scons)
  45. #:use-module (guix build-system r)
  46. #:use-module (guix download)
  47. #:use-module (guix git-download)
  48. #:use-module (guix svn-download)
  49. #:use-module ((guix licenses) #:prefix license:)
  50. #:use-module (guix packages)
  51. #:use-module (guix utils)
  52. #:use-module (gnu packages)
  53. #:use-module (gnu packages algebra)
  54. #:use-module (gnu packages astronomy)
  55. #:use-module (gnu packages audio)
  56. #:use-module (gnu packages autotools)
  57. #:use-module (gnu packages backup)
  58. #:use-module (gnu packages bash)
  59. #:use-module (gnu packages bison)
  60. #:use-module (gnu packages boost)
  61. #:use-module (gnu packages check)
  62. #:use-module (gnu packages compression)
  63. #:use-module (gnu packages curl)
  64. #:use-module (gnu packages databases)
  65. #:use-module (gnu packages datastructures)
  66. #:use-module (gnu packages docbook)
  67. #:use-module (gnu packages documentation)
  68. #:use-module (gnu packages elf)
  69. #:use-module (gnu packages flex)
  70. #:use-module (gnu packages fonts)
  71. #:use-module (gnu packages fontutils)
  72. #:use-module (gnu packages gettext)
  73. #:use-module (gnu packages gl)
  74. #:use-module (gnu packages glib)
  75. #:use-module (gnu packages gnome)
  76. #:use-module (gnu packages gps)
  77. #:use-module (gnu packages gtk)
  78. #:use-module (gnu packages haskell-apps)
  79. #:use-module (gnu packages image)
  80. #:use-module (gnu packages image-processing)
  81. #:use-module (gnu packages icu4c)
  82. #:use-module (gnu packages java)
  83. #:use-module (gnu packages kde)
  84. #:use-module (gnu packages lua)
  85. #:use-module (gnu packages maths)
  86. #:use-module (gnu packages pcre)
  87. #:use-module (gnu packages pdf)
  88. #:use-module (gnu packages perl)
  89. #:use-module (gnu packages photo)
  90. #:use-module (gnu packages pkg-config)
  91. #:use-module (gnu packages protobuf)
  92. #:use-module (gnu packages pulseaudio)
  93. #:use-module (gnu packages python)
  94. #:use-module (gnu packages python-check)
  95. #:use-module (gnu packages python-crypto)
  96. #:use-module (gnu packages python-science)
  97. #:use-module (gnu packages python-web)
  98. #:use-module (gnu packages python-xyz)
  99. #:use-module (gnu packages qt)
  100. #:use-module (gnu packages readline)
  101. #:use-module (gnu packages swig)
  102. #:use-module (gnu packages sqlite)
  103. #:use-module (gnu packages textutils)
  104. #:use-module (gnu packages time)
  105. #:use-module (gnu packages web)
  106. #:use-module (gnu packages webkit)
  107. #:use-module (gnu packages wxwidgets)
  108. #:use-module (gnu packages xml)
  109. #:use-module (gnu packages xorg))
  110. (define-public memphis
  111. (package
  112. (name "memphis")
  113. (version "0.2.3")
  114. (source
  115. (origin
  116. (method git-fetch)
  117. (uri
  118. (git-reference
  119. (url "https://github.com/jiuka/memphis")
  120. (commit version)))
  121. (file-name (git-file-name name version))
  122. (sha256
  123. (base32 "068c3943pgbpfjq44pmvn5fmkh005ak5aa67vvrq3fn487c6w54q"))))
  124. (build-system glib-or-gtk-build-system)
  125. (outputs '("out" "doc"))
  126. (arguments
  127. `(#:configure-flags
  128. (list
  129. "--disable-static"
  130. "--enable-gtk-doc"
  131. "--enable-vala"
  132. (string-append "--with-html-dir="
  133. (assoc-ref %outputs "doc")
  134. "/share/gtk-doc/html"))
  135. #:phases
  136. (modify-phases %standard-phases
  137. (add-after 'unpack 'patch-autogen
  138. (lambda _
  139. (substitute* "autogen.sh"
  140. (("\\./configure \"\\$@\"")
  141. ""))
  142. #t))
  143. (add-after 'patch-autogen 'patch-docbook-xml
  144. (lambda* (#:key inputs #:allow-other-keys)
  145. (with-directory-excursion "docs/reference"
  146. (substitute* "libmemphis-docs.sgml"
  147. (("http://www.oasis-open.org/docbook/xml/4.3/")
  148. (string-append (assoc-ref inputs "docbook-xml")
  149. "/xml/dtd/docbook/"))))
  150. #t)))))
  151. (native-inputs
  152. `(("autoconf" ,autoconf)
  153. ("automake" ,automake)
  154. ("docbook-xml" ,docbook-xml-4.3)
  155. ("gobject-introspection" ,gobject-introspection)
  156. ("gtk-doc" ,gtk-doc/stable)
  157. ("libtool" ,libtool)
  158. ("pkg-config" ,pkg-config)
  159. ("python" ,python-wrapper)
  160. ("seed" ,seed)
  161. ("vala" ,vala)))
  162. (inputs
  163. `(("expat" ,expat)
  164. ("glib" ,glib)))
  165. (propagated-inputs
  166. `(("cairo" ,cairo)))
  167. (synopsis "Map-rendering for OpenSteetMap")
  168. (description "Memphis is a map-rendering application and a library for
  169. OpenStreetMap written in C using eXpat, Cairo and GLib.")
  170. (home-page "http://trac.openstreetmap.ch/trac/memphis/")
  171. (license license:lgpl2.1+)))
  172. (define-public geos
  173. (package
  174. (name "geos")
  175. (version "3.8.1")
  176. (source (origin
  177. (method url-fetch)
  178. (uri (string-append "http://download.osgeo.org/geos/geos-"
  179. version
  180. ".tar.bz2"))
  181. (sha256
  182. (base32
  183. "1xqpmr10xi0n9sj47fbwc89qb0yr9imh4ybk0jsxpffy111syn22"))))
  184. (build-system gnu-build-system)
  185. (arguments `(#:phases
  186. (modify-phases %standard-phases
  187. (add-after
  188. 'unpack 'patch-test-shebangs
  189. (lambda _
  190. (substitute* '("tests/xmltester/testrunner.sh"
  191. "tests/geostest/testrunner.sh")
  192. (("/bin/sh") (which "sh")))
  193. #t)))))
  194. (inputs
  195. `(("glib" ,glib)))
  196. (home-page "https://geos.osgeo.org/")
  197. (synopsis "Geometry Engine for Geographic Information Systems")
  198. (description
  199. "GEOS provides a spatial object model and fundamental geometric
  200. functions. It is a C++ port of the Java Topology Suite (JTS). As such,
  201. it aims to contain the complete functionality of JTS in C++. This
  202. includes all the OpenGIS Simple Features for SQL spatial predicate
  203. functions and spatial operators, as well as specific JTS enhanced
  204. topology functions.")
  205. (license (list license:lgpl2.1+ ; Main distribution.
  206. license:zlib ; tests/xmltester/tinyxml/*
  207. license:public-domain)))) ; include/geos/timeval.h
  208. (define-public gnome-maps
  209. (package
  210. (name "gnome-maps")
  211. (version "40.5")
  212. (source (origin
  213. (method url-fetch)
  214. (uri (string-append "mirror://gnome/sources/" name "/"
  215. (version-major version) "/"
  216. name "-" version ".tar.xz"))
  217. (sha256
  218. (base32
  219. "02bdkmb3wyzfrbq726634v4g1hyh9za70cc2ivlbp7zc2n1jgp5c"))))
  220. (build-system meson-build-system)
  221. (arguments
  222. `(#:glib-or-gtk? #t
  223. #:phases
  224. (modify-phases %standard-phases
  225. (add-after 'unpack 'skip-gtk-update-icon-cache
  226. ;; Don't create 'icon-theme.cache'.
  227. (lambda _
  228. (substitute* "meson_post_install.py"
  229. (("gtk-update-icon-cache") "true"))))
  230. (add-after 'unpack 'patch-dbus-service
  231. (lambda* (#:key outputs #:allow-other-keys)
  232. (substitute* "data/org.gnome.Maps.service.in"
  233. (("@pkgdatadir@/org.gnome.Maps")
  234. (string-append (assoc-ref outputs "out")
  235. "/bin/gnome-maps")))))
  236. (add-after 'install 'wrap
  237. (lambda* (#:key inputs outputs #:allow-other-keys)
  238. (let ((out (assoc-ref outputs "out"))
  239. (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
  240. (geocode-glib-path (string-append
  241. (assoc-ref inputs "geocode-glib")
  242. "/lib"))
  243. (goa-path (string-append
  244. (assoc-ref inputs "gnome-online-accounts:lib")
  245. "/lib"))
  246. (gdk-pixbuf-path (string-append
  247. (assoc-ref inputs "gdk-pixbuf")
  248. "/lib"))
  249. (webkitgtk-path (string-append
  250. (assoc-ref inputs "webkitgtk")
  251. "/lib")))
  252. (wrap-program (string-append out "/bin/gnome-maps")
  253. `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
  254. ;; There seems to be no way to embed the path of
  255. ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
  256. ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
  257. ;; libgeocode-glib.so.0
  258. `("LD_LIBRARY_PATH" ":" prefix (,goa-path
  259. ,webkitgtk-path
  260. ,gdk-pixbuf-path
  261. ,geocode-glib-path)))
  262. #t))))))
  263. (native-inputs
  264. `(("gettext" ,gettext-minimal)
  265. ("gobject-introspection" ,gobject-introspection)
  266. ("pkg-config" ,pkg-config)))
  267. (inputs
  268. `(("evolution-data-server" ,evolution-data-server)
  269. ("folks" ,folks)
  270. ("libchamplain" ,libchamplain)
  271. ("libgee" ,libgee)
  272. ("libhandy" ,libhandy)
  273. ("libsecret" ,libsecret)
  274. ("libsoup" ,libsoup)
  275. ("libgweather" ,libgweather)
  276. ("libxml2" ,libxml2)
  277. ("gdk-pixbuf" ,gdk-pixbuf+svg)
  278. ("glib-networking" ,glib-networking)
  279. ("geoclue" ,geoclue)
  280. ("geocode-glib" ,geocode-glib)
  281. ("gfbgraph" ,gfbgraph)
  282. ("gjs" ,gjs)
  283. ("glib" ,glib)
  284. ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
  285. ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
  286. ("gtk+" ,gtk+)
  287. ("rest" ,rest)
  288. ("webkitgtk" ,webkitgtk)))
  289. (synopsis "Graphical map viewer and wayfinding program")
  290. (description "GNOME Maps is a graphical map viewer. It uses map data from
  291. the OpenStreetMap project. It can provide directions for walking, bicycling,
  292. and driving.")
  293. (home-page "https://wiki.gnome.org/Apps/Maps")
  294. (license license:gpl2+)))
  295. (define-public libgeotiff
  296. (package
  297. (name "libgeotiff")
  298. (version "1.5.1")
  299. (source
  300. (origin
  301. (method url-fetch)
  302. (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
  303. version ".tar.gz"))
  304. (patches (search-patches
  305. ;; See libgeotiff 1.5.1 issue
  306. ;; https://github.com/OSGeo/libgeotiff/issues/22
  307. "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
  308. (sha256
  309. (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
  310. (modules '((guix build utils)))
  311. (snippet
  312. '(begin
  313. ;; Remove .csv files, distributed from EPSG under a restricted
  314. ;; license. See LICENSE for full license text.
  315. (for-each delete-file (find-files "." "\\.csv$"))
  316. #t))))
  317. (build-system gnu-build-system)
  318. (inputs
  319. `(("libjpeg-turbo" ,libjpeg-turbo)
  320. ("libtiff" ,libtiff)
  321. ("zlib" ,zlib)))
  322. (propagated-inputs
  323. `(;; libgeotiff headers include proj headers, so ensure those are available.
  324. ("proj" ,proj)))
  325. (arguments
  326. `(#:configure-flags
  327. (list "--disable-static"
  328. "--with-zlib" "--with-jpeg"
  329. (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
  330. (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
  331. (description "libgeotiff is a library on top of libtiff for reading and
  332. writing GeoTIFF information tags.")
  333. (home-page "https://trac.osgeo.org/geotiff/")
  334. ;; This is a mixture of various contributions under different licenses.
  335. ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
  336. ;; states, as its commercial redistribution is restricted. Hence, we have
  337. ;; removed it from the package.
  338. (license (list license:public-domain
  339. license:x11
  340. license:bsd-3
  341. (license:non-copyleft "file://LICENSE"
  342. "See LICENSE in the distribution.")))))
  343. (define-public librasterlite2
  344. (package
  345. (name "librasterlite2")
  346. (version "1.1.0-beta1")
  347. (source
  348. (origin
  349. (method url-fetch)
  350. (uri (string-append
  351. "https://www.gaia-gis.it/gaia-sins/librasterlite2-sources/"
  352. "librasterlite2-" version ".tar.gz"))
  353. (sha256
  354. (base32
  355. "1x24gqp4hsq97c31ncwxblab0x0863q8v1z42jil7lvsq3glqa7p"))))
  356. (build-system gnu-build-system)
  357. (native-inputs
  358. `(("pkg-config" ,pkg-config)))
  359. (inputs
  360. `(("cairo" ,cairo)
  361. ("curl" ,curl)
  362. ("freetype" ,freetype)
  363. ("freexl" ,freexl)
  364. ("giflib" ,giflib)
  365. ("libgeotiff" ,libgeotiff)
  366. ("libjpeg-turbo" ,libjpeg-turbo)
  367. ("libpng" ,libpng)
  368. ("librttopo" ,librttopo)
  369. ("libspatialite" ,libspatialite)
  370. ("libtiff" ,libtiff)
  371. ("libwebp" ,libwebp)
  372. ("libxml2" ,libxml2)
  373. ("lz4" ,lz4)
  374. ("minizip" ,minizip)
  375. ("openjpeg" ,openjpeg)
  376. ("proj" ,proj)
  377. ("sqlite" ,sqlite)
  378. ("zstd" ,zstd "lib")))
  379. (synopsis "Library to work with huge raster coverages using a SpatiaLite")
  380. (description
  381. "librasterlite2 is a library that stores and retrieves huge raster
  382. coverages using a SpatiaLite DBMS.")
  383. (home-page "https://www.gaia-gis.it/fossil/librasterlite2/index")
  384. ;; For the genuine librasterlite-sources holds:
  385. ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
  386. ;; Files under src/control_points are from GRASS
  387. ;; and are licensed under GPL2+ only.
  388. ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
  389. ;; The tools supporting the library (both rl2tool and wmslite) are
  390. ;; licensed under the GPL v3 (or any subsequent version) terms.
  391. ;; The test/*.svg files are placed in the public domain, except for
  392. ;; test/Car_Yellow.svg which is licensed under the Free Art License 1.3.
  393. (license (list license:gpl2+
  394. license:gpl3+
  395. license:lal1.3
  396. license:lgpl2.1+
  397. license:mpl1.1
  398. license:public-domain))))
  399. (define-public librttopo
  400. (package
  401. (name "librttopo")
  402. (version "1.1.0")
  403. (source
  404. (origin
  405. (method git-fetch)
  406. (uri (git-reference
  407. (url "https://git.osgeo.org/gitea/rttopo/librttopo")
  408. (commit (string-append "librttopo-" version))))
  409. (file-name (git-file-name name version))
  410. (sha256
  411. (base32 "0h7lzlkn9g4xky6h81ndy0aa6dxz8wb6rnl8v3987jy1i6pr072p"))))
  412. (build-system gnu-build-system)
  413. (arguments
  414. `(#:phases
  415. (modify-phases %standard-phases
  416. (add-after 'unpack 'patch-autogen
  417. (lambda _
  418. (let ((autoconf (which "autoconf"))
  419. (autoheader (which "autoheader"))
  420. (aclocal (which "aclocal"))
  421. (automake (which "automake"))
  422. (libtoolize (which "libtoolize")))
  423. (substitute* "autogen.sh"
  424. (("`which autoconf 2>/dev/null`") autoconf)
  425. (("`which autoheader 2>/dev/null`") autoheader)
  426. (("ACLOCAL=.*$")
  427. (string-append "ACLOCAL=" aclocal "\n"))
  428. (("AUTOMAKE=.*$")
  429. (string-append "AUTOMAKE=" automake "\n"))
  430. (("LIBTOOLIZE=.*$")
  431. (string-append "LIBTOOLIZE=" libtoolize "\n"))))
  432. #t)))))
  433. (native-inputs
  434. `(("autoconf" ,autoconf)
  435. ("automake" ,automake)
  436. ("libtool" ,libtool)
  437. ("pkg-config" ,pkg-config)))
  438. (inputs
  439. `(("geos" ,geos)))
  440. (synopsis "Library to handle SQL/MM topologies")
  441. (description
  442. "The RT Topology Library exposes an API to create and manage standard
  443. (ISO 13249 aka SQL/MM) topologies using user-provided data stores.")
  444. (home-page "https://git.osgeo.org/gitea/rttopo/librttopo")
  445. (license license:gpl2+)))
  446. (define-public libspatialite
  447. (package
  448. (name "libspatialite")
  449. (version "5.0.1")
  450. (source
  451. (origin
  452. (method url-fetch)
  453. (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
  454. version ".tar.gz"))
  455. (sha256
  456. (base32
  457. "164y82rw2lrp5glfc0rkn7n6xvx5dvlgmh7bb7815067251wkjzf"))))
  458. (build-system gnu-build-system)
  459. (native-inputs
  460. `(("pkg-config" ,pkg-config)))
  461. (inputs
  462. `(("freexl" ,freexl)
  463. ("geos" ,geos)
  464. ("librttopo" ,librttopo)
  465. ("libxml2" ,libxml2)
  466. ("minizip" ,minizip)
  467. ("proj" ,proj)
  468. ("sqlite" ,sqlite)))
  469. (arguments
  470. `(#:configure-flags
  471. '("--enable-rttopo=yes")
  472. #:phases
  473. (modify-phases %standard-phases
  474. ;; 1 test is failing, ignore it:
  475. (add-after 'unpack 'ignore-broken-tests
  476. (lambda _
  477. (substitute* '("test/Makefile.in")
  478. (("check_wms\\$\\(EXEEXT\\) check_drop_rename\\$\\(EXEEXT\\) ")
  479. "check_wms$(EXEEXT) ")))))))
  480. (synopsis "Extend SQLite to support Spatial SQL capabilities")
  481. (description
  482. "SpatiaLite is a library intended to extend the SQLite core to support
  483. fully fledged Spatial SQL capabilities.")
  484. (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
  485. ;; For the genuine libspatialite-sources holds:
  486. ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
  487. ;; Files under src/control_points are from GRASS
  488. ;; and are licensed under GPL2+ only.
  489. ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
  490. (license (list license:gpl2+
  491. license:lgpl2.1+
  492. license:mpl1.1
  493. license:public-domain))))
  494. (define-public proj
  495. (package
  496. (name "proj")
  497. (version "7.2.1")
  498. (source
  499. (origin
  500. (method url-fetch)
  501. (uri (string-append "http://download.osgeo.org/proj/proj-"
  502. version ".tar.gz"))
  503. (sha256
  504. (base32
  505. "050apzdn0isxpsblys1shrl9ccli5vd32kgswlgx1imrbwpg915k"))))
  506. (build-system cmake-build-system)
  507. (arguments
  508. `(#:configure-flags '("-DUSE_EXTERNAL_GTEST=ON")))
  509. (inputs
  510. `(("curl" ,curl)
  511. ("libjpeg-turbo" ,libjpeg-turbo)
  512. ("libtiff" ,libtiff)
  513. ("sqlite" ,sqlite)))
  514. (native-inputs
  515. `(("googletest" ,googletest)
  516. ("pkg-config" ,pkg-config)))
  517. (home-page "https://proj.org/")
  518. (synopsis "Coordinate transformation software")
  519. (description
  520. "Proj is a generic coordinate transformation software that transforms
  521. geospatial coordinates from one @acronym{CRS, coordinate reference system}
  522. to another. This includes cartographic projections as well as geodetic
  523. transformations. Proj includes command line applications for easy
  524. conversion of coordinates from text files or directly from user input.
  525. In addition, Proj also exposes an application programming interface that
  526. lets developers use the functionality of Proj in their own software.")
  527. (license (list license:expat
  528. ;; src/projections/patterson.cpp
  529. license:asl2.0
  530. ;; src/geodesic.*, src/tests/geodtest.cpp
  531. license:x11))))
  532. (define-public proj.4
  533. (package
  534. (name "proj.4")
  535. (version "4.9.3")
  536. (source (origin
  537. (method url-fetch)
  538. (uri (string-append "http://download.osgeo.org/proj/proj-"
  539. version ".tar.gz"))
  540. (sha256
  541. (base32
  542. "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
  543. (build-system gnu-build-system)
  544. (arguments
  545. `(#:phases
  546. (modify-phases %standard-phases
  547. (add-after 'unpack 'patch-test-paths
  548. (lambda _
  549. (substitute* '("nad/test27"
  550. "nad/test83"
  551. "nad/testvarious"
  552. "nad/testdatumfile"
  553. "nad/testflaky"
  554. "nad/testIGNF")
  555. (("/bin/rm") (which "rm")))
  556. #t))
  557. ;; Precision problems on i686 and other platforms. See:
  558. ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
  559. ;; Disable failing test.
  560. (add-after 'patch-test-paths 'ignore-failing-tests
  561. (lambda _
  562. (substitute* '("nad/Makefile.in")
  563. (("\tPROJ_LIB.*" all) (string-append "#" all)))
  564. #t)))))
  565. (inputs
  566. `(("glib" ,glib)))
  567. (home-page "https://proj.org/")
  568. (synopsis "Cartographic Projections Library")
  569. (description
  570. "Proj.4 is a library for converting coordinates between cartographic
  571. projections.")
  572. (license (list license:expat
  573. ;; src/PJ_patterson.c
  574. license:asl2.0
  575. ;; src/geodesic.c/h
  576. license:x11
  577. ;; Embedded EPSG database.
  578. (license:non-copyleft "http://www.epsg.org/TermsOfUse")
  579. ;; cmake/*
  580. license:boost1.0))))
  581. (define-public python-pyproj
  582. (package
  583. (name "python-pyproj")
  584. (version "3.2.1")
  585. (source
  586. (origin
  587. (method url-fetch)
  588. (uri (pypi-uri "pyproj" version))
  589. (sha256
  590. (base32
  591. "0xrqpy708qlyd7nqjra0dl7nvkqzaj9w0v7wq4j5pxazha9n14sa"))))
  592. (build-system python-build-system)
  593. (arguments
  594. `(#:phases
  595. (modify-phases %standard-phases
  596. (add-after 'unpack 'set-proj-path
  597. (lambda* (#:key inputs #:allow-other-keys)
  598. (let ((proj (assoc-ref inputs "proj")))
  599. (setenv "PROJ_DIR" proj)
  600. (substitute* "pyproj/datadir.py"
  601. (("(internal_datadir = ).*$" all var)
  602. (string-append var "Path(\"" proj "/share/proj\")\n")))))))))
  603. (inputs
  604. `(("proj" ,proj)))
  605. (propagated-inputs
  606. `(("python-certifi" ,python-certifi)))
  607. (native-inputs
  608. `(("python-cython" ,python-cython)
  609. ("python-numpy" ,python-numpy)
  610. ("python-pandas" ,python-pandas)
  611. ("python-pytest" ,python-pytest)
  612. ("python-xarray" ,python-xarray)))
  613. (home-page "https://github.com/pyproj4/pyproj")
  614. (synopsis
  615. "Python interface to PROJ")
  616. (description
  617. "This package provides a Python interface to PROJ, a cartographic
  618. projections and coordinate transformations library.")
  619. (license license:expat)))
  620. (define-public python-fiona
  621. (package
  622. (name "python-fiona")
  623. (version "1.8.20")
  624. (source
  625. (origin
  626. (method url-fetch)
  627. (uri (pypi-uri "Fiona" version))
  628. (sha256
  629. (base32
  630. "0fql7i7dg1xpbadmk8d26dwp91v7faixxc4wq14zg0kvhp9041d7"))))
  631. (build-system python-build-system)
  632. (arguments
  633. `(#:phases
  634. (modify-phases %standard-phases
  635. (add-before 'check 'remove-local-fiona
  636. (lambda _
  637. ; This would otherwise interfere with finding the installed
  638. ; fiona when running tests.
  639. (delete-file-recursively "fiona")))
  640. (replace 'check
  641. (lambda* (#:key tests? inputs outputs #:allow-other-keys)
  642. (add-installed-pythonpath inputs outputs)
  643. (when tests?
  644. (invoke "pytest" "-m" "not network and not wheel")))))))
  645. (inputs
  646. `(("gdal" ,gdal)))
  647. (propagated-inputs
  648. `(("python-attrs" ,python-attrs)
  649. ("python-certifi" ,python-certifi)
  650. ("python-click" ,python-click)
  651. ("python-click-plugins" ,python-click-plugins)
  652. ("python-cligj" ,python-cligj)
  653. ("python-munch" ,python-munch)
  654. ("python-setuptools" ,python-setuptools)
  655. ("python-six" ,python-six)
  656. ("python-pytz" ,python-pytz)))
  657. (native-inputs
  658. `(("gdal" ,gdal) ; for gdal-config
  659. ("python-boto3" ,python-boto3)
  660. ("python-cython" ,python-cython)
  661. ("python-pytest" ,python-pytest)
  662. ("python-pytest-cov" ,python-pytest-cov)))
  663. (home-page "https://github.com/Toblerity/Fiona")
  664. (synopsis
  665. "Fiona reads and writes spatial data files")
  666. (description
  667. "Fiona is GDAL’s neat and nimble vector API for Python programmers.
  668. Fiona is designed to be simple and dependable. It focuses on reading
  669. and writing data in standard Python IO style and relies upon familiar
  670. Python types and protocols such as files, dictionaries, mappings, and
  671. iterators instead of classes specific to OGR. Fiona can read and write
  672. real-world data using multi-layered GIS formats and zipped virtual file
  673. systems and integrates readily with other Python GIS packages such as
  674. pyproj, Rtree, and Shapely.")
  675. (license license:bsd-3)))
  676. (define-public python-geopandas
  677. (package
  678. (name "python-geopandas")
  679. (version "0.9.0")
  680. (source
  681. (origin
  682. (method url-fetch)
  683. (uri (pypi-uri "geopandas" version))
  684. (sha256
  685. (base32
  686. "02k389zyyjv51gd09c92vlr83sv46awdq0066jgh5i24vjs2m5v3"))))
  687. (build-system python-build-system)
  688. (arguments
  689. '(#:phases
  690. (modify-phases %standard-phases
  691. (replace 'check
  692. (lambda* (#:key tests? #:allow-other-keys)
  693. (when tests?
  694. (invoke "pytest"
  695. ; Disable test that fails with
  696. ; NotImplementedError in pandas.
  697. "-k" "not test_fillna_no_op_returns_copy"
  698. ; Disable tests that require internet access.
  699. "-m" "not web")))))))
  700. (propagated-inputs
  701. `(("python-fiona" ,python-fiona)
  702. ("python-pandas" ,python-pandas)
  703. ("python-pyproj" ,python-pyproj)
  704. ("python-shapely" ,python-shapely)))
  705. (native-inputs
  706. `(("python-pytest" ,python-pytest)))
  707. (home-page "http://geopandas.org")
  708. (synopsis "Geographic pandas extensions")
  709. (description "The goal of GeoPandas is to make working with
  710. geospatial data in Python easier. It combines the capabilities of
  711. Pandas and Shapely, providing geospatial operations in Pandas and a
  712. high-level interface to multiple geometries to Shapely. GeoPandas
  713. enables you to easily do operations in Python that would otherwise
  714. require a spatial database such as PostGIS.")
  715. (license license:bsd-3)))
  716. (define-public mapnik
  717. (package
  718. (name "mapnik")
  719. (version "3.0.18")
  720. (source
  721. (origin
  722. (method url-fetch)
  723. (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
  724. version "/mapnik-v" version ".tar.bz2"))
  725. (sha256
  726. (base32
  727. "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
  728. (build-system scons-build-system)
  729. (inputs
  730. `(("boost" ,boost)
  731. ("cairo" ,cairo)
  732. ("freetype" ,freetype)
  733. ("harfbuzz" ,harfbuzz)
  734. ("icu4c" ,icu4c)
  735. ("libjpeg-turbo" ,libjpeg-turbo)
  736. ("libpng" ,libpng)
  737. ("libtiff" ,libtiff)
  738. ("libwebp" ,libwebp)
  739. ("libxml2" ,libxml2)
  740. ("proj.4" ,proj.4)
  741. ("sqlite" ,sqlite)
  742. ("zlib" ,zlib)))
  743. (native-inputs
  744. `(("pkg-config" ,pkg-config)))
  745. (arguments
  746. `(#:scons ,scons-python2
  747. #:scons-flags
  748. (list "CC=gcc"
  749. (string-append "PREFIX=" %output)
  750. (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
  751. (home-page "https://mapnik.org/")
  752. (synopsis "Toolkit for developing mapping applications")
  753. (description "Mapnik is a toolkit for developing mapping applications. It
  754. is basically a collection of geographic objects like maps, layers,
  755. datasources, features, and geometries. At its core is a C++ shared library
  756. providing algorithms and patterns for spatial data access and visualization.
  757. The library does not rely on any specific windowing system and can be deployed
  758. to any server environment. It is intended to play fair in a multi-threaded
  759. environment and is aimed primarily, but not exclusively, at web-based
  760. development.")
  761. (license (list license:lgpl2.1+
  762. ;; demo/viewer, demo/python/rundemo.py
  763. license:gpl2+
  764. ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
  765. license:boost1.0
  766. ;; deps/mapnik/sparsehash
  767. license:bsd-3
  768. ;; deps/agg
  769. (license:non-copyleft "file://deps/agg/copying")))))
  770. (define-public spatialite-gui
  771. (package
  772. (name "spatialite-gui")
  773. (version "2.1.0-beta1")
  774. (source
  775. (origin
  776. (method url-fetch)
  777. (uri (string-append
  778. "https://www.gaia-gis.it/gaia-sins/spatialite-gui-sources/"
  779. "spatialite_gui-" version ".tar.gz"))
  780. (sha256
  781. (base32 "0cyv4cycl073p9lnnnglcb72qn71g8h9g5zn4gzw7swcy5nxjj5s"))))
  782. (build-system gnu-build-system)
  783. (native-inputs
  784. `(("pkg-config" ,pkg-config)))
  785. (inputs
  786. `(("curl" ,curl)
  787. ("freexl" ,freexl)
  788. ("geos" ,geos)
  789. ("giflib" ,giflib)
  790. ("libjpeg-turbo" ,libjpeg-turbo)
  791. ("librasterlite2" ,librasterlite2)
  792. ("librttopo" ,librttopo)
  793. ("libspatialite" ,libspatialite)
  794. ("libwebp" ,libwebp)
  795. ("libxlsxwriter" ,libxlsxwriter)
  796. ("libxml2" ,libxml2)
  797. ("lz4" ,lz4)
  798. ("minizip" ,minizip)
  799. ("openjpeg" ,openjpeg)
  800. ("postgresql" ,postgresql)
  801. ("proj" ,proj)
  802. ("sqlite" ,sqlite)
  803. ("virtualpg" ,virtualpg)
  804. ("wxwidgets" ,wxwidgets)
  805. ("zstd" ,zstd "lib")))
  806. (arguments
  807. `(#:phases (modify-phases %standard-phases
  808. (add-after 'unpack 'fix-gui
  809. (lambda _
  810. ;; Fix for the GUI not showing up.
  811. (substitute* "Main.cpp"
  812. (("Hide\\(\\);") ""))
  813. #t)))))
  814. (synopsis "Graphical user interface for SpatiaLite")
  815. (description "Spatialite-gui provides a visual interface for viewing and
  816. maintaining a spatialite database. You can easily see the structure of the
  817. tables and data contents using point and click functions, many of which
  818. construct common SQL queries, or craft your own SQL queries.")
  819. (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
  820. (license license:gpl3+)))
  821. (define-public gdal
  822. (package
  823. (name "gdal")
  824. (version "3.1.2")
  825. (source (origin
  826. (method url-fetch)
  827. (uri (string-append
  828. "http://download.osgeo.org/gdal/" version "/gdal-"
  829. version ".tar.gz"))
  830. (sha256
  831. (base32
  832. "1p6nmlsr8wbyq350pa6c22vrp98dcsa7yjnqsbhdbp74yj53nw9r"))
  833. (modules '((guix build utils)))
  834. (snippet
  835. `(begin
  836. ;; TODO: frmts contains a lot more bundled code.
  837. (for-each delete-file-recursively
  838. ;; bundled code
  839. '("frmts/png/libpng"
  840. "frmts/gif/giflib"
  841. "frmts/jpeg/libjpeg"
  842. "frmts/jpeg/libjpeg12"
  843. "frmts/gtiff/libtiff"
  844. "frmts/gtiff/libgeotiff"
  845. "frmts/zlib"
  846. "ogr/ogrsf_frmts/geojson/libjson"))))))
  847. (build-system gnu-build-system)
  848. (arguments
  849. `(#:tests? #f
  850. #:configure-flags
  851. (let-syntax ((with (syntax-rules ()
  852. ((_ option input)
  853. (string-append option "="
  854. (assoc-ref %build-inputs input))))))
  855. (list
  856. ;; TODO: --with-pcidsk, --with-pcraster
  857. (with "--with-freexl" "freexl")
  858. (with "--with-libjson-c" "json-c")
  859. (with "--with-png" "libpng")
  860. (with "--with-webp" "libwebp")
  861. (with "--with-gif" "giflib")
  862. (with "--with-jpeg" "libjpeg-turbo")
  863. (with "--with-libtiff" "libtiff")
  864. (with "--with-geotiff" "libgeotiff")
  865. (with "--with-libz" "zlib")
  866. (with "--with-expat" "expat")
  867. (with "--with-sqlite3" "sqlite")
  868. "--with-pcre"))
  869. #:phases
  870. (modify-phases %standard-phases
  871. (add-before 'build 'fix-path
  872. (lambda _
  873. (substitute* "frmts/mrf/mrf_band.cpp"
  874. (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
  875. (inputs
  876. `(("expat" ,expat)
  877. ("freexl" ,freexl)
  878. ("geos" ,geos)
  879. ("giflib" ,giflib)
  880. ("json-c" ,json-c)
  881. ("libgeotiff" ,libgeotiff)
  882. ("libjpeg-turbo" ,libjpeg-turbo)
  883. ("libpng" ,libpng)
  884. ("libtiff" ,libtiff)
  885. ("libwebp" ,libwebp)
  886. ("netcdf" ,netcdf)
  887. ("pcre" ,pcre)
  888. ("postgresql" ,postgresql) ; libpq
  889. ("proj" ,proj)
  890. ("sqlite" ,sqlite)
  891. ("zlib" ,zlib)))
  892. (native-inputs
  893. `(("pkg-config" ,pkg-config)))
  894. (home-page "https://gdal.org/")
  895. (synopsis "Raster and vector geospatial data format library")
  896. (description "GDAL is a translator library for raster and vector geospatial
  897. data formats. As a library, it presents a single raster abstract data model
  898. and single vector abstract data model to the calling application for all
  899. supported formats. It also comes with a variety of useful command line
  900. utilities for data translation and processing.")
  901. (license (list
  902. ;; general license
  903. license:expat
  904. ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
  905. ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
  906. ;; frmts/mrf/
  907. license:bsd-3
  908. ;; frmts/hdf4/hdf-eos/*
  909. ;; similar to the expat license, but without guarantee exclusion
  910. (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
  911. ;; frmts/grib/degrib/
  912. license:public-domain ; with guarantee exclusion
  913. ;; port/cpl_minizip*
  914. ;; Some bsd-inspired license
  915. (license:non-copyleft "file://port/LICENCE_minizip")
  916. ;; alg/internal_libqhull
  917. ;; Some 5-clause license
  918. (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
  919. ;; frmts/mrf/libLERC
  920. license:asl2.0))))
  921. (define-public python-gdal
  922. (package (inherit gdal)
  923. (name "python-gdal")
  924. (build-system python-build-system)
  925. (arguments
  926. '(#:tests? #f ; no tests
  927. #:phases
  928. (modify-phases %standard-phases
  929. (add-before 'build 'chdir
  930. (lambda _
  931. (chdir "swig/python")
  932. #t)))))
  933. (native-inputs '())
  934. (propagated-inputs
  935. `(("python-numpy" ,python-numpy)))
  936. (inputs
  937. `(("gdal" ,gdal)))
  938. (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
  939. (define-public python-pyshp
  940. (package
  941. (name "python-pyshp")
  942. (version "2.1.3")
  943. (source
  944. (origin
  945. (method git-fetch)
  946. (uri (git-reference
  947. (url "https://github.com/GeospatialPython/pyshp")
  948. (commit version)))
  949. (file-name (git-file-name name version))
  950. (sha256
  951. (base32 "0jsraqzq82pw19wvx84x7w5cs8agr44a9b5y0jjw540wim4xa73r"))))
  952. (build-system python-build-system)
  953. (arguments
  954. `(#:phases
  955. (modify-phases %standard-phases
  956. (replace 'check
  957. (lambda* (#:key tests? #:allow-other-keys)
  958. (when tests?
  959. ;; This is the only test file.
  960. (invoke "python" "-m" "pytest" "test_shapefile.py")))))))
  961. (native-inputs
  962. `(("python-pytest" ,python-pytest)
  963. ("python-pytest-runner" ,python-pytest-runner)))
  964. (home-page "https://github.com/GeospatialPython/pyshp")
  965. (synopsis "Read/write support for ESRI Shapefile format")
  966. (description
  967. "The Python Shapefile Library (PyShp) reads and writes ESRI Shapefiles.")
  968. (license license:expat)))
  969. (define-public python-cartopy
  970. (package
  971. (name "python-cartopy")
  972. ;; This is a post-release fix that adds build_ext to setup.py.
  973. (version "0.19.0.post1")
  974. (source
  975. (origin
  976. (method url-fetch)
  977. (uri (pypi-uri "Cartopy" version))
  978. (sha256
  979. (base32 "0xnm8z3as3hriivdfd26s6vn5b63gb46x6vxw6gh1mwfm5rlg2sb"))))
  980. (build-system python-build-system)
  981. (arguments
  982. `(#:phases
  983. (modify-phases %standard-phases
  984. (replace 'check
  985. (lambda* (#:key inputs outputs tests? #:allow-other-keys)
  986. (when tests?
  987. (add-installed-pythonpath inputs outputs)
  988. (invoke "python" "-m" "pytest" "--pyargs" "cartopy"
  989. ;; These tests require online data.
  990. "-m" "not natural_earth and not network"
  991. ;; This one too but it's not marked as such.
  992. "-k" "not test_gridliner_labels_bbox_style")))))))
  993. (propagated-inputs
  994. `(("python-matplotlib" ,python-matplotlib)
  995. ("python-numpy" ,python-numpy)
  996. ("python-pykdtree" ,python-pykdtree)
  997. ("python-pyshp" ,python-pyshp)
  998. ("python-scipy" ,python-scipy)
  999. ("python-shapely" ,python-shapely)))
  1000. (inputs
  1001. `(("geos" ,geos)
  1002. ("proj" ,proj)))
  1003. (native-inputs
  1004. `(("python-cython" ,python-cython)
  1005. ("python-flufl-lock" ,python-flufl-lock)
  1006. ("python-pytest" ,python-pytest)))
  1007. (home-page "https://scitools.org.uk/cartopy/docs/latest/")
  1008. (synopsis "Cartographic library for visualisation")
  1009. (description
  1010. "Cartopy is a Python package designed to make drawing maps for data
  1011. analysis and visualisation easy.
  1012. It features:
  1013. @itemize
  1014. @item object oriented projection definitions
  1015. @item point, line, polygon and image transformations between projections
  1016. @item integration to expose advanced mapping in Matplotlib with a simple and
  1017. intuitive interface
  1018. @item powerful vector data handling by integrating shapefile reading with
  1019. Shapely capabilities
  1020. @end itemize")
  1021. (license license:lgpl3+)))
  1022. (define-public postgis
  1023. (package
  1024. (name "postgis")
  1025. (version "3.1.2")
  1026. (source (origin
  1027. (method url-fetch)
  1028. (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
  1029. version ".tar.gz"))
  1030. (sha256
  1031. (base32
  1032. "0ch7gry8a1i9114mlhklxryn7ja3flsz6pxj9r5p09k92xh3gp9c"))))
  1033. (build-system gnu-build-system)
  1034. (arguments
  1035. `(#:tests? #f
  1036. #:make-flags
  1037. (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
  1038. (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
  1039. (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
  1040. (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
  1041. #:phases
  1042. (modify-phases %standard-phases
  1043. (add-before 'build 'fix-install-path
  1044. (lambda* (#:key outputs #:allow-other-keys)
  1045. (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
  1046. (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
  1047. (string-append (assoc-ref outputs "out") "/bin"))))))))
  1048. (inputs
  1049. `(("gdal" ,gdal)
  1050. ("geos" ,geos)
  1051. ("giflib" ,giflib)
  1052. ("json-c" ,json-c)
  1053. ("libjpeg" ,libjpeg-turbo)
  1054. ("libxml2" ,libxml2)
  1055. ("pcre" ,pcre)
  1056. ("postgresql" ,postgresql)
  1057. ("protobuf-c" ,protobuf-c)
  1058. ("proj" ,proj)))
  1059. (native-inputs
  1060. `(("perl" ,perl)
  1061. ("pkg-config" ,pkg-config)))
  1062. (home-page "https://postgis.net")
  1063. (synopsis "Spatial database extender for PostgreSQL")
  1064. (description "PostGIS is a spatial database extender for PostgreSQL
  1065. object-relational database. It adds support for geographic objects allowing
  1066. location queries to be run in SQL. This package provides a PostgreSQL
  1067. extension.")
  1068. (license (list
  1069. ;; General license
  1070. license:gpl2+
  1071. ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
  1072. license:expat
  1073. ;; loader/getopt.*
  1074. license:public-domain
  1075. ;; doc/xsl
  1076. license:bsd-3 ; files only say "BSD"
  1077. ;; doc
  1078. license:cc-by-sa3.0))))
  1079. (define-public tegola
  1080. (package
  1081. (name "tegola")
  1082. (version "0.7.0")
  1083. (source (origin
  1084. (method url-fetch)
  1085. (uri (string-append
  1086. "https://github.com/go-spatial/tegola/archive/v"
  1087. version ".tar.gz"))
  1088. (file-name (string-append name "-" version ".tar.gz"))
  1089. (sha256
  1090. (base32
  1091. "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
  1092. (build-system go-build-system)
  1093. (arguments
  1094. `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
  1095. #:unpack-path "github.com/go-spatial/tegola"
  1096. #:phases
  1097. (modify-phases %standard-phases
  1098. (add-before 'build 'set-version
  1099. (lambda _
  1100. (with-directory-excursion "src/github.com/go-spatial/tegola"
  1101. (substitute* '("cmd/tegola/cmd/root.go"
  1102. "cmd/tegola_lambda/main.go")
  1103. (("version not set") ,version)))
  1104. #t)))))
  1105. (home-page "https://tegola.io")
  1106. (synopsis "Vector tile server for maps")
  1107. (description "Tegola is a free vector tile server written in Go. Tegola
  1108. takes geospatial data and slices it into vector tiles that can be efficiently
  1109. delivered to any client.")
  1110. (license (list
  1111. license:expat
  1112. ;; Some packages in vendor have other licenses
  1113. license:asl2.0
  1114. license:bsd-2
  1115. license:bsd-3
  1116. license:wtfpl2))))
  1117. (define-public imposm3
  1118. (package
  1119. (name "imposm3")
  1120. (version "0.6.0-alpha.4")
  1121. (source
  1122. (origin
  1123. (method url-fetch)
  1124. (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
  1125. version ".tar.gz"))
  1126. (file-name (string-append name "-" version ".tar.gz"))
  1127. (sha256
  1128. (base32
  1129. "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
  1130. (build-system go-build-system)
  1131. (arguments
  1132. `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
  1133. #:unpack-path "github.com/omniscale/imposm3"
  1134. #:phases
  1135. (modify-phases %standard-phases
  1136. (add-before 'build 'set-version
  1137. (lambda _
  1138. (substitute* "src/github.com/omniscale/imposm3/version.go"
  1139. (("0.0.0-dev") ,version))
  1140. #t)))))
  1141. (inputs
  1142. `(("geos" ,geos)
  1143. ("leveldb" ,leveldb)))
  1144. (home-page "https://imposm.org/")
  1145. (synopsis "OpenStreetMap importer for PostGIS")
  1146. (description "Imposm is an importer for OpenStreetMap data. It reads PBF
  1147. files and imports the data into PostgreSQL/PostGIS databases. It is designed
  1148. to create databases that are optimized for rendering/tile/map-services.")
  1149. (license (list
  1150. license:asl2.0
  1151. ;; Some dependencies in vendor have different licenses
  1152. license:expat
  1153. license:bsd-2
  1154. license:bsd-3))))
  1155. (define-public libosmium
  1156. (package
  1157. (name "libosmium")
  1158. (version "2.15.6")
  1159. (source
  1160. (origin
  1161. (method git-fetch)
  1162. (uri (git-reference
  1163. (url "https://github.com/osmcode/libosmium")
  1164. (commit (string-append "v" version))))
  1165. (file-name (git-file-name name version))
  1166. (sha256
  1167. (base32 "0rqy18bbakp41f44y5id9ixh0ar2dby46z17p4115z8k1vv9znq2"))))
  1168. (build-system cmake-build-system)
  1169. (propagated-inputs
  1170. `(("boost" ,boost)
  1171. ("bzip2" ,bzip2)
  1172. ("expat" ,expat)
  1173. ("gdal" ,gdal)
  1174. ("geos" ,geos)
  1175. ("proj" ,proj)
  1176. ("protozero" ,protozero)
  1177. ("sparsehash" ,sparsehash)
  1178. ("utfcpp" ,utfcpp)
  1179. ("zlib" ,zlib)))
  1180. (native-inputs
  1181. `(("doxygen" ,doxygen)))
  1182. (home-page "https://osmcode.org/libosmium/")
  1183. (synopsis "C++ library for working with OpenStreetMap data")
  1184. (description "Libosmium is a fast and flexible C++ library for working with
  1185. OpenStreetMap data.")
  1186. (license license:boost1.0)))
  1187. (define-public osm2pgsql
  1188. (package
  1189. (name "osm2pgsql")
  1190. (version "1.2.2")
  1191. (source
  1192. (origin
  1193. (method git-fetch)
  1194. (uri (git-reference
  1195. (url "https://github.com/openstreetmap/osm2pgsql")
  1196. (commit version)))
  1197. (file-name (git-file-name name version))
  1198. (sha256
  1199. (base32 "1j35aa8qinhavliqi5pdm0viyi7lm5xyk402rliaxxs1r2hbsafn"))
  1200. (modules '((guix build utils)))
  1201. (snippet
  1202. '(begin
  1203. (delete-file-recursively "contrib/protozero")
  1204. (delete-file-recursively "contrib/libosmium")
  1205. #t))))
  1206. (build-system cmake-build-system)
  1207. (arguments
  1208. `(#:tests? #f; tests fail because we need to setup a database
  1209. #:configure-flags
  1210. (list (string-append "-DOSMIUM_INCLUDE_DIR="
  1211. (assoc-ref %build-inputs "libosmium")
  1212. "/include")
  1213. (string-append "-DPROTOZERO_INCLUDE_DIR="
  1214. (assoc-ref %build-inputs "protozero")
  1215. "/include"))))
  1216. (inputs
  1217. `(("boost" ,boost)
  1218. ("bzip2" ,bzip2)
  1219. ("expat" ,expat)
  1220. ("libosmium" ,libosmium)
  1221. ("lua" ,lua)
  1222. ("postgresql" ,postgresql)
  1223. ("proj" ,proj)
  1224. ("protozero" ,protozero)
  1225. ("zlib" ,zlib)))
  1226. (native-inputs
  1227. `(("python" ,python)
  1228. ("python-psycopg2" ,python-psycopg2)))
  1229. (home-page "https://github.com/openstreetmap/osm2pgsql")
  1230. (synopsis "OSM data importer to postgresql")
  1231. (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
  1232. PostgreSQL / PostGIS database suitable for applications like rendering into a
  1233. map, geocoding with Nominatim, or general analysis.")
  1234. (license license:gpl2+)))
  1235. (define-public tippecanoe
  1236. (package
  1237. (name "tippecanoe")
  1238. (version "1.36.0")
  1239. (source
  1240. (origin
  1241. (method git-fetch)
  1242. (uri (git-reference
  1243. (url "https://github.com/mapbox/tippecanoe")
  1244. (commit version)))
  1245. (file-name (git-file-name name version))
  1246. (sha256
  1247. (base32 "0lbmhly4ivnqc6qk1k3sdqvsg6x3nfd8gnjx846bhqj4wag3f88m"))))
  1248. (build-system gnu-build-system)
  1249. (arguments
  1250. `(#:phases
  1251. (modify-phases %standard-phases (delete 'configure))
  1252. #:test-target "test"
  1253. #:make-flags
  1254. (list (string-append "CC=" ,(cc-for-target))
  1255. (string-append "PREFIX=" (assoc-ref %outputs "out")))))
  1256. (inputs
  1257. `(("perl" ,perl)
  1258. ("sqlite" ,sqlite)
  1259. ("zlib" ,zlib)))
  1260. (home-page "https://github.com/mapbox/tippecanoe")
  1261. (synopsis "Vector tile server for maps")
  1262. (description "Tippecanoe creates scale-independent view of data, so that
  1263. the texture and density of features is visible at every zoom level, instead of
  1264. dropping features at lower levels.")
  1265. (license license:bsd-2)))
  1266. (define-public osmctools
  1267. (package
  1268. (name "osmctools")
  1269. (version "0.9")
  1270. (source
  1271. (origin
  1272. (method git-fetch)
  1273. (uri (git-reference
  1274. (url "https://gitlab.com/osm-c-tools/osmctools")
  1275. (commit version)))
  1276. (file-name (git-file-name name version))
  1277. (sha256
  1278. (base32
  1279. "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
  1280. (build-system gnu-build-system)
  1281. (native-inputs
  1282. `(("autoconf" ,autoconf)
  1283. ("automake" ,automake)))
  1284. (inputs
  1285. `(("zlib" ,zlib)))
  1286. (home-page "https://gitlab.com/osm-c-tools/osmctools")
  1287. (synopsis "Tools to convert, filter and update OpenStreetMap data files")
  1288. (description "This project contains a few tools which are used in the
  1289. OpenStreetMap project. They can be used to convert, filter and update
  1290. OpenStreetMap data files.")
  1291. (license license:agpl3)))
  1292. (define-public osm-gps-map
  1293. (package
  1294. (name "osm-gps-map")
  1295. (version "1.1.0")
  1296. (source
  1297. (origin
  1298. (method url-fetch)
  1299. (uri (string-append
  1300. "https://github.com/nzjrs/osm-gps-map/releases/download/"
  1301. version "/osm-gps-map-" version ".tar.gz"))
  1302. (sha256
  1303. (base32
  1304. "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
  1305. (build-system gnu-build-system)
  1306. (native-inputs
  1307. `(("gnome-common" ,gnome-common)
  1308. ("gtk-doc" ,gtk-doc/stable)
  1309. ("pkg-config" ,pkg-config)))
  1310. (inputs
  1311. `(("cairo" ,cairo)
  1312. ("glib" ,glib)
  1313. ("gobject-introspection" ,gobject-introspection)
  1314. ("gtk+" ,gtk+)
  1315. ("libsoup" ,libsoup)))
  1316. (home-page "https://nzjrs.github.io/osm-gps-map/")
  1317. (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
  1318. (description
  1319. "This package provides a GTK+ widget (and Python bindings) that when
  1320. given GPS coordinates,draws a GPS track, and points of interest on a moving
  1321. map display. Downloads map data from a number of websites, including
  1322. @url{https://www.openstreetmap.org}.")
  1323. (license license:gpl2+)))
  1324. (define-public xygrib
  1325. (package
  1326. (name "xygrib")
  1327. (version "1.2.6.1")
  1328. (source (origin
  1329. (method git-fetch)
  1330. (uri (git-reference
  1331. (url "https://github.com/opengribs/XyGrib")
  1332. (commit (string-append "v" version))))
  1333. (file-name (git-file-name name version))
  1334. (patches (search-patches "xygrib-fix-finding-data.patch"))
  1335. (sha256
  1336. (base32
  1337. "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
  1338. (modules '((guix build utils)))
  1339. (snippet
  1340. '(begin
  1341. (delete-file-recursively "data/fonts")
  1342. ;; Fixes compilation, can be removed with the next release.
  1343. ;; Upstream link: https://github.com/opengribs/XyGrib/pull/255
  1344. (substitute* "src/SkewT.h"
  1345. (("QMessageBox>") "QMessageBox>\n#include <QPainterPath>"))
  1346. #t))))
  1347. (build-system cmake-build-system)
  1348. (arguments
  1349. `(#:configure-flags (list "-DGNU_PACKAGE=ON")
  1350. #:phases
  1351. (modify-phases %standard-phases
  1352. (add-after 'unpack 'patch-directories
  1353. (lambda* (#:key inputs #:allow-other-keys)
  1354. (let ((jpeg (assoc-ref inputs "openjpeg"))
  1355. (font (assoc-ref inputs "font-liberation")))
  1356. (substitute* "CMakeLists.txt"
  1357. ;; Skip looking for the static library.
  1358. (("\"libnova.a\"") ""))
  1359. ;; Don't use the bundled font-liberation.
  1360. (substitute* "src/util/Font.cpp"
  1361. (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
  1362. (string-append "\"" font "/share/fonts/truetype/\"")))
  1363. (substitute* "src/util/Util.h"
  1364. (("pathData\\(\\)\\+\"data/fonts/\"")
  1365. (string-append "\"" font "/share/fonts/\"")))))))
  1366. #:tests? #f)) ; no tests
  1367. (native-inputs
  1368. `(("qttools" ,qttools)))
  1369. (inputs
  1370. `(("bzip2" ,bzip2)
  1371. ("font-liberation" ,font-liberation)
  1372. ("libnova" ,libnova)
  1373. ("libpng" ,libpng)
  1374. ("openjpeg" ,openjpeg)
  1375. ("proj" ,proj)
  1376. ("qtbase" ,qtbase-5)
  1377. ("zlib" ,zlib)))
  1378. (native-search-paths
  1379. (list (search-path-specification
  1380. (variable "XDG_DATA_DIRS")
  1381. (files '("share")))))
  1382. (synopsis "Weather Forecast Visualization")
  1383. (description
  1384. "XyGrib is a Grib file reader and visualizes meteorological data providing
  1385. an off-line capability to analyse weather forecasts or hindcasts. It is
  1386. intended to be used as a capable weather work station for anyone with a serious
  1387. interest in examining weather. This would include members of the sailing
  1388. community, private and sport aviators, farmers, weather buffs and many more.
  1389. XyGrib is the continuation of the zyGrib software package with a new team of
  1390. volunteers.")
  1391. (home-page "https://opengribs.org")
  1392. (license license:gpl3+)))
  1393. (define-public libspatialindex
  1394. (package
  1395. (name "libspatialindex")
  1396. (version "1.9.3")
  1397. (source
  1398. (origin
  1399. (method url-fetch)
  1400. (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
  1401. "releases/download/" version "/spatialindex-src-"
  1402. version ".tar.bz2"))
  1403. (sha256
  1404. (base32
  1405. "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
  1406. (build-system cmake-build-system)
  1407. (home-page "https://libspatialindex.org")
  1408. (synopsis "Spatial indexing library")
  1409. (description "The purpose of this library is to provide:
  1410. @itemize
  1411. @item An extensible framework that will support robust spatial indexing
  1412. methods.
  1413. @item Support for sophisticated spatial queries. Range, point location,
  1414. nearest neighbor and k-nearest neighbor as well as parametric queries (defined
  1415. by spatial constraints) should be easy to deploy and run.
  1416. @item Easy to use interfaces for inserting, deleting and updating information.
  1417. @item Wide variety of customization capabilities. Basic index and storage
  1418. characteristics like the page size, node capacity, minimum fan-out, splitting
  1419. algorithm, etc. should be easy to customize.
  1420. @item Index persistence. Internal memory and external memory structures
  1421. should be supported. Clustered and non-clustered indices should be easy to be
  1422. persisted.
  1423. @end itemize
  1424. ")
  1425. (license license:expat)))
  1426. (define-public java-jmapviewer
  1427. (package
  1428. (name "java-jmapviewer")
  1429. (version "2.13")
  1430. (source (origin
  1431. (method url-fetch)
  1432. (uri (string-append "https://svn.openstreetmap.org/applications/"
  1433. "viewer/jmapviewer/releases/" version
  1434. "/JMapViewer-" version "-Source.zip"))
  1435. (sha256
  1436. (base32
  1437. "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
  1438. (build-system ant-build-system)
  1439. (native-inputs
  1440. `(("unzip" ,unzip)))
  1441. (arguments
  1442. `(#:build-target "pack"
  1443. #:tests? #f; No tests
  1444. #:phases
  1445. (modify-phases %standard-phases
  1446. (add-before 'build 'clean
  1447. (lambda* _
  1448. (invoke "ant" "clean")))
  1449. (replace 'install
  1450. (lambda* (#:key outputs #:allow-other-keys)
  1451. (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
  1452. (mkdir-p dir)
  1453. (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))
  1454. #t))))))
  1455. (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
  1456. (synopsis "OSM map integration in Java")
  1457. (description "JMapViewer is a Java component which easily
  1458. integrates an OSM map view into your Java application. It is maintained as
  1459. an independent project by the JOSM team.")
  1460. (license license:gpl2)))
  1461. (define-public java-opening-hours-parser
  1462. (package
  1463. (name "java-opening-hours-parser")
  1464. (version "0.23.0")
  1465. (source (origin
  1466. (method git-fetch)
  1467. (uri (git-reference
  1468. (url "https://github.com/simonpoole/OpeningHoursParser")
  1469. (commit version)))
  1470. (file-name (git-file-name name version))
  1471. (sha256
  1472. (base32
  1473. "0yhbd2ix6h506aljh0jkrnp28m4xcqdcdpnqm30fn08kawdgxgsh"))))
  1474. (build-system ant-build-system)
  1475. (arguments
  1476. `(#:jar-name "java-opening-hours-parser.jar"
  1477. #:source-dir "src/main/java"
  1478. #:phases
  1479. (modify-phases %standard-phases
  1480. (add-before 'build 'copy-resources
  1481. (lambda _
  1482. (copy-recursively "src/main/resources" "build/classes")
  1483. #t))
  1484. (add-before 'build 'generate-parser
  1485. (lambda* _
  1486. (let* ((dir "src/main/java/ch/poole/openinghoursparser")
  1487. (file (string-append dir "/OpeningHoursParser.jj")))
  1488. (invoke "javacc" "-DEBUG_PARSER=false"
  1489. "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
  1490. "-GRAMMAR_ENCODING=UTF-8"
  1491. (string-append "-OUTPUT_DIRECTORY=" dir)
  1492. file))
  1493. #t)))))
  1494. (inputs
  1495. `(("java-jetbrains-annotations" ,java-jetbrains-annotations)))
  1496. (native-inputs
  1497. `(("javacc" ,javacc)
  1498. ("java-junit" ,java-junit)
  1499. ("java-hamcrest-core" ,java-hamcrest-core)))
  1500. (home-page "https://github.com/simonpoole/OpeningHoursParser")
  1501. (synopsis "Java parser for the OpenStreetMap opening hour format")
  1502. (description "This is a very simplistic parser for string values according
  1503. to the OSM opening hours specification.")
  1504. (license license:expat)))
  1505. (define-public josm
  1506. (package
  1507. (name "josm")
  1508. (version "18193")
  1509. (source (origin
  1510. (method svn-fetch)
  1511. (uri (svn-reference
  1512. (url "https://josm.openstreetmap.de/svn/trunk")
  1513. (revision (string->number version))
  1514. (recursive? #f)))
  1515. (sha256
  1516. (base32
  1517. "162hdck29bkag1d97nisx8v7395pdw00bl7nf0p02hr30fc1fcrh"))
  1518. (file-name (string-append name "-" version "-checkout"))
  1519. (modules '((guix build utils)))
  1520. (snippet
  1521. '(begin
  1522. (for-each delete-file (find-files "." ".*.jar$"))
  1523. #t))))
  1524. (build-system ant-build-system)
  1525. (native-inputs
  1526. `(("javacc" ,javacc)))
  1527. (inputs
  1528. `(("java-commons-jcs" ,java-commons-jcs)
  1529. ("java-commons-compress" ,java-commons-compress)
  1530. ("java-jmapviewer" ,java-jmapviewer)
  1531. ("java-jsonp-api" ,java-jsonp-api)
  1532. ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
  1533. ("java-jsr305" ,java-jsr305)
  1534. ("java-metadata-extractor" ,java-metadata-extractor)
  1535. ("java-opening-hours-parser" ,java-opening-hours-parser)
  1536. ("java-openjfx-media" ,java-openjfx-media)
  1537. ("java-signpost-core" ,java-signpost-core)
  1538. ("java-svg-salamander" ,java-svg-salamander)))
  1539. (arguments
  1540. `(#:tests? #f
  1541. #:jar-name "josm.jar"
  1542. #:phases
  1543. (modify-phases %standard-phases
  1544. (add-after 'unpack 'rm-build.xml
  1545. (lambda* _
  1546. (delete-file "build.xml")
  1547. #t))
  1548. (add-before 'build 'fix-revision
  1549. (lambda* _
  1550. (with-output-to-file "REVISION.XML"
  1551. (lambda _
  1552. (display
  1553. (string-append "<info><entry><commit revision=\"" ,version "\">"
  1554. "<date>1970-01-01 00:00:00 +0000</date>"
  1555. "</commit></entry></info>"))))
  1556. #t))
  1557. (add-before 'build 'fix-jcs
  1558. (lambda _
  1559. ;; This version of JOSM uses an unreleased version of commons-jcs,
  1560. ;; which has renamed its classes to another namespace. Rename them
  1561. ;; back so they can be used with our version of jcs.
  1562. (substitute* (find-files "." ".*.java$")
  1563. (("jcs3") "jcs")
  1564. (("ICache.NAME_COMPONENT_DELIMITER") "\":\""))
  1565. #t))
  1566. (add-before 'build 'fix-classpath
  1567. (lambda* (#:key inputs #:allow-other-keys)
  1568. (setenv "CLASSPATH"
  1569. (string-join
  1570. (filter
  1571. (lambda (s)
  1572. (let ((source (assoc-ref inputs "source")))
  1573. (not (equal? (substring s 0 (string-length source))
  1574. source))))
  1575. (string-split (getenv "CLASSPATH") #\:))
  1576. ":"))
  1577. #t))
  1578. (add-before 'build 'generate-parser
  1579. (lambda* _
  1580. (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
  1581. (out (string-append dir "/parsergen"))
  1582. (file (string-append dir "/MapCSSParser.jj")))
  1583. (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
  1584. (invoke "javacc" "-DEBUG_PARSER=false"
  1585. "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
  1586. "-GRAMMAR_ENCODING=UTF-8"
  1587. (string-append "-OUTPUT_DIRECTORY=" out)
  1588. file))
  1589. #t))
  1590. (add-after 'build 'generate-epsg
  1591. (lambda _
  1592. (system* "javac" "scripts/BuildProjectionDefinitions.java"
  1593. "-cp" "build/classes")
  1594. (mkdir-p "data/projection")
  1595. (with-output-to-file "data/projection/custom-epsg"
  1596. (lambda _ (display "")))
  1597. (invoke "java" "-cp" "build/classes:scripts:."
  1598. "BuildProjectionDefinitions" ".")
  1599. #t))
  1600. (add-after 'generate-epsg 'copy-resources
  1601. (lambda _
  1602. (copy-recursively "resources" "build/classes")
  1603. #t))
  1604. (add-before 'install 'regenerate-jar
  1605. (lambda _
  1606. ;; We need to regenerate the jar file to add data.
  1607. (delete-file "build/jar/josm.jar")
  1608. (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
  1609. "build/classes" ".")
  1610. #t))
  1611. (add-before 'build 'copy-revision
  1612. (lambda _
  1613. (mkdir-p "build/classes")
  1614. (with-output-to-file "build/classes/REVISION"
  1615. (lambda _
  1616. (display
  1617. (string-append "Revision: " ,version "\n"
  1618. "Is-Local-Build: true\n"
  1619. "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
  1620. #t))
  1621. (add-after 'install 'install-share-directories
  1622. (lambda* (#:key outputs #:allow-other-keys)
  1623. (let ((out (assoc-ref outputs "out"))
  1624. (share-directories '("applications" "icons" "man" "menu"
  1625. "metainfo" "mime" "pixmaps"))
  1626. (desktop "org.openstreetmap.josm.desktop"))
  1627. (for-each (lambda (directory)
  1628. (copy-recursively (string-append
  1629. "native/linux/tested/usr/share/"
  1630. directory)
  1631. (string-append
  1632. out "/share/" directory)))
  1633. share-directories)
  1634. (substitute* (string-append out "/share/applications/" desktop)
  1635. (("josm-MainApplication") "josm-gui-MainApplication")))
  1636. #t))
  1637. (add-after 'install 'install-bin
  1638. (lambda* (#:key outputs inputs #:allow-other-keys)
  1639. (let* ((out (assoc-ref outputs "out"))
  1640. (bin (string-append out "/bin")))
  1641. (mkdir-p bin)
  1642. (with-output-to-file (string-append bin "/josm")
  1643. (lambda _
  1644. (display
  1645. (string-append "#!/bin/sh\n"
  1646. (assoc-ref inputs "jdk") "/bin/java"
  1647. " -cp " out "/share/java/josm.jar:"
  1648. (getenv "CLASSPATH")
  1649. " org.openstreetmap.josm.gui.MainApplication"))))
  1650. (chmod (string-append bin "/josm") #o755))
  1651. #t)))))
  1652. (home-page "https://josm.openstreetmap.de")
  1653. (synopsis "OSM editor")
  1654. (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
  1655. supports loading GPX tracks, background imagery and OSM data from local
  1656. sources as well as from online sources and allows editing the OSM data (nodes,
  1657. ways, and relations) and their metadata tags.")
  1658. (license license:gpl2+)))
  1659. (define-public libmaxminddb
  1660. (package
  1661. (name "libmaxminddb")
  1662. (version "1.4.3")
  1663. (source
  1664. (origin
  1665. (method url-fetch)
  1666. (uri (string-append "https://github.com/maxmind/libmaxminddb"
  1667. "/releases/download/" version "/"
  1668. "/libmaxminddb-" version ".tar.gz"))
  1669. (sha256
  1670. (base32 "0fd4a4sxiiwzbd5h74wl1ijnb7xybjyybb7q41vdq3w8nk3zdzd5"))))
  1671. (build-system gnu-build-system)
  1672. (arguments
  1673. `(#:make-flags
  1674. (list ,(string-append "CC=" (cc-for-target)))))
  1675. (native-inputs
  1676. `(("perl" ,perl)))
  1677. (home-page "https://maxmind.github.io/libmaxminddb/")
  1678. (synopsis "C library for the MaxMind DB file format")
  1679. (description "The libmaxminddb library provides a C library for reading
  1680. MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
  1681. format is a custom, but open, binary format designed to facilitate fast
  1682. lookups of IP addresses while allowing flexibility in the type of data
  1683. associated with an address.")
  1684. (license license:asl2.0)))
  1685. (define-public python-maxminddb
  1686. (package
  1687. (name "python-maxminddb")
  1688. (version "1.5.1")
  1689. (source
  1690. (origin
  1691. (method url-fetch)
  1692. (uri (pypi-uri "maxminddb" version))
  1693. (sha256
  1694. (base32
  1695. "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
  1696. (build-system python-build-system)
  1697. (arguments
  1698. `(#:tests? #f)) ;; Tests require a copy of the maxmind database
  1699. (inputs
  1700. `(("libmaxminddb" ,libmaxminddb)))
  1701. (home-page "https://www.maxmind.com/")
  1702. (synopsis "Reader for the MaxMind DB format")
  1703. (description "MaxMind DB is a binary file format that stores data indexed
  1704. by IP address subnets (IPv4 or IPv6). This is a Python module for reading
  1705. MaxMind DB files.")
  1706. (license license:asl2.0)))
  1707. (define-public python-geoip2
  1708. (package
  1709. (name "python-geoip2")
  1710. (version "2.9.0")
  1711. (source
  1712. (origin
  1713. (method url-fetch)
  1714. (uri (pypi-uri "geoip2" version))
  1715. (sha256
  1716. (base32
  1717. "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
  1718. (build-system python-build-system)
  1719. (arguments
  1720. `(#:tests? #f)) ;; Tests require a copy of the maxmind database
  1721. (inputs
  1722. `(("python-maxminddb" ,python-maxminddb)
  1723. ("python-requests" ,python-requests)))
  1724. (home-page "https://www.maxmind.com/")
  1725. (synopsis "MaxMind GeoIP2 API")
  1726. (description "Provides an API for the GeoIP2 web services and databases.
  1727. The API also works with MaxMind’s free GeoLite2 databases.")
  1728. (license license:asl2.0)))
  1729. (define-public routino
  1730. (package
  1731. (name "routino")
  1732. (version "3.3.3")
  1733. (source
  1734. (origin
  1735. (method url-fetch)
  1736. (uri (string-append "http://www.routino.org/download/routino-"
  1737. version ".tgz"))
  1738. (sha256
  1739. (base32 "1xa7l2bjn832nk6bc7b481nv8hd2gj41jwhg0d2qy10lqdvjpn5b"))))
  1740. (build-system gnu-build-system)
  1741. (native-inputs
  1742. `(("perl" ,perl)))
  1743. (inputs
  1744. `(("bzip2" ,bzip2)
  1745. ("xz" ,xz)
  1746. ("zlib" ,zlib)))
  1747. (arguments
  1748. `(#:test-target "test"
  1749. #:phases
  1750. (modify-phases %standard-phases
  1751. (replace 'configure
  1752. (lambda* (#:key outputs #:allow-other-keys)
  1753. (substitute* "Makefile.conf"
  1754. (("prefix=/usr/local")
  1755. (string-append "prefix=" (assoc-ref outputs "out")))
  1756. (("LDFLAGS_LDSO=-Wl,-R\\.")
  1757. "LDFLAGS_LDSO=-Wl,-R$(libdir)")
  1758. (("#CFLAGS\\+=-DUSE_XZ")
  1759. "CFLAGS+=-DUSE_XZ")
  1760. (("#LDFLAGS\\+=-llzma")
  1761. "LDFLAGS+=-llzma"))
  1762. #t)))))
  1763. (synopsis "Routing application for OpenStreetMap data")
  1764. (description
  1765. "Routino is an application for finding a route between two points
  1766. using the dataset of topographical information collected by
  1767. @url{https://www.OpenStreetMap.org}.")
  1768. (home-page "https://www.routino.org/")
  1769. (license license:agpl3+)))
  1770. (define-public qmapshack
  1771. (package
  1772. (name "qmapshack")
  1773. (version "1.15.2")
  1774. (source
  1775. (origin
  1776. (method git-fetch)
  1777. (uri (git-reference
  1778. (url "https://github.com/Maproom/qmapshack")
  1779. (commit (string-append "V_" version))))
  1780. (file-name (git-file-name name version))
  1781. (sha256
  1782. (base32 "1l1j2axf94pdqwirwwhwy3y6k8v1aix78ifqbv6j8sv131h2j7y7"))))
  1783. (build-system qt-build-system)
  1784. (native-inputs
  1785. `(("pkg-config" ,pkg-config)
  1786. ("qttools" ,qttools)))
  1787. (inputs
  1788. `(("gdal" ,gdal)
  1789. ("libjpeg-turbo" ,libjpeg-turbo)
  1790. ("proj" ,proj)
  1791. ("qtbase" ,qtbase-5)
  1792. ("qtdeclarative" ,qtdeclarative)
  1793. ("qtlocation" ,qtlocation)
  1794. ("qtwebchannel" ,qtwebchannel)
  1795. ("qtwebengine" ,qtwebengine)
  1796. ("quazip" ,quazip-0)
  1797. ("routino" ,routino)
  1798. ("sqlite" ,sqlite) ; See wrap phase
  1799. ("zlib" ,zlib)))
  1800. (arguments
  1801. `(#:tests? #f
  1802. #:phases
  1803. (modify-phases %standard-phases
  1804. (add-after 'unpack 'fix-cmake-modules
  1805. (lambda* (#:key inputs #:allow-other-keys)
  1806. (substitute* "CMakeLists.txt"
  1807. (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
  1808. (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
  1809. (substitute* "cmake/Modules/FindROUTINO.cmake"
  1810. (("/usr/local")
  1811. (assoc-ref inputs "routino")))
  1812. ;; The following fixes are included as patches in the sources
  1813. ;; of QMapShack, but they are not applied by default, for
  1814. ;; some reason...
  1815. (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
  1816. (invoke "patch" "-p1" "-i" "FindQuaZip5.patch"))))))
  1817. (synopsis "GPS mapping application")
  1818. (description
  1819. "QMapShack can be used to plan your next outdoor trip or to visualize and
  1820. archive all the GPS recordings of your past trips. It is the successor of the
  1821. QLandkarte GT application.")
  1822. (home-page "https://github.com/Maproom/qmapshack/wiki")
  1823. (license license:gpl3+)))
  1824. (define-public readosm
  1825. (package
  1826. (name "readosm")
  1827. (version "1.1.0a")
  1828. (source
  1829. (origin
  1830. (method url-fetch)
  1831. (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
  1832. "readosm-" version ".tar.gz"))
  1833. (sha256
  1834. (base32 "0igif2bxf4dr82glxz9gyx5mmni0r2dsnx9p9k6pxv3c4lfhaz6v"))))
  1835. (build-system gnu-build-system)
  1836. (inputs
  1837. `(("expat" ,expat)
  1838. ("zlib" ,zlib)))
  1839. (synopsis "Data extractor for OpenStreetMap files")
  1840. (description
  1841. "ReadOSM is a library to extract valid data from within an OpenStreetMap
  1842. input file (in @code{.osm} or @code{.osm.pbf} format).")
  1843. (home-page "https://www.gaia-gis.it/fossil/readosm/index")
  1844. (license (list license:gpl2+
  1845. license:lgpl2.1+
  1846. license:mpl1.1))))
  1847. (define-public shapelib
  1848. (package
  1849. (name "shapelib")
  1850. (version "1.5.0")
  1851. (source
  1852. (origin
  1853. (method git-fetch)
  1854. (uri (git-reference
  1855. (url "https://github.com/OSGeo/shapelib")
  1856. (commit (string-append "v" version))))
  1857. (file-name (git-file-name name version))
  1858. (sha256
  1859. (base32 "1lzch0jf6yqhw391phhafzw4ghmiz98zkf698h4fmq109fa2vhqd"))))
  1860. (build-system gnu-build-system)
  1861. (native-inputs
  1862. `(("autoconf" ,autoconf)
  1863. ("automake" ,automake)
  1864. ("libtool" ,libtool)))
  1865. (home-page "http://shapelib.maptools.org/")
  1866. (synopsis "Provides C library to write and update ESRI Shapefiles")
  1867. (description
  1868. "The Shapefile C Library provides the ability to write simple C programs
  1869. for reading, writing and updating (to a limited extent) ESRI Shapefiles, and the
  1870. associated attribute file (@file{.dbf}).")
  1871. (license license:gpl2+)))
  1872. (define-public spatialite-tools
  1873. (package
  1874. (name "spatialite-tools")
  1875. (version "5.0.1")
  1876. (source
  1877. (origin
  1878. (method url-fetch)
  1879. (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
  1880. "spatialite-tools-" version ".tar.gz"))
  1881. (sha256
  1882. (base32 "070p6pg541wvwb28wkn7k0z1qdyirik2qc2jpj4pf0vzx02w414n"))))
  1883. (build-system gnu-build-system)
  1884. (native-inputs
  1885. `(("pkg-config" ,pkg-config)))
  1886. (inputs
  1887. `(("expat" ,expat)
  1888. ("freexl" ,freexl)
  1889. ("geos" ,geos)
  1890. ("librttopo" ,librttopo)
  1891. ("libspatialite" ,libspatialite)
  1892. ("libxml2" ,libxml2)
  1893. ("minizip" ,minizip)
  1894. ("proj" ,proj)
  1895. ("readosm" ,readosm)
  1896. ("sqlite" ,sqlite)))
  1897. (synopsis "Collection of command line tools for SpatiaLite")
  1898. (description
  1899. "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
  1900. tools supporting SpatiaLite.")
  1901. (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
  1902. (license license:gpl3+)))
  1903. (define-public virtualpg
  1904. (package
  1905. (name "virtualpg")
  1906. (version "2.0.1")
  1907. (source
  1908. (origin
  1909. (method url-fetch)
  1910. (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
  1911. "virtualpg-" version ".tar.gz"))
  1912. (sha256
  1913. (base32 "12z0l7368r4116ljzg7nljy5hf425r11vxc540w79wlzikmynamy"))))
  1914. (build-system gnu-build-system)
  1915. (inputs
  1916. `(("postgresql" ,postgresql)
  1917. ("sqlite" ,sqlite)))
  1918. (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
  1919. (description
  1920. "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
  1921. the VirtualPostgres driver, allowing to directly exchange data between SQLite
  1922. and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
  1923. exchanged form one Spatial DBMS and the other.")
  1924. (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
  1925. (license (list license:gpl2+
  1926. license:lgpl2.1+
  1927. license:mpl1.1))))
  1928. (define-public opencpn
  1929. (package
  1930. (name "opencpn")
  1931. (version "5.0.0")
  1932. (source
  1933. (origin
  1934. (method git-fetch)
  1935. (uri (git-reference
  1936. (url "https://github.com/OpenCPN/OpenCPN")
  1937. (commit (string-append "v" version))))
  1938. (file-name (git-file-name name version))
  1939. (sha256
  1940. (base32 "1xv3h6svw9aay5ixpql231md3pf00qxvhg62z88daraf18hlkfja"))))
  1941. (build-system cmake-build-system)
  1942. (native-inputs
  1943. `(("gettext" ,gettext-minimal)
  1944. ("pkg-config" ,pkg-config)))
  1945. (inputs
  1946. `(("bzip2" ,bzip2)
  1947. ("cairo" ,cairo)
  1948. ("curl" ,curl)
  1949. ("glu" ,glu)
  1950. ("gtk+" ,gtk+)
  1951. ("libarchive" ,libarchive)
  1952. ("libelf" ,libelf)
  1953. ("libexif" ,libexif)
  1954. ("libsndfile" ,libsndfile)
  1955. ("lz4" ,lz4)
  1956. ("mesa" ,mesa)
  1957. ("pango" ,pango)
  1958. ("portaudio" ,portaudio)
  1959. ("sqlite" ,sqlite)
  1960. ("tinyxml" ,tinyxml)
  1961. ("wxsvg" ,wxsvg)
  1962. ("wxwidgets" ,wxwidgets)
  1963. ("xz" ,xz)
  1964. ("zlib" ,zlib)))
  1965. (arguments
  1966. `(#:configure-flags '("-DENABLE_PORTAUDIO=ON"
  1967. "-DENABLE_SNDFILE=ON"
  1968. "-DBUNDLE_TCDATA=ON"
  1969. "-DBUNDLE_GSHHS=CRUDE"
  1970. "-DCMAKE_C_FLAGS=-fcommon")
  1971. #:tests? #f ; No tests defined
  1972. #:phases
  1973. (modify-phases %standard-phases
  1974. (add-after 'unpack 'fix-build
  1975. (lambda _
  1976. (substitute* "CMakeLists.txt"
  1977. (("set\\(wxWidgets_CONFIG_OPTIONS.*--toolkit=gtk3" all)
  1978. (string-append all " --libs all")))
  1979. #t)))))
  1980. (synopsis "Chart plotter and marine GPS navigation software")
  1981. (description
  1982. "OpenCPN is a chart plotter and marine navigation software designed to be
  1983. used at the helm station of your boat while underway. Chart a course and
  1984. track your position right from your laptop.")
  1985. (home-page "https://opencpn.org/")
  1986. (license (list license:asl2.0
  1987. license:cc0
  1988. license:bsd-2
  1989. license:bsd-3
  1990. license:expat
  1991. license:gpl3+
  1992. license:lgpl2.1+
  1993. license:lgpl3+
  1994. license:sgifreeb2.0
  1995. license:zlib))))
  1996. (define-public grass
  1997. (let* ((version "7.8.5")
  1998. (majorminor (string-join (list-head (string-split version #\.) 2) ""))
  1999. (grassxx (string-append "grass" majorminor)))
  2000. (package
  2001. (name "grass")
  2002. (version version)
  2003. (source
  2004. (origin
  2005. (method url-fetch)
  2006. (uri (string-append "https://grass.osgeo.org/" grassxx
  2007. "/source/grass-" version ".tar.gz"))
  2008. (sha256
  2009. (base32 "0dzzhgcsrszzinvjir50nvzq873b8gsp0p9k8fvcrv14amkbnnd3"))))
  2010. (build-system gnu-build-system)
  2011. (inputs
  2012. `(("bzip2" ,bzip2)
  2013. ("cairo" ,cairo)
  2014. ("fftw" ,fftw)
  2015. ("freetype" ,freetype)
  2016. ("gdal" ,gdal)
  2017. ("geos" ,geos)
  2018. ("glu" ,glu)
  2019. ("lapack" ,lapack)
  2020. ("libpng" ,libpng)
  2021. ("libtiff" ,libtiff)
  2022. ("mesa" ,mesa)
  2023. ("mariadb-dev" ,mariadb "dev")
  2024. ("mariadb-lib" ,mariadb "lib")
  2025. ("netcdf" ,netcdf)
  2026. ("openblas" ,openblas)
  2027. ("perl" ,perl)
  2028. ("postgresql" ,postgresql)
  2029. ("proj" ,proj)
  2030. ("python" ,python)
  2031. ("python-dateutil" ,python-dateutil)
  2032. ("python-numpy" ,python-numpy)
  2033. ("python-wxpython" ,python-wxpython)
  2034. ("readline" ,readline)
  2035. ("sqlite" ,sqlite)
  2036. ("wxwidgets" ,wxwidgets)
  2037. ("zlib" ,zlib)
  2038. ("zstd" ,zstd "lib")))
  2039. (native-inputs
  2040. `(("bash" ,bash-minimal)
  2041. ("bison" ,bison)
  2042. ("flex" ,flex)
  2043. ("pkg-config" ,pkg-config)))
  2044. (arguments
  2045. `(#:tests? #f ; No tests
  2046. #:modules ((guix build gnu-build-system)
  2047. ((guix build python-build-system) #:prefix python:)
  2048. (guix build utils))
  2049. #:imported-modules (,@%gnu-build-system-modules
  2050. (guix build python-build-system))
  2051. #:phases
  2052. (modify-phases %standard-phases
  2053. (replace 'configure
  2054. (lambda* (#:key inputs outputs #:allow-other-keys)
  2055. (let ((shell (search-input-file inputs "/bin/bash")))
  2056. (setenv "SHELL" shell)
  2057. (setenv "CONFIG_SHELL" shell)
  2058. (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
  2059. (assoc-ref outputs "out")
  2060. "/" ,grassxx "/lib")))
  2061. (invoke "./configure"
  2062. (string-append "--prefix="
  2063. (assoc-ref outputs "out"))
  2064. "--with-blas"
  2065. "--with-bzlib"
  2066. (string-append "--with-freetype-includes="
  2067. (assoc-ref inputs "freetype")
  2068. "/include/freetype2")
  2069. (string-append "--with-freetype-libs="
  2070. (assoc-ref inputs "freetype")
  2071. "/lib")
  2072. "--with-geos"
  2073. "--with-lapack"
  2074. "--with-mysql"
  2075. (string-append "--with-mysql-includes="
  2076. (assoc-ref inputs "mariadb-dev")
  2077. "/include/mysql")
  2078. (string-append "--with-mysql-libs="
  2079. (assoc-ref inputs "mariadb-lib")
  2080. "/lib")
  2081. "--with-netcdf"
  2082. "--with-postgres"
  2083. (string-append "--with-proj-share="
  2084. (assoc-ref inputs "proj")
  2085. "/share/proj")
  2086. "--with-pthread"
  2087. "--with-readline"
  2088. "--with-sqlite"
  2089. "--with-wxwidgets")))
  2090. (add-after 'install 'install-links
  2091. (lambda* (#:key outputs #:allow-other-keys)
  2092. ;; Put links for includes and libraries in the standard places.
  2093. (let* ((out (assoc-ref outputs "out"))
  2094. (dir (string-append out "/" ,grassxx)))
  2095. (symlink (string-append dir "/include")
  2096. (string-append out "/include"))
  2097. (symlink (string-append dir "/lib")
  2098. (string-append out "/lib")))
  2099. #t))
  2100. (add-after 'install-links 'python:wrap
  2101. (assoc-ref python:%standard-phases 'wrap))
  2102. (add-after 'python:wrap 'wrap-with-python-interpreter
  2103. (lambda* (#:key outputs #:allow-other-keys)
  2104. (let ((out (assoc-ref outputs "out")))
  2105. (wrap-program (string-append out "/bin/" ,grassxx)
  2106. `("GRASS_PYTHON" = (,(which "python3"))))
  2107. #t))))))
  2108. (synopsis "GRASS Geographic Information System")
  2109. (description
  2110. "GRASS (Geographic Resources Analysis Support System), is a Geographic
  2111. Information System (GIS) software suite used for geospatial data management and
  2112. analysis, image processing, graphics and maps production, spatial modeling, and
  2113. visualization.")
  2114. (home-page "https://grass.osgeo.org/")
  2115. (license license:gpl2+))))
  2116. (define-public saga
  2117. (package
  2118. (name "saga")
  2119. (version "7.9.0")
  2120. (source
  2121. (origin
  2122. (method url-fetch)
  2123. (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
  2124. (version-major version) "/SAGA%20-%20" version
  2125. "/saga-" version ".tar.gz"))
  2126. (sha256
  2127. (base32 "1n051yxxkylly0k9rlkx2ih3j2lf9d4csg00sm7161r7nhjvggd1"))))
  2128. (build-system gnu-build-system)
  2129. (native-inputs
  2130. `(("pkg-config" ,pkg-config)
  2131. ("swig" ,swig)))
  2132. (inputs
  2133. `(("curl" ,curl)
  2134. ("fftw" ,fftw)
  2135. ("gdal" ,gdal)
  2136. ("hdf5" ,hdf5)
  2137. ("jasper" ,jasper)
  2138. ("libharu" ,libharu)
  2139. ("libtiff" ,libtiff)
  2140. ("opencv" ,opencv)
  2141. ("postgresql" ,postgresql)
  2142. ("proj" ,proj)
  2143. ("python" ,python)
  2144. ("qhull" ,qhull)
  2145. ("unixodbc" ,unixodbc)
  2146. ("vigra" ,vigra)
  2147. ("wxwidgets" ,wxwidgets)))
  2148. (arguments
  2149. '(#:configure-flags '("--enable-python")))
  2150. (synopsis "System for Automated Geoscientific Analyses")
  2151. (description
  2152. "SAGA (System for Automated Geoscientific Analyses) is a Geographic
  2153. Information System (GIS) software. It has been designed for an easy and
  2154. effective implementation of spatial algorithms and it offers a comprehensive,
  2155. growing set of geoscientific methods.")
  2156. (home-page "http://www.saga-gis.org")
  2157. (license (list license:gpl2+ license:lgpl2.1+))))
  2158. (define-public qgis
  2159. (package
  2160. (name "qgis")
  2161. (version "3.16.3")
  2162. (source
  2163. (origin
  2164. (method url-fetch)
  2165. (uri (string-append "https://qgis.org/downloads/qgis-"
  2166. version ".tar.bz2"))
  2167. (sha256
  2168. (base32 "012dv8dcg7w4lf6k37i41wialwhi0kpkxw2dnq19yqqk35632mzx"))))
  2169. (build-system cmake-build-system)
  2170. (arguments
  2171. `(#:modules ((guix build cmake-build-system)
  2172. ((guix build python-build-system) #:prefix python:)
  2173. (guix build qt-utils)
  2174. (guix build utils))
  2175. #:imported-modules (,@%cmake-build-system-modules
  2176. (guix build python-build-system)
  2177. (guix build qt-utils))
  2178. #:phases
  2179. (modify-phases %standard-phases
  2180. ;; Configure correct path to PyQt5 SIP directory
  2181. (add-after 'unpack 'configure-pyqt5-sip-path
  2182. (lambda* (#:key inputs #:allow-other-keys)
  2183. (substitute* "cmake/FindPyQt5.py"
  2184. (("sip_dir = cfg.default_sip_dir")
  2185. (string-append "sip_dir = \""
  2186. (assoc-ref inputs "python-pyqt+qscintilla")
  2187. "/share/sip\""))
  2188. ;; Fix building with python-sip@5.
  2189. ;;
  2190. ;; The reason for this is that python-sip@5 introduces some
  2191. ;; changes such as a new build system 'sip-build' as well as the
  2192. ;; use of the path "/lib/pythonX.X/site-packages/*/bindings/"
  2193. ;; instead of "/share/sip/" for .sip files. However, we do not
  2194. ;; actually use that those yet. QGIS detects SIP5 and assumes we
  2195. ;; are, messing up the build. The long term solution is to fully
  2196. ;; upgrade SIP, use sip-build and fix all failing packages, but
  2197. ;; for now I just want to get the build working.
  2198. ((".pyqt_sip_dir...os.path.join.*,")
  2199. (string-append "'pyqt_sip_dir': \""
  2200. (assoc-ref inputs "python-pyqt+qscintilla")
  2201. "/share/sip" "\",")))
  2202. (substitute* (list "scripts/prepare_commit.sh"
  2203. "scripts/qstringfixup.sh"
  2204. "scripts/release.pl"
  2205. "scripts/runtests_local_travis_config.sh"
  2206. "scripts/sip_include.sh"
  2207. "scripts/sipdiff"
  2208. "scripts/sipify_all.sh"
  2209. "scripts/spell_check/check_spelling.sh"
  2210. "scripts/spell_check/spell_test.sh"
  2211. "scripts/verify_indentation.sh"
  2212. "tests/code_layout/test_banned_keywords.sh"
  2213. "tests/code_layout/test_licenses.sh"
  2214. "tests/code_layout/test_shellcheck.sh"
  2215. "tests/code_layout/test_sip_include.sh"
  2216. "tests/code_layout/test_sipfiles.sh"
  2217. "tests/code_layout/test_sipify.sh")
  2218. (("\\$\\(git rev-parse --show-toplevel\\)")
  2219. (getcwd)))
  2220. (substitute* "tests/code_layout/test_sip_include.sh"
  2221. (("^REV=.*") "REV=currentrev\n"))
  2222. #t))
  2223. (replace 'check
  2224. (lambda* (#:key inputs #:allow-other-keys)
  2225. (setenv "HOME" "/tmp")
  2226. (system "Xvfb :1 &")
  2227. (setenv "DISPLAY" ":1")
  2228. (setenv "TRAVIS" "true")
  2229. (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
  2230. (invoke "ctest"
  2231. "-E" (string-join
  2232. '(;; Disable tests that require network access
  2233. "qgis_filedownloader"
  2234. ;; TODO: Find why the following tests fail
  2235. "ProcessingGdalAlgorithmsRasterTest"
  2236. "ProcessingGdalAlgorithmsVectorTest"
  2237. "ProcessingGrass7AlgorithmsImageryTest"
  2238. "ProcessingGrass7AlgorithmsRasterTest"
  2239. "ProcessingGrass7AlgorithmsVectorTest"
  2240. "ProcessingOtbAlgorithmsTest"
  2241. "ProcessingQgisAlgorithmsTestPt1"
  2242. "ProcessingQgisAlgorithmsTestPt2"
  2243. "ProcessingQgisAlgorithmsTestPt3"
  2244. "ProcessingQgisAlgorithmsTestPt4"
  2245. "PyCoreAdittions"
  2246. "PyQgsAnnotation"
  2247. "PyQgsAppStartup"
  2248. "PyQgsAuthBasicMethod"
  2249. "PyQgsAuthenticationSystem"
  2250. "PyQgsAuxiliaryStorage"
  2251. "PyQgsDBManagerGpkg"
  2252. "PyQgsDBManagerSpatialite"
  2253. "PyQgsDataItem"
  2254. "PyQgsFieldValidator"
  2255. "PyQgsFileUtils"
  2256. "PyQgsGeometryTest"
  2257. "PyQgsImageCache"
  2258. "PyQgsImportIntoPostGIS"
  2259. "PyQgsLayerDependencies"
  2260. "PyQgsLayerMetadata"
  2261. "PyQgsLayout"
  2262. "PyQgsLayoutExporter"
  2263. "PyQgsLayoutHtml"
  2264. "PyQgsLayoutLegend"
  2265. "PyQgsLayoutMapGrid"
  2266. "PyQgsMapLayer"
  2267. "PyQgsMetadataBase"
  2268. "PyQgsOGRProvider"
  2269. "PyQgsOGRProviderGpkg"
  2270. "PyQgsOapifProvider"
  2271. "PyQgsPalLabelingLayout"
  2272. "PyQgsProject"
  2273. "PyQgsProviderConnectionGpkg"
  2274. "PyQgsProviderConnectionPostgres"
  2275. "PyQgsProviderConnectionSpatialite"
  2276. "PyQgsPythonProvider"
  2277. "PyQgsRasterLayer"
  2278. "PyQgsRulebasedRenderer"
  2279. "PyQgsSelectiveMasking"
  2280. "PyQgsSettings"
  2281. "PyQgsShapefileProvider"
  2282. "PyQgsSpatialiteProvider"
  2283. "PyQgsSvgCache"
  2284. "PyQgsSymbolExpressionVariables"
  2285. "PyQgsTextRenderer"
  2286. "PyQgsVectorFileWriter"
  2287. "PyQgsVectorLayer"
  2288. "PyQgsVectorLayerUtils"
  2289. "PyQgsVirtualLayerProvider"
  2290. "PyQgsWFSProvider"
  2291. "qgis_arcgisrestutilstest"
  2292. "qgis_authmanagertest"
  2293. "qgis_compositionconvertertest"
  2294. "qgis_coordinatereferencesystemtest"
  2295. "qgis_expressiontest"
  2296. "qgis_fontmarkertest"
  2297. "qgis_geometrycheckstest"
  2298. "qgis_geometrytest"
  2299. "qgis_gpsinformationwidget"
  2300. "qgis_grassprovidertest7"
  2301. "qgis_imagecachetest"
  2302. "qgis_labelingenginetest"
  2303. "qgis_layouthtmltest"
  2304. "qgis_layoutmanualtabletest"
  2305. "qgis_layoutmapgridtest"
  2306. "qgis_layoutmaptest"
  2307. "qgis_layoutpicturetest"
  2308. "qgis_layouttabletest"
  2309. "qgis_mapdevicepixelratiotest"
  2310. "qgis_maprendererjobtest"
  2311. "qgis_ogrproviderguitest"
  2312. "qgis_painteffecttest"
  2313. "qgis_pallabelingtest"
  2314. "qgis_processingtest"
  2315. "qgis_rasterlayertest"
  2316. "qgis_shellcheck"
  2317. "qgis_sip_include"
  2318. "qgis_sip_uptodate"
  2319. "qgis_sipify"
  2320. "qgis_styletest"
  2321. "qgis_svgmarkertest"
  2322. "qgis_taskmanagertest"
  2323. "qgis_wcsprovidertest"
  2324. "qgis_ziplayertest")
  2325. "|"))))
  2326. (add-after 'install 'wrap-python
  2327. (assoc-ref python:%standard-phases 'wrap))
  2328. (add-after 'wrap-python 'wrap-qt
  2329. (lambda* (#:key outputs inputs #:allow-other-keys)
  2330. (let ((out (assoc-ref outputs "out")))
  2331. (wrap-qt-program "qgis" #:output out #:inputs inputs))
  2332. #t))
  2333. (add-after 'wrap-qt 'wrap-gis
  2334. (lambda* (#:key inputs outputs #:allow-other-keys)
  2335. ;; TODO: Find if there is a way to get SAGA to work.
  2336. ;; Currently QGIS says "version of SAGA not supported".
  2337. ;; Disable it for now.
  2338. (let* ((out (assoc-ref outputs "out"))
  2339. ;;(saga (string-append (assoc-ref inputs "saga") "/bin"))
  2340. (grass-version ,(package-version grass))
  2341. (grass-majorminor (string-join
  2342. (list-head
  2343. (string-split grass-version #\.) 2)
  2344. ""))
  2345. (grass (string-append (assoc-ref inputs "grass")
  2346. "/grass" grass-majorminor)))
  2347. (wrap-program (string-append out "/bin/qgis")
  2348. ;;`("PATH" ":" prefix (,saga))
  2349. `("QGIS_PREFIX_PATH" = (,out))
  2350. `("GISBASE" = (,grass))))
  2351. #t)))))
  2352. (inputs
  2353. `(("exiv2" ,exiv2)
  2354. ("expat" ,expat)
  2355. ("gdal" ,gdal)
  2356. ("geos" ,geos)
  2357. ("gpsbabel" ,gpsbabel)
  2358. ("grass" ,grass)
  2359. ("gsl" ,gsl)
  2360. ("hdf5" ,hdf5)
  2361. ("libspatialindex" ,libspatialindex)
  2362. ("libspatialite" ,libspatialite)
  2363. ("libxml2" ,libxml2)
  2364. ("libzip" ,libzip)
  2365. ("netcdf" ,netcdf)
  2366. ("postgresql" ,postgresql)
  2367. ("proj" ,proj)
  2368. ("protobuf" ,protobuf)
  2369. ("python" ,python)
  2370. ("python-chardet" ,python-chardet)
  2371. ("python-dateutil" ,python-dateutil)
  2372. ("python-future" ,python-future)
  2373. ("python-gdal" ,python-gdal)
  2374. ("python-jinja2" ,python-jinja2)
  2375. ("python-numpy" ,python-numpy)
  2376. ("python-owslib" ,python-owslib)
  2377. ("python-psycopg2" ,python-psycopg2)
  2378. ("python-pygments" ,python-pygments)
  2379. ("python-pyqt+qscintilla" ,python-pyqt+qscintilla)
  2380. ("python-pytz" ,python-pytz)
  2381. ("python-pyyaml" ,python-pyyaml)
  2382. ("python-requests" ,python-requests)
  2383. ("python-sip" ,python-sip)
  2384. ("python-six" ,python-six)
  2385. ("python-urllib3" ,python-urllib3)
  2386. ("qca" ,qca)
  2387. ("qscintilla" ,qscintilla)
  2388. ("qtbase" ,qtbase-5)
  2389. ("qtdeclarative" ,qtdeclarative)
  2390. ("qtkeychain" ,qtkeychain)
  2391. ("qtlocation" ,qtlocation)
  2392. ("qtserialport" ,qtserialport)
  2393. ("qtsvg" ,qtsvg)
  2394. ("qtwebkit" ,qtwebkit)
  2395. ("qwt" ,qwt)
  2396. ;;("saga" ,saga)
  2397. ("sqlite" ,sqlite)))
  2398. (native-inputs
  2399. `(("bison" ,bison)
  2400. ("flex" ,flex)
  2401. ("perl" ,perl)
  2402. ("perl-yaml-tiny" ,perl-yaml-tiny)
  2403. ("pkg-config" ,pkg-config)
  2404. ("python-mock" ,python-mock)
  2405. ("python-nose2" ,python-nose2)
  2406. ("qttools" ,qttools)
  2407. ("shellcheck" ,shellcheck)
  2408. ("xorg-server" ,xorg-server-for-tests)))
  2409. (home-page "https://qgis.org")
  2410. (synopsis "Geographical information system")
  2411. (description "QGIS is an easy to use Geographical Information
  2412. System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
  2413. raster and vector data formats, with new support easily added using the plugin
  2414. architecture.")
  2415. (license
  2416. (list
  2417. license:asl1.1
  2418. license:asl2.0
  2419. license:bsd-2
  2420. license:bsd-3
  2421. license:boost1.0
  2422. license:cc-by3.0
  2423. license:cc-by4.0
  2424. license:cc-by-sa3.0
  2425. license:cc-by-sa4.0
  2426. (license:fsdg-compatible "https://www.deviantart.com/elvensword")
  2427. (license:fsf-free "file://debian/copyright" "Go Squared")
  2428. license:expat
  2429. license:fdl1.2+
  2430. (license:fsf-free
  2431. "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
  2432. (license:fsf-free
  2433. "file://debian/copyright"
  2434. "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
  2435. license:gpl2
  2436. license:gpl2+
  2437. license:gpl3
  2438. license:gpl3+
  2439. license:isc
  2440. license:lgpl2.0+
  2441. license:lgpl2.1
  2442. license:lgpl2.1+
  2443. license:lgpl3
  2444. (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
  2445. (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
  2446. (license:non-copyleft
  2447. "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
  2448. "NCL Source Code License")
  2449. license:ogl-psi1.0
  2450. license:opl1.0+
  2451. license:public-domain
  2452. license:qwt1.0))))
  2453. (define-public python-geographiclib
  2454. (package
  2455. (name "python-geographiclib")
  2456. (version "1.50")
  2457. (source
  2458. (origin
  2459. (method url-fetch)
  2460. (uri (pypi-uri "geographiclib" version))
  2461. (sha256
  2462. (base32
  2463. "0cn6ap5fkh3mkfa57l5b44z3gvz7j6lpmc9rl4g2jny2gvp4dg8j"))))
  2464. (build-system python-build-system)
  2465. (home-page "https://geographiclib.sourceforge.io/1.50/python/")
  2466. (synopsis "Python geodesic routines from GeographicLib")
  2467. (description
  2468. "This is a python implementation of the geodesic routines in GeographicLib.")
  2469. (license license:expat)))
  2470. (define-public python-geopy
  2471. (package
  2472. (name "python-geopy")
  2473. (version "2.0.0")
  2474. (source
  2475. (origin
  2476. (method url-fetch)
  2477. (uri (pypi-uri "geopy" version))
  2478. (sha256
  2479. (base32
  2480. "0fx0cv0kgbvynpmjgsvq2fpsyngd5idiscdn8pd5201f1ngii3mq"))))
  2481. (build-system python-build-system)
  2482. (propagated-inputs
  2483. `(("python-geographiclib" ,python-geographiclib)))
  2484. (native-inputs
  2485. `(("python-async-generator" ,python-async-generator)
  2486. ("python-coverage" ,python-coverage)
  2487. ("python-flake8" ,python-flake8)
  2488. ("python-isort" ,python-isort)
  2489. ("python-pytest" ,python-pytest)
  2490. ("python-pytest-aiohttp" ,python-pytest-aiohttp)
  2491. ("python-readme-renderer" ,python-readme-renderer)
  2492. ("python-pytz" ,python-pytz)))
  2493. (home-page "https://github.com/geopy/geopy")
  2494. (synopsis "Geocoding library for Python")
  2495. (description "@code{geopy} is a Python client for several popular geocoding
  2496. web services. @code{geopy} makes it easy for Python developers to locate the
  2497. coordinates of addresses, cities, countries, and landmarks across the globe
  2498. using third-party geocoders and other data sources.")
  2499. (license license:expat)))
  2500. (define-public marble-qt
  2501. (let ((release "17.08")
  2502. (commit "fc7166eeef784732033c999ba605364f9c82d21c")
  2503. (revision "1"))
  2504. (package
  2505. (name "marble-qt")
  2506. (version (git-version release revision commit))
  2507. (source
  2508. (origin
  2509. (method git-fetch)
  2510. (uri (git-reference
  2511. (url "https://invent.kde.org/education/marble.git/")
  2512. (commit commit)))
  2513. (file-name (git-file-name name version))
  2514. (sha256
  2515. (base32 "0m0sf3sddaib7vc5lhbmh7ziw07p1hahg02f65sgfylyl5f5kj92"))
  2516. (patches (search-patches
  2517. "marble-qt-add-qt-headers.patch"))))
  2518. (build-system cmake-build-system)
  2519. (arguments
  2520. `(#:tests? #f ; libmarblewidget-qt5.so.28 not found
  2521. #:configure-flags
  2522. '("-DCMAKE_BUILD_TYPE=Release"
  2523. "-DWITH_KF5=FALSE")))
  2524. (native-inputs
  2525. `(("qttools" ,qttools)))
  2526. (inputs
  2527. `(("qtbase" ,qtbase-5)
  2528. ("qtsvg" ,qtsvg)
  2529. ("qtdeclarative" ,qtdeclarative)
  2530. ("qtwebkit" ,qtwebkit)
  2531. ("qtlocation" ,qtlocation)))
  2532. (home-page "https://marble.kde.org/")
  2533. (synopsis "Virtual globe and world atlas")
  2534. (description "Marble is similar to a desktop globe. At closer scale it
  2535. becomes a world atlas, while OpenStreetMap takes the user to street level. It
  2536. supports searching for places of interest, viewing Wikipedia articles,
  2537. creating routes by drag and drop and more.")
  2538. (license license:gpl3))))