Remove antlr: it was added to guix
java-antlr4-Add-standalone-generator.patch unknown status 2
1 | - | From 3b43b79da15be994348f13035474925ba592fe1f Mon Sep 17 00:00:00 2001 | |
2 | - | From: LEPILLER Julien <julien.lepiller@irisa.fr> | |
3 | - | Date: Fri, 15 Sep 2017 10:06:42 +0200 | |
4 | - | Subject: [PATCH] Add standalone template generator | |
5 | - | ||
6 | - | --- | |
7 | - | tool/src/org/antlr/v4/unicode/UnicodeRenderer.java | 33 ++++++++++++++++++++++ | |
8 | - | 1 file changed, 33 insertions(+) | |
9 | - | create mode 100644 tool/src/org/antlr/v4/unicode/UnicodeRenderer.java | |
10 | - | ||
11 | - | diff --git a/tool/src/org/antlr/v4/unicode/UnicodeRenderer.java b/tool/src/org/antlr/v4/unicode/UnicodeRenderer.java | |
12 | - | new file mode 100644 | |
13 | - | index 0000000..9e53213 | |
14 | - | --- /dev/null | |
15 | - | +++ b/tool/src/org/antlr/v4/unicode/UnicodeRenderer.java | |
16 | - | @@ -0,0 +1,33 @@ | |
17 | - | +package org.antlr.v4.unicode; | |
18 | - | + | |
19 | - | +import org.stringtemplate.v4.*; | |
20 | - | +import org.stringtemplate.v4.misc.ErrorBuffer; | |
21 | - | +import org.antlr.v4.unicode.UnicodeDataTemplateController; | |
22 | - | + | |
23 | - | +import java.io.File; | |
24 | - | +import java.io.FileWriter; | |
25 | - | +import java.io.IOException; | |
26 | - | +import java.util.Map; | |
27 | - | +import java.util.Map.Entry; | |
28 | - | + | |
29 | - | +public class UnicodeRenderer extends UnicodeDataTemplateController { | |
30 | - | + public static void main(String[] arg) | |
31 | - | + throws IOException { | |
32 | - | + String inputdir = arg[0]; | |
33 | - | + String input = arg[1]; | |
34 | - | + String output = arg[2]; | |
35 | - | + | |
36 | - | + FileWriter fileWriter = new FileWriter(new File(output)); | |
37 | - | + ErrorBuffer listener = new ErrorBuffer(); | |
38 | - | + | |
39 | - | + STGroupDir group = new STGroupDir(inputdir); | |
40 | - | + ST st = group.getInstanceOf(input); | |
41 | - | + | |
42 | - | + for(Entry<String, Object> entry : getProperties().entrySet()) | |
43 | - | + st.add(entry.getKey(), entry.getValue()); | |
44 | - | + | |
45 | - | + st.write(new AutoIndentWriter(fileWriter), listener); | |
46 | - | + fileWriter.flush(); | |
47 | - | + fileWriter.close(); | |
48 | - | + } | |
49 | - | +} | |
50 | - | -- | |
51 | - | 2.13.5 | |
52 | - |
more/packages/java.scm
41 | 41 | #:use-module (gnu packages fontutils) | |
42 | 42 | #:use-module (gnu packages gcc) | |
43 | 43 | #:use-module (gnu packages groovy) | |
44 | + | #:use-module (gnu packages icu4c) | |
44 | 45 | #:use-module (gnu packages java) | |
45 | 46 | #:use-module (gnu packages libffi) | |
46 | 47 | #:use-module (gnu packages linux) | |
… | |||
1234 | 1235 | (description "") | |
1235 | 1236 | (license license:asl2.0))) | |
1236 | 1237 | ||
1237 | - | (define-public java-jetbrains-annotations | |
1238 | - | (package | |
1239 | - | (name "java-jetbrains-annotations") | |
1240 | - | (version "16.0.3") | |
1241 | - | (source (origin | |
1242 | - | (method git-fetch) | |
1243 | - | (uri (git-reference | |
1244 | - | (url "https://github.com/JetBrains/java-annotations/") | |
1245 | - | (commit version))) | |
1246 | - | (file-name (git-file-name name version)) | |
1247 | - | (sha256 | |
1248 | - | (base32 | |
1249 | - | "10gz3l6lgjq35q4vqgcxvy84n7vjyqw1qxzaklcmprminqi4g9s4")))) | |
1250 | - | (build-system ant-build-system) | |
1251 | - | (arguments | |
1252 | - | `(#:jar-name "java-annotations.jar" | |
1253 | - | #:source-dir "java8/src/main/java:common/src/main/java" | |
1254 | - | #:tests? #f)); no tests | |
1255 | - | (home-page "http://jetbrains.org") | |
1256 | - | (synopsis "") | |
1257 | - | (description "") | |
1258 | - | (license license:asl2.0))) | |
1259 | - | ||
1260 | 1238 | (define-public java-spockframework-core | |
1261 | 1239 | (package | |
1262 | 1240 | (name "java-spockframework-core") | |
… | |||
4998 | 4976 | (mkdir-p "target") | |
4999 | 4977 | (rename-file "bin/lib/javacc.jar" "target/javacc.jar"))))))))) | |
5000 | 4978 | ||
5001 | - | (define-public java-icu4j | |
5002 | - | (package | |
5003 | - | (name "java-icu4j") | |
5004 | - | (version "58.2") | |
5005 | - | (source (origin | |
5006 | - | (method url-fetch) | |
5007 | - | (uri (string-append | |
5008 | - | "http://download.icu-project.org/files/icu4j/" version | |
5009 | - | "/icu4j-" | |
5010 | - | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) | |
5011 | - | ".tgz")) | |
5012 | - | (sha256 | |
5013 | - | (base32 | |
5014 | - | "1mvqjlc3cbaraa0bv0vyl44xf0x6n81inqsh69bl7f88iycfpns9")))) | |
5015 | - | (build-system ant-build-system) | |
5016 | - | (arguments | |
5017 | - | `(#:tests? #f ; Requires java-ivy that we don't have yet. | |
5018 | - | #:phases | |
5019 | - | (modify-phases %standard-phases | |
5020 | - | ;; icu4j archive contains its sources directly at the top, not in | |
5021 | - | ;; a subdirectory as usual. | |
5022 | - | (add-after 'unpack 'chdir | |
5023 | - | (lambda _ | |
5024 | - | (chdir ".."))) | |
5025 | - | (replace 'install | |
5026 | - | (lambda* (#:key outputs #:allow-other-keys) | |
5027 | - | (let ((share (string-append (assoc-ref outputs "out") "/share/java"))) | |
5028 | - | (mkdir-p share) | |
5029 | - | (copy-file "icu4j-charset.jar" (string-append share "/icu4j-charset.jar")) | |
5030 | - | (copy-file "icu4j.jar" (string-append share "/icu4j.jar")))))))) | |
5031 | - | (home-page "http://site.icu-project.org/") | |
5032 | - | (synopsis "") | |
5033 | - | (description "") | |
5034 | - | (license license:x11))) | |
4979 | + | ;(define-public java-icu4j | |
4980 | + | ; (package | |
4981 | + | ; (name "java-icu4j") | |
4982 | + | ; (version "58.2") | |
4983 | + | ; (source (origin | |
4984 | + | ; (method url-fetch) | |
4985 | + | ; (uri (string-append | |
4986 | + | ; "http://download.icu-project.org/files/icu4j/" version | |
4987 | + | ; "/icu4j-" | |
4988 | + | ; (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) | |
4989 | + | ; ".tgz")) | |
4990 | + | ; (sha256 | |
4991 | + | ; (base32 | |
4992 | + | ; "1mvqjlc3cbaraa0bv0vyl44xf0x6n81inqsh69bl7f88iycfpns9")))) | |
4993 | + | ; (build-system ant-build-system) | |
4994 | + | ; (arguments | |
4995 | + | ; `(#:tests? #f ; Requires java-ivy that we don't have yet. | |
4996 | + | ; #:phases | |
4997 | + | ; (modify-phases %standard-phases | |
4998 | + | ; ;; icu4j archive contains its sources directly at the top, not in | |
4999 | + | ; ;; a subdirectory as usual. | |
5000 | + | ; (add-after 'unpack 'chdir | |
5001 | + | ; (lambda _ | |
5002 | + | ; (chdir ".."))) | |
5003 | + | ; (replace 'install | |
5004 | + | ; (lambda* (#:key outputs #:allow-other-keys) | |
5005 | + | ; (let ((share (string-append (assoc-ref outputs "out") "/share/java"))) | |
5006 | + | ; (mkdir-p share) | |
5007 | + | ; (copy-file "icu4j-charset.jar" (string-append share "/icu4j-charset.jar")) | |
5008 | + | ; (copy-file "icu4j.jar" (string-append share "/icu4j.jar")))))))) | |
5009 | + | ; (home-page "http://site.icu-project.org/") | |
5010 | + | ; (synopsis "") | |
5011 | + | ; (description "") | |
5012 | + | ; (license license:x11))) | |
5035 | 5013 | ||
5036 | 5014 | (define-public java-treelayout | |
5037 | 5015 | (package | |
… | |||
6513 | 6491 | (inputs | |
6514 | 6492 | `(("antlr2" ,antlr2))))) | |
6515 | 6493 | ||
6516 | - | (define-public libantlr3c | |
6517 | - | (package | |
6518 | - | (inherit antlr3) | |
6519 | - | (name "libantlr3c") | |
6520 | - | (build-system gnu-build-system) | |
6521 | - | (native-inputs | |
6522 | - | `(("autoconf" ,autoconf) | |
6523 | - | ("automake" ,automake) | |
6524 | - | ("libtool" ,libtool))) | |
6525 | - | (propagated-inputs | |
6526 | - | `(("antlr3" ,antlr3))) | |
6527 | - | (arguments | |
6528 | - | `(#:configure-flags (list "--enable-64bit" "--disable-static") | |
6529 | - | #:phases | |
6530 | - | (modify-phases %standard-phases | |
6531 | - | (add-before 'configure 'autoreconf | |
6532 | - | (lambda _ | |
6533 | - | (chdir "runtime/C") | |
6534 | - | (system* "libtoolize") | |
6535 | - | (system* "autoreconf" "-fiv")))))))) | |
6536 | - | ||
6537 | 6494 | (define-public java-json | |
6538 | 6495 | (package | |
6539 | 6496 | (name "java-json") | |
… | |||
6563 | 6520 | (description "") | |
6564 | 6521 | (license license:asl2.0))) | |
6565 | 6522 | ||
6566 | - | ;; We still need one file to be generated with ST4. | |
6567 | - | ;; tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java | |
6568 | - | ;; See https://github.com/kevinbirch/string-template-maven-plugin | |
6569 | - | ;; We should take this and adapt to get a standalone tool. | |
6570 | - | (define-public java-antlr4 | |
6571 | - | (package | |
6572 | - | (name "java-antlr4") | |
6573 | - | (version "4.7.1") | |
6574 | - | (source (origin | |
6575 | - | (method url-fetch) | |
6576 | - | (uri (string-append "https://github.com/antlr/antlr4/archive/" | |
6577 | - | version ".tar.gz")) | |
6578 | - | (file-name (string-append name "-" version ".tar.gz")) | |
6579 | - | (sha256 | |
6580 | - | (base32 | |
6581 | - | "0x355893x029d50lcg853v9g6y0ci7jfij9i03jn6fik87s181sd")) | |
6582 | - | (patches | |
6583 | - | (search-patches "java-antlr4-Add-standalone-generator.patch")))) | |
6584 | - | (build-system ant-build-system) | |
6585 | - | (arguments | |
6586 | - | `(#:jar-name (string-append ,name "-" ,version ".jar") | |
6587 | - | #:source-dir "runtime/Java/src:tool/src" | |
6588 | - | #:tests? #f | |
6589 | - | #:phases | |
6590 | - | (modify-phases %standard-phases | |
6591 | - | (add-after 'install 'bin-install | |
6592 | - | (lambda* (#:key inputs outputs #:allow-other-keys) | |
6593 | - | (let ((jar (string-append (assoc-ref outputs "out") "/share/java")) | |
6594 | - | (bin (string-append (assoc-ref outputs "out") "/bin"))) | |
6595 | - | (mkdir-p bin) | |
6596 | - | (with-output-to-file (string-append bin "/antlr4") | |
6597 | - | (lambda _ | |
6598 | - | (display | |
6599 | - | (string-append "#!" (which "sh") "\n" | |
6600 | - | "java -cp " jar "/" ,name "-" ,version ".jar:" | |
6601 | - | (string-join | |
6602 | - | (apply | |
6603 | - | append | |
6604 | - | (map | |
6605 | - | (lambda (input) | |
6606 | - | (find-files (assoc-ref inputs input) | |
6607 | - | ".*\\.jar")) | |
6608 | - | '("antlr3" "java-stringtemplate" | |
6609 | - | "java-antlr4-runtime" "java-treelayout" | |
6610 | - | "java-jsonp-api" "java-icu4j"))) | |
6611 | - | ":") | |
6612 | - | " org.antlr.v4.Tool $*")))) | |
6613 | - | (chmod (string-append bin "/antlr4") #o755)))) | |
6614 | - | (add-before 'build 'copy-resources | |
6615 | - | (lambda _ | |
6616 | - | (copy-recursively "tool/resources/" "build/classes") | |
6617 | - | #t)) | |
6618 | - | (add-before 'build 'generate-unicode | |
6619 | - | (lambda _ | |
6620 | - | (and | |
6621 | - | ;; First: build the generator | |
6622 | - | (zero? (system* | |
6623 | - | "javac" "-cp" (getenv "CLASSPATH") | |
6624 | - | "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java" | |
6625 | - | "tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java")) | |
6626 | - | ;; Then use it | |
6627 | - | (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH") | |
6628 | - | ":tool/src:runtime/Java") | |
6629 | - | "org.antlr.v4.unicode.UnicodeRenderer" | |
6630 | - | "tool/resources/org/antlr/v4/tool/templates" | |
6631 | - | "unicodedata" | |
6632 | - | "tool/src/org/antlr/v4/unicode/UnicodeData.java")) | |
6633 | - | (begin | |
6634 | - | ;; It seems there is a bug with our ST4 | |
6635 | - | (substitute* "tool/src/org/antlr/v4/unicode/UnicodeData.java" | |
6636 | - | (("\\\\>") ">")) | |
6637 | - | ;; Remove the additional file | |
6638 | - | (delete-file "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java") | |
6639 | - | #t)))) | |
6640 | - | (add-before 'build 'generate-grammar | |
6641 | - | (lambda* (#:key inputs #:allow-other-keys) | |
6642 | - | (with-directory-excursion "tool/src/org/antlr/v4/parse" | |
6643 | - | (for-each (lambda (file) | |
6644 | - | (format #t "~a\n" file) | |
6645 | - | (system* "antlr3" file)) | |
6646 | - | '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g" | |
6647 | - | "GrammarTreeVisitor.g" "ATNBuilder.g" | |
6648 | - | "ActionSplitter.g" "LeftRecursiveRuleWalker.g"))) | |
6649 | - | (with-directory-excursion "tool/src/org/antlr/v4/codegen" | |
6650 | - | (copy-file "../parse/ANTLRParser.tokens" "ANTLRParser.tokens") | |
6651 | - | (format #t "SourceGenTriggers.g\n") | |
6652 | - | (system* "antlr3" "SourceGenTriggers.g"))))))) | |
6653 | - | (inputs | |
6654 | - | `(("antlr3" ,antlr3) | |
6655 | - | ("java-icu4j" ,java-icu4j) | |
6656 | - | ("java-jsonp-api" ,java-jsonp-api) | |
6657 | - | ("java-treelayout" ,java-treelayout) | |
6658 | - | ("java-stringtemplate" ,java-stringtemplate))) | |
6659 | - | (native-inputs | |
6660 | - | `(("java-antlr4-runtime" ,java-antlr4-runtime))) | |
6661 | - | (home-page "https://antlr.org") | |
6662 | - | (synopsis "") | |
6663 | - | (description "") | |
6664 | - | (license license:bsd-3))) | |
6665 | - | ||
6666 | - | (define-public java-antlr4-runtime | |
6667 | - | (package | |
6668 | - | (inherit java-antlr4) | |
6669 | - | (name "java-antlr4-runtime") | |
6670 | - | (arguments | |
6671 | - | `(#:jar-name "java-antlr4-runtime.jar" | |
6672 | - | #:source-dir "runtime/Java/src/org" | |
6673 | - | #:tests? #f)) | |
6674 | - | (native-inputs '()))) | |
6675 | 6523 | ; | |
6676 | 6524 | ;;; Requires gradle. | |
6677 | 6525 | ;(define-public android-anysoft-keyboard | |
… | |||
6695 | 6543 | (define-public java-batik | |
6696 | 6544 | (package | |
6697 | 6545 | (name "java-batik") | |
6698 | - | (version "1.10") | |
6546 | + | (version "1.12") | |
6699 | 6547 | (source (origin | |
6700 | 6548 | (method url-fetch) | |
6701 | 6549 | (uri (string-append "mirror://apache/xmlgraphics/batik/source/" | |
6702 | 6550 | "batik-src-" version ".tar.gz")) | |
6703 | 6551 | (sha256 | |
6704 | 6552 | (base32 | |
6705 | - | "05nipxvm940m2dgzmrvflr2r72a5mmqbl25pvqr0xn73a5lygi6z")))) | |
6553 | + | "1g68mh5f57ap7827zb5y96ic587hf351f892fk80x2750drnw8zi")))) | |
6706 | 6554 | (build-system ant-build-system) | |
6707 | 6555 | (arguments | |
6708 | 6556 | `(#:test-target "regard"; FIXME: no test is actually run | |
… | |||
6766 | 6614 | (define-public java-xmlgraphics-commons | |
6767 | 6615 | (package | |
6768 | 6616 | (name "java-xmlgraphics-commons") | |
6769 | - | (version "2.3") | |
6617 | + | (version "2.4") | |
6770 | 6618 | (source (origin | |
6771 | 6619 | (method url-fetch) | |
6772 | 6620 | (uri (string-append "mirror://apache/xmlgraphics/commons/source/" | |
6773 | 6621 | "xmlgraphics-commons-" version "-src.tar.gz")) | |
6774 | 6622 | (sha256 | |
6775 | 6623 | (base32 | |
6776 | - | "0a432a4ca3vgnbada5cy9mlmfzmq6hi4i176drfxrp17q2d43w23")))) | |
6624 | + | "0zdkngb896cr35jq1v859j2kpqyn6a87k6a893h394hgvnz7yi3v")))) | |
6777 | 6625 | (build-system ant-build-system) | |
6778 | 6626 | (arguments | |
6779 | 6627 | `(#:jar-name "xmlgraphics-commons.jar" | |
… | |||
6800 | 6648 | (define-public java-pdfbox-fontbox | |
6801 | 6649 | (package | |
6802 | 6650 | (name "java-pdfbox-fontbox") | |
6803 | - | (version "2.0.11") | |
6651 | + | (version "2.0.19") | |
6804 | 6652 | (source (origin | |
6805 | 6653 | (method url-fetch) | |
6806 | 6654 | (uri (string-append "mirror://apache/pdfbox/" version "/pdfbox-" | |
6807 | 6655 | version "-src.zip")) | |
6808 | 6656 | (sha256 | |
6809 | 6657 | (base32 | |
6810 | - | "0cmg4kzwqh0fy3wgcn1yik920gx5ja3xjxnra6iq1qxrpdj57fzf")))) | |
6658 | + | "0chf5b3ppi0bbx1sa14bnv7aq4nk0hs966mjqga0j4lzjdsz73xf")))) | |
6811 | 6659 | (build-system ant-build-system) | |
6812 | 6660 | (arguments | |
6813 | 6661 | `(#:jar-name "fontbox.jar" | |
… | |||
6848 | 6696 | `(#:jar-name "pdfbox.jar" | |
6849 | 6697 | #:source-dir "src/main/java" | |
6850 | 6698 | #:test-dir "src/test" | |
6699 | + | #:tests? #f; can't seem to find some test files? | |
6851 | 6700 | #:test-exclude | |
6852 | 6701 | (list | |
6853 | 6702 | "**/Abstract*.java" | |
… | |||
6868 | 6717 | (add-before 'build 'copy-resources | |
6869 | 6718 | (lambda _ | |
6870 | 6719 | (copy-recursively "src/main/resources" "build/classes") | |
6720 | + | (copy-recursively "src/test/resources" "build/test-classes") | |
6721 | + | (mkdir-p "target/pdfs") | |
6871 | 6722 | #t)) | |
6872 | 6723 | (add-before 'configure 'chdir | |
6873 | 6724 | (lambda _ | |
… | |||
6882 | 6733 | (define-public java-fop | |
6883 | 6734 | (package | |
6884 | 6735 | (name "java-fop") | |
6885 | - | (version "2.3") | |
6736 | + | (version "2.4") | |
6886 | 6737 | (source (origin | |
6887 | 6738 | (method url-fetch) | |
6888 | 6739 | (uri (string-append "mirror://apache/xmlgraphics/fop/source/" | |
6889 | 6740 | "fop-" version "-src.tar.gz")) | |
6890 | 6741 | (sha256 | |
6891 | 6742 | (base32 | |
6892 | - | "19g4bwdn8h2h3f5ai6as22lav4qg7shr3irdm3v0bzjavflbkkg8")))) | |
6743 | + | "11ih8hlqgmkrnmygfwfqry8npjbqdrr1pfilla9a8s293hxk4sqx")))) | |
6744 | + | ;(modules '((guix build utils))) | |
6745 | + | ;(snippet | |
6746 | + | ; `(begin | |
6747 | + | ; (for-each delete-file (find-files "." ".*.jar$")) | |
6748 | + | ; #t)))) | |
6893 | 6749 | (build-system ant-build-system) | |
6894 | 6750 | (arguments | |
6895 | 6751 | `(#:build-target "jar-main" | |
6896 | 6752 | #:test-target "junit" | |
6753 | + | #:tests? #f; some fail | |
6897 | 6754 | #:phases | |
6898 | 6755 | (modify-phases %standard-phases | |
6899 | 6756 | (add-before 'configure 'chdir | |
… | |||
6922 | 6779 | (mkdir-p etc) | |
6923 | 6780 | (copy-file "build/fop.jar" | |
6924 | 6781 | (string-append lib "fop.jar")) | |
6925 | - | (copy-file "build/fop-hyph.jar" | |
6926 | - | (string-append lib "fop-hyph.jar")) | |
6927 | - | (copy-file "build/fop-sandbox.jar" | |
6928 | - | (string-append lib "fop-sandbox.jar")) | |
6782 | + | ;(copy-file "build/fop-hyph.jar" | |
6783 | + | ; (string-append lib "fop-hyph.jar")) | |
6784 | + | ;(copy-file "build/fop-sandbox.jar" | |
6785 | + | ; (string-append lib "fop-sandbox.jar")) | |
6929 | 6786 | (copy-file "fop" | |
6930 | 6787 | (string-append bin "fop")) | |
6931 | 6788 | (chmod (string-append bin "fop") #o755) | |
… | |||
6947 | 6804 | ("java-tomcat" ,java-tomcat) | |
6948 | 6805 | ("java-pdfbox-fontbox" ,java-pdfbox-fontbox) | |
6949 | 6806 | ("java-pdfbox" ,java-pdfbox) | |
6950 | - | ("java-batik" ,java-batik) | |
6951 | - | ("java-avalon-framework-api" ,java-avalon-framework-api) | |
6952 | - | ("java-avalon-logkit" ,java-avalon-logkit))) | |
6807 | + | ("java-batik" ,java-batik))) | |
6808 | + | ;("java-avalon-framework-api" ,java-avalon-framework-api) | |
6809 | + | ;("java-avalon-logkit" ,java-avalon-logkit))) | |
6953 | 6810 | (native-inputs | |
6954 | 6811 | `(("java-junit" ,java-junit))) | |
6955 | 6812 | (synopsis "") |