From patchwork Fri Jan 6 18:46:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Pursel X-Patchwork-Id: 45894 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 85A4E27BBED; Fri, 6 Jan 2023 23:14:39 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7D7B927BBE9 for ; Fri, 6 Jan 2023 23:14:35 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDvud-0007fR-Af; Fri, 06 Jan 2023 18:14:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDvuZ-0007fB-Nk for guix-patches@gnu.org; Fri, 06 Jan 2023 18:14:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDvuU-0001Mh-C8 for guix-patches@gnu.org; Fri, 06 Jan 2023 18:14:07 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pDvuU-0006xf-6f for guix-patches@gnu.org; Fri, 06 Jan 2023 18:14:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60612] [PATCH 1/1] gnu: Add ditaa. Resent-From: Frank Pursel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 06 Jan 2023 23:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60612 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60612@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167304681526715 (code B ref -1); Fri, 06 Jan 2023 23:14:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 Jan 2023 23:13:35 +0000 Received: from localhost ([127.0.0.1]:56067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDvu2-0006wo-CC for submit@debbugs.gnu.org; Fri, 06 Jan 2023 18:13:35 -0500 Received: from lists.gnu.org ([209.51.188.17]:49602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDvu0-0006wg-CG for submit@debbugs.gnu.org; Fri, 06 Jan 2023 18:13:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDvu0-0007cL-0r for guix-patches@gnu.org; Fri, 06 Jan 2023 18:13:32 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDvtx-0001Ir-7X for guix-patches@gnu.org; Fri, 06 Jan 2023 18:13:30 -0500 Received: by mail-pj1-x1029.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so6787998pjj.2 for ; Fri, 06 Jan 2023 15:13:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=cKz78GpmJw3STvua0dKI1jEgMI6mHhTGofjcLCvdtuM=; b=lWp4JPHTPEShvoKJMtvo0U5Qr60JoNKveuCyBgrnubXVjUG/9406NZUnvOlYaKLmr/ zxUzmPPG9Vtqo7fjfkGJsseObsGoJvvZAvTU+k+c99G+KXoRrfLzy4jMy1oUXt9/AHgr w2uCAQka4PwYDRUJ29S7geZ0kh2MfVGYP+uthjD2qXVqWjZHN2DQkc/utQDl7f9cas8L 8LNmAdEmvw5R6Wy27y7VR8m8/EP/LIx62CrN2pnMbyMGRhPzHrnTr+jRKHd0Ole//6z6 MYSmMTKvu/aMJbk+28IivIPw5ys65ye9hd2zA+AXFJrXFnnt+p4zP4bt7GGvcxlpanks cUhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cKz78GpmJw3STvua0dKI1jEgMI6mHhTGofjcLCvdtuM=; b=oZIafApTFzTzIPtOkuhD86Eq+hzvHCZfiRmhBHfpX9oLLZdFjeboDOnSdTzegntbKc BXHJ3uGOZhFYsFyTVZGbwU36hvgRGcXy9y4Mru4Gt+DTgkUifOJKTJCyKk7x3lC6qQtX F8rloqwGmm6mh2479IFkZNyck+DwCI+OwroubwegiX9LS3YP5OksRa801iAuOitLHYdI aOZ6XPcci9bkP89L5w6BV5SAt7V6u2d+oMkV0njHYFsRhEl5Q7tjp1h/88T4W7wNbMsf /C0dIY+Cvb2xsyDIwJus+rD/ZHj5myhU0toZjPWWyWm2uPYbitHiWgCnNMh+9NeMJH87 UiUQ== X-Gm-Message-State: AFqh2kpNryi9PCVsOcNtFETAkjY8rdbsKPO43/Aovmj9G0ekMQBD+bQp 96D4YiOgEPAkX64V3Yd1iad+nwgMGGM= X-Google-Smtp-Source: AMrXdXvJdizKEjnlFqhRf/Yfw1BiKY7Q2dz2mndgEIraNVFj15Xn4o/eHiPCWTVZ2NYEaYoqPpLr4A== X-Received: by 2002:a17:902:a711:b0:192:4ce1:3695 with SMTP id w17-20020a170902a71100b001924ce13695mr59084335plq.57.1673046805391; Fri, 06 Jan 2023 15:13:25 -0800 (PST) Received: from Ginko ([66.170.190.211]) by smtp.gmail.com with ESMTPSA id k11-20020a170902c40b00b001889e58d520sm1397152plk.184.2023.01.06.15.13.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 15:13:24 -0800 (PST) From: Frank Pursel Date: Fri, 6 Jan 2023 10:46:18 -0800 Message-Id: MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=frank.pursel@gmail.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_03_06=1.592, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/ditaa.scm: New file. --- gnu/packages/ditaa.scm | 218 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 gnu/packages/ditaa.scm base-commit: 22ffa5e00a05f75bb3b4285cd1ede28f2e7c6325 diff --git a/gnu/packages/ditaa.scm b/gnu/packages/ditaa.scm new file mode 100644 index 0000000000..295a716d5a --- /dev/null +++ b/gnu/packages/ditaa.scm @@ -0,0 +1,218 @@ +;;; GNU Guix --- Functional package management for GNU +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . +;;; +;;; Copyright © 2023 Frank Pursel +;;; + +(define-module (gnu packages ditaa) + #:use-module (gnu packages) + #:use-module (gnu packages java) + #:use-module (gnu packages xml) + #:use-module (gnu packages javascript) + #:use-module (gnu packages batik) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system ant) + #:use-module (guix modules) + #:use-module (guix build utils) ) + +(define-public java-libbatik + (package + (name "batik") + (version "1.16+dfsg") + (source + (origin + (method url-fetch) + (uri (string-append + "https://deb.debian.org/debian/pool/main/b/batik/" + name "_" + version ".orig.tar.xz")) + (sha256 (base32 + "1xnmnnadp4l74dz55d3ask236lwy0iwg981851d01j2zlrgpw4p9")) )) + (build-system ant-build-system) + (arguments + `(#:tests? #f + #:jar-name (string-append ,name ".jar") + #:source-dir "sources" + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'remove-prepackaged-jars + (lambda _ + (for-each + (lambda (jarf) + (delete-file jarf) + (format #t "Deleted: ~s\n" jarf)) + (find-files "." ".*\\.jar")) + #t) ) + (add-after + 'remove-prepackaged-jars 'src-consolidation + (lambda _ + (mkdir-p "sources") + (let ((cwd (getcwd)) + (sub-dirs (list "anim" "awt-util" "bridge" + "codec" "constants" "css" + "dom" "ext" "extension" + "gui-util" "gvt" "i18n" + "parser" "script" "slideshow" + "svgbrowser" "svg-dom" + "svggen" "svgpp" + "svgrasterizer" "swing" + "transcoder" "ttf2svg" + "util" "xml")) ) + (for-each + (lambda (sdir) + (copy-recursively + (string-append + "batik-" sdir "/src/main/java/") "sources/") ) + sub-dirs) ) + ;; Remove scripting subdirs for jpython, and jacl. + (for-each + (lambda (rfile) + (delete-file rfile) + (format #t "Deleted: ~s\n" rfile)) + (append + (find-files + "sources/org/apache/batik/script/jpython" ) + (find-files + "sources/org/apache/batik/script/jacl" ) )) + #t) ) ) ) ) + (inputs (list rhino java-xmlgraphics-commons libxslt + java-jaxen java-junit java-jaxp java-xerces + java-jdom quickjs)) + (home-page "https://xmlgraphics.apache.org/batik") + (synopsis "The java based toolkit for Scalable Vector Graphics") + (description "Batik is a Java-based toolkit for applications or +applets that want to use images in the Scalable Vector Graphics (SVG) +format for various purposes, such as display, generation or manipulation.") + (license license:asl2.0) ) ) + +(define-public ditaa + (package + (name "ditaa") + (version "0.11.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/stathissideris/ditaa") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1y3g17wp1wvb05m56pp25avww2njpgh0gk0jsbsf25scj7hyyj26")))) + (build-system ant-build-system) + (inputs (list java-libbatik java-commons-cli java-w3c-svg + `(,icedtea "jdk") java-junit)) + (arguments + `(#:build-target "release-all" + #:phases (modify-phases %standard-phases + ;; Ant's buildfile and build tree need to be modified + ;; to provide access to the guix builds of the + ;; batik and the java-commons-cli + ;; jar files. Also some of the source requires java7. + (add-after 'unpack 'remove-prepackaged-jars + (lambda _ + (for-each (lambda (jarf) + (delete-file jarf) + (format #t "Deleted: ~s\n" jarf)) + (find-files "." ".*\\.jar")) #t)) + (add-before 'build 'build-prep + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((batik-jar (search-input-file inputs + "share/java/batik.jar")) + (commons-cli-jar (search-input-file inputs + "lib/m2/commons-cli/commons-cli/1.4/commons-cli-1.4.jar"))) + (mkdir-p "lib") + (copy-file batik-jar "./lib/batik.jar") + (copy-file commons-cli-jar "./lib/commons-cli.jar")) + (with-directory-excursion "build" + (substitute* "release.xml" + (("source=\"1.6\"") + "source=\"7\"") + (("") + (string-append "" + "\n" "")))) + #t)) + (replace 'build + (lambda* _ + (setenv "ANT_OPTS" + (string-append "-Dversion.string=" + ,version)) + (with-directory-excursion "build" + (invoke "ant" "-f" "release.xml" "release-jar")) #t)) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (if tests? + (begin + (setenv "ANT_OPTS" + (string-append "-Dversion.string=" + ,version)) + (mkdir-p "tests/testlib") + (with-directory-excursion "build" + (invoke "ant" "-f" "release.xml" + "generate-test-images") + (invoke "ant" "test"))) #f))) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (bin (string-append out "/bin")) + (bash (search-input-file inputs "bin/bash")) + (java (search-input-file inputs "bin/java")) + (jre (search-input-directory inputs "jre")) + (ditaa (string-append out "/bin/ditaa")) + (jar-name (string-append ,name + ,version ".jar"))) + (with-directory-excursion "releases" + (install-file jar-name lib)) + (mkdir-p bin) + (with-output-to-file ditaa + (lambda () + (display (string-append "#!" + bash + "\n" + "JAVA_HOME=" + jre + " " + java + " -jar " + out + "/lib/" + jar-name + " $@")))) + (chmod ditaa #o755)) #t)) + (add-after 'install 'install-docs + (lambda* (#:key outputs #:allow-other-keys) + (let ((doc (string-append (assoc-ref outputs "out") + "/share/doc/"))) + (for-each (lambda (filen) + (install-file filen doc)) + (find-files "." ".*README\\.md"))) #t))))) + (home-page "https://github.com/stathissideris/ditaa") + (synopsis "Create graphics from ascii art") + (description + "ditaa is a small command-line utility +that converts diagrams drawn using ascii art +('drawings' that contain characters that resemble lines like | / - ), +into proper bitmap graphics.") + (license license:lgpl3))) + + + + +