about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/dmd/generic.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-10-20 22:09:03 +0000
committerAlyssa Ross <hi@alyssa.is>2023-10-20 22:09:03 +0000
commit50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e (patch)
treef2556b911180125ccbb7ed0e78a54e92da89adce /nixpkgs/pkgs/development/compilers/dmd/generic.nix
parent4c16d4548a98563c9d9ad76f4e5b2202864ccd54 (diff)
parentcfc75eec4603c06503ae750f88cf397e00796ea8 (diff)
downloadnixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.gz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.bz2
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.lz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.xz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.zst
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.zip
Merge commit 'cfc75eec4603c06503ae750f88cf397e00796ea8'
Conflicts:
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/dmd/generic.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/dmd/generic.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/development/compilers/dmd/generic.nix b/nixpkgs/pkgs/development/compilers/dmd/generic.nix
index d2679c184da7..0f6abb574a59 100644
--- a/nixpkgs/pkgs/development/compilers/dmd/generic.nix
+++ b/nixpkgs/pkgs/development/compilers/dmd/generic.nix
@@ -6,6 +6,7 @@
 { stdenv
 , lib
 , fetchFromGitHub
+, removeReferencesTo
 , makeWrapper
 , which
 , writeTextFile
@@ -20,7 +21,8 @@
 , installShellFiles
 , git
 , unzip
-, dmd_bin ? "${callPackage ./bootstrap.nix { }}/bin"
+, dmdBootstrap ? callPackage ./bootstrap.nix { }
+, dmd_bin ? "${dmdBootstrap}/bin"
 }:
 
 let
@@ -155,6 +157,7 @@ stdenv.mkDerivation rec {
     fi
 
     ${dmd_bin}/rdmd dmd/compiler/src/build.d -j$buildJobs HOST_DMD=${dmd_bin}/dmd $buildFlags
+    make -C dmd/druntime -f posix.mak DMD=${pathToDmd} $buildFlags -j$buildJobs
     echo ${tzdata}/share/zoneinfo/ > TZDatabaseDirFile
     echo ${lib.getLib curl}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} > LibcurlPathFile
     make -C phobos -f posix.mak $buildFlags -j$buildJobs DMD=${pathToDmd} DFLAGS="-version=TZDatabaseDir -version=LibcurlPath -J$PWD"
@@ -195,7 +198,7 @@ stdenv.mkDerivation rec {
     installManPage dmd/docs/man/man*/*
 
     mkdir -p $out/include/dmd
-    cp -r {druntime/import/*,phobos/{std,etc}} $out/include/dmd/
+    cp -r {dmd/druntime/import/*,phobos/{std,etc}} $out/include/dmd/
 
     mkdir $out/lib
     cp phobos/generated/${osname}/release/${bits}/libphobos2.* $out/lib/
@@ -209,6 +212,12 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
+  preFixup = ''
+    find $out/bin -type f -exec ${removeReferencesTo}/bin/remove-references-to -t ${dmd_bin}/dmd '{}' +
+  '';
+
+  disallowedReferences = [ dmdBootstrap ];
+
   meta = with lib; {
     description = "Official reference compiler for the D language";
     homepage = "https://dlang.org/";