unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Julien Lepiller <julien@lepiller.eu>
To: 35545@debbugs.gnu.org
Subject: [bug#35545] [PATCH 17/17] gnu: Add josm.
Date: Fri,  3 May 2019 15:01:34 +0200	[thread overview]
Message-ID: <20190503130134.24788-17-julien@lepiller.eu> (raw)
In-Reply-To: <20190503130134.24788-1-julien@lepiller.eu>

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

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index de9e228a25..06fd6c2822 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages icu4c)
+  #:use-module (gnu packages java)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
@@ -887,3 +888,136 @@ dropping features at lower levels.")
 integrate an OSM map view into your Java application.  It is maintained as
 an independent project by the JOSM team.")
     (license license:gpl2)))
+
+(define-public josm
+  (package
+    (name "josm")
+    (version "15031")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/openstreetmap/josm.git")
+                     (commit "04d4c64b1b5698c0f9af40938f32194bc25bf75f")))
+              (sha256
+               (base32
+                "0dgxa0yqh2sxl6nvpzw9507y5rdfxvmy54bhk2gfk1hxh3hvgmxh"))
+              (file-name (git-file-name name version))
+              (modules '((guix build utils)))
+              (snippet
+                `(begin
+                   (for-each delete-file (find-files "." ".*.jar"))
+                   (for-each delete-file-recursively
+                     '("src/org/apache"
+                       "src/org/glassfish"
+                       "src/org/tukaani"
+                       "src/javax"
+                       "src/oauth"
+                       "src/com"))
+                   #t))))
+    (build-system ant-build-system)
+    (native-inputs
+     `(("javacc" ,javacc)))
+    (inputs
+     `(("java-commons-jcs" ,java-commons-jcs)
+       ("java-commons-compress" ,java-commons-compress)
+       ("java-jmapviewer" ,java-jmapviewer)
+       ("java-jsonp-api" ,java-jsonp-api)
+       ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
+       ("java-metadata-extractor" ,java-metadata-extractor)
+       ("java-openjfx-media" ,java-openjfx-media)
+       ("java-signpost-core" ,java-signpost-core)
+       ("java-svg-salamander" ,java-svg-salamander)))
+    (arguments
+     `(#:tests? #f
+       #:jar-name "josm.jar"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'rm-build.xml
+           (lambda* _
+             (delete-file "build.xml")
+             #t))
+         (add-before 'build 'fix-revision
+           (lambda* _
+             (with-output-to-file "REVISION.XML"
+               (lambda _
+                 (display
+                   (string-append "<info><entry><commit revision=\"" ,version "\">"
+                                  "<date>1970-01-01 00:00:00 +0000</date>"
+                                  "</commit></entry></info>"))))
+             #t))
+         (add-before 'build 'generate-parser
+           (lambda* _
+             (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
+                    (out (string-append dir "/parsergen"))
+                    (file (string-append dir "/MapCSSParser.jj")))
+               (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
+               (invoke "javacc" "-DEBUG_PARSER=false"
+                       "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
+                       "-GRAMMAR_ENCODING=UTF-8"
+                       (string-append "-OUTPUT_DIRECTORY=" out)
+                       file))
+             #t))
+         (add-after 'build 'generate-epsg
+           (lambda _
+             (system* "javac" "scripts/BuildProjectionDefinitions.java"
+                      "-cp" "build/classes")
+             (mkdir-p "data/projection")
+             (with-output-to-file "data/projection/custom-epsg"
+               (lambda _ (display "")))
+             (invoke "java" "-cp" "build/classes:scripts:."
+                     "BuildProjectionDefinitions" ".")
+             #t))
+         (add-after 'generate-epsg 'copy-data
+           (lambda _
+             (mkdir-p "build/classes")
+             (rename-file "data" "build/classes/data")
+             #t))
+         (add-before 'install 'regenerate-jar
+           (lambda _
+             ;; We need to regenerate the jar file to add data.
+             (delete-file "build/jar/josm.jar")
+             (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
+                     "build/classes" ".")
+             #t))
+         (add-before 'build 'copy-styles
+           (lambda _
+             (mkdir-p "build/classes")
+             (rename-file "styles" "build/classes/styles")
+             #t))
+         (add-before 'build 'copy-images
+           (lambda _
+             (mkdir-p "build/classes")
+             (rename-file "images" "build/classes/images")
+             #t))
+         (add-before 'build 'copy-revision
+           (lambda _
+             (mkdir-p "build/classes")
+             (with-output-to-file "build/classes/REVISION"
+               (lambda _
+                 (display
+                   (string-append "Revision: " ,version "\n"
+                                  "Is-Local-Build: true\n"
+                                  "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
+             #t))
+         (add-after 'install 'install-bin
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (mkdir-p bin)
+               (with-output-to-file (string-append bin "/josm")
+                 (lambda _
+                   (display
+                     (string-append "#!/bin/sh\n"
+                                    (assoc-ref inputs "jdk") "/bin/java"
+                                    " -cp " out "/share/java/josm.jar:"
+                                    (getenv "CLASSPATH")
+                                    " org.openstreetmap.josm.gui.MainApplication"))))
+               (chmod (string-append bin "/josm") #o755))
+             #t)))))
+    (home-page "https://josm.openstreetmap.de")
+    (synopsis "OSM editor")
+    (description "JOSM is an extensible editor for OpenStreetMap (OSM).  It
+supports loading GPX tracks, background imagery and OSM data from local
+sources as well as from online sources and allows to edit the OSM data (nodes,
+ways, and relations) and their metadata tags.")
+    (license license:gpl2+)))
-- 
2.21.0

  parent reply	other threads:[~2019-05-03 13:06 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-03 12:58 [bug#35545] [PATCH] Add josm Julien Lepiller
2019-05-03 13:01 ` [bug#35545] [PATCH 01/17] gnu: Add java-signpost-core Julien Lepiller
2019-05-03 13:01   ` [bug#35545] [PATCH 02/17] gnu: Add java-jsonp-api Julien Lepiller
2019-05-05 10:37     ` Björn Höfling
2019-05-03 13:01   ` [bug#35545] [PATCH 03/17] gnu: Add java-jsonp-impl Julien Lepiller
2019-05-03 13:01   ` [bug#35545] [PATCH 04/17] gnu: Add java-xmp Julien Lepiller
2019-05-05 10:52     ` Björn Höfling
2019-05-03 13:01   ` [bug#35545] [PATCH 05/17] gnu: Add java-metadata-extractor Julien Lepiller
2019-05-05 11:07     ` Björn Höfling
2019-05-03 13:01   ` [bug#35545] [PATCH 06/17] gnu: javacc: Install binaries Julien Lepiller
2019-05-04 11:52     ` Ricardo Wurmus
2019-05-04 12:14       ` Julien Lepiller
2019-05-04 17:08         ` Ricardo Wurmus
2019-05-03 13:01   ` [bug#35545] [PATCH 07/17] gnu: Add java-openjfx-build Julien Lepiller
2019-05-03 15:14     ` Nicolas Goaziou
2019-05-04 11:48     ` Ricardo Wurmus
2019-05-04 12:22       ` Julien Lepiller
2019-05-05 22:05     ` Björn Höfling
2019-05-03 13:01   ` [bug#35545] [PATCH 08/17] gnu: Add java-openjfx-base Julien Lepiller
2019-05-03 15:15     ` Nicolas Goaziou
2019-05-04 11:38       ` Julien Lepiller
2019-05-04 21:03         ` Nicolas Goaziou
2019-05-04 11:46     ` Ricardo Wurmus
2019-05-03 13:01   ` [bug#35545] [PATCH 09/17] gnu: Add java-openjfx-graphics Julien Lepiller
2019-05-03 13:01   ` [bug#35545] [PATCH 10/17] gnu: Add java-openjfx-media Julien Lepiller
2019-05-03 13:01   ` [bug#35545] [PATCH 11/17] gnu: Add java-jmapviewer Julien Lepiller
2019-05-05 22:06     ` Björn Höfling
2019-05-03 13:01   ` [bug#35545] [PATCH 12/17] gnu: Add java-svg-salamander Julien Lepiller
2019-05-05 22:07     ` Björn Höfling
2019-05-03 13:01   ` [bug#35545] [PATCH 13/17] gnu: Add java-jboss-transaction-api-spec Julien Lepiller
2019-05-05 22:07     ` Björn Höfling
2019-05-03 13:01   ` [bug#35545] [PATCH 14/17] gnu: Add java-commons-pool2 Julien Lepiller
2019-05-05 22:07     ` Björn Höfling
2019-05-03 13:01   ` [bug#35545] [PATCH 15/17] gnu: Add java-commons-dbcp2 Julien Lepiller
2019-05-03 13:01   ` [bug#35545] [PATCH 16/17] gnu: Add java-commons-jcs Julien Lepiller
2019-05-03 13:01   ` Julien Lepiller [this message]
2019-05-05 22:22     ` [bug#35545] [PATCH 17/17] gnu: Add josm Björn Höfling
2019-05-05 10:07   ` [bug#35545] [PATCH 01/17] gnu: Add java-signpost-core Björn Höfling
2019-05-05 11:18 ` [bug#35545] [PATCH] Add josm Björn Höfling
2019-05-05 11:37   ` Julien Lepiller
2019-05-05 22:53     ` Björn Höfling
2019-06-18 12:29       ` Julien Lepiller
2019-06-18 16:14         ` Björn Höfling
2019-06-20 11:39           ` Ludovic Courtès
2019-11-13 21:52 ` bug#35545: " Julien Lepiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190503130134.24788-17-julien@lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=35545@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).