Remove pushed antlr packages
more/packages/java.scm
592 | 592 | #:src-dir "src/main")))) | |
593 | 593 | ||
594 | 594 | ||
595 | - | ;; antlr2 is used to generate some java files in other packages. This is an old | |
596 | - | ;; package, it is not maintained anymore. It also contains the definition | |
597 | - | ;; for CommonTree and maybe other classes, so it is still required by more | |
598 | - | ;; recent antlr versions. | |
599 | - | ;; | |
600 | - | ;; antlr3.5 requires an antlr3 generator and ST4. Unfortunately, ST4 requires | |
601 | - | ;; an antlr3 generator. We use antlr3-3.1 that can be built with ST3 and antlr2 | |
602 | - | ;; to build the intermediate antlr3-3.3 that requires only an antlr3 generator. | |
603 | - | ;; This intermediate antlr3 is used to build a version of ST4 that do not depend | |
604 | - | ;; on recent antlr3. Then this version is used to build the latest antlr3, | |
605 | - | ;; which is used to build the latest ST4, which is used as a dependency of the | |
606 | - | ;; latest antlr3. | |
607 | - | ;; | |
608 | - | ;; Then we can use the latest versions of ST4 and antlr3 to build antlr4. | |
609 | - | (define-public antlr2 | |
610 | - | (package | |
611 | - | (name "antlr2") | |
612 | - | (version "2.7.7") | |
613 | - | (source (origin | |
614 | - | (method url-fetch) | |
615 | - | (uri (string-append "http://www.antlr2.org/download/antlr-" | |
616 | - | version ".tar.gz")) | |
617 | - | (sha256 | |
618 | - | (base32 | |
619 | - | "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5")) | |
620 | - | (modules '((guix build utils))) | |
621 | - | (snippet | |
622 | - | '(begin | |
623 | - | (delete-file "antlr.jar") | |
624 | - | (substitute* "configure" | |
625 | - | (("/bin/sh") "sh")))))) | |
626 | - | (build-system gnu-build-system) | |
627 | - | (arguments | |
628 | - | `(#:tests? #f | |
629 | - | #:phases | |
630 | - | (modify-phases %standard-phases | |
631 | - | (add-after 'configure 'fix-bin-ls | |
632 | - | (lambda _ | |
633 | - | (for-each (lambda (file) | |
634 | - | (substitute* file | |
635 | - | (("/bin/ls") "ls"))) | |
636 | - | (find-files "Makefile"))))))) | |
637 | - | (native-inputs | |
638 | - | `(("which" ,which) | |
639 | - | ("java" ,icedtea "jdk"))) | |
640 | - | (propagated-inputs | |
641 | - | `(("java" ,icedtea "jdk"))) | |
642 | - | (inputs | |
643 | - | `(("java" ,icedtea))) | |
644 | - | (home-page "http://www.antlr2.org") | |
645 | - | (synopsis "") | |
646 | - | (description "") | |
647 | - | (license license:public-domain))) | |
648 | - | ||
649 | - | (define-public stringtemplate3 | |
650 | - | (package | |
651 | - | (name "stringtemplate3") | |
652 | - | (version "3.2.1") | |
653 | - | (source (origin | |
654 | - | (method url-fetch) | |
655 | - | (uri (string-append "https://github.com/antlr/website-st4/raw/" | |
656 | - | "gh-pages/download/stringtemplate-" | |
657 | - | version ".tar.gz")) | |
658 | - | (sha256 | |
659 | - | (base32 | |
660 | - | "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is")))) | |
661 | - | (build-system ant-build-system) | |
662 | - | (arguments | |
663 | - | `(#:jar-name "stringtemplate-3.2.1.jar" | |
664 | - | #:tests? #f | |
665 | - | #:phases | |
666 | - | (modify-phases %standard-phases | |
667 | - | (add-before 'build 'generate-grammar | |
668 | - | (lambda _ | |
669 | - | (let ((dir "src/org/antlr/stringtemplate/language/")) | |
670 | - | (for-each (lambda (file) | |
671 | - | (display file) | |
672 | - | (newline) | |
673 | - | (system* "antlr" "-o" dir (string-append dir file))) | |
674 | - | '("template.g" "angle.bracket.template.g" "action.g" | |
675 | - | "eval.g" "group.g" "interface.g")))))))) | |
676 | - | (native-inputs | |
677 | - | `(("antlr" ,antlr2))) | |
678 | - | (home-page "http://www.stringtemplate.org") | |
679 | - | (synopsis "") | |
680 | - | (description "") | |
681 | - | (license license:bsd-3))) | |
682 | - | ||
683 | - | (define-public antlr3-temp | |
684 | - | (package | |
685 | - | (name "antlr3-temp") | |
686 | - | (version "3.5.2") | |
687 | - | (source (origin | |
688 | - | (method url-fetch) | |
689 | - | (uri (string-append "https://github.com/antlr/antlr3/archive/" | |
690 | - | version ".tar.gz")) | |
691 | - | (file-name (string-append name "-" version ".tar.gz")) | |
692 | - | (sha256 | |
693 | - | (base32 | |
694 | - | "07zff5frmjd53rnqdx31h0pmswz1lv0p2lp28cspfszh25ysz6sj")))) | |
695 | - | (build-system ant-build-system) | |
696 | - | (arguments | |
697 | - | `(#:jar-name (string-append ,name "-" ,version ".jar") | |
698 | - | #:src-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3" | |
699 | - | #:tests? #f | |
700 | - | #:phases | |
701 | - | (modify-phases %standard-phases | |
702 | - | (add-after 'install 'bin-install | |
703 | - | (lambda* (#:key inputs outputs #:allow-other-keys) | |
704 | - | (let ((jar (string-append (assoc-ref outputs "out") "/share/java")) | |
705 | - | (bin (string-append (assoc-ref outputs "out") "/bin"))) | |
706 | - | (mkdir-p bin) | |
707 | - | (with-output-to-file (string-append bin "/antlr3") | |
708 | - | (lambda _ | |
709 | - | (display | |
710 | - | (string-append "#!/bin/sh\n" | |
711 | - | "java -cp " jar "/" ,name "-" ,version ".jar:" | |
712 | - | (string-concatenate | |
713 | - | (find-files (assoc-ref inputs "stringtemplate") | |
714 | - | ".*\\.jar")) | |
715 | - | ":" | |
716 | - | (string-concatenate | |
717 | - | (find-files (assoc-ref inputs "stringtemplate4") | |
718 | - | ".*\\.jar")) | |
719 | - | ":" | |
720 | - | (string-concatenate | |
721 | - | (find-files (string-append (assoc-ref inputs "antlr") "/lib") | |
722 | - | ".*\\.jar")) | |
723 | - | " org.antlr.Tool $*")))) | |
724 | - | (chmod (string-append bin "/antlr3") #o755)))) | |
725 | - | (add-before 'build 'generate-grammar | |
726 | - | (lambda _ | |
727 | - | (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/") | |
728 | - | (for-each (lambda (file) | |
729 | - | (display file) | |
730 | - | (newline) | |
731 | - | (system* "antlr3" file)) | |
732 | - | '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g" | |
733 | - | "AssignTokenTypesWalker.g" | |
734 | - | "ActionTranslator.g" "TreeToNFAConverter.g" | |
735 | - | "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g" | |
736 | - | "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g")) | |
737 | - | (chdir "../../../../../../../..") | |
738 | - | (system* "antlr" "-o" "tool/src/main/java/org/antlr/tool" | |
739 | - | "tool/src/main/java/org/antlr/tool/serialize.g") | |
740 | - | (substitute* "tool/src/main/java/org/antlr/tool/LeftRecursiveRuleAnalyzer.java" | |
741 | - | (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*; | |
742 | - | import org.antlr.grammar.v3.ANTLRTreePrinter;")) | |
743 | - | (substitute* "tool/src/main/java/org/antlr/tool/ErrorManager.java" | |
744 | - | (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") "")) | |
745 | - | (substitute* "tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRParser.java" | |
746 | - | (("public Object getTree") "public GrammarAST getTree")) | |
747 | - | (substitute* "tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3Parser.java" | |
748 | - | (("public Object getTree") "public CommonTree getTree")))) | |
749 | - | (add-before 'build 'fix-build-xml | |
750 | - | (lambda _ | |
751 | - | (substitute* "build.xml" | |
752 | - | (("<exec") "<copy todir=\"${classes.dir}\"> | |
753 | - | <fileset dir=\"tool/src/main/resources\"> | |
754 | - | <include name=\"**/*.stg\"/> | |
755 | - | <include name=\"**/*.st\"/> | |
756 | - | <include name=\"**/*.sti\"/> | |
757 | - | <include name=\"**/STLexer.tokens\"/> | |
758 | - | </fileset> | |
759 | - | </copy><exec"))))))) | |
760 | - | (native-inputs | |
761 | - | `(("antlr" ,antlr2) | |
762 | - | ("antlr3" ,antlr3-3.3))) | |
763 | - | (inputs | |
764 | - | `(("junit" ,java-junit))) | |
765 | - | (propagated-inputs | |
766 | - | `(("stringtemplate" ,stringtemplate3) | |
767 | - | ("antlr" ,antlr2) | |
768 | - | ("stringtemplate4" ,stringtemplate4-4.0.6))) | |
769 | - | (home-page "http://www.stringtemplate.org") | |
770 | - | (synopsis "") | |
771 | - | (description "") | |
772 | - | (license license:bsd-3))) | |
773 | - | ||
774 | - | (define-public antlr3 | |
775 | - | (package | |
776 | - | (inherit antlr3-temp) | |
777 | - | (name "antlr3") | |
778 | - | (native-inputs | |
779 | - | `(("antlr" ,antlr2) | |
780 | - | ("antlr3" ,antlr3-temp))) | |
781 | - | (inputs | |
782 | - | `(("junit" ,java-junit) | |
783 | - | ("stringtemplate" ,stringtemplate3) | |
784 | - | ("stringtemplate4" ,stringtemplate4))))) | |
785 | - | ||
786 | 595 | (define-public antlr3-3.4 | |
787 | 596 | (package | |
788 | 597 | (name "antlr3") | |
… | |||
898 | 707 | (system* "libtoolize") | |
899 | 708 | (system* "autoreconf" "-fiv")))))))) | |
900 | 709 | ||
901 | - | (define-public antlr3-3.3 | |
902 | - | (package | |
903 | - | (name "antlr3") | |
904 | - | (version "3.3") | |
905 | - | (source (origin | |
906 | - | (method url-fetch) | |
907 | - | (uri (string-append "https://github.com/antlr/website-antlr3/raw/" | |
908 | - | "gh-pages/download/antlr-" | |
909 | - | version ".tar.gz")) | |
910 | - | (sha256 | |
911 | - | (base32 | |
912 | - | "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m")))) | |
913 | - | (build-system ant-build-system) | |
914 | - | (arguments | |
915 | - | `(#:jar-name (string-append ,name "-" ,version ".jar") | |
916 | - | #:src-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr2:tool/src/main/antlr3" | |
917 | - | #:tests? #f | |
918 | - | #:phases | |
919 | - | (modify-phases %standard-phases | |
920 | - | (add-after 'install 'bin-install | |
921 | - | (lambda* (#:key inputs outputs #:allow-other-keys) | |
922 | - | (let ((jar (string-append (assoc-ref outputs "out") "/share/java")) | |
923 | - | (bin (string-append (assoc-ref outputs "out") "/bin"))) | |
924 | - | (mkdir-p bin) | |
925 | - | (with-output-to-file (string-append bin "/antlr3") | |
926 | - | (lambda _ | |
927 | - | (display | |
928 | - | (string-append "#!/bin/sh\n" | |
929 | - | "java -cp " jar "/antlr3-3.3.jar:" | |
930 | - | (string-concatenate | |
931 | - | (find-files (assoc-ref inputs "stringtemplate") | |
932 | - | ".*\\.jar")) | |
933 | - | ":" | |
934 | - | (string-concatenate | |
935 | - | (find-files (string-append (assoc-ref inputs "antlr") "/lib") | |
936 | - | ".*\\.jar")) | |
937 | - | " org.antlr.Tool $*")))) | |
938 | - | (chmod (string-append bin "/antlr3") #o755)))) | |
939 | - | (add-before 'build 'generate-grammar | |
940 | - | (lambda _ | |
941 | - | (let ((dir "tool/src/main/antlr2/org/antlr/grammar/v2/")) | |
942 | - | (for-each (lambda (file) | |
943 | - | (display file) | |
944 | - | (newline) | |
945 | - | (system* "antlr" "-o" dir (string-append dir file))) | |
946 | - | '("antlr.g" "antlr.print.g" "assign.types.g" | |
947 | - | "buildnfa.g" "codegen.g" "define.g"))) | |
948 | - | (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/") | |
949 | - | (for-each (lambda (file) | |
950 | - | (display file) | |
951 | - | (newline) | |
952 | - | (system* "antlr3" file)) | |
953 | - | '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g" | |
954 | - | "ANTLRv3Tree.g")) | |
955 | - | (chdir "../../../../../../../..") | |
956 | - | (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java" | |
957 | - | (("import org.antlr.grammar.v2.\\*;") | |
958 | - | "import org.antlr.grammar.v2.*;\n | |
959 | - | import org.antlr.grammar.v2.TreeToNFAConverter;\n | |
960 | - | import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n | |
961 | - | import org.antlr.grammar.v2.ANTLRTreePrinter;")))) | |
962 | - | (add-before 'build 'fix-build-xml | |
963 | - | (lambda _ | |
964 | - | (substitute* "build.xml" | |
965 | - | (("<exec") "<copy todir=\"${classes.dir}\"> | |
966 | - | <fileset dir=\"tool/src/main/resources\"> | |
967 | - | <include name=\"**/*.stg\"/> | |
968 | - | <include name=\"**/*.st\"/> | |
969 | - | <include name=\"**/*.sti\"/> | |
970 | - | <include name=\"**/STLexer.tokens\"/> | |
971 | - | </fileset> | |
972 | - | </copy><exec"))))))) | |
973 | - | (native-inputs | |
974 | - | `(("antlr" ,antlr2) | |
975 | - | ("antlr3" ,antlr3-3.1))) | |
976 | - | (inputs | |
977 | - | `(("junit" ,java-junit))) | |
978 | - | (propagated-inputs | |
979 | - | `(("stringtemplate" ,stringtemplate3) | |
980 | - | ("antlr" ,antlr2) | |
981 | - | ("antlr3" ,antlr3-3.1))) | |
982 | - | (home-page "http://www.stringtemplate.org") | |
983 | - | (synopsis "") | |
984 | - | (description "") | |
985 | - | (license license:bsd-3))) | |
986 | - | ||
987 | - | (define-public antlr3-3.1 | |
988 | - | (package | |
989 | - | (name "antlr3-3.1") | |
990 | - | (version "3.1") | |
991 | - | (source (origin | |
992 | - | (method url-fetch) | |
993 | - | (uri (string-append "https://github.com/antlr/website-antlr3/raw/" | |
994 | - | "gh-pages/download/antlr-" | |
995 | - | version ".tar.gz")) | |
996 | - | (sha256 | |
997 | - | (base32 | |
998 | - | "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z")))) | |
999 | - | (build-system ant-build-system) | |
1000 | - | (arguments | |
1001 | - | `(#:jar-name (string-append ,name "-" ,version ".jar") | |
1002 | - | #:src-dir "src:runtime/Java/src" | |
1003 | - | #:tests? #f | |
1004 | - | #:phases | |
1005 | - | (modify-phases %standard-phases | |
1006 | - | (add-after 'install 'bin-install | |
1007 | - | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1008 | - | (let ((jar (string-append (assoc-ref outputs "out") "/share/java")) | |
1009 | - | (bin (string-append (assoc-ref outputs "out") "/bin"))) | |
1010 | - | (mkdir-p bin) | |
1011 | - | (with-output-to-file (string-append bin "/antlr3") | |
1012 | - | (lambda _ | |
1013 | - | (display | |
1014 | - | (string-append "#!/bin/sh\n" | |
1015 | - | "java -cp " jar "/antlr3-3.1-3.1.jar:" | |
1016 | - | (string-concatenate | |
1017 | - | (find-files (assoc-ref inputs "stringtemplate") | |
1018 | - | ".*\\.jar")) | |
1019 | - | ":" | |
1020 | - | (string-concatenate | |
1021 | - | (find-files (string-append (assoc-ref inputs "antlr") "/lib") | |
1022 | - | ".*\\.jar")) | |
1023 | - | " org.antlr.Tool $*")))) | |
1024 | - | (chmod (string-append bin "/antlr3") #o755)))) | |
1025 | - | (add-before 'build 'generate-grammar | |
1026 | - | (lambda _ | |
1027 | - | (let ((dir "src/org/antlr/tool/")) | |
1028 | - | (for-each (lambda (file) | |
1029 | - | (display file) | |
1030 | - | (newline) | |
1031 | - | (system* "antlr" "-o" dir (string-append dir file))) | |
1032 | - | '("antlr.g" "antlr.print.g" "assign.types.g" | |
1033 | - | "buildnfa.g" "define.g"))) | |
1034 | - | (format #t "codegen.g\n") | |
1035 | - | (system* "antlr" "-o" "src/org/antlr/codegen" | |
1036 | - | "src/org/antlr/codegen/codegen.g"))) | |
1037 | - | (add-before 'build 'fix-build-xml | |
1038 | - | (lambda _ | |
1039 | - | (substitute* "build.xml" | |
1040 | - | (("<exec") "<copy todir=\"${classes.dir}\"> | |
1041 | - | <fileset dir=\"src\"> | |
1042 | - | <include name=\"**/*.stg\"/> | |
1043 | - | <include name=\"**/*.st\"/> | |
1044 | - | <include name=\"**/*.sti\"/> | |
1045 | - | <include name=\"**/STLexer.tokens\"/> | |
1046 | - | </fileset> | |
1047 | - | </copy><exec"))))))) | |
1048 | - | (native-inputs | |
1049 | - | `(("antlr" ,antlr2))) | |
1050 | - | (inputs | |
1051 | - | `(("junit" ,java-junit))) | |
1052 | - | (propagated-inputs | |
1053 | - | `(("stringtemplate" ,stringtemplate3))) | |
1054 | - | (home-page "http://www.stringtemplate.org") | |
1055 | - | (synopsis "") | |
1056 | - | (description "") | |
1057 | - | (license license:bsd-3))) | |
1058 | - | ||
1059 | - | (define-public stringtemplate4-4.0.6 | |
1060 | - | (package | |
1061 | - | (name "stringtemplate4") | |
1062 | - | (version "4.0.6") | |
1063 | - | (source (origin | |
1064 | - | (method url-fetch) | |
1065 | - | (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-" | |
1066 | - | version ".tar.gz")) | |
1067 | - | (file-name (string-append name "-" version ".tar.gz")) | |
1068 | - | (sha256 | |
1069 | - | (base32 | |
1070 | - | "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp")))) | |
1071 | - | (build-system ant-build-system) | |
1072 | - | (arguments | |
1073 | - | `(#:tests? #f | |
1074 | - | #:jar-name (string-append ,name "-" ,version ".jar") | |
1075 | - | #:phases | |
1076 | - | (modify-phases %standard-phases | |
1077 | - | (add-before 'build 'generate-grammar | |
1078 | - | (lambda* (#:key inputs #:allow-other-keys) | |
1079 | - | (chdir "src/org/stringtemplate/v4/compiler/") | |
1080 | - | (for-each (lambda (file) | |
1081 | - | (display file) | |
1082 | - | (newline) | |
1083 | - | (system* "antlr3" file)) | |
1084 | - | '("STParser.g" "Group.g" "CodeGenerator.g")) | |
1085 | - | (chdir "../../../../..")))))) | |
1086 | - | (inputs | |
1087 | - | `(("antlr3" ,antlr3-3.3) | |
1088 | - | ("antlr2" ,antlr2) | |
1089 | - | ("stringtemplate" ,stringtemplate3))) | |
1090 | - | (home-page "http://www.stringtemplate.org") | |
1091 | - | (synopsis "") | |
1092 | - | (description "") | |
1093 | - | (license license:bsd-3))) | |
1094 | - | ||
1095 | - | (define-public stringtemplate4 | |
1096 | - | (package | |
1097 | - | (inherit stringtemplate4-4.0.6) | |
1098 | - | (name "stringtemplate4") | |
1099 | - | (version "4.0.8") | |
1100 | - | (source (origin | |
1101 | - | (method url-fetch) | |
1102 | - | (uri (string-append "https://github.com/antlr/stringtemplate4/archive/" | |
1103 | - | version ".tar.gz")) | |
1104 | - | (file-name (string-append name "-" version ".tar.gz")) | |
1105 | - | (sha256 | |
1106 | - | (base32 | |
1107 | - | "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087")))) | |
1108 | - | (inputs | |
1109 | - | `(("antlr3" ,antlr3-temp) | |
1110 | - | ("antlr2" ,antlr2) | |
1111 | - | ("stringtemplate" ,stringtemplate3))))) | |
1112 | - | ||
1113 | 710 | ;; javax.json.* | |
1114 | 711 | ;; org.abego.treelayout.* | |
1115 | 712 | ;; com.ibm.icu.* |