From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8Sjt-0006cr-Ba for guix-patches@gnu.org; Fri, 05 Oct 2018 12:14:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8Sjq-0003Sk-4e for guix-patches@gnu.org; Fri, 05 Oct 2018 12:14:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:33885) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8Sjp-0003SW-W8 for guix-patches@gnu.org; Fri, 05 Oct 2018 12:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g8Sjp-0002BW-Kc for guix-patches@gnu.org; Fri, 05 Oct 2018 12:14:01 -0400 Subject: [bug#32947] [PATCH 1/3] gnu: Add java-cup. Resent-Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 05 Oct 2018 18:13:34 +0200 From: Julien Lepiller In-Reply-To: <20181005180048.56b2ff27@scratchpost.org> References: <20181005151859.9616-1-dannym@scratchpost.org> <20181005152044.9682-1-dannym@scratchpost.org> <9094b40c6c25c077212da6428dcc30dc@lepiller.eu> <20181005180048.56b2ff27@scratchpost.org> Message-ID: <49f3aba8442545a4299d740fd8cbe3e0@lepiller.eu> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 32947@debbugs.gnu.org >> I have a recipe for java-jflex and java-cup that are built without >> pre-generated source, using two bootstrap jars. Then, I could use them >> to build other packages that I need for the future maven-build-system. >> I >> wasn't able to build java-jflex with the latest java-cup. >> Do you want me to send these recipes for comparison? > > Yes, please. > > If we could get maven to work that would be cool. I've packaged batik > and > it's not fun to emulate maven manually... > > If we can't get maven to work, a recursive guix importer that reads the > pom.xml would be a great improvement instead. > > I can help with both. There are my recipes: (define %java-cup-bootstrap (package (name "java-cup") (version "11b-20160615") (source (origin (method url-fetch) (uri (string-append "http://www2.cs.tum.edu/projects/cup/" "releases/java-cup-bin-" version ".tar.gz")) (sha256 (base32 "1k6ycm5bpg7r2z2jprdp54s8bvaxggdxk4qmvkjw3013i1bxc09z")))) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils)) (let* ((source (assoc-ref %build-inputs "source")) (tar (string-append (assoc-ref %build-inputs "tar") "/bin/tar")) (gzip (assoc-ref %build-inputs "gzip")) (output (assoc-ref %outputs "out")) (java-dir (string-append output "/share/java"))) (mkdir-p java-dir) (chdir java-dir) (setenv "PATH" (string-append (getenv "PATH") ":" gzip "/bin")) (invoke tar "xf" source))))) (native-inputs `(("tar" ,tar) ("gzip" ,gzip))) (home-page "http://www2.cs.tum.edu/projects/cup/") (synopsis "") (description "") (license license:expat))) (define-public java-jflex (package (name "java-jflex") (version "1.6.1") (source (origin (method url-fetch) (uri (string-append "http://www.jflex.de/release/jflex-" version ".tar.gz")) (sha256 (base32 "1h7q2vhb4s42g4pqz5xxxliagprray7i9krr6hyaz1mjlx7gnycq")) (modules '((guix build utils))) (snippet `(begin ;; The first entry is a symlink to jflex-version (delete-file "../jflex") ;; Delete bundled jar archives. (for-each delete-file (find-files "." ".*\\.jar")) ;; Guix wants to repack jflex as that was the first entry in the archive (chdir "..") (rename-file "jflex-1.6.1" "jflex") (chdir "jflex") #t)))) (build-system ant-build-system) (arguments `(#:jdk ,icedtea-8 #:test-target "test" #:phases (modify-phases %standard-phases (replace 'install (install-jars "."))))) (native-inputs `(("%java-jflex-bootstrap" ,%java-jflex-bootstrap) ("java-junit" ,java-junit))) (home-page "https://jflex.de") (synopsis "") (description "") (license license:bsd-3))) (define-public java-cup (package (name "java-cup") (version "11b") (source (origin (method git-fetch) (uri (git-reference (url "https://versioncontrolseidl.in.tum.de/parsergenerators/cup.git") (commit "fe729fe8c27441f046dab19135a38b9dde4c4e5e"))) (sha256 (base32 "09xigxm7b44hz79xhqpfykvjrk4q90p33j2l07w69izx9sn0y42b")) (modules '((guix build utils))) (snippet '(begin ;; Delete bundled jar archives. (for-each delete-file (find-files "." ".*\\.jar")) (for-each delete-file (find-files "." ".*\\.tar.gz")) #t)))) (build-system ant-build-system) (arguments `(#:jdk ,icedtea-8 #:build-target "dist" #:tests? #f; no test target #:phases (modify-phases %standard-phases (add-before 'build 'fix-jflex (lambda _ (substitute* "build.xml" (("JFlex.ant") "jflex.ant")) #t)) (add-before 'build 'add-lib (lambda _ (mkdir-p "lib"))) (replace 'install (install-jars "."))))) (native-inputs `(("%java-jflex-bootstrap" ,%java-jflex-bootstrap) ("git" ,git))) (home-page "http://www2.cs.tum.edu/projects/cup") (synopsis "") (description "") (license license:expat))); http://www2.cs.tum.edu/projects/cup/licence.html