Package: guix-patches;
Reported by: Frank Pursel <frank.pursel <at> gmail.com>
Date: Fri, 20 Jan 2023 23:29:02 UTC
Severity: normal
Tags: patch
Done: Vagrant Cascadian <vagrant <at> debian.org>
Bug is archived. No further changes may be made.
Message #47 received at 60976 <at> debbugs.gnu.org (full text, mbox):
From: Frank Pursel <frank.pursel <at> gmail.com> To: 60976 <at> debbugs.gnu.org Subject: [PATCH v3 4/4] java-jericho-html: Using bzr-fetch and complete testing. Date: Thu, 23 Feb 2023 13:00:27 -0800
--- gnu/packages/java-xml.scm | 118 +++++++++++++++----------------------- 1 file changed, 46 insertions(+), 72 deletions(-) diff --git a/gnu/packages/java-xml.scm b/gnu/packages/java-xml.scm index 9cf256549b..739b525fa0 100644 --- a/gnu/packages/java-xml.scm +++ b/gnu/packages/java-xml.scm @@ -30,6 +30,7 @@ (define-module (gnu packages java-xml) #:use-module (gnu packages compression) #:use-module (gnu packages gtk) #:use-module (gnu packages java) + #:use-module (guix bzr-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix gexp) #:use-module (guix packages) @@ -39,82 +40,55 @@ (define-module (gnu packages java-xml) #: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 + (package + (name "java-jericho-html") + (version "3.4") + (source (origin + (method bzr-fetch) + (uri + (bzr-reference + (url + "http://jerichohtml.bzr.sourceforge.net/bzr/jerichohtml") + (revision (string-append "tag:" version)))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "1zsf4i33jn05pma4y1658d6avhw7x4c12ggs96szhc06b7bxs8j0")) + (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") + #:phases (modify-phases %standard-phases + (add-before 'build 'add-ant-env-options + (lambda* _ + (setenv "ANT_OPTS" "-Dfile.encoding=iso-8859-1") + (let ((match-str + (string-append "jerichohtml-" ,version))) + (substitute* "build.xml" + ((match-str) + ""))) + #t)) + (add-after 'build 'check-prep + (lambda* (#:key source #:allow-other-keys) + (mkdir-p "src/test/java") + #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))))) + (synopsis "Java HTML Parser library") + (license (list license:lgpl2.1+ license:asl2.0 license:epl1.0)))) (define-public java-simple-xml (package -- 2.39.1
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.