Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 21.05 43 lines 1.4 kB view raw
1{ lib, stdenv, fetchurl, curl, tzdata, autoPatchelfHook, fixDarwinDylibNames, libxml2 2, version, hashes }: 3 4let 5 inherit (stdenv) hostPlatform; 6 OS = if stdenv.hostPlatform.isDarwin then "osx" else hostPlatform.parsed.kernel.name; 7 ARCH = toString hostPlatform.parsed.cpu.name; 8in stdenv.mkDerivation { 9 pname = "ldc-bootstrap"; 10 inherit version; 11 12 src = fetchurl rec { 13 name = "ldc2-${version}-${OS}-${ARCH}.tar.xz"; 14 url = "https://github.com/ldc-developers/ldc/releases/download/v${version}/${name}"; 15 sha256 = hashes."${OS}-${ARCH}" or (throw "missing bootstrap sha256 for ${OS}-${ARCH}"); 16 }; 17 18 dontConfigure = true; 19 dontBuild = true; 20 21 nativeBuildInputs = [ autoPatchelfHook ] 22 ++ lib.optional hostPlatform.isDarwin fixDarwinDylibNames; 23 24 buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libxml2 stdenv.cc.cc ]; 25 26 propagatedBuildInputs = [ curl tzdata ]; 27 28 installPhase = '' 29 mkdir -p $out 30 31 mv bin etc import lib LICENSE README $out/ 32 ''; 33 34 meta = with lib; { 35 inherit version; 36 description = "The LLVM-based D Compiler"; 37 homepage = "https://github.com/ldc-developers/ldc"; 38 # from https://github.com/ldc-developers/ldc/blob/master/LICENSE 39 license = with licenses; [ bsd3 boost mit ncsa gpl2Plus ]; 40 maintainers = with maintainers; [ ThomasMader lionello ]; 41 platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" ]; 42 }; 43}