From d22ba64276c0bbacb77d0670635f67f053a16c6b Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sun, 18 Nov 2018 10:38:54 +0100 Subject: gnu: ccl: Include x86-headers and remove missing "contrib" folder. * gnu/packages/lisp.scm (ccl): Include x86-headers and remove missing "contrib" folder. --- gnu/packages/lisp.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gnu/packages/lisp.scm') diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 9fb25a15a2..dcdd551884 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -530,8 +530,12 @@ statistical profiler, a code coverage tool, and many other extensions.") (install-file kernel libdir) (install-file heap libdir) - (let ((dirs '("lib" "library" "examples" "contrib" - "tools" "objc-bridge"))) + (let ((dirs '("lib" "library" "examples" "tools" "objc-bridge" + ,(match (%current-system) + ("x86_64-linux" + "x86-headers64") + ("i686-linux" + "x86-headers"))))) (for-each copy-recursively dirs (map (cut string-append libdir <>) dirs))) -- cgit v1.2.3 From 28e32b14e4b3139a8bda294d3cc0efd33f286998 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Fri, 12 Oct 2018 17:58:00 +0800 Subject: gnu: clojure: Move from java to lisp. * gnu/packages/java.scm (clojure): Move from here... * gnu/packages/lisp.scm (clojure): ...to here. --- gnu/packages/java.scm | 145 ------------------------------------------------- gnu/packages/lisp.scm | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+), 145 deletions(-) (limited to 'gnu/packages/lisp.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index f6d72edeea..cea3c4e333 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -1803,151 +1803,6 @@ new Date();")) `(("java-junit" ,java-junit) ,@(package-inputs ant/java8))))) -(define-public clojure - (let* ((remove-archives '(begin - (for-each delete-file - (find-files "." ".*\\.(jar|zip)")) - #t)) - (submodule (lambda (prefix version hash) - (origin - (method url-fetch) - (uri (string-append "https://github.com/clojure/" - prefix version ".tar.gz")) - (sha256 (base32 hash)) - (modules '((guix build utils))) - (snippet remove-archives))))) - (package - (name "clojure") - (version "1.9.0") - (source - (origin - (method url-fetch) - (uri - (string-append "https://github.com/clojure/clojure/archive/clojure-" - version ".tar.gz")) - (sha256 - (base32 "0xjbzcw45z32vsn9pifp7ndysjzqswp5ig0jkjpivigh2ckkdzha")) - (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) - (for-each - (lambda (name) - (mkdir-p name) - (with-directory-excursion name - (invoke "tar" - ;; Use xz for repacked tarball. - "--xz" - "--extract" - "--verbose" - "--file" (assoc-ref inputs name) - "--strip-components=1")) - (copy-recursively (string-append name "/src/main/clojure/") - "src/clj/")) - '("core-specs-alpha-src" - "data-generators-src" - "spec-alpha-src" - "test-check-src" - "test-generative-src" - "tools-namespace-src")) - #t)) - (add-after 'unpack 'fix-manifest-classpath - (lambda _ - (substitute* "build.xml" - (("") "")) - #t)) - ;; The javadoc target is not built by default. - (add-after 'build 'build-doc - (lambda _ - (invoke "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/"))) - ;; Install versioned 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 "/"))) - (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 - `(("core-specs-alpha-src" - ,(submodule "core.specs.alpha/archive/core.specs.alpha-" - "0.1.24" - "0v2a0svf1ar2y42ajxwsjr7zmm5j7pp2zwrd2jh3k7xzd1p9x1fv")) - ("data-generators-src" - ,(submodule "data.generators/archive/data.generators-" - "0.1.2" - "0kki093jp4ckwxzfnw8ylflrfqs8b1i1wi9iapmwcsy328dmgzp1")) - ("spec-alpha-src" - ,(submodule "spec.alpha/archive/spec.alpha-" - "0.1.143" - "00alf0347licdn773w2jarpllyrbl52qz4d8mw61anjksacxylzz")) - ("test-check-src" - ,(submodule "test.check/archive/test.check-" - "0.9.0" - "0p0mnyhr442bzkz0s4k5ra3i6l5lc7kp6ajaqkkyh4c2k5yck1md")) - ("test-generative-src" - ,(submodule "test.generative/archive/test.generative-" - "0.5.2" - "1pjafy1i7yblc7ixmcpfq1lfbyf3jaljvkgrajn70sws9xs7a9f8")) - ("tools-namespace-src" - ,(submodule "tools.namespace/archive/tools.namespace-" - "0.2.11" - "10baak8v0hnwz2hr33bavshm7y49mmn9zsyyms1dwjz45p5ymhy0")))) - (home-page "https://clojure.org/") - (synopsis "Lisp dialect running on the JVM") - (description "Clojure is a dynamic, general-purpose programming language, -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 dynamic -– every feature supported by Clojure is supported at runtime. Clojure -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 philosophy -and a powerful macro system. Clojure is predominantly a functional programming -language, and features a rich set of immutable, persistent data structures. -When mutable state is needed, Clojure offers a software transactional memory -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 APL2.0 - ;; src/clj/repl.clj is licensed 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 javacc-4 (package (name "javacc") diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index dcdd551884..0e07e1969e 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2017, 2018 Efraim Flashner ;;; Copyright © 2017 Tobias Geerinckx-Rice ;;; Copyright © 2018 Benjamin Slade +;;; Copyright © 2018 Alex Vong ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,6 +35,7 @@ #:use-module (guix hg-download) #:use-module (guix utils) #:use-module (guix build-system gnu) + #:use-module (guix build-system ant) #:use-module (guix build-system asdf) #:use-module (guix build-system trivial) #:use-module (gnu packages admin) @@ -563,6 +565,151 @@ interface.") (license (list license:lgpl2.1 license:clarified-artistic)))) ;TRIVIAL-LDAP package +(define-public clojure + (let* ((remove-archives '(begin + (for-each delete-file + (find-files "." ".*\\.(jar|zip)")) + #t)) + (submodule (lambda (prefix version hash) + (origin + (method url-fetch) + (uri (string-append "https://github.com/clojure/" + prefix version ".tar.gz")) + (sha256 (base32 hash)) + (modules '((guix build utils))) + (snippet remove-archives))))) + (package + (name "clojure") + (version "1.9.0") + (source + (origin + (method url-fetch) + (uri + (string-append "https://github.com/clojure/clojure/archive/clojure-" + version ".tar.gz")) + (sha256 + (base32 "0xjbzcw45z32vsn9pifp7ndysjzqswp5ig0jkjpivigh2ckkdzha")) + (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) + (for-each + (lambda (name) + (mkdir-p name) + (with-directory-excursion name + (invoke "tar" + ;; Use xz for repacked tarball. + "--xz" + "--extract" + "--verbose" + "--file" (assoc-ref inputs name) + "--strip-components=1")) + (copy-recursively (string-append name "/src/main/clojure/") + "src/clj/")) + '("core-specs-alpha-src" + "data-generators-src" + "spec-alpha-src" + "test-check-src" + "test-generative-src" + "tools-namespace-src")) + #t)) + (add-after 'unpack 'fix-manifest-classpath + (lambda _ + (substitute* "build.xml" + (("") "")) + #t)) + ;; The javadoc target is not built by default. + (add-after 'build 'build-doc + (lambda _ + (invoke "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/"))) + ;; Install versioned 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 "/"))) + (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 + `(("core-specs-alpha-src" + ,(submodule "core.specs.alpha/archive/core.specs.alpha-" + "0.1.24" + "0v2a0svf1ar2y42ajxwsjr7zmm5j7pp2zwrd2jh3k7xzd1p9x1fv")) + ("data-generators-src" + ,(submodule "data.generators/archive/data.generators-" + "0.1.2" + "0kki093jp4ckwxzfnw8ylflrfqs8b1i1wi9iapmwcsy328dmgzp1")) + ("spec-alpha-src" + ,(submodule "spec.alpha/archive/spec.alpha-" + "0.1.143" + "00alf0347licdn773w2jarpllyrbl52qz4d8mw61anjksacxylzz")) + ("test-check-src" + ,(submodule "test.check/archive/test.check-" + "0.9.0" + "0p0mnyhr442bzkz0s4k5ra3i6l5lc7kp6ajaqkkyh4c2k5yck1md")) + ("test-generative-src" + ,(submodule "test.generative/archive/test.generative-" + "0.5.2" + "1pjafy1i7yblc7ixmcpfq1lfbyf3jaljvkgrajn70sws9xs7a9f8")) + ("tools-namespace-src" + ,(submodule "tools.namespace/archive/tools.namespace-" + "0.2.11" + "10baak8v0hnwz2hr33bavshm7y49mmn9zsyyms1dwjz45p5ymhy0")))) + (home-page "https://clojure.org/") + (synopsis "Lisp dialect running on the JVM") + (description "Clojure is a dynamic, general-purpose programming language, +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 dynamic +– every feature supported by Clojure is supported at runtime. Clojure +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 philosophy +and a powerful macro system. Clojure is predominantly a functional programming +language, and features a rich set of immutable, persistent data structures. +When mutable state is needed, Clojure offers a software transactional memory +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 APL2.0 + ;; src/clj/repl.clj is licensed 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 femtolisp (let ((commit "68c5b1225572ecf2c52baf62f928063e5a30511b") (revision "1")) -- cgit v1.2.3 From df0a180421b34b6f1f3395652291f94a37303988 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Sat, 13 Oct 2018 18:32:14 +0800 Subject: gnu: clojure: Remove 'remove-archives' snippet. This is no longer needed since clojure now makes official source releases in github. * gnu/packages/lisp.scm (clojure)[source]: Remove it. [native-inputs]: Remove it in 'submodule'. [arguments]: Adjust 'unpack-submodule-sources' phase accordingly. --- gnu/packages/lisp.scm | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'gnu/packages/lisp.scm') diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 0e07e1969e..f963dfb5de 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -566,18 +566,12 @@ interface.") license:clarified-artistic)))) ;TRIVIAL-LDAP package (define-public clojure - (let* ((remove-archives '(begin - (for-each delete-file - (find-files "." ".*\\.(jar|zip)")) - #t)) - (submodule (lambda (prefix version hash) - (origin - (method url-fetch) - (uri (string-append "https://github.com/clojure/" - prefix version ".tar.gz")) - (sha256 (base32 hash)) - (modules '((guix build utils))) - (snippet remove-archives))))) + (let ((submodule (lambda (prefix version hash) + (origin + (method url-fetch) + (uri (string-append "https://github.com/clojure/" + prefix version ".tar.gz")) + (sha256 (base32 hash)))))) (package (name "clojure") (version "1.9.0") @@ -588,9 +582,7 @@ interface.") (string-append "https://github.com/clojure/clojure/archive/clojure-" version ".tar.gz")) (sha256 - (base32 "0xjbzcw45z32vsn9pifp7ndysjzqswp5ig0jkjpivigh2ckkdzha")) - (modules '((guix build utils))) - (snippet remove-archives))) + (base32 "0xjbzcw45z32vsn9pifp7ndysjzqswp5ig0jkjpivigh2ckkdzha")))) (build-system ant-build-system) (arguments `(#:modules ((guix build ant-build-system) @@ -609,8 +601,6 @@ interface.") (mkdir-p name) (with-directory-excursion name (invoke "tar" - ;; Use xz for repacked tarball. - "--xz" "--extract" "--verbose" "--file" (assoc-ref inputs name) -- cgit v1.2.3 From 8da9187a5a2477e3e7114e5a25ae8ae57bf73271 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Sun, 14 Oct 2018 00:08:29 +0800 Subject: gnu: clojure: Refactor to ensure there's a single list of libraries. This avoids having to update multiple lists. * gnu/packages/lisp.scm (clojure)[native-inputs]: Use new local variable. [arguments]: Adjust build phases accordingly. --- gnu/packages/lisp.scm | 101 ++++++++++++++++++++++++-------------------------- 1 file changed, 49 insertions(+), 52 deletions(-) (limited to 'gnu/packages/lisp.scm') diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index f963dfb5de..24738f3f13 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -566,12 +566,40 @@ interface.") license:clarified-artistic)))) ;TRIVIAL-LDAP package (define-public clojure - (let ((submodule (lambda (prefix version hash) - (origin - (method url-fetch) - (uri (string-append "https://github.com/clojure/" - prefix version ".tar.gz")) - (sha256 (base32 hash)))))) + (let* ((lib (lambda (prefix version hash) + (origin (method url-fetch) + (uri (string-append "https://github.com/clojure/" + prefix version ".tar.gz")) + (sha256 (base32 hash))))) + ;; The libraries below are needed to run the tests. + (libraries + `(("core-specs-alpha-src" + ,(lib "core.specs.alpha/archive/core.specs.alpha-" + "0.1.24" + "0v2a0svf1ar2y42ajxwsjr7zmm5j7pp2zwrd2jh3k7xzd1p9x1fv")) + ("data-generators-src" + ,(lib "data.generators/archive/data.generators-" + "0.1.2" + "0kki093jp4ckwxzfnw8ylflrfqs8b1i1wi9iapmwcsy328dmgzp1")) + ("spec-alpha-src" + ,(lib "spec.alpha/archive/spec.alpha-" + "0.1.143" + "00alf0347licdn773w2jarpllyrbl52qz4d8mw61anjksacxylzz")) + ("test-check-src" + ,(lib "test.check/archive/test.check-" + "0.9.0" + "0p0mnyhr442bzkz0s4k5ra3i6l5lc7kp6ajaqkkyh4c2k5yck1md")) + ("test-generative-src" + ,(lib "test.generative/archive/test.generative-" + "0.5.2" + "1pjafy1i7yblc7ixmcpfq1lfbyf3jaljvkgrajn70sws9xs7a9f8")) + ("tools-namespace-src" + ,(lib "tools.namespace/archive/tools.namespace-" + "0.2.11" + "10baak8v0hnwz2hr33bavshm7y49mmn9zsyyms1dwjz45p5ymhy0")))) + (library-names (match libraries + (((library-name _) ...) + library-name)))) (package (name "clojure") (version "1.9.0") @@ -594,27 +622,21 @@ interface.") #:test-target "test" #:phases (modify-phases %standard-phases - (add-after 'unpack 'unpack-submodule-sources + (add-after 'unpack 'unpack-library-sources (lambda* (#:key inputs #:allow-other-keys) - (for-each - (lambda (name) - (mkdir-p name) - (with-directory-excursion name - (invoke "tar" - "--extract" - "--verbose" - "--file" (assoc-ref inputs name) - "--strip-components=1")) - (copy-recursively (string-append name "/src/main/clojure/") - "src/clj/")) - '("core-specs-alpha-src" - "data-generators-src" - "spec-alpha-src" - "test-check-src" - "test-generative-src" - "tools-namespace-src")) + (define (extract-library name) + (mkdir-p name) + (with-directory-excursion name + (invoke "tar" + "--extract" + "--verbose" + "--file" (assoc-ref inputs name) + "--strip-components=1")) + (copy-recursively (string-append name "/src/main/clojure/") + "src/clj/")) + (for-each extract-library ',library-names) #t)) - (add-after 'unpack 'fix-manifest-classpath + (add-after 'unpack-library-sources 'fix-manifest-classpath (lambda _ (substitute* "build.xml" (("") "")) @@ -647,32 +669,7 @@ interface.") <>) (scandir "./"))) #t)))))) - ;; The native-inputs below are needed to run the tests. - (native-inputs - `(("core-specs-alpha-src" - ,(submodule "core.specs.alpha/archive/core.specs.alpha-" - "0.1.24" - "0v2a0svf1ar2y42ajxwsjr7zmm5j7pp2zwrd2jh3k7xzd1p9x1fv")) - ("data-generators-src" - ,(submodule "data.generators/archive/data.generators-" - "0.1.2" - "0kki093jp4ckwxzfnw8ylflrfqs8b1i1wi9iapmwcsy328dmgzp1")) - ("spec-alpha-src" - ,(submodule "spec.alpha/archive/spec.alpha-" - "0.1.143" - "00alf0347licdn773w2jarpllyrbl52qz4d8mw61anjksacxylzz")) - ("test-check-src" - ,(submodule "test.check/archive/test.check-" - "0.9.0" - "0p0mnyhr442bzkz0s4k5ra3i6l5lc7kp6ajaqkkyh4c2k5yck1md")) - ("test-generative-src" - ,(submodule "test.generative/archive/test.generative-" - "0.5.2" - "1pjafy1i7yblc7ixmcpfq1lfbyf3jaljvkgrajn70sws9xs7a9f8")) - ("tools-namespace-src" - ,(submodule "tools.namespace/archive/tools.namespace-" - "0.2.11" - "10baak8v0hnwz2hr33bavshm7y49mmn9zsyyms1dwjz45p5ymhy0")))) + (native-inputs libraries) (home-page "https://clojure.org/") (synopsis "Lisp dialect running on the JVM") (description "Clojure is a dynamic, general-purpose programming language, @@ -693,7 +690,7 @@ designs.") ;; ASM bytecode manipulation library is licensed under BSD-3 ;; Guava Murmur3 hash implementation is licensed under APL2.0 ;; src/clj/repl.clj is licensed under CPL1.0 - ;; + ;; See readme.html or readme.txt for details. (license (list license:epl1.0 license:bsd-3 -- cgit v1.2.3 From d0ad97115abb548195b920e83ce2769b5020884d Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Sun, 14 Oct 2018 02:52:41 +0800 Subject: gnu: clojure: Use (guix build java-utils) to simplify build phases. * gnu/packages/lisp.scm (clojure)[arguments]: Use 'ant-build-javadoc', 'install-jars' and 'install-javadoc' in build phases. --- gnu/packages/lisp.scm | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'gnu/packages/lisp.scm') diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 24738f3f13..c33e4187c7 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -614,10 +614,10 @@ interface.") (build-system ant-build-system) (arguments `(#:modules ((guix build ant-build-system) + (guix build java-utils) (guix build utils) (ice-9 ftw) (ice-9 regex) - (srfi srfi-1) (srfi srfi-26)) #:test-target "test" #:phases @@ -641,34 +641,22 @@ interface.") (substitute* "build.xml" (("") "")) #t)) - ;; The javadoc target is not built by default. - (add-after 'build 'build-doc - (lambda _ - (invoke "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/"))) - ;; Install versioned to avoid collisions. - (install-file (string-append "clojure-" ,version ".jar") - java-dir) - #t))) - ;; Needed since no install-doc target is provided. + (add-after 'build 'build-javadoc ant-build-javadoc) + (replace 'install (install-jars "./")) (add-after 'install 'install-doc (lambda* (#:key outputs #:allow-other-keys) (let ((doc-dir (string-append (assoc-ref outputs "out") "/share/doc/clojure-" ,version "/"))) (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)))))) + #t))) + (add-after 'install-doc 'install-javadoc + (install-javadoc "target/javadoc/"))))) (native-inputs libraries) (home-page "https://clojure.org/") (synopsis "Lisp dialect running on the JVM") -- cgit v1.2.3 From 53f316ab904196cf20673f34209664b6249cb646 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Mon, 19 Nov 2018 12:05:19 +0100 Subject: guix: Add clojure-utils. * guix/build/clojure-utils.scm: New file. * gnu/packages/lisp.scm (clojure)[arguments]: Use it. * Makefile.am (MODULES): Add it. --- Makefile.am | 2 ++ gnu/packages/lisp.scm | 23 ++++++---------- guix/build/clojure-utils.scm | 65 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 15 deletions(-) create mode 100644 guix/build/clojure-utils.scm (limited to 'gnu/packages/lisp.scm') diff --git a/Makefile.am b/Makefile.am index c63b65ba56..a2144d4b8e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,6 +12,7 @@ # Copyright © 2018 Nils Gillmann # Copyright © 2018 Julien Lepiller # Copyright © 2018 Oleg Pykhalov +# Copyright © 2018 Alex Vong # # This file is part of GNU Guix. # @@ -172,6 +173,7 @@ MODULES = \ guix/build/syscalls.scm \ guix/build/gremlin.scm \ guix/build/debug-link.scm \ + guix/build/clojure-utils.scm \ guix/build/emacs-utils.scm \ guix/build/java-utils.scm \ guix/build/lisp-utils.scm \ diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index c33e4187c7..6b0de63986 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -600,6 +600,7 @@ interface.") (library-names (match libraries (((library-name _) ...) library-name)))) + (package (name "clojure") (version "1.9.0") @@ -613,11 +614,13 @@ interface.") (base32 "0xjbzcw45z32vsn9pifp7ndysjzqswp5ig0jkjpivigh2ckkdzha")))) (build-system ant-build-system) (arguments - `(#:modules ((guix build ant-build-system) + `(#:imported-modules ((guix build clojure-utils) + (guix build guile-build-system) + ,@%ant-build-system-modules) + #:modules ((guix build ant-build-system) + (guix build clojure-utils) (guix build java-utils) (guix build utils) - (ice-9 ftw) - (ice-9 regex) (srfi srfi-26)) #:test-target "test" #:phases @@ -643,18 +646,8 @@ interface.") #t)) (add-after 'build 'build-javadoc ant-build-javadoc) (replace 'install (install-jars "./")) - (add-after 'install 'install-doc - (lambda* (#:key outputs #:allow-other-keys) - (let ((doc-dir (string-append (assoc-ref outputs "out") - "/share/doc/clojure-" - ,version "/"))) - (copy-recursively "doc/clojure" doc-dir) - (for-each (cut install-file <> doc-dir) - (filter (cut string-match - ".*\\.(html|markdown|md|txt)" - <>) - (scandir "./"))) - #t))) + (add-after 'install-license-files 'install-doc + (cut install-doc #:doc-dirs '("doc/clojure/") <...>)) (add-after 'install-doc 'install-javadoc (install-javadoc "target/javadoc/"))))) (native-inputs libraries) diff --git a/guix/build/clojure-utils.scm b/guix/build/clojure-utils.scm new file mode 100644 index 0000000000..713dff2d8f --- /dev/null +++ b/guix/build/clojure-utils.scm @@ -0,0 +1,65 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2018 Alex Vong +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix build clojure-utils) + #:use-module (guix build utils) + #:use-module (ice-9 ftw) + #:use-module (ice-9 regex) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:export (%clojure-regex + define-with-docs + install-doc)) + +(define-syntax-rule (define-with-docs name docs val) + "Create top-level variable named NAME with doc string DOCS and value VAL." + (begin (define name val) + (set-object-property! name 'documentation docs))) + +(define-with-docs %doc-regex + "Default regex for matching the base name of top-level documentation files." + (format #f + "(~a)|(\\.(html|markdown|md|txt)$)" + (@@ (guix build guile-build-system) + %documentation-file-regexp))) + +(define* (install-doc #:key + doc-dirs + (doc-regex %doc-regex) + outputs + #:allow-other-keys) + "Install the following to the default documentation directory: + +1. Top-level files with base name matching DOC-REGEX. +2. All files (recursively) inside DOC-DIRS. + +DOC-REGEX can be compiled or uncompiled." + (let* ((out (assoc-ref outputs "out")) + (doc (assoc-ref outputs "doc")) + (name-ver (strip-store-file-name out)) + (dest-dir (string-append (or doc out) "/share/doc/" name-ver "/")) + (doc-regex* (if (string? doc-regex) + (make-regexp doc-regex) + doc-regex))) + (for-each (cut install-file <> dest-dir) + (remove (compose file-exists? + (cut string-append dest-dir <>)) + (scandir "./" (cut regexp-exec doc-regex* <>)))) + (for-each (cut copy-recursively <> dest-dir) + doc-dirs) + #t)) -- cgit v1.2.3 From d2a659e5bf05297f67a54b4c46143ed4115a3941 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Sun, 14 Oct 2018 04:17:14 +0800 Subject: gnu: Add clojure-instaparse. * gnu/packages/lisp.scm (clojure-instaparse): New public variable. --- gnu/packages/lisp.scm | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'gnu/packages/lisp.scm') diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 6b0de63986..7ed4359271 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -36,6 +36,7 @@ #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (guix build-system ant) + #:use-module (guix build-system clojure) #:use-module (guix build-system asdf) #:use-module (guix build-system trivial) #:use-module (gnu packages admin) @@ -1607,6 +1608,58 @@ compressor. It works on data produced by @code{parse-js} to generate a ("sbcl-cl-uglify-js" ,sbcl-cl-uglify-js))) (synopsis "JavaScript compressor"))) +(define-public clojure-instaparse + (let ((commit "dcfffad5b065e750f0f5835f017cdd8188b8ca2e") + (version "1.4.9")) ; upstream forget to tag this release + (package + (name "clojure-instaparse") + (version version) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Engelberg/instaparse.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "002mrgin4z3dqy88r1lak7smd0m7x8d22vmliw0m6w6mh5pa17lk")))) + (build-system clojure-build-system) + (arguments + '(#:doc-dirs '("docs/"))) + (synopsis "No grammar left behind") + (description + "Instaparse aims to be the simplest way to build parsers in Clojure. + +@itemize +@item Turns @emph{standard EBNF or ABNF notation} for context-free grammars +into an executable parser that takes a string as an input and produces a parse +tree for that string. + +@item @dfn{No Grammar Left Behind}: Works for @emph{any} context-free grammar, +including @emph{left-recursive}, @emph{right-recursive}, and @emph{ambiguous} +grammars. + +@item Extends the power of context-free grammars with PEG-like syntax for +lookahead and negative lookahead. + +@item Supports both of Clojure's most popular tree formats (hiccup and enlive) +as output targets + +@item Detailed reporting of parse errors. + +@item Optionally produces lazy sequence of all parses (especially useful for +diagnosing and debugging ambiguous grammars). + +@item ``Total parsing'' mode where leftover string is embedded in the parse +tree. + +@item Optional combinator library for building grammars programmatically. + +@item Performant. +@end itemize") + (home-page "https://github.com/Engelberg/instaparse") + (license license:epl1.0)))) + (define-public confusion-mdl (let* ((commit "12a055581fc262225272df43287dae48281900f5")) (package -- cgit v1.2.3 From c784ffa0c46a822cdacda4b480f131276b86c924 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Sun, 14 Oct 2018 18:08:26 +0800 Subject: gnu: Add clojure-core-match. * gnu/packages/lisp.scm (clojure-core-match): New public variable. --- gnu/packages/lisp.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gnu/packages/lisp.scm') diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 7ed4359271..a9ddb3c01b 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -1608,6 +1608,33 @@ compressor. It works on data produced by @code{parse-js} to generate a ("sbcl-cl-uglify-js" ,sbcl-cl-uglify-js))) (synopsis "JavaScript compressor"))) +(define-public clojure-core-match + (let ((commit "1837ffbd4a150e8f3953b2d9ed5cf4a4ad3720a7") + (revision "1")) ; this is the 1st commit buildable with clojure 1.9 + (package + (name "clojure-core-match") + (version (git-version "0.3.0-alpha5" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/clojure/core.match.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "04bdlp5dgkrqzrz0lw3mfwmygj2218qnm1cz3dkb9wy4m0238s4d")))) + (build-system clojure-build-system) + (arguments + '(#:source-dirs '("src/main/clojure") + #:test-dirs '("src/test/clojure") + #:doc-dirs '())) + (synopsis "Optimized pattern matching for Clojure") + (description + "An optimized pattern matching library for Clojure. +It supports Clojure 1.5.1 and later as well as ClojureScript.") + (home-page "https://github.com/clojure/core.match") + (license license:epl1.0)))) + (define-public clojure-instaparse (let ((commit "dcfffad5b065e750f0f5835f017cdd8188b8ca2e") (version "1.4.9")) ; upstream forget to tag this release -- cgit v1.2.3 From eea5530c9f3ad9fb749f218015482c011a734696 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Sun, 14 Oct 2018 19:06:52 +0800 Subject: gnu: Add clojure-algo-generic. * gnu/packages/lisp.scm (clojure-algo-generic): New public variable. --- gnu/packages/lisp.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'gnu/packages/lisp.scm') diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index a9ddb3c01b..ddd912f957 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -1608,6 +1608,30 @@ compressor. It works on data produced by @code{parse-js} to generate a ("sbcl-cl-uglify-js" ,sbcl-cl-uglify-js))) (synopsis "JavaScript compressor"))) +(define-public clojure-algo-generic + (package + (name "clojure-algo-generic") + (version "0.1.3") + (source + (origin + (method url-fetch) + (uri + (string-append "https://github.com/clojure/algo.generic/archive" + "/algo.generic-" version ".tar.gz")) + (sha256 + (base32 "12w9681i545gp1af4576z1qbixwps1j13c16fmcc7zsb0bd1zr7w")))) + (build-system clojure-build-system) + (arguments + '(#:source-dirs '("src/main/clojure/") + #:test-dirs '("src/test/clojure/") + #:doc-dirs '())) + (synopsis "Generic versions of common functions") + (description + "Generic versions of commonly used functions, implemented as multimethods +that can be implemented for any data type.") + (home-page "https://github.com/clojure/algo.generic") + (license license:epl1.0))) + (define-public clojure-core-match (let ((commit "1837ffbd4a150e8f3953b2d9ed5cf4a4ad3720a7") (revision "1")) ; this is the 1st commit buildable with clojure 1.9 -- cgit v1.2.3 From 2cab1d4a7d0aa3d4d3d10d745d4bb8762f93f90b Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Sun, 14 Oct 2018 19:37:40 +0800 Subject: gnu: Add clojure-tools-macro. * gnu/packages/lisp.scm (clojure-tools-macro): New public variable. --- gnu/packages/lisp.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gnu/packages/lisp.scm') diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index ddd912f957..3d0fce4e7a 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -1711,6 +1711,28 @@ tree. (home-page "https://github.com/Engelberg/instaparse") (license license:epl1.0)))) +(define-public clojure-tools-macro + (package + (name "clojure-tools-macro") + (version "0.1.5") + (source + (origin + (method url-fetch) + (uri + (string-append "https://github.com/clojure/tools.macro/archive" + "/tools.macro-" version ".tar.gz")) + (sha256 + (base32 "0fs64a0g63xx6g7sj6vrsqknhl90s0isf6k053nw8vv5prfzc7v6")))) + (build-system clojure-build-system) + (arguments + '(#:source-dirs '("src/main/clojure/") + #:test-dirs '("src/test/clojure/") + #:doc-dirs '())) + (synopsis "Utilities for macro writers") + (description "Tools for writing macros.") + (home-page "https://github.com/clojure/tools.macro") + (license license:epl1.0))) + (define-public confusion-mdl (let* ((commit "12a055581fc262225272df43287dae48281900f5")) (package -- cgit v1.2.3 From 5497214d80b5c2569e0cd72fd9c702c01d231152 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Sun, 14 Oct 2018 20:15:02 +0800 Subject: gnu: Add clojure-algo-monads. * gnu/packages/lisp.scm (clojure-algo-monads): New public variable. --- gnu/packages/lisp.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gnu/packages/lisp.scm') diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 3d0fce4e7a..6849cdd2bf 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -1632,6 +1632,33 @@ that can be implemented for any data type.") (home-page "https://github.com/clojure/algo.generic") (license license:epl1.0))) +(define-public clojure-algo-monads + (package + (name "clojure-algo-monads") + (version "0.1.6") + (source + (origin + (method url-fetch) + (uri + (string-append "https://github.com/clojure/algo.monads/archive" + "/algo.monads-" version ".tar.gz")) + (sha256 + (base32 "14gbvfgmrda990h45yn7zag83vp1kdkz4f4yzmyvkr0sjihlgdmq")))) + (build-system clojure-build-system) + (arguments + '(#:source-dirs '("src/main/clojure/") + #:test-dirs '("src/test/clojure/") + #:doc-dirs '())) + (native-inputs + `(("clojure-tools-macro" ,clojure-tools-macro))) + (synopsis + "Monad Macros and Definitions") + (description + "This library contains the most commonly used monads as well as macros for +defining and using monads and useful monadic functions.") + (home-page "https://github.com/clojure/algo.monads") + (license license:epl1.0))) + (define-public clojure-core-match (let ((commit "1837ffbd4a150e8f3953b2d9ed5cf4a4ad3720a7") (revision "1")) ; this is the 1st commit buildable with clojure 1.9 -- cgit v1.2.3