Add java-cup and jflex from binary bootstraps. Fix dependent packages.
more/packages/java.scm
45 | 45 | #:use-module (gnu packages linux) | |
46 | 46 | #:use-module (gnu packages maven) | |
47 | 47 | #:use-module (gnu packages perl) | |
48 | + | #:use-module (gnu packages version-control) | |
48 | 49 | #:use-module (gnu packages web) | |
49 | 50 | #:use-module (gnu packages xml) | |
50 | 51 | #:use-module (gnu packages xorg) | |
… | |||
1615 | 1616 | (native-inputs | |
1616 | 1617 | `(("java-junit" ,java-junit))))) | |
1617 | 1618 | ||
1619 | + | (define-public java-slf4j-jdk14 | |
1620 | + | (package | |
1621 | + | (inherit java-slf4j-api) | |
1622 | + | (name "java-slf4j-jdk14") | |
1623 | + | (arguments | |
1624 | + | `(#:jar-name "slf4j-jdk14.jar" | |
1625 | + | #:source-dir "slf4j-jdk14/src/main" | |
1626 | + | #:test-dir "slf4j-jdk14/src/test" | |
1627 | + | ;; Require test files from slf4j-api | |
1628 | + | #:tests? #f)) | |
1629 | + | (inputs | |
1630 | + | `(("java-slf4j-api" ,java-slf4j-api))) | |
1631 | + | (native-inputs | |
1632 | + | `(("java-junit" ,java-junit) | |
1633 | + | ("java-hamcrest-core" ,java-hamcrest-core))) | |
1634 | + | (synopsis "") | |
1635 | + | (description ""))) | |
1636 | + | ||
1637 | + | (define-public java-log4j-over-slf4j | |
1638 | + | (package | |
1639 | + | (inherit java-slf4j-api) | |
1640 | + | (name "java-log4j-over-slf4j") | |
1641 | + | (arguments | |
1642 | + | `(#:jar-name "log4j-over-slf4j.jar" | |
1643 | + | #:source-dir "log4j-over-slf4j/src/main" | |
1644 | + | #:test-dir "log4j-over-slf4j/src/test")) | |
1645 | + | (inputs | |
1646 | + | `(("java-slf4j-api" ,java-slf4j-api))) | |
1647 | + | (native-inputs | |
1648 | + | `(("java-junit" ,java-junit) | |
1649 | + | ("java-hamcrest-core" ,java-hamcrest-core) | |
1650 | + | ("java-slf4j-jdk14" ,java-slf4j-jdk14))) | |
1651 | + | (synopsis "") | |
1652 | + | (description ""))) | |
1653 | + | ||
1654 | + | (define-public java-jdom-for-freemarker | |
1655 | + | (package | |
1656 | + | (inherit java-jdom) | |
1657 | + | (version "1.0b8") | |
1658 | + | (source (origin | |
1659 | + | (method url-fetch) | |
1660 | + | (uri "http://jdom.org/dist/binary/archive/jdom-b8.tar.gz") | |
1661 | + | (sha256 | |
1662 | + | (base32 | |
1663 | + | "1y26baiamx67zl2lkqrjd19my3vz4xbjhv9l1iylirq0fcr9v7a1")))) | |
1664 | + | (arguments | |
1665 | + | `(#:build-target "package" | |
1666 | + | #:tests? #f; tests are part of the package target | |
1667 | + | #:phases | |
1668 | + | (modify-phases %standard-phases | |
1669 | + | ;(add-before 'build 'remove-collections | |
1670 | + | ; (lambda _ | |
1671 | + | ; (delete-file "lib/collections.jar") | |
1672 | + | ; #t)) | |
1673 | + | (replace 'install | |
1674 | + | (lambda* (#:key outputs #:allow-other-keys) | |
1675 | + | (let ((jar-dir (string-append (assoc-ref outputs "out") "/share/java"))) | |
1676 | + | (mkdir-p jar-dir) | |
1677 | + | (install-file "build/jdom.jar" jar-dir) | |
1678 | + | #t)))))))) | |
1679 | + | ||
1618 | 1680 | (define-public java-apache-freemarker | |
1619 | 1681 | (package | |
1620 | 1682 | (name "java-apache-freemarker") | |
… | |||
1631 | 1693 | `(#:jar-name "java-apache-freemarker.jar" | |
1632 | 1694 | #:source-dir "src/main/java" | |
1633 | 1695 | #:test-dir "src/test" | |
1696 | + | #:tests? #f; TODO: require spring-framework-test. | |
1634 | 1697 | #:jdk ,icedtea-8 | |
1698 | + | ;#:test-target "test" | |
1635 | 1699 | #:phases | |
1636 | 1700 | (modify-phases %standard-phases | |
1637 | 1701 | (add-before 'build 'remove-unpackaged-dependencies | |
1638 | 1702 | ;; TODO: package these dependencies | |
1639 | 1703 | (lambda _ | |
1640 | 1704 | (delete-file-recursively "src/main/java/freemarker/ext/jython") | |
1705 | + | (delete-file "src/test/java/freemarker/core/ObjectBuilderSettingsTest.java") | |
1641 | 1706 | (delete-file-recursively "src/main/java/freemarker/ext/rhino") | |
1642 | 1707 | ;; This class depends on javareble, a non-free package | |
1643 | 1708 | (delete-file "src/main/java/freemarker/ext/beans/JRebelClassChangeNotifier.java") | |
1644 | 1709 | (delete-file "src/main/java/freemarker/ext/ant/UnlinkedJythonOperationsImpl.java") | |
1645 | 1710 | (delete-file "src/main/java/freemarker/template/utility/JythonRuntime.java") | |
1646 | 1711 | #t)) | |
1712 | + | (add-before 'build 'update-jsp | |
1713 | + | (lambda _ | |
1714 | + | (substitute* "src/main/java/freemarker/ext/jsp/FreeMarkerJspFactory.java" | |
1715 | + | (("^}$") | |
1716 | + | "@Override | |
1717 | + | public JspApplicationContext getJspApplicationContext(ServletContext c) { | |
1718 | + | throw new UnsupportedOperationException(); | |
1719 | + | } | |
1720 | + | }") | |
1721 | + | (("package freemarker.ext.jsp;") | |
1722 | + | "package freemarker.ext.jsp; | |
1723 | + | ||
1724 | + | import javax.servlet.ServletContext; | |
1725 | + | import javax.servlet.jsp.JspApplicationContext;")) | |
1726 | + | (substitute* "src/main/java/freemarker/ext/jsp/_FreeMarkerPageContext2.java" | |
1727 | + | (("^}") | |
1728 | + | "@Override | |
1729 | + | public ELContext getELContext() { | |
1730 | + | throw new UnsupportedOperationException(); | |
1731 | + | } | |
1732 | + | }") | |
1733 | + | (("package freemarker.ext.jsp;") | |
1734 | + | "package freemarker.ext.jsp; | |
1735 | + | ||
1736 | + | import javax.el.ELContext;")) | |
1737 | + | #t)) | |
1647 | 1738 | (add-before 'build 'run-javacc | |
1648 | 1739 | (lambda _ | |
1649 | 1740 | (invoke "java" "-cp" (getenv "CLASSPATH") "javacc" | |
… | |||
1656 | 1747 | ("java-commons-logging-minimal" ,java-commons-logging-minimal) | |
1657 | 1748 | ("java-dom4j" ,java-dom4j) | |
1658 | 1749 | ("java-jaxen" ,java-jaxen) | |
1659 | - | ("java-jdom" ,java-jdom) | |
1660 | - | ("java-log4j-api" ,java-log4j-api) | |
1750 | + | ("java-jdom" ,java-jdom-for-freemarker) | |
1751 | + | ("java-log4j-over-slf4j" ,java-log4j-over-slf4j) | |
1661 | 1752 | ("java-slf4j-api" ,java-slf4j-api) | |
1662 | 1753 | ("java-spotbugs-annotations" ,java-spotbugs-annotations) | |
1663 | 1754 | ("java-tomcat" ,java-tomcat) | |
1664 | 1755 | ("java-xalan" ,java-xalan))) | |
1665 | 1756 | (native-inputs | |
1666 | - | `(("javacc" ,javacc-6))) | |
1757 | + | `(("javacc" ,javacc-6) | |
1758 | + | ("java-commons-collections" ,java-commons-collections) | |
1759 | + | ("java-commons-io" ,java-commons-io) | |
1760 | + | ("java-commons-lang" ,java-commons-lang) | |
1761 | + | ("java-guava" ,java-guava) | |
1762 | + | ("java-hamcrest-all" ,java-hamcrest-all) | |
1763 | + | ("java-eclipse-jetty-server" ,java-eclipse-jetty-server) | |
1764 | + | ("java-eclipse-jetty-webapp" ,java-eclipse-jetty-webapp) | |
1765 | + | ("java-junit" ,java-junit))) | |
1667 | 1766 | (home-page "https://github.com/ralfstx/minimal-json") | |
1668 | 1767 | (synopsis "") | |
1669 | 1768 | (description "") | |
… | |||
1702 | 1801 | (arguments | |
1703 | 1802 | `(#:jar-name "java-hazelcast-code-generator.jar" | |
1704 | 1803 | #:source-dir "hazelcast-code-generator/src/main/java" | |
1705 | - | #:test-dir "hazelcast-core-generator/src/test" | |
1804 | + | #:tests? #f; no tests | |
1706 | 1805 | #:phases | |
1707 | 1806 | (modify-phases %standard-phases | |
1708 | 1807 | (add-before 'build 'copy-resources | |
… | |||
1710 | 1809 | (copy-recursively "hazelcast-core-generator/src/main/resources" | |
1711 | 1810 | "build/classes") | |
1712 | 1811 | #t))))) | |
1812 | + | (inputs | |
1813 | + | `(("java-apache-freemarker" ,java-apache-freemarker))) | |
1713 | 1814 | (home-page "https://hazelcast.org") | |
1714 | 1815 | (synopsis "") | |
1715 | 1816 | (description "") | |
… | |||
1725 | 1826 | `(#:jar-name "java-hazelcast-client-protocol.jar" | |
1726 | 1827 | #:source-dir "hazelcast/src/main/java" | |
1727 | 1828 | #:test-dir "hazelcast/src/test")) | |
1829 | + | (inputs | |
1830 | + | `(("java-hazelcast-code-generator" ,java-hazelcast-code-generator))) | |
1728 | 1831 | (home-page "https://hazelcast.org") | |
1729 | 1832 | (synopsis "") | |
1730 | 1833 | (description "") | |
… | |||
1756 | 1859 | (for-each delete-file (find-files "." "package-info.java")) | |
1757 | 1860 | #t))))) | |
1758 | 1861 | (inputs | |
1759 | - | `(("java-jsr107" ,java-jsr107) | |
1862 | + | `(("java-findbugs" ,java-findbugs) | |
1863 | + | ("java-jsr107" ,java-jsr107) | |
1760 | 1864 | ("java-jsr305" ,java-jsr305) | |
1761 | 1865 | ("java-minimal-json" ,java-minimal-json) | |
1762 | 1866 | ("java-hazelcast-client-protocol-source" ,java-hazelcast-client-protocol-source))) | |
… | |||
2123 | 2227 | ("java-tomcat" ,java-tomcat))) | |
2124 | 2228 | (description ""))) | |
2125 | 2229 | ||
2230 | + | (define-public java-spring-framework-test | |
2231 | + | (package | |
2232 | + | (inherit java-spring-framework-core) | |
2233 | + | (name "java-spring-framework-test") | |
2234 | + | (arguments | |
2235 | + | `(#:jar-name "java-spring-framework-test.jar" | |
2236 | + | #:jdk ,icedtea-8 | |
2237 | + | #:source-dir "src/main/java" | |
2238 | + | #:test-dir "src/test" | |
2239 | + | #:phases | |
2240 | + | (modify-phases %standard-phases | |
2241 | + | (add-before 'configure 'chdir | |
2242 | + | (lambda _ | |
2243 | + | ;; Needed because tests look for data in src/... directly. | |
2244 | + | (chdir "spring-test") | |
2245 | + | #t)) | |
2246 | + | (add-before 'build 'copy-resources | |
2247 | + | (lambda _ | |
2248 | + | (copy-recursively "src/main/resources" "build/classes") | |
2249 | + | #t)) | |
2250 | + | (add-before 'check 'copy-test-resources | |
2251 | + | (lambda* (#:key inputs #:allow-other-keys) | |
2252 | + | (copy-recursively "src/test/resources" | |
2253 | + | "build/test-classes") | |
2254 | + | #t))))) | |
2255 | + | (inputs | |
2256 | + | `(("java-spring-framework-core" ,java-spring-framework-core) | |
2257 | + | ("java-spring-framework-web" ,java-spring-framework-web))) | |
2258 | + | (description ""))) | |
2259 | + | ||
2126 | 2260 | (define-public java-lucene-core | |
2127 | 2261 | (package | |
2128 | 2262 | (name "java-lucene-core") | |
… | |||
3709 | 3843 | (description "") | |
3710 | 3844 | (license license:bsd-3))) | |
3711 | 3845 | ||
3712 | - | (define-public java-jflex | |
3846 | + | (define %java-jflex-bootstrap | |
3713 | 3847 | (package | |
3714 | 3848 | (name "java-jflex") | |
3715 | 3849 | (version "1.6.1") | |
3716 | 3850 | (source (origin | |
3717 | 3851 | (method url-fetch) | |
3718 | - | ; https://github.com/jflex-de/jflex/releases/download/v1.6.1/jflex-1.6.1.tar.gz | |
3719 | - | (uri (string-append "https://github.com/jflex-de/jflex/releases/" | |
3720 | - | "download/v" version "/jflex-" version ".tar.gz")) | |
3852 | + | (uri (string-append "http://www.jflex.de/release/jflex-" version | |
3853 | + | ".tar.gz")) | |
3721 | 3854 | (sha256 | |
3722 | 3855 | (base32 | |
3723 | 3856 | "1h7q2vhb4s42g4pqz5xxxliagprray7i9krr6hyaz1mjlx7gnycq")))) | |
3857 | + | (build-system trivial-build-system) | |
3858 | + | ;(arguments | |
3859 | + | ; `(#:tests? #f | |
3860 | + | ; #:phases | |
3861 | + | ; (modify-phases %standard-phases | |
3862 | + | ; (delete 'build) | |
3863 | + | ; (replace 'install | |
3864 | + | ; (lambda* (#:key outputs #:allow-other-keys) | |
3865 | + | ; (let ((java-dir (string-append (assoc-ref outputs "out") "/share/java"))) | |
3866 | + | ; (install-file (string-append "lib/jflex-" ,version ".jar") | |
3867 | + | ; java-dir) | |
3868 | + | ; (install-file (string-append "lib/java-cup-11a.jar") | |
3869 | + | ; java-dir)) | |
3870 | + | ; #t))))) | |
3871 | + | (arguments | |
3872 | + | `(#:modules ((guix build utils)) | |
3873 | + | #:builder (begin | |
3874 | + | (use-modules (guix build utils)) | |
3875 | + | (let* ((source (assoc-ref %build-inputs "source")) | |
3876 | + | (tar (string-append | |
3877 | + | (assoc-ref %build-inputs "tar") | |
3878 | + | "/bin/tar")) | |
3879 | + | (gzip (assoc-ref %build-inputs "gzip")) | |
3880 | + | (output (assoc-ref %outputs "out")) | |
3881 | + | (java-dir (string-append output "/share/java"))) | |
3882 | + | (mkdir-p java-dir) | |
3883 | + | (setenv "PATH" (string-append (getenv "PATH") ":" gzip "/bin")) | |
3884 | + | (invoke tar "xf" source) | |
3885 | + | (install-file "jflex-1.6.1/lib/jflex-1.6.1.jar" java-dir) | |
3886 | + | (install-file "jflex-1.6.1/lib/java-cup-11a.jar" java-dir) | |
3887 | + | #t)))) | |
3888 | + | (native-inputs | |
3889 | + | `(("tar" ,tar) | |
3890 | + | ("gzip" ,gzip))) | |
3891 | + | (home-page "http://www.jflex.de") | |
3892 | + | (synopsis "") | |
3893 | + | (description "") | |
3894 | + | (license license:bsd-3))) | |
3895 | + | ||
3896 | + | (define %java-cup-bootstrap | |
3897 | + | (package | |
3898 | + | (name "java-cup") | |
3899 | + | (version "11b-20160615") | |
3900 | + | (source (origin | |
3901 | + | (method url-fetch) | |
3902 | + | (uri (string-append "http://www2.cs.tum.edu/projects/cup/" | |
3903 | + | "releases/java-cup-bin-" version ".tar.gz")) | |
3904 | + | (sha256 | |
3905 | + | (base32 | |
3906 | + | "1k6ycm5bpg7r2z2jprdp54s8bvaxggdxk4qmvkjw3013i1bxc09z")))) | |
3907 | + | (build-system trivial-build-system) | |
3908 | + | (arguments | |
3909 | + | `(#:modules ((guix build utils)) | |
3910 | + | #:builder (begin | |
3911 | + | (use-modules (guix build utils)) | |
3912 | + | (let* ((source (assoc-ref %build-inputs "source")) | |
3913 | + | (tar (string-append | |
3914 | + | (assoc-ref %build-inputs "tar") | |
3915 | + | "/bin/tar")) | |
3916 | + | (gzip (assoc-ref %build-inputs "gzip")) | |
3917 | + | (output (assoc-ref %outputs "out")) | |
3918 | + | (java-dir (string-append output "/share/java"))) | |
3919 | + | (mkdir-p java-dir) | |
3920 | + | (chdir java-dir) | |
3921 | + | (setenv "PATH" (string-append (getenv "PATH") ":" gzip "/bin")) | |
3922 | + | (invoke tar "xf" source))))) | |
3923 | + | (native-inputs | |
3924 | + | `(("tar" ,tar) | |
3925 | + | ("gzip" ,gzip))) | |
3926 | + | (home-page "http://www2.cs.tum.edu/projects/cup/") | |
3927 | + | (synopsis "") | |
3928 | + | (description "") | |
3929 | + | (license license:expat))) | |
3930 | + | ||
3931 | + | (define-public java-jflex | |
3932 | + | (package | |
3933 | + | (name "java-jflex") | |
3934 | + | (version "1.6.1") | |
3935 | + | (source (origin | |
3936 | + | (method url-fetch) | |
3937 | + | (uri (string-append "http://www.jflex.de/release/jflex-" version | |
3938 | + | ".tar.gz")) | |
3939 | + | (sha256 | |
3940 | + | (base32 | |
3941 | + | "1h7q2vhb4s42g4pqz5xxxliagprray7i9krr6hyaz1mjlx7gnycq")) | |
3942 | + | (modules '((guix build utils))) | |
3943 | + | (snippet | |
3944 | + | `(begin | |
3945 | + | ;; The first entry is a symlink to jflex-version | |
3946 | + | (delete-file "../jflex") | |
3947 | + | ;; Delete bundled jar archives. | |
3948 | + | (for-each delete-file (find-files "." ".*\\.jar")) | |
3949 | + | (chdir "..") | |
3950 | + | (rename-file "jflex-1.6.1" "jflex") | |
3951 | + | (chdir "jflex") | |
3952 | + | #t)))) | |
3724 | 3953 | (build-system ant-build-system) | |
3725 | 3954 | (arguments | |
3726 | - | `(#:jar-name "jflex.jar" | |
3727 | - | #:jdk ,icedtea-8 | |
3728 | - | #:source-dir "src/main/java" | |
3729 | - | #:test-dir "src/test" | |
3955 | + | `(#:jdk ,icedtea-8 | |
3956 | + | #:test-target "test" | |
3730 | 3957 | #:phases | |
3731 | 3958 | (modify-phases %standard-phases | |
3732 | - | (add-before 'build 'generate-lex | |
3733 | - | (lambda _ | |
3734 | - | (substitute* "src/main/jflex/LexScan.flex" | |
3735 | - | (("^%final.*") "") | |
3736 | - | (("^%column.*") "") | |
3737 | - | (("^%inputstream.*") "") | |
3738 | - | (("^//.*") "") | |
3739 | - | (("^/\\*.*\\*/") "") | |
3740 | - | (("^%eofclose.*") "")) | |
3741 | - | (invoke "java" "JLex.Main" "src/main/jflex/LexScan.flex") | |
3742 | - | (copy-file "src/main/jflex/LexScan.flex.java" | |
3743 | - | "src/main/java/jflex/LexScan.java") | |
3744 | - | #t))))) | |
3959 | + | (replace 'install | |
3960 | + | (install-jars "."))))) | |
3745 | 3961 | (native-inputs | |
3746 | - | `(("java-jlex" ,java-jlex))) | |
3962 | + | `(("%java-jflex-bootstrap" ,%java-jflex-bootstrap) | |
3963 | + | ("java-junit" ,java-junit))) | |
3747 | 3964 | (home-page "https://jflex.de") | |
3748 | 3965 | (synopsis "") | |
3749 | 3966 | (description "") | |
… | |||
3784 | 4001 | ||
3785 | 4002 | (define-public java-cup | |
3786 | 4003 | (package | |
4004 | + | (inherit java-cup-runtime) | |
3787 | 4005 | (name "java-cup") | |
3788 | - | (version "11b") | |
3789 | - | (source (origin | |
3790 | - | (method url-fetch) | |
3791 | - | (uri "http://www2.cs.tum.edu/projects/cup/releases/java-cup-src-11b-20160615.tar.gz") | |
3792 | - | (sha256 | |
3793 | - | (base32 | |
3794 | - | "09xigxm7b44hz79xhqpfykvjrk4q90p33j2l07w69izx9sn0y42b")) | |
3795 | - | ;(method git-fetch) | |
3796 | - | ;(uri (git-reference | |
3797 | - | ; (url "https://versioncontrolseidl.in.tum.de/parsergenerators/cup") | |
3798 | - | ; (commit "fe729fe8c27441f046dab19135a38b9dde4c4e5e"))) | |
3799 | - | ;(sha256 | |
3800 | - | ; (base32 | |
3801 | - | ; "09xigxm7b44hz79xhqpfykvjrk4q90p33j2l07w69izx9sn0y42b")) | |
3802 | - | (modules '((guix build utils))) | |
3803 | - | (snippet | |
3804 | - | '(begin | |
3805 | - | ;; Delete bundled archives. | |
3806 | - | (for-each delete-file (find-files "." ".*\\.jar")) | |
3807 | - | (for-each delete-file (find-files "." ".*\\.tar.gz")) | |
3808 | - | #t)))) | |
3809 | - | (build-system ant-build-system) | |
3810 | 4006 | (arguments | |
3811 | - | `(#:jar-name "cup-runtime.jar" | |
3812 | - | #:source-dir "src/java/java_cup/runtime" | |
3813 | - | #:tests? #f; no tests for runtime | |
4007 | + | `(#:jdk ,icedtea-8 | |
4008 | + | #:build-target "dist" | |
4009 | + | #:tests? #f; no test target | |
3814 | 4010 | #:phases | |
3815 | 4011 | (modify-phases %standard-phases | |
3816 | - | (add-before 'configure 'remove-build-xml | |
4012 | + | (add-before 'build 'fix-jflex | |
3817 | 4013 | (lambda _ | |
3818 | - | (delete-file "build.xml")))))) | |
4014 | + | (substitute* "build.xml" | |
4015 | + | (("JFlex.ant") "jflex.ant")) | |
4016 | + | #t)) | |
4017 | + | (add-before 'build 'add-lib | |
4018 | + | (lambda _ | |
4019 | + | (mkdir-p "lib"))) | |
4020 | + | (replace 'install | |
4021 | + | (install-jars "."))))) | |
4022 | + | (native-inputs | |
4023 | + | `(("%java-jflex-bootstrap" ,%java-jflex-bootstrap) | |
4024 | + | ("git" ,git))) | |
3819 | 4025 | (home-page "http://www2.cs.tum.edu/projects/cup") | |
3820 | 4026 | (synopsis "") | |
3821 | 4027 | (description "") | |
3822 | 4028 | (license license:expat))); http://www2.cs.tum.edu/projects/cup/licence.html | |
3823 | 4029 | ||
3824 | - | ;; Requires java-cup, but it requires jflex which in turn requires java-cup. | |
3825 | 4030 | (define-public java-xalan | |
3826 | 4031 | (package | |
3827 | 4032 | (name "java-xalan") | |
… | |||
3848 | 4053 | (inputs | |
3849 | 4054 | `(("java-commons-bcel" ,java-commons-bcel) | |
3850 | 4055 | ("java-xerces" ,java-xerces))) | |
4056 | + | (native-inputs | |
4057 | + | `(("java-cup" ,java-cup))) | |
3851 | 4058 | (home-page "") | |
3852 | 4059 | (synopsis "") | |
3853 | 4060 | (description "") |