From patchwork Fri May 3 13:01:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 13861 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 851B216F8F; Fri, 3 May 2019 14:08:36 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id D290916F8D for ; Fri, 3 May 2019 14:08:35 +0100 (BST) Received: from localhost ([127.0.0.1]:40595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMXvX-00039a-E2 for patchwork@mira.cbaines.net; Fri, 03 May 2019 09:08:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMXtE-0001dn-8t for guix-patches@gnu.org; Fri, 03 May 2019 09:06:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMXt8-0006tG-10 for guix-patches@gnu.org; Fri, 03 May 2019 09:06:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34540) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMXt5-0006kd-7i for guix-patches@gnu.org; Fri, 03 May 2019 09:06:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hMXt3-00060R-QM for guix-patches@gnu.org; Fri, 03 May 2019 09:06:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35545] [PATCH 17/17] gnu: Add josm. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 May 2019 13:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35545 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35545@debbugs.gnu.org Received: via spool by 35545-submit@debbugs.gnu.org id=B35545.155688875223065 (code B ref 35545); Fri, 03 May 2019 13:06:01 +0000 Received: (at 35545) by debbugs.gnu.org; 3 May 2019 13:05:52 +0000 Received: from localhost ([127.0.0.1]:48082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMXsu-0005zw-C4 for submit@debbugs.gnu.org; Fri, 03 May 2019 09:05:52 -0400 Received: from lepiller.eu ([89.234.186.109]:60756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMXoz-0005pL-J4 for 35545@debbugs.gnu.org; Fri, 03 May 2019 09:01:50 -0400 Received: from localhost.localdomain (89-92-10-229.hfc.dyn.abo.bbox.fr [89.92.10.229]) by lepiller.eu (OpenSMTPD) with ESMTPSA id 67d63eb4 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <35545@debbugs.gnu.org>; Fri, 3 May 2019 13:01:42 +0000 (UTC) From: Julien Lepiller Date: Fri, 3 May 2019 15:01:34 +0200 Message-Id: <20190503130134.24788-17-julien@lepiller.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190503130134.24788-1-julien@lepiller.eu> References: <20190503145820.606f37db@sybil.lepiller.eu> <20190503130134.24788-1-julien@lepiller.eu> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 "" + "1970-01-01 00:00:00 +0000" + "")))) + #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+)))