Mirror of GNU Guix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
4.8 KiB

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Roel Janssen <roel@gnu.org>
;;; Copyright © 2015 Pjotr Prins <pjotr.guix@thebird.nl>
;;; 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
;;; 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 <http://www.gnu.org/licenses/>.
(define-module (gnu packages ldc)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system cmake)
#:use-module (gnu packages)
#:use-module (gnu packages base)
#:use-module (gnu packages libedit)
#:use-module (gnu packages llvm)
#:use-module (gnu packages textutils)
#:use-module (gnu packages zip))
(define-public ldc
(name "ldc")
(version "0.16.1")
(source (origin
(method url-fetch)
(uri (string-append
version ".tar.gz"))
(file-name (string-append name "-" version ".tar.gz"))
(build-system cmake-build-system)
;; LDC currently only supports the x86_64 and i686 architectures.
(supported-systems '("x86_64-linux" "i686-linux"))
(modify-phases %standard-phases
(add-after 'unpack 'unpack-submodule-sources
(lambda* (#:key inputs #:allow-other-keys)
(let ((unpack (lambda (source target)
(with-directory-excursion target
(zero? (system* "tar" "xvf"
(assoc-ref inputs source)
(and (unpack "phobos-src" "runtime/phobos")
(unpack "druntime-src" "runtime/druntime")
(unpack "dmd-testsuite-src" "tests/d2/dmd-testsuite")))))
(add-after 'unpack-submodule-sources 'patch-phobos
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "runtime/phobos/std/process.d"
(("/bin/sh") (which "sh"))
(("echo") (which "echo")))
(substitute* "runtime/phobos/std/datetime.d"
(string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")))
(substitute* "tests/d2/dmd-testsuite/Makefile"
(("/bin/bash") (which "bash")))
`(("libconfig" ,libconfig)
("libedit" ,libedit)
("tzdata" ,tzdata)))
`(("llvm" ,llvm)
("clang" ,clang)
("unzip" ,unzip)
(method url-fetch)
(uri (string-append
version ".tar.gz"))
(patches (list (search-patch "ldc-disable-tests.patch")))))
(method url-fetch)
(uri (string-append
version ".tar.gz"))
(method url-fetch)
(uri (string-append
version ".tar.gz"))
(home-page "http://wiki.dlang.org/LDC")
(synopsis "LLVM compiler for the D programming language")
"LDC is a compiler for the D programming language. It is based on the
latest DMD frontend and uses LLVM as backend.")
;; Most of the code is released under BSD-3, except for code originally
;; written for GDC, which is released under GPLv2+, and the DMD frontend,
;; which is released under the "Boost Software License version 1.0".
(license (list license:bsd-3