summaryrefslogtreecommitdiff
path: root/pkgs
diff options
context:
space:
mode:
authorLinnnus <[email protected]>2024-11-21 10:49:48 +0100
committerLinnnus <[email protected]>2024-11-21 10:49:48 +0100
commitaa99e1e10c38fc929243893b0b6b4c3e359c7283 (patch)
treebc5e9005f92f82010687eb0c9e3ecb1f5eb2b5ab /pkgs
parent7c81e64eb0bf6d647be475c474a4dbc708910e65 (diff)
pkgs/cscript: Use CC and LLDB from nixpkgs
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/cscript/default.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/cscript/default.nix b/pkgs/cscript/default.nix
index 602bbe7..fa529bc 100644
--- a/pkgs/cscript/default.nix
+++ b/pkgs/cscript/default.nix
@@ -2,6 +2,7 @@
stdenv,
lib,
fetchFromGitHub,
+ llvmPackages,
}: let
self = stdenv.mkDerivation rec {
pname = "cscript";
@@ -14,6 +15,17 @@
hash = "sha256-d722f3K3QXnPqDVNVGBK+mj6Bl1VNShmJ4WICj0p64s=";
};
+ # Instead of using the system CC and LLDB (impure), use the most recent LLVM release.
+ postPatch = let
+ toStringLiteral = lib.flip lib.pipe [builtins.toJSON lib.strings.escapeShellArg];
+ ccPathLiteral = toStringLiteral "${llvmPackages.clang}/bin/clang";
+ lldbPathLiteral = toStringLiteral "${llvmPackages.lldb}/bin/lldb";
+ in ''
+ substituteInPlace cscript.c \
+ --replace-fail '"cc"' ${ccPathLiteral} \
+ --replace-fail '"lldb"' ${lldbPathLiteral} \
+ '';
+
preInstall = "mkdir -p $out/bin";
makeFlags = ["INSTALL=$(out)/bin"];