nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at netboot-syslinux-multiplatform 88 lines 2.5 kB view raw
1{ lib, stdenv, llvm_meta 2, fetch 3, fetchpatch 4, cmake 5, zlib 6, ncurses 7, swig 8, which 9, libedit 10, libxml2 11, libllvm 12, libclang 13, python3 14, version 15, darwin 16}: 17 18stdenv.mkDerivation rec { 19 pname = "lldb"; 20 inherit version; 21 22 src = fetch "lldb" "05178zkyh84x32n91md6wm22lkzzrrfwa5cpmgzn0yrg3y2771bb"; 23 24 patches = [ 25 # Fix PythonString::GetString for >=python-3.7 26 (fetchpatch { 27 url = "https://github.com/llvm/llvm-project/commit/5457b426f5e15a29c0acc8af1a476132f8be2a36.patch"; 28 sha256 = "1zbx4m0m8kbg0wq6740jcw151vb2pb1p25p401wiq8diqqagkjps"; 29 stripLen = 1; 30 }) 31 ./gnu-install-dirs.patch 32 ]; 33 34 postPatch = '' 35 # Fix up various paths that assume llvm and clang are installed in the same place 36 sed -i 's,".*ClangConfig.cmake","${libclang.dev}/lib/cmake/clang/ClangConfig.cmake",' \ 37 cmake/modules/LLDBStandalone.cmake 38 sed -i 's,".*tools/clang/include","${libclang.dev}/include",' \ 39 cmake/modules/LLDBStandalone.cmake 40 sed -i 's,"$.LLVM_LIBRARY_DIR.",${libllvm.lib}/lib ${libclang.lib}/lib,' \ 41 cmake/modules/LLDBStandalone.cmake 42 ''; 43 44 outputs = [ "out" "lib" "dev" ]; 45 46 nativeBuildInputs = [ 47 cmake python3 which swig 48 ]; 49 50 buildInputs = [ 51 ncurses zlib libedit libxml2 libllvm 52 ] ++ lib.optionals stdenv.isDarwin [ 53 darwin.libobjc 54 darwin.apple_sdk.libs.xpc 55 darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa 56 ]; 57 58 CXXFLAGS = "-fno-rtti"; 59 hardeningDisable = [ "format" ]; 60 61 cmakeFlags = [ 62 "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" 63 "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic 64 ] ++ lib.optionals doCheck [ 65 "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" 66 "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" 67 ]; 68 69 doCheck = false; 70 71 postInstall = '' 72 mkdir -p $out/share/man/man1 73 cp ../docs/lldb.1 $out/share/man/man1/ 74 ''; 75 76 meta = llvm_meta // { 77 homepage = "https://lldb.llvm.org/"; 78 description = "A next-generation high-performance debugger"; 79 longDescription = '' 80 LLDB is a next generation, high-performance debugger. It is built as a set 81 of reusable components which highly leverage existing libraries in the 82 larger LLVM Project, such as the Clang expression parser and LLVM 83 disassembler. 84 ''; 85 # never built on aarch64-darwin since first introduction in nixpkgs 86 broken = stdenv.isDarwin && stdenv.isAarch64; 87 }; 88}