nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 54 lines 1.6 kB view raw
1{ lib, stdenv, fetchurl, curl, tzdata, autoPatchelfHook, fixDarwinDylibNames, glibc 2, version, hashes }: 3 4let 5 inherit (stdenv) hostPlatform; 6 OS = if hostPlatform.isDarwin then "osx" else hostPlatform.parsed.kernel.name; 7 MODEL = toString hostPlatform.parsed.cpu.bits; 8in stdenv.mkDerivation { 9 pname = "dmd-bootstrap"; 10 inherit version; 11 12 src = fetchurl rec { 13 name = "dmd.${version}.${OS}.tar.xz"; 14 url = "http://downloads.dlang.org/releases/2.x/${version}/${name}"; 15 sha256 = hashes.${OS} or (throw "missing bootstrap sha256 for OS ${OS}"); 16 }; 17 18 dontConfigure = true; 19 dontBuild = true; 20 21 nativeBuildInputs = lib.optionals hostPlatform.isLinux [ 22 autoPatchelfHook 23 ] ++ lib.optional hostPlatform.isDarwin fixDarwinDylibNames; 24 propagatedBuildInputs = [ curl tzdata ] ++ lib.optional hostPlatform.isLinux glibc; 25 26 installPhase = '' 27 mkdir -p $out 28 29 # try to copy model-specific binaries into bin first 30 mv ${OS}/bin${MODEL} $out/bin || true 31 32 mv src license.txt ${OS}/* $out/ 33 34 # move man into place 35 mkdir -p $out/share 36 mv man $out/share/ 37 38 # move docs into place 39 mkdir -p $out/share/doc 40 mv html/d $out/share/doc/ 41 42 # fix paths in dmd.conf (one level less) 43 substituteInPlace $out/bin/dmd.conf --replace "/../../" "/../" 44 ''; 45 46 meta = with lib; { 47 description = "Digital Mars D Compiler Package"; 48 # As of 2.075 all sources and binaries use the boost license 49 license = licenses.boost; 50 maintainers = [ maintainers.lionello ]; 51 homepage = "https://dlang.org/"; 52 platforms = [ "x86_64-darwin" "i686-linux" "x86_64-linux" ]; 53 }; 54}