diff options
Diffstat (limited to 'nix-overlays/ldc')
| -rw-r--r-- | nix-overlays/ldc/bootstrap.nix | 11 | ||||
| -rw-r--r-- | nix-overlays/ldc/package.nix | 101 | 
2 files changed, 61 insertions, 51 deletions
| diff --git a/nix-overlays/ldc/bootstrap.nix b/nix-overlays/ldc/bootstrap.nix index d81e5a4..8f76b5b 100644 --- a/nix-overlays/ldc/bootstrap.nix +++ b/nix-overlays/ldc/bootstrap.nix @@ -1,4 +1,13 @@ -{ lib, stdenv, fetchurl, curl, tzdata, autoPatchelfHook, fixDarwinDylibNames, libxml2 }: +{ +  lib, +  stdenv, +  fetchurl, +  curl, +  tzdata, +  autoPatchelfHook, +  fixDarwinDylibNames, +  libxml2, +}:  let    inherit (stdenv) hostPlatform; diff --git a/nix-overlays/ldc/package.nix b/nix-overlays/ldc/package.nix index 69a6457..39b510a 100644 --- a/nix-overlays/ldc/package.nix +++ b/nix-overlays/ldc/package.nix @@ -1,26 +1,27 @@ -{ lib -, stdenv -, fetchFromGitHub -, cmake -, ninja -, llvm_19 -, curl -, tzdata -, lit -, gdb -, unzip -, darwin -, callPackage -, makeWrapper -, runCommand -, writeText -, targetPackages - -, ldcBootstrap ? callPackage ./bootstrap.nix { } +{ +  lib, +  stdenv, +  fetchFromGitHub, +  cmake, +  ninja, +  llvm_19, +  curl, +  tzdata, +  lit, +  gdb, +  unzip, +  darwin, +  callPackage, +  makeWrapper, +  runCommand, +  writeText, +  targetPackages, + +  ldcBootstrap ? callPackage ./bootstrap.nix { },  }:  let -  pathConfig = runCommand "ldc-lib-paths" {} '' +  pathConfig = runCommand "ldc-lib-paths" { } ''      mkdir $out      echo ${tzdata}/share/zoneinfo/ > $out/TZDatabaseDirFile      echo ${curl.out}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} > $out/LibcurlPathFile @@ -106,8 +107,7 @@ stdenv.mkDerivation (finalAttrs: {    '';    # https://github.com/ldc-developers/ldc/issues/2497#issuecomment-459633746 -  additionalExceptions = lib.optionalString stdenv.hostPlatform.isDarwin -    "|druntime-test-shared"; +  additionalExceptions = lib.optionalString stdenv.hostPlatform.isDarwin "|druntime-test-shared";    checkPhase = ''      # Build default lib test runners @@ -147,34 +147,35 @@ stdenv.mkDerivation (finalAttrs: {    };    passthru.ldcBootstrap = ldcBootstrap; -  passthru.tests = let -    ldc = finalAttrs.finalPackage; -    helloWorld = stdenv.mkDerivation (finalAttrs: { -      name = "ldc-hello-world"; -      src = writeText "hello_world.d" '' -        module hello_world; -        import std.stdio; -        void main() { -          writeln("Hello, world!"); -        } -      ''; -      dontUnpack = true; -      buildInputs = [ ldc ]; -      dFlags = []; -      buildPhase = '' -        ldc2 ${lib.escapeShellArgs finalAttrs.dFlags} -of=test $src -      ''; -      installPhase = '' -        mkdir -p $out/bin -        mv test $out/bin -      ''; -    }); -  in { -    # Without -shared, built binaries should not contain -    # references to the compiler binaries. -    no-references-to-compiler = helloWorld.overrideAttrs { -      disallowedReferences = [ ldc ]; -      dFlags = ["-g"]; +  passthru.tests = +    let +      ldc = finalAttrs.finalPackage; +      helloWorld = stdenv.mkDerivation (finalAttrs: { +        name = "ldc-hello-world"; +        src = writeText "hello_world.d" '' +          module hello_world; +          import std.stdio; +          void main() { +            writeln("Hello, world!"); +          } +        ''; +        dontUnpack = true; +        buildInputs = [ ldc ]; +        dFlags = [ ]; +        buildPhase = '' +          ldc2 ${lib.escapeShellArgs finalAttrs.dFlags} -of=test $src +        ''; +        installPhase = '' +          mkdir -p $out/bin +          mv test $out/bin +        ''; +      }); +    in { +      # Without -shared, built binaries should not contain +      # references to the compiler binaries. +      no-references-to-compiler = helloWorld.overrideAttrs { +        disallowedReferences = [ ldc ]; +        dFlags = ["-g"];      };    };  }) | 
