gnu: ldc: Don't use unstable tarball.

* gnu/packages/dlang.scm (ldc)[source]: Use GIT-FETCH and
GIT-FILE-NAME.
[native-inputs]: Likewise.
[arguments]: Adjust ‘unpack-submodule-sources’ phase accordingly.
This commit is contained in:
Tobias Geerinckx-Rice 2019-04-08 23:15:22 +02:00
parent d57748e367
commit 36f7fbca13
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79
1 changed files with 45 additions and 40 deletions

View File

@ -199,28 +199,33 @@ bootstrapping more recent compilers written in D.")
(inherit ldc-bootstrap) (inherit ldc-bootstrap)
(name "ldc") (name "ldc")
(version "1.10.0") (version "1.10.0")
(source (origin (source
(method url-fetch) (origin
(uri (string-append (method git-fetch)
"https://github.com/ldc-developers/ldc/archive/v" (uri (git-reference
version ".tar.gz")) (url "https://github.com/ldc-developers/ldc.git")
(file-name (string-append name "-" version ".tar.gz")) (commit (string-append "v" version))))
(sha256 (file-name (git-file-name name version))
(base32 (sha256
"16b1h9kwfggjw6ykc6sfs26ak6vypylsx9wmvp5m6x3cvi6g70yi")))) (base32 "0qcb2rn01wql7y8qp31blbv3hwmnh3zjgzi2n7k168cxr6rrdhlp"))))
(arguments (arguments
`(#:phases `(#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'unpack-submodule-sources (add-after 'unpack 'unpack-submodule-sources
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((unpack (lambda (source target) (let ((unpack (lambda (input target)
(with-directory-excursion target (let ((source (assoc-ref inputs input)))
(invoke "tar" "xvf" ;; Git checkouts are directories as long as
(assoc-ref inputs source) ;; there are no patches; tarballs otherwise.
"--strip-components=1"))))) (if (file-is-directory? source)
(copy-recursively source target)
(with-directory-excursion target
(invoke "tar" "xvf" source
"--strip-components=1")))))))
(unpack "phobos-src" "runtime/phobos") (unpack "phobos-src" "runtime/phobos")
(unpack "druntime-src" "runtime/druntime") (unpack "druntime-src" "runtime/druntime")
(unpack "dmd-testsuite-src" "tests/d2/dmd-testsuite")))) (unpack "dmd-testsuite-src" "tests/d2/dmd-testsuite")
#t)))
(add-after 'unpack-submodule-sources 'patch-phobos (add-after 'unpack-submodule-sources 'patch-phobos
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(substitute* '("runtime/phobos/std/process.d" (substitute* '("runtime/phobos/std/process.d"
@ -228,7 +233,7 @@ bootstrapping more recent compilers written in D.")
(("/bin/sh") (which "sh")) (("/bin/sh") (which "sh"))
(("echo") (which "echo"))) (("echo") (which "echo")))
(substitute* "tests/d2/dmd-testsuite/Makefile" (substitute* "tests/d2/dmd-testsuite/Makefile"
(("/bin/bash") (which "bash"))) (("/bin/bash") (which "bash")))
;; disable unittests in the following files. We are discussing with ;; disable unittests in the following files. We are discussing with
;; upstream ;; upstream
(substitute* '("runtime/phobos/std/net/curl.d" (substitute* '("runtime/phobos/std/net/curl.d"
@ -245,14 +250,14 @@ bootstrapping more recent compilers written in D.")
(delete-file "tests/plugins/addFuncEntryCall/testPlugin.d") (delete-file "tests/plugins/addFuncEntryCall/testPlugin.d")
;; the following tests requires AVX instruction set in the CPU. ;; the following tests requires AVX instruction set in the CPU.
(substitute* "tests/d2/dmd-testsuite/runnable/test_cdvecfill.d" (substitute* "tests/d2/dmd-testsuite/runnable/test_cdvecfill.d"
(("^// DISABLED: ") "^// DISABLED: linux64 ")) (("^// DISABLED: ") "^// DISABLED: linux64 "))
#t)) #t))
(replace 'check (replace 'check
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
;; some tests call into gdb binary which needs SHELL and CC set ;; some tests call into gdb binary which needs SHELL and CC set
(setenv "SHELL" (which "sh")) (setenv "SHELL" (which "sh"))
(setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
(invoke "make" "test" "-j" (number->string (parallel-job-count)))))))) (invoke "make" "test" "-j" (number->string (parallel-job-count))))))))
(native-inputs (native-inputs
`(("llvm" ,llvm-6) `(("llvm" ,llvm-6)
("clang" ,clang-6) ("clang" ,clang-6)
@ -263,13 +268,13 @@ bootstrapping more recent compilers written in D.")
("gdb" ,gdb) ("gdb" ,gdb)
("phobos-src" ("phobos-src"
,(origin ,(origin
(method url-fetch) (method git-fetch)
(uri (string-append (uri (git-reference
"https://github.com/ldc-developers/phobos/archive/ldc-v" (url "https://github.com/ldc-developers/phobos.git")
older-version ".tar.gz")) (commit (string-append "ldc-v" older-version))))
(file-name (git-file-name "phobos" older-version))
(sha256 (sha256
(base32 (base32 "1gmlwnjdcf6s5aahadxsif9l5nyaj0rrn379g6fmhcvdk64kf509"))
"0cpmrww00xf1qx38bcc22rr05qw41p00p45yb5fbwnfaccfwdn0s"))
;; This patch deactivates some tests that depend on network access ;; This patch deactivates some tests that depend on network access
;; to pass. It also deactivates some tests that have some reliance ;; to pass. It also deactivates some tests that have some reliance
;; on timezone. ;; on timezone.
@ -282,22 +287,22 @@ bootstrapping more recent compilers written in D.")
(patches (search-patches "ldc-disable-phobos-tests.patch")))) (patches (search-patches "ldc-disable-phobos-tests.patch"))))
("druntime-src" ("druntime-src"
,(origin ,(origin
(method url-fetch) (method git-fetch)
(uri (string-append (uri (git-reference
"https://github.com/ldc-developers/druntime/archive/ldc-v" (url "https://github.com/ldc-developers/druntime.git")
older-version ".tar.gz")) (commit (string-append "ldc-v" older-version))))
(file-name (git-file-name "druntime" older-version))
(sha256 (sha256
(base32 (base32 "0a3yyjcnpvm5fbdczf76fx08kl154w17w06hlxf0j3p1p4jc85aj"))))
"1akh2vdi98jih8642yjbvv2vavxzrmq24kz8i3kfidg5ndqyv222"))))
("dmd-testsuite-src" ("dmd-testsuite-src"
,(origin ,(origin
(method url-fetch) (method git-fetch)
(uri (string-append (uri (git-reference
"https://github.com/ldc-developers/dmd-testsuite/archive/ldc-v" (url "https://github.com/ldc-developers/dmd-testsuite.git")
older-version ".tar.gz")) (commit (string-append "ldc-v" older-version))))
(file-name (git-file-name "dmd-testsuite" older-version))
(sha256 (sha256
(base32 (base32 "0mm3rliki1nqiqfaha7ssvm156aa398vpvf4v6895m7nn1mz7rss")))))))))
"0z5x07qrbkpksshaymp11ir6jlmg9wjicxn6zhp8cya6i1ha9p99")))))))))
(define-public dub (define-public dub
(package (package