unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Julien Lepiller <julien@lepiller.eu>
To: Frank Pursel <frank.pursel@gmail.com>, 60976@debbugs.gnu.org
Subject: [bug#60976] [PATCH v3 1/4] gnu: Add java-jericho-html
Date: Sun, 26 Feb 2023 08:47:12 +0100	[thread overview]
Message-ID: <2BACC913-D4CF-4920-AC20-C6A8BE0C5B3D@lepiller.eu> (raw)
In-Reply-To: <63faa821.170a0220.bf499.2f6f@mx.google.com>

Hi!

Since you're introducing jericho-html in this series, why don't you merge the first and fourth patch, to introduce the correct version immediately?

Note that phases do not need to end with #t anymore.

Usually, synopsis is put before description. The description should be a full sentence, it cannot start with "A". Maybe "This library is a…" or "This Java library allows analysing…"

I'm not a fan of having the hash and version outside the package dehinition with a let when it's not necessary. You can put the hash directly where it belongs, since it's used only once, and the version in the version fiild. You can refer to the version field in all subsequent fields, which is how we do it usually. Same with internal name, it won't change, so I would just use a string directly.

I'd also sort inputs in alphabetic order (even chough most packages in java.scm don't…)

Le 26 janvier 2023 17:46:25 GMT+01:00, Frank Pursel <frank.pursel@gmail.com> a écrit :
>---
>The main point here is to give us ditaa but we also want the ziggaraut
>to be fully guix maintainable.  Hence here I submit another complete
>patch set providing all that preceeded plus changes to java-jericho-html
>that, in hindsight, I wish I had put in there in the first place.
>Better late than never.
>
>Regards,
>Frank Pursel
>
> gnu/packages/java-xml.scm | 79 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 79 insertions(+)
>
>diff --git a/gnu/packages/java-xml.scm b/gnu/packages/java-xml.scm
>index 5b16806e27..9cf256549b 100644
>--- a/gnu/packages/java-xml.scm
>+++ b/gnu/packages/java-xml.scm
>@@ -6,6 +6,7 @@
> ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
> ;;; Copyright © 2021 Léo Le Bouter <lle-bout@zaclys.net>
> ;;; Copyright © 2022 Christopher Baines <mail@cbaines.net>
>+;;; Copyright © 2023 Frank Pursel <frank.pursel@gmail.com>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
>@@ -37,6 +38,84 @@ (define-module (gnu packages java-xml)
>   #:use-module (guix build-system ant)
>   #:use-module (guix utils))
> 
>+(define-public java-jericho-html
>+  (let ((ver "3.4")
>+        (hash "1i7z3b8yamgkm7p3pv9qzv8l2kw15ccxy1aj9mpbf66kzkkds51i")
>+        (internal-name "jericho-html"))
>+    (package
>+      (name "java-jericho-html")
>+      (version ver)
>+      (source (origin
>+                (method url-fetch/zipbomb)
>+                (uri (string-append
>+                      "https://sourceforge.net/projects/jerichohtml"
>+                      "/files/jericho-html/3.4/jericho-html-3.4.zip/download"))
>+                (sha256
>+                 (base32
>+                  hash))
>+                (modules '((guix build utils)))
>+                (snippet '(begin
>+                            (format #t "~%~a~%" "Removing sourced jar files.")
>+                            (for-each (lambda (jarf)
>+                                        (delete-file jarf)
>+                                        (format #t "Deleted: ~a~%" jarf))
>+                                      (find-files "." "\\.jar$"))))))
>+      (build-system ant-build-system)
>+      (arguments
>+       `(#:jar-name (string-append ,name ".jar")
>+         #:source-dir (string-append ,internal-name "-"
>+                                     ,ver "/src/")
>+         #:test-dir (string-append ,internal-name "-"
>+                                   ,ver "/test/")
>+         #:test-exclude (list "**/StAXTest.java"
>+			      "**/NodeIteratorTest.java"
>+			      "**/ScriptTest.java"
>+			      "**/SegmentGetStyleURISegmentsTest.java"
>+			      "**/SegmentTest.java"
>+			      "**/StreamedSourceTest.java"
>+			      "**/HTMLSanitiserTest.java")
>+         #:phases (modify-phases %standard-phases
>+                    (add-before 'build 'add-ant-env-options
>+                      (lambda* _
>+                        (setenv "ANT_OPTS" "-Dfile.encoding=iso-8859-1") #t))
>+                    (add-after 'build 'check-prep
>+                      (lambda* (#:key source #:allow-other-keys)
>+                        (let* ((cwd (getcwd))
>+			       (jericho-test (string-append cwd "/" ,internal-name
>+						    "-" ,ver "/test"))
>+			       (test (string-append jericho-test "/test"))
>+			       (test-data (string-append jericho-test "/data"))
>+			       (test-src (string-append jericho-test "/src"))
>+			       (test-src-data (string-append test-src "/data")))
>+                          (format #t "~%Check Prep dir: ~s\n" cwd)
>+                          (substitute* "build.xml"
>+                            (("\\$\\{test\\.home\\}/java")
>+                             "${test.home}/src"))
>+                          (mkdir-p (string-append cwd "/build/test-classes"))
>+                          (copy-recursively (string-append cwd
>+                                      "/"
>+                                      ,internal-name
>+                                      "-"
>+                                      ,ver
>+                                      "/samples/console/classes")
>+                                     (string-append cwd
>+                                      "/build/test-classes/"))
>+			  (mkdir-p test-src-data)
>+			  (copy-recursively test-data
>+					    test-src-data))
>+                        #t)))))
>+      (native-inputs (list java-junit java-slf4j-api java-log4j-api
>+                           java-commons-logging-minimal))
>+      (home-page "http://jericho.htmlparser.net/docs/index.html")
>+      (description
>+       "A java library allowing analysis and manipulation of
>+parts of an HTML document, including server-side tags, while
>+reproducing verbatim any unrecognised or invalid HTML.  It also
>+provides high-level HTML form manipulation functions.  
>+")
>+      (synopsis "Java HTML Parser library")
>+      (license (list license:lgpl2.1+ license:asl2.0 license:epl1.0)))))
>+
> (define-public java-simple-xml
>   (package
>     (name "java-simple-xml")
>
>base-commit: 0e480ca7b60428a62fc4681d7aca6c7c067add42




  reply	other threads:[~2023-02-26  7:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06 18:46 [bug#60976] [PATCH] gnu: Add ditaa Frank Pursel
2023-01-24 10:44 ` Simon Tournier
2023-01-25  2:50 ` Frank Pursel
2023-01-25 10:10   ` zimoun
2023-01-25 17:42 ` Frank Pursel
2023-01-26 12:36   ` Simon Tournier
2023-01-26 16:46 ` [bug#60976] [PATCH v3 1/4] gnu: Add java-jericho-html Frank Pursel
2023-02-26  7:47   ` Julien Lepiller [this message]
2023-01-26 16:46 ` [bug#60976] [PATCH 1/3] " Frank Pursel
2023-01-26 16:46 ` [bug#60976] [PATCH v4 " Frank Pursel
2023-01-26 16:53   ` [bug#60976] [PATCH v4 2/3] gnu: Add java-libbatik Frank Pursel
2023-01-26 17:01   ` [bug#60976] [PATCH v4 3/3] gnu: Add ditaa Frank Pursel
2023-08-28 22:50     ` bug#60976: " Vagrant Cascadian
2023-01-27 13:41 ` [bug#60976] [PATCH 3/3] " Frank Pursel
2023-01-28  4:49 ` [bug#60976] [PATCH] gnu: " Frank Pursel
2023-03-09  0:25 ` Frank Pursel

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=2BACC913-D4CF-4920-AC20-C6A8BE0C5B3D@lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=60976@debbugs.gnu.org \
    --cc=frank.pursel@gmail.com \
    /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).