mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
Merge pull request #324400 from CyberShadow/ldc-include-output
ldc: split includes to separate output
This commit is contained in:
commit
beab3b862a
@ -15,6 +15,7 @@
|
||||
, callPackage
|
||||
, makeWrapper
|
||||
, runCommand
|
||||
, writeText
|
||||
, targetPackages
|
||||
|
||||
, ldcBootstrap ? callPackage ./bootstrap.nix { }
|
||||
@ -73,8 +74,12 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
buildInputs = [ curl tzdata ];
|
||||
|
||||
outputs = [ "out" "include" ];
|
||||
outputInclude = "include";
|
||||
|
||||
cmakeFlags = [
|
||||
"-DD_FLAGS=-d-version=TZDatabaseDir;-d-version=LibcurlPath;-J${pathConfig}"
|
||||
"-DINCLUDE_INSTALL_DIR=${placeholder "include"}/include/d"
|
||||
];
|
||||
|
||||
postConfigure = ''
|
||||
@ -142,4 +147,35 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
maintainers = with maintainers; [ lionello jtbx ];
|
||||
platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
};
|
||||
|
||||
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"];
|
||||
};
|
||||
};
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user