1 {stdenv, lib, fetchFromGitHub, ldc ? null, dcompiler ? ldc }:
3 assert dcompiler != null;
5 stdenv.mkDerivation rec {
9 src = fetchFromGitHub {
10 owner = "dragon-lang";
13 sha256 = "10x6f1nn294r5qnpacrpcbp348dndz5fv4nz6ih55c61ckpkvgcf";
16 buildInputs = [ dcompiler ];
18 for candidate in dmd ldmd2 gdmd; do
19 echo Checking for DCompiler $candidate ...
20 dc=$(type -P $candidate || echo "")
21 if [ ! "$dc" == "" ]; then
25 if [ "$dc" == "" ]; then
26 exit "Error: could not find a D compiler"
28 echo Using DCompiler $candidate
29 $dc -I=$src/src -i -run $src/make.d build --out $NIX_BUILD_TOP
34 $NIX_BUILD_TOP/rund make.d test
39 mv $NIX_BUILD_TOP/rund $out/bin
43 description = "A compiler-wrapper that runs and caches D programs";
45 homepage = "https://github.com/dragon-lang/rund";
46 license = lib.licenses.boost;
47 maintainers = with maintainers; [ jonathanmarler ];
48 platforms = lib.platforms.unix;