From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Vong Subject: Re: [PATCH] gnu: Add clojure. Date: Wed, 27 Jul 2016 14:47:14 +0800 Message-ID: <87bn1j60i5.fsf@gmail.com> References: <87r3b7gc4d.fsf@gmail.com> <8737ndiln5.fsf@elephly.net> <87h9bs4amm.fsf@gmail.com> <87twfe7n6t.fsf@elephly.net> <87h9bc36wg.fsf@gmail.com> <87y44okw3r.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSIcu-0006cT-7e for guix-devel@gnu.org; Wed, 27 Jul 2016 02:47:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSIcp-0002DV-Tm for guix-devel@gnu.org; Wed, 27 Jul 2016 02:47:31 -0400 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]:36514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSIcp-0002DL-IU for guix-devel@gnu.org; Wed, 27 Jul 2016 02:47:27 -0400 Received: by mail-pa0-x242.google.com with SMTP id ez1so1216359pab.3 for ; Tue, 26 Jul 2016 23:47:27 -0700 (PDT) In-Reply-To: <87y44okw3r.fsf@elephly.net> (Ricardo Wurmus's message of "Tue, 26 Jul 2016 22:00:56 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ricardo, Ricardo Wurmus writes: > Hi Alex, > >> Thanks for the review again, the package definition is now simplier. > > You only attached the patch to the Clojure sources. Could you please > also attach the latest patch to add the clojure package? > Ahhh, I think I formatted the wrong patch (I am a new user of magit). This time the correct one is attached. >> Yes, the ASM library is included as source (not jar) and is one majar >> version behind upstream (4 vs 5). Also, this SO question says it is inde= ed a >> fork >> (https://stackoverflow.com/questions/21642115/how-does-the-clojure-compi= ler-generates-jvm-bytecode). > > In this case I think it=E2=80=99s okay to not carve it out of the Clojure= source > archive. Once we need an ASM package in the future we can revisit this > decision and see if we can express one in terms of the other. > Agreed, I see debian make the split, but it is because they have multiple packages build-depend on it. [...] >> Finally, I want to ask do I need to sign my commit? I sign my commit and >> do a `magit-format-patch', but it seems the patch does not contain info >> of the signature. > > The signature would not make it into the repository if you sent the > commit as a patch. The committer to the central repository at Savannah > is the one who signs the commit =E2=80=94 this does not mean that the com= mitter > claims authorship, of course. > Got it! > Thanks again for your work. Please send the missing patch some time :) > > ~~ Ricardo Cheers, Alex --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-clojure.patch Content-Transfer-Encoding: quoted-printable >From 420ca3add28cb493f69bff44f461b870f6546b51 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Tue, 5 Jul 2016 16:24:20 +0800 Subject: [PATCH] gnu: Add clojure. * gnu/packages/java.scm (clojure): New variables. --- gnu/packages/java.scm | 186 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 186 insertions(+) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 83ffba4..293490a 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -142,6 +142,192 @@ is implemented.") license:mpl2.0 license:lgpl2.1+)))) =20 +(define-public clojure + (let ((remove-archives '(begin + (for-each delete-file + (find-files "./" ".*\\.(jar|zip)")) + #t))) + (package + (name "clojure") + (version "1.8.0") + (source + (origin + (method url-fetch) + (uri + (string-append "http://repo1.maven.org/maven2/org/clojure/clojur= e/" + version "/clojure-" version ".zip")) + (sha256 + (base32 "1nip095fz5c492sw15skril60i1vd21ibg6szin4jcvyy3xr6cym")) + (modules '((guix build utils))) + (snippet remove-archives))) + (build-system ant-build-system) + (arguments + `(#:modules ((guix build ant-build-system) + (guix build utils) + (ice-9 ftw) + (ice-9 regex) + (srfi srfi-1) + (srfi srfi-26)) + #:test-target "test" + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'unpack-submodule-sources + (lambda* (#:key inputs #:allow-other-keys) + (let ((unpack + (lambda (src-name) + (and (mkdir-p src-name) + (with-directory-excursion src-name + (zero? (system* "tar" + ;; Use xz for repacked tarb= all. + "--xz" + "--extract" + "--verbose" + "--file" (assoc-ref inputs + src-nam= e) + "--strip-components=3D1")))= ))) + (copy (lambda (src-name) + (copy-recursively + (string-append src-name "/src/main/clojure/") + "src/clj/")))) + (every (lambda (src) + (unpack src) + (copy src)) + '("data-generators-src" "java-classpath-src" + "test-check-src" "test-generative-src" + "tools-namespace-src" "tools-reader-src"))))) + ;;; The javadoc target is not built by default. + (add-after 'build 'build-doc + (lambda _ + (zero? (system* "ant" "javadoc")))) + ;;; Needed since no install target is provided. + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((java-dir (string-append (assoc-ref outputs "out") + "/share/java/"))) + ;; Do not install clojure.jar to avoid collisions. + (install-file (string-append "clojure-" ,version ".jar") + java-dir) + #t))) + ;;; Needed since no install-doc target is provided. + (add-after 'install 'install-doc + (lambda* (#:key outputs #:allow-other-keys) + (let ((doc-dir (string-append (assoc-ref outputs "out") + "/share/doc/clojure-" + ,version "/"))) + (and (copy-recursively "doc/clojure" doc-dir) + (copy-recursively "target/javadoc/" + (string-append doc-dir "javadoc/")= )) + (for-each (cut install-file <> doc-dir) + (filter (cut string-match + ".*\\.(html|markdown|md|txt)" + <>) + (scandir "./"))) + #t)))))) + ;; The native-inputs below are needed to run the tests. + (native-inputs + `(("data-generators-src" + ,(let ((version "0.1.2")) + (origin + (method url-fetch) + (uri (string-append "https://github.com/clojure" + "/data.generators/archive/data.generato= rs-" + version ".tar.gz")) + (sha256 + (base32 + "0kki093jp4ckwxzfnw8ylflrfqs8b1i1wi9iapmwcsy328dmgzp1")) + (modules '((guix build utils) + (ice-9 ftw))) + (snippet remove-archives)))) + ("java-classpath-src" + ,(let ((version "0.2.3")) + (origin + (method url-fetch) + (uri + (string-append "https://github.com/clojure" + "/java.classpath/archive/java.classpath-" + version ".tar.gz")) + (sha256 + (base32 + "0sjymly9xh1lkvwn5ygygpsfwz4dabblnlq0c9bx76rkvq62fyng")) + (modules '((guix build utils))) + (snippet remove-archives)))) + ("test-check-src" + ,(let ((version "0.9.0")) + (origin + (method url-fetch) + (uri + (string-append "https://github.com/clojure" + "/test.check/archive/test.check-" + version ".tar.gz")) + (sha256 + (base32 + "0p0mnyhr442bzkz0s4k5ra3i6l5lc7kp6ajaqkkyh4c2k5yck1md")) + (modules '((guix build utils))) + (snippet remove-archives)))) + ("test-generative-src" + ,(let ((version "0.5.2")) + (origin + (method url-fetch) + (uri (string-append "https://github.com/clojure" + "/test.generative/archive/test.generati= ve-" + version ".tar.gz")) + (sha256 + (base32 + "1pjafy1i7yblc7ixmcpfq1lfbyf3jaljvkgrajn70sws9xs7a9f8")) + (modules '((guix build utils))) + (snippet remove-archives)))) + ("tools-namespace-src" + ,(let ((version "0.2.11")) + (origin + (method url-fetch) + (uri (string-append "https://github.com/clojure" + "/tools.namespace/archive/tools.namespa= ce-" + version ".tar.gz")) + (sha256 + (base32 + "10baak8v0hnwz2hr33bavshm7y49mmn9zsyyms1dwjz45p5ymhy0")) + (modules '((guix build utils))) + (snippet remove-archives)))) + ("tools-reader-src" + ,(let ((version "0.10.0")) + (origin + (method url-fetch) + (uri + (string-append "https://github.com/clojure" + "/tools.reader/archive/tools.reader-" + version ".tar.gz")) + (sha256 + (base32 + "09i3lzbhr608h76mhdjm3932gg9xi8sflscla3c5f0v1nkc28cnr")) + (modules '((guix build utils))) + (snippet remove-archives)))))) + (home-page "https://clojure.org/") + (synopsis "Lisp dialect running on the JVM") + (description "Clojure is a dynamic, general-purpose programming lang= uage, +combining the approachability and interactive development of a scripting +language with an efficient and robust infrastructure for multithreaded +programming. Clojure is a compiled language, yet remains completely dynam= ic +=E2=80=93 every feature supported by Clojure is supported at runtime. Clo= jure +provides easy access to the Java frameworks, with optional type hints and = type +inference, to ensure that calls to Java can avoid reflection. + +Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philos= ophy +and a powerful macro system. Clojure is predominantly a functional progra= mming +language, and features a rich set of immutable, persistent data structures. +When mutable state is needed, Clojure offers a software transactional memo= ry +system and reactive Agent system that ensure clean, correct, multithreaded +designs.") + ;; Clojure is licensed under EPL1.0 + ;; ASM bytecode manipulation library is licensed under BSD-3 + ;; Guava Murmur3 hash implementation is licensed under under APL2.0 + ;; src/clj/repl.clj is licensed under under CPL1.0 + ;; + ;; See readme.html or readme.txt for details. + (license (list license:epl1.0 + license:bsd-3 + license:asl2.0 + license:cpl1.0))))) + (define-public ant (package (name "ant") --=20 2.9.2 --=-=-=--