3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/compilers/llvm/5/lldb/default.nix

83 lines
2.1 KiB
Nix
Raw Normal View History

{ lib, stdenv
2017-09-16 01:38:38 +01:00
, fetch
, fetchpatch
2017-09-16 01:38:38 +01:00
, cmake
, zlib
, ncurses
, swig
, which
, libedit
, libxml2
, libllvm
, libclang
2020-01-12 20:22:29 +00:00
, python3
2017-09-16 01:38:38 +01:00
, version
, darwin
}:
stdenv.mkDerivation rec {
2019-08-13 22:52:01 +01:00
pname = "lldb";
inherit version;
2017-09-16 01:38:38 +01:00
2018-05-04 16:54:06 +01:00
src = fetch "lldb" "05j2a63yzln43852nng8a7y47spzlyr1cvdmgmbxgd29c8r0bfkq";
2017-09-16 01:38:38 +01:00
patches = [
# Fix PythonString::GetString for >=python-3.7
(fetchpatch {
url = "https://github.com/llvm/llvm-project/commit/5457b426f5e15a29c0acc8af1a476132f8be2a36.patch";
sha256 = "1zbx4m0m8kbg0wq6740jcw151vb2pb1p25p401wiq8diqqagkjps";
stripLen = 1;
})
./gnu-install-dirs.patch
];
2017-09-16 01:38:38 +01:00
postPatch = ''
# Fix up various paths that assume llvm and clang are installed in the same place
sed -i 's,".*ClangConfig.cmake","${libclang.dev}/lib/cmake/clang/ClangConfig.cmake",' \
2017-09-16 01:38:38 +01:00
cmake/modules/LLDBStandalone.cmake
sed -i 's,".*tools/clang/include","${libclang.dev}/include",' \
2017-09-16 01:38:38 +01:00
cmake/modules/LLDBStandalone.cmake
sed -i 's,"$.LLVM_LIBRARY_DIR.",${libllvm.lib}/lib ${libclang.lib}/lib,' \
2017-09-16 01:38:38 +01:00
cmake/modules/LLDBStandalone.cmake
'';
outputs = [ "out" "lib" "dev" ];
nativeBuildInputs = [
cmake python3 which swig
];
buildInputs = [
ncurses zlib libedit libxml2 libllvm
] ++ 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
];
2017-09-16 01:38:38 +01:00
CXXFLAGS = "-fno-rtti";
hardeningDisable = [ "format" ];
cmakeFlags = [
"-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}"
2017-09-16 01:38:38 +01:00
"-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
] ++ lib.optionals doCheck [
"-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
"-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++"
2017-09-16 01:38:38 +01:00
];
doCheck = false;
2018-01-16 21:05:42 +00:00
postInstall = ''
mkdir -p $out/share/man/man1
cp ../docs/lldb.1 $out/share/man/man1/
'';
meta = with lib; {
2017-09-16 01:38:38 +01:00
description = "A next-generation high-performance debugger";
homepage = "https://llvm.org/";
2017-09-16 01:38:38 +01:00
license = licenses.ncsa;
platforms = platforms.all;
};
}