nixpkgs/pkgs/development/compilers/llvm/4/lldb.nix
Will Dietz 6f6c06adc1 llvm4.0: Rename "4.0" (and _40) to "4" (and _4).
This reflects upstream versioning change, and allows
us to replace 4.0 with 4.1 (which is now a minor revision)
without changing the attribute name.

Thanks to @vcunat for the idea.
2017-03-02 17:19:44 -06:00

51 lines
1.3 KiB
Nix

{ stdenv
, fetch
, cmake
, zlib
, ncurses
, swig
, which
, libedit
, libxml2
, llvm
, clang-unwrapped
, python
, version
, darwin
}:
stdenv.mkDerivation {
name = "lldb-${version}";
src = fetch "lldb" "1qr0ky7llwgjgx1pzkp3pnz32nb6f7lvg8qg6rp5axhgpkx54hz7";
patchPhase = ''
# Fix up various paths that assume llvm and clang are installed in the same place
sed -i 's,".*ClangConfig.cmake","${clang-unwrapped}/lib/cmake/clang/ClangConfig.cmake",' \
cmake/modules/LLDBStandalone.cmake
sed -i 's,".*tools/clang/include","${clang-unwrapped}/include",' \
cmake/modules/LLDBStandalone.cmake
sed -i 's,"$.LLVM_LIBRARY_DIR.",${llvm}/lib ${clang-unwrapped}/lib,' \
cmake/modules/LLDBStandalone.cmake
'';
buildInputs = [ cmake python which swig ncurses zlib libedit libxml2 llvm ]
++ stdenv.lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc ];
CXXFLAGS = "-fno-rtti";
hardeningDisable = [ "format" ];
cmakeFlags = [
"-DLLDB_DISABLE_LIBEDIT=ON"
];
enableParallelBuilding = true;
meta = with stdenv.lib; {
description = "A next-generation high-performance debugger";
homepage = http://llvm.org/;
license = licenses.ncsa;
platforms = platforms.allBut platforms.darwin;
};
}