1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Roel Janssen <roel@gnu.org>
3 ;;; Copyright © 2015 Pjotr Prins <pjotr.guix@thebird.nl>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages ldc)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix git-download)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix build-system cmake)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages libedit)
30 #:use-module (gnu packages llvm)
31 #:use-module (gnu packages textutils)
32 #:use-module (gnu packages zip))
35 (let ((commit "da0a2e0a379b08294015eec9d531f1e5dd4226f0"))
38 (version (string-append "v2.070.0-1." (string-take commit 7)))
42 (url "https://github.com/D-Programming-Language/tools.git")
44 (file-name (string-append name "-" version "-checkout"))
47 "1pcx5lyqzrip86f4vv60x292rpvnwsq2hvl1znm9x9rn68f34m45"))))
48 (build-system gnu-build-system)
51 (modify-phases %standard-phases
53 (delete 'check) ; There is no Makefile, so there's no 'make check'.
57 (zero? (system* "ldc2" "rdmd.d"))))
60 (lambda* (#:key outputs #:allow-other-keys)
61 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
62 (install-file "rdmd" bin)))))))
65 (home-page "https://github.com/D-Programming-Language/tools/")
66 (synopsis "Specialized equivalent to 'make' for the D language")
68 "rdmd is a companion to the dmd compiler that simplifies the typical
69 edit-compile-link-run or edit-make-run cycle to a rapid edit-run cycle. Like
70 make and other tools, rdmd uses the relative dates of the files involved to
71 minimize the amount of work necessary. Unlike make, rdmd tracks dependencies
72 and freshness without requiring additional information from the user.")
73 (license license:boost1.0))))
82 "https://github.com/ldc-developers/ldc/archive/v"
84 (file-name (string-append name "-" version ".tar.gz"))
87 "1jvilxx0rpqmkbja4m69fhd5g09697xq7vyqp2hz4hvxmmmv4j40"))))
88 (build-system cmake-build-system)
89 ;; LDC currently only supports the x86_64 and i686 architectures.
90 (supported-systems '("x86_64-linux" "i686-linux"))
93 (modify-phases %standard-phases
94 (add-after 'unpack 'unpack-submodule-sources
95 (lambda* (#:key inputs #:allow-other-keys)
96 (let ((unpack (lambda (source target)
97 (with-directory-excursion target
98 (zero? (system* "tar" "xvf"
99 (assoc-ref inputs source)
100 "--strip-components=1"))))))
101 (and (unpack "phobos-src" "runtime/phobos")
102 (unpack "druntime-src" "runtime/druntime")
103 (unpack "dmd-testsuite-src" "tests/d2/dmd-testsuite")))))
104 (add-after 'unpack-submodule-sources 'patch-phobos
105 (lambda* (#:key inputs #:allow-other-keys)
106 (substitute* "runtime/phobos/std/process.d"
107 (("/bin/sh") (which "sh"))
108 (("echo") (which "echo")))
109 (substitute* "runtime/phobos/std/datetime.d"
110 (("/usr/share/zoneinfo/")
111 (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")))
112 (substitute* "tests/d2/dmd-testsuite/Makefile"
113 (("/bin/bash") (which "bash")))
116 `(("libconfig" ,libconfig)
127 "https://github.com/ldc-developers/phobos/archive/ldc-v"
131 "0sgdj0536c4nb118yiw1f8lqy5d3g3lpg9l99l165lk9xy45l9z4"))
132 (patches (search-patches "ldc-disable-tests.patch"))))
137 "https://github.com/ldc-developers/druntime/archive/ldc-v"
141 "0z4mkyddx6c4sy1vqgqvavz55083dsxws681qkh93jh1rpby9yg6"))))
146 "https://github.com/ldc-developers/dmd-testsuite/archive/ldc-v"
150 "0yc6miidzgl9k33ygk7xcppmfd6kivqj02cvv4fmkbs3qz4yy3z1"))))))
151 (home-page "http://wiki.dlang.org/LDC")
152 (synopsis "LLVM compiler for the D programming language")
154 "LDC is a compiler for the D programming language. It is based on the
155 latest DMD frontend and uses LLVM as backend.")
156 ;; Most of the code is released under BSD-3, except for code originally
157 ;; written for GDC, which is released under GPLv2+, and the DMD frontend,
158 ;; which is released under the "Boost Software License version 1.0".
159 (license (list license:bsd-3