From af7dd521363ea9b8476b8e92a44782678b3b5a5e Mon Sep 17 00:00:00 2001 From: r0man Date: Sat, 16 Jul 2022 20:24:18 +0200 Subject: gnu: clojure: Update to 1.11.1. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch updates Clojure to 1.11.1. It also adds the 'reset-class-timestamps phase to the Clojure build system. This phase makes sure the timestamp of compiled class files is set to a later point in time than the timestamp of the corresponding Clojure source files. If the timestamps of the class and source files are the same, the Clojure compiler will compile the sources again which can lead to issues. This problem has been discussed here [1]. The suggested solution was to keep/adjust the timestamps of the class files. [1] https://www.mail-archive.com/clojure@googlegroups.com/msg99928.html * gnu/packages/clojure.scm (clojure): Update to 1.11.1 and update all of LIBRARIES accordingly. [arguments]: In 'unpack-library-sources' phase, copy from "core-specs-alpha-src" and "spec-alpha-src" as well. Add phases 'closure-spec-skip-macros', 'clojure-spec-compile', 'maven-classpath-properties', and 'reset-class-timestamps'. * guix/build/clojure-build-system.scm (regular-jar-file?) (reset-class-timestamps): New procedures. (%standard-phases): Add 'reset-class-timestamps' phase. Co-authored-by: Ludovic Courtès --- gnu/packages/clojure.scm | 93 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 72 insertions(+), 21 deletions(-) (limited to 'gnu/packages/clojure.scm') diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm index 8b94d118a2..dfff54f8ee 100644 --- a/gnu/packages/clojure.scm +++ b/gnu/packages/clojure.scm @@ -43,36 +43,44 @@ (define-public clojure ;; 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")) + ,(lib "core.specs.alpha/archive/v" + "0.2.62" + "0v6nhghsigpzm8y7dykfm318q5dvk5l8sykmn1hr0qgs1jsjqh9j")) ("data-generators-src" ,(lib "data.generators/archive/data.generators-" - "0.1.2" - "0kki093jp4ckwxzfnw8ylflrfqs8b1i1wi9iapmwcsy328dmgzp1")) + "1.0.0" + "0s3hf1njvs68b8igasikvzagzqxl0gbri7w2qhzsypkhfh60v2cp")) + ("java-classpath-src" + ,(lib "java.classpath/archive/java.classpath-" + "1.0.0" + "178zajjsc9phk5l61r8w9hcpk0wgc9a811pl7kjgvn7rg4l7fh7j")) ("spec-alpha-src" - ,(lib "spec.alpha/archive/spec.alpha-" - "0.1.143" - "00alf0347licdn773w2jarpllyrbl52qz4d8mw61anjksacxylzz")) + ,(lib "spec.alpha/archive/v" + "0.3.218" + "0h5nd9xlind1a2vmllr2yfhnirgj2pm5dndgqzrly78l5iwcc3wa")) ("test-check-src" - ,(lib "test.check/archive/test.check-" - "0.9.0" - "0p0mnyhr442bzkz0s4k5ra3i6l5lc7kp6ajaqkkyh4c2k5yck1md")) + ,(lib "test.check/archive/v" + "1.1.1" + "0kx8l79mhpnn94rpsgc7nac7gb222g7a47mzrycj8crfc54wf0c1")) ("test-generative-src" ,(lib "test.generative/archive/test.generative-" - "0.5.2" - "1pjafy1i7yblc7ixmcpfq1lfbyf3jaljvkgrajn70sws9xs7a9f8")) + "1.0.0" + "0yy2vc38s4j5n94jdcjx1v7l2gdq0lywam31id1jh07sx37lv5il")) ("tools-namespace-src" ,(lib "tools.namespace/archive/tools.namespace-" - "0.2.11" - "10baak8v0hnwz2hr33bavshm7y49mmn9zsyyms1dwjz45p5ymhy0")))) + "1.0.0" + "1ifpk93m33rj2xm1qnnninlsdvm1liqmsp9igr63pjjwwwjw1cnn")) + ("tools-reader-src" + ,(lib "tools.reader/archive/tools.reader-" + "1.3.2" + "1n4dhg61iyypnjbxmihhqjb7lfpc0lzfvlk4jd8w0yr6za414f3a")))) (library-names (match libraries (((library-name _) ...) library-name)))) (package (name "clojure") - (version "1.10.0") + (version "1.11.1") (source (let ((name+version (string-append name "-" version))) (origin (method git-fetch) @@ -81,18 +89,23 @@ (define-public clojure (commit name+version))) (file-name (string-append name+version "-checkout")) (sha256 - (base32 "1kcyv2836acs27vi75hvf3r773ahv2nlh9b3j9xa9m9sdanz1h83"))))) + (base32 "1xbab21rm9zvhmw1i2h5lqm7612vrdkxprq0rgb2i3sbgsxcdsn4"))))) (build-system ant-build-system) (inputs `(("jre" ,icedtea))) (arguments `(#:imported-modules ((guix build clojure-utils) + (guix build clojure-build-system) (guix build guile-build-system) ,@%ant-build-system-modules) #:modules ((guix build ant-build-system) + ((guix build clojure-build-system) #:prefix clj:) (guix build clojure-utils) (guix build java-utils) (guix build utils) + (guix build syscalls) + (ice-9 match) + (ice-9 regex) (srfi srfi-26)) #:test-target "test" #:phases @@ -106,22 +119,60 @@ (define (extract-library name) "--extract" "--verbose" "--file" (assoc-ref inputs name) - "--strip-components=1")) - (copy-recursively (string-append name "/src/main/clojure/") - "src/clj/")) + "--strip-components=1"))) (for-each extract-library ',library-names) + (copy-recursively "core-specs-alpha-src/src/main/clojure" + "src/clj/") + (copy-recursively "spec-alpha-src/src/main/clojure" + "src/clj/") #t)) (add-after 'unpack-library-sources 'fix-manifest-classpath (lambda _ (substitute* "build.xml" (("") "")) #t)) + (add-after 'unpack-library-sources 'clojure-spec-skip-macros + ;; Disable spec macro instrumentation when compiling clojure.spec + ;; See: https://clojure.atlassian.net/browse/CLJ-2254 + (lambda _ + (substitute* "build.xml" + (("") + ,(string-join + '("" + "\n") + "\n"))) + #t)) + (add-after 'unpack-library-sources 'clojure-spec-compile + ;; Compile and include clojure.spec.alpha & clojure.core.specs.alpha + (lambda _ + (substitute* "build.xml" + (("") + ,(string-join + '("" + "" + "" + "" + "")))) + #t)) + (add-before 'build 'maven-classpath-properties + (lambda _ + (define (make-classpath libraries) + (string-join (map (lambda (library) + (string-append library "/src/main/clojure")) + libraries) ":")) + (with-output-to-file "maven-classpath.properties" + (lambda () + (let ((classpath (make-classpath ',library-names))) + (display (string-append "maven.compile.classpath=" classpath "\n")) + (display (string-append "maven.test.classpath=" classpath "\n"))))) + #t)) (add-after 'build 'build-javadoc ant-build-javadoc) (replace 'install (install-jars "./")) (add-after 'install-license-files 'install-doc (cut install-doc #:doc-dirs '("doc/clojure/") <...>)) (add-after 'install-doc 'install-javadoc - (install-javadoc "target/javadoc/"))))) + (install-javadoc "target/javadoc/")) + (add-after 'reset-gzip-timestamps 'reset-class-timestamps clj:reset-class-timestamps)))) (native-inputs libraries) (home-page "https://clojure.org/") (synopsis "Lisp dialect running on the JVM") -- cgit v1.2.3