2019-09-19 19:19:41 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetch
|
|
|
|
, cmake
|
|
|
|
, zlib
|
|
|
|
, ncurses
|
|
|
|
, swig
|
|
|
|
, which
|
|
|
|
, libedit
|
|
|
|
, libxml2
|
|
|
|
, llvm
|
|
|
|
, clang-unwrapped
|
2020-01-12 20:22:29 +00:00
|
|
|
, python3
|
2019-09-19 19:19:41 +01:00
|
|
|
, version
|
|
|
|
, darwin
|
2019-09-20 00:40:47 +01:00
|
|
|
, lit
|
2019-09-19 19:19:41 +01:00
|
|
|
}:
|
|
|
|
|
2019-09-19 19:24:37 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-09-19 19:19:41 +01:00
|
|
|
pname = "lldb";
|
|
|
|
inherit version;
|
|
|
|
|
2019-12-31 20:53:24 +00:00
|
|
|
src = fetch pname "02gb3fbz09kyw8n71218v5v77ip559x3gqbcp8y3w6n3jpbryywa";
|
2019-09-19 19:19:41 +01:00
|
|
|
|
2019-09-19 19:24:37 +01:00
|
|
|
patches = [ ./lldb-procfs.patch ];
|
|
|
|
|
2020-01-12 20:22:29 +00:00
|
|
|
nativeBuildInputs = [ cmake python3 which swig lit ];
|
2019-09-20 00:40:47 +01:00
|
|
|
buildInputs = [
|
|
|
|
ncurses
|
|
|
|
zlib
|
|
|
|
libedit
|
|
|
|
libxml2
|
|
|
|
llvm
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.libobjc
|
|
|
|
darwin.apple_sdk.libs.xpc
|
|
|
|
darwin.apple_sdk.frameworks.Foundation
|
|
|
|
darwin.bootstrap_cmds
|
|
|
|
darwin.apple_sdk.frameworks.Carbon
|
|
|
|
darwin.apple_sdk.frameworks.Cocoa
|
|
|
|
];
|
2019-09-19 19:19:41 +01:00
|
|
|
|
|
|
|
CXXFLAGS = "-fno-rtti";
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
|
2019-09-20 00:40:47 +01:00
|
|
|
"-DClang_DIR=${clang-unwrapped}/lib/cmake"
|
|
|
|
"-DLLVM_EXTERNAL_LIT=${lit}/bin/lit"
|
2019-09-19 19:19:41 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
postInstall = ''
|
2019-09-20 00:40:47 +01:00
|
|
|
# man page
|
2019-09-19 19:19:41 +01:00
|
|
|
mkdir -p $out/share/man/man1
|
2019-09-20 00:40:47 +01:00
|
|
|
install ../docs/lldb.1 -t $out/share/man/man1/
|
2019-09-19 19:19:41 +01:00
|
|
|
|
2019-09-20 00:40:47 +01:00
|
|
|
# Editor support
|
|
|
|
# vscode:
|
2019-09-19 19:19:41 +01:00
|
|
|
install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json
|
2019-09-20 00:40:47 +01:00
|
|
|
mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
|
2019-09-19 19:19:41 +01:00
|
|
|
ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A next-generation high-performance debugger";
|
2020-04-13 17:50:35 +01:00
|
|
|
homepage = "https://llvm.org/";
|
2019-09-20 00:40:47 +01:00
|
|
|
license = licenses.ncsa;
|
|
|
|
platforms = platforms.all;
|
2019-09-19 19:19:41 +01:00
|
|
|
};
|
|
|
|
}
|