llvmPackages.lldb: deduplicate >10

Artturin d53d5a8b 0ef7eafd

+363 -1123
+7 -2
pkgs/development/compilers/llvm/10/default.nix
··· 130 inherit llvm_meta; 131 }; 132 133 - lldb = callPackage ./lldb { 134 - inherit llvm_meta; 135 }; 136 137 # Below, is the LLVM bootstrapping logic. It handles building a
··· 130 inherit llvm_meta; 131 }; 132 133 + lldb = callPackage ../common/lldb.nix { 134 + src = fetch "lldb" "051p5b04y6z3g730rmc2n2v71lipbw7k69riww3a6sl74myfiaq7"; 135 + patches = [ 136 + ./lldb/procfs.patch 137 + ./lldb/gnu-install-dirs.patch 138 + ]; 139 + inherit llvm_meta release_version; 140 }; 141 142 # Below, is the LLVM bootstrapping logic. It handles building a
-128
pkgs/development/compilers/llvm/10/lldb/default.nix
··· 1 - { lib, stdenv, llvm_meta 2 - , fetch 3 - , cmake 4 - , zlib 5 - , ncurses 6 - , swig 7 - , which 8 - , libedit 9 - , libxml2 10 - , libllvm 11 - , libclang 12 - , python3 13 - , version 14 - , darwin 15 - , lit 16 - , makeWrapper 17 - , enableManpages ? false 18 - }: 19 - 20 - stdenv.mkDerivation (rec { 21 - pname = "lldb"; 22 - inherit version; 23 - 24 - src = fetch pname "051p5b04y6z3g730rmc2n2v71lipbw7k69riww3a6sl74myfiaq7"; 25 - 26 - patches = [ 27 - ./procfs.patch 28 - ./gnu-install-dirs.patch 29 - ]; 30 - 31 - outputs = [ "out" "lib" "dev" ]; 32 - 33 - nativeBuildInputs = [ 34 - cmake python3 which swig lit makeWrapper 35 - ] ++ lib.optionals enableManpages [ 36 - python3.pkgs.sphinx python3.pkgs.recommonmark 37 - ]; 38 - 39 - buildInputs = [ 40 - ncurses zlib libedit libxml2 libllvm 41 - ] ++ lib.optionals stdenv.isDarwin [ 42 - darwin.libobjc 43 - darwin.apple_sdk.libs.xpc 44 - darwin.apple_sdk.frameworks.Foundation 45 - darwin.bootstrap_cmds 46 - darwin.apple_sdk.frameworks.Carbon 47 - darwin.apple_sdk.frameworks.Cocoa 48 - ]; 49 - 50 - hardeningDisable = [ "format" ]; 51 - 52 - cmakeFlags = [ 53 - "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" 54 - "-DLLVM_ENABLE_RTTI=OFF" 55 - "-DClang_DIR=${libclang.dev}/lib/cmake" 56 - "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" 57 - ] ++ lib.optionals stdenv.isDarwin [ 58 - "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" 59 - ] ++ lib.optionals (!stdenv.isDarwin) [ 60 - "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic 61 - ] ++ lib.optionals enableManpages [ 62 - "-DLLVM_ENABLE_SPHINX=ON" 63 - "-DSPHINX_OUTPUT_MAN=ON" 64 - "-DSPHINX_OUTPUT_HTML=OFF" 65 - ] ++ lib.optionals doCheck [ 66 - "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" 67 - "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" 68 - ]; 69 - 70 - doCheck = false; 71 - 72 - doInstallCheck = true; 73 - 74 - installCheckPhase = '' 75 - if [ ! -e "$lib/${python3.sitePackages}/lldb/_lldb.so" ] ; then 76 - echo "ERROR: python files not installed where expected!"; 77 - return 1; 78 - fi 79 - ''; 80 - 81 - postInstall = '' 82 - wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/ 83 - 84 - # Editor support 85 - # vscode: 86 - install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json 87 - mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 88 - ln -s $out/bin/llvm-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 89 - ''; 90 - 91 - meta = llvm_meta // { 92 - homepage = "https://lldb.llvm.org/"; 93 - description = "A next-generation high-performance debugger"; 94 - longDescription = '' 95 - LLDB is a next generation, high-performance debugger. It is built as a set 96 - of reusable components which highly leverage existing libraries in the 97 - larger LLVM Project, such as the Clang expression parser and LLVM 98 - disassembler. 99 - ''; 100 - # never built on aarch64-darwin since first introduction in nixpkgs 101 - broken = stdenv.isDarwin && stdenv.isAarch64; 102 - }; 103 - } // lib.optionalAttrs enableManpages { 104 - pname = "lldb-manpages"; 105 - 106 - buildPhase = '' 107 - make docs-man 108 - ''; 109 - 110 - propagatedBuildInputs = []; 111 - 112 - # manually install lldb man page 113 - installPhase = '' 114 - mkdir -p $out/share/man/man1 115 - install docs/man/lldb.1 -t $out/share/man/man1/ 116 - ''; 117 - 118 - postPatch = null; 119 - postInstall = null; 120 - 121 - outputs = [ "out" ]; 122 - 123 - doCheck = false; 124 - 125 - meta = llvm_meta // { 126 - description = "man pages for LLDB ${version}"; 127 - }; 128 - })
···
+7 -2
pkgs/development/compilers/llvm/11/default.nix
··· 145 inherit llvm_meta; 146 }; 147 148 - lldb = callPackage ./lldb { 149 - inherit llvm_meta; 150 }; 151 152 # Below, is the LLVM bootstrapping logic. It handles building a
··· 145 inherit llvm_meta; 146 }; 147 148 + lldb = callPackage ../common/lldb.nix { 149 + src = fetch "lldb" "1vlyg015dyng43xqb8cg2l6r9ix8klibxsajazbfnckdnh54hwxj"; 150 + patches = [ 151 + ./lldb/procfs.patch 152 + ./lldb/gnu-install-dirs.patch 153 + ]; 154 + inherit llvm_meta release_version; 155 }; 156 157 # Below, is the LLVM bootstrapping logic. It handles building a
-126
pkgs/development/compilers/llvm/11/lldb/default.nix
··· 1 - { lib, stdenv, llvm_meta 2 - , fetch 3 - , cmake 4 - , zlib 5 - , ncurses 6 - , swig 7 - , which 8 - , libedit 9 - , libxml2 10 - , libllvm 11 - , libclang 12 - , python3 13 - , version 14 - , darwin 15 - , lit 16 - , makeWrapper 17 - , enableManpages ? false 18 - }: 19 - 20 - stdenv.mkDerivation (rec { 21 - pname = "lldb"; 22 - inherit version; 23 - 24 - src = fetch pname "1vlyg015dyng43xqb8cg2l6r9ix8klibxsajazbfnckdnh54hwxj"; 25 - 26 - patches = [ 27 - ./procfs.patch 28 - ./gnu-install-dirs.patch 29 - ]; 30 - 31 - outputs = [ "out" "lib" "dev" ]; 32 - 33 - nativeBuildInputs = [ 34 - cmake python3 which swig lit makeWrapper 35 - ] ++ lib.optionals enableManpages [ 36 - python3.pkgs.sphinx python3.pkgs.recommonmark 37 - ]; 38 - 39 - buildInputs = [ 40 - ncurses zlib libedit libxml2 libllvm 41 - ] ++ lib.optionals stdenv.isDarwin [ 42 - darwin.libobjc 43 - darwin.apple_sdk.libs.xpc 44 - darwin.apple_sdk.frameworks.Foundation 45 - darwin.bootstrap_cmds 46 - darwin.apple_sdk.frameworks.Carbon 47 - darwin.apple_sdk.frameworks.Cocoa 48 - ]; 49 - 50 - hardeningDisable = [ "format" ]; 51 - 52 - cmakeFlags = [ 53 - "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" 54 - "-DLLVM_ENABLE_RTTI=OFF" 55 - "-DClang_DIR=${libclang.dev}/lib/cmake" 56 - "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" 57 - ] ++ lib.optionals stdenv.isDarwin [ 58 - "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" 59 - ] ++ lib.optionals (!stdenv.isDarwin) [ 60 - "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic 61 - ] ++ lib.optionals enableManpages [ 62 - "-DLLVM_ENABLE_SPHINX=ON" 63 - "-DSPHINX_OUTPUT_MAN=ON" 64 - "-DSPHINX_OUTPUT_HTML=OFF" 65 - ] ++ lib.optionals doCheck [ 66 - "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" 67 - "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" 68 - ]; 69 - 70 - doCheck = false; 71 - 72 - doInstallCheck = true; 73 - 74 - installCheckPhase = '' 75 - if [ ! -e "$lib/${python3.sitePackages}/lldb/_lldb.so" ] ; then 76 - echo "ERROR: python files not installed where expected!"; 77 - return 1; 78 - fi 79 - ''; 80 - 81 - postInstall = '' 82 - wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/ 83 - 84 - # Editor support 85 - # vscode: 86 - install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json 87 - mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 88 - ln -s $out/bin/llvm-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 89 - ''; 90 - 91 - meta = llvm_meta // { 92 - homepage = "https://lldb.llvm.org/"; 93 - description = "A next-generation high-performance debugger"; 94 - longDescription = '' 95 - LLDB is a next generation, high-performance debugger. It is built as a set 96 - of reusable components which highly leverage existing libraries in the 97 - larger LLVM Project, such as the Clang expression parser and LLVM 98 - disassembler. 99 - ''; 100 - }; 101 - } // lib.optionalAttrs enableManpages { 102 - pname = "lldb-manpages"; 103 - 104 - buildPhase = '' 105 - make docs-man 106 - ''; 107 - 108 - propagatedBuildInputs = []; 109 - 110 - # manually install lldb man page 111 - installPhase = '' 112 - mkdir -p $out/share/man/man1 113 - install docs/man/lldb.1 -t $out/share/man/man1/ 114 - ''; 115 - 116 - postPatch = null; 117 - postInstall = null; 118 - 119 - outputs = [ "out" ]; 120 - 121 - doCheck = false; 122 - 123 - meta = llvm_meta // { 124 - description = "man pages for LLDB ${version}"; 125 - }; 126 - })
···
+17 -5
pkgs/development/compilers/llvm/12/default.nix
··· 134 inherit (libraries) libunwind; 135 }; 136 137 - lldb = callPackage ./lldb { 138 - inherit llvm_meta; 139 - inherit (darwin) libobjc bootstrap_cmds; 140 - inherit (darwin.apple_sdk.libs) xpc; 141 - inherit (darwin.apple_sdk.frameworks) Foundation Carbon Cocoa; 142 }; 143 144 # Below, is the LLVM bootstrapping logic. It handles building a
··· 134 inherit (libraries) libunwind; 135 }; 136 137 + lldb = callPackage ../common/lldb.nix { 138 + src = fetch "lldb" "0g3pj1m3chafavpr35r9fynm85y2hdyla6klj0h28khxs2613i78"; 139 + patches = 140 + let 141 + resourceDirPatch = callPackage ({ runCommand, libclang }: (runCommand "resource-dir.patch" 142 + { 143 + clangLibDir = "${libclang.lib}/lib"; 144 + } '' 145 + substitute '${./lldb/resource-dir.patch}' "$out" --subst-var clangLibDir 146 + '')) { }; 147 + in 148 + [ 149 + ./lldb/procfs.patch 150 + resourceDirPatch 151 + ./lldb/gnu-install-dirs.patch 152 + ]; 153 + inherit llvm_meta release_version; 154 }; 155 156 # Below, is the LLVM bootstrapping logic. It handles building a
-142
pkgs/development/compilers/llvm/12/lldb/default.nix
··· 1 - { lib, stdenv, llvm_meta 2 - , runCommand 3 - , fetch 4 - , cmake 5 - , zlib 6 - , ncurses 7 - , swig 8 - , which 9 - , libedit 10 - , libxml2 11 - , libllvm 12 - , libclang 13 - , python3 14 - , version 15 - , libobjc 16 - , xpc 17 - , Foundation 18 - , bootstrap_cmds 19 - , Carbon 20 - , Cocoa 21 - , lit 22 - , makeWrapper 23 - , enableManpages ? false 24 - }: 25 - 26 - stdenv.mkDerivation (rec { 27 - pname = "lldb"; 28 - inherit version; 29 - 30 - src = fetch pname "0g3pj1m3chafavpr35r9fynm85y2hdyla6klj0h28khxs2613i78"; 31 - 32 - patches = [ 33 - ./procfs.patch 34 - (runCommand "resource-dir.patch" { 35 - clangLibDir = "${libclang.lib}/lib"; 36 - } '' 37 - substitute '${./resource-dir.patch}' "$out" --subst-var clangLibDir 38 - '') 39 - ./gnu-install-dirs.patch 40 - ]; 41 - 42 - outputs = [ "out" "lib" "dev" ]; 43 - 44 - nativeBuildInputs = [ 45 - cmake python3 which swig lit makeWrapper 46 - ] ++ lib.optionals enableManpages [ 47 - python3.pkgs.sphinx python3.pkgs.recommonmark 48 - ]; 49 - 50 - buildInputs = [ 51 - ncurses 52 - zlib 53 - libedit 54 - libxml2 55 - libllvm 56 - ] 57 - ++ lib.optionals stdenv.isDarwin [ 58 - libobjc 59 - xpc 60 - Foundation 61 - bootstrap_cmds 62 - Carbon 63 - Cocoa 64 - ]; 65 - 66 - hardeningDisable = [ "format" ]; 67 - 68 - cmakeFlags = [ 69 - "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" 70 - "-DLLVM_ENABLE_RTTI=OFF" 71 - "-DClang_DIR=${libclang.dev}/lib/cmake" 72 - "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" 73 - ] ++ lib.optionals stdenv.isDarwin [ 74 - "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" 75 - ] ++ lib.optionals (!stdenv.isDarwin) [ 76 - "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic 77 - ] ++ lib.optionals enableManpages [ 78 - "-DLLVM_ENABLE_SPHINX=ON" 79 - "-DSPHINX_OUTPUT_MAN=ON" 80 - "-DSPHINX_OUTPUT_HTML=OFF" 81 - ] ++ lib.optionals doCheck [ 82 - "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" 83 - "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" 84 - ]; 85 - 86 - doCheck = false; 87 - 88 - doInstallCheck = true; 89 - 90 - installCheckPhase = '' 91 - if [ ! -e "$lib/${python3.sitePackages}/lldb/_lldb.so" ] ; then 92 - echo "ERROR: python files not installed where expected!"; 93 - return 1; 94 - fi 95 - ''; 96 - 97 - postInstall = '' 98 - wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/ 99 - 100 - # Editor support 101 - # vscode: 102 - install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json 103 - mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 104 - ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 105 - ''; 106 - 107 - meta = llvm_meta // { 108 - homepage = "https://lldb.llvm.org/"; 109 - description = "A next-generation high-performance debugger"; 110 - longDescription = '' 111 - LLDB is a next generation, high-performance debugger. It is built as a set 112 - of reusable components which highly leverage existing libraries in the 113 - larger LLVM Project, such as the Clang expression parser and LLVM 114 - disassembler. 115 - ''; 116 - }; 117 - } // lib.optionalAttrs enableManpages { 118 - pname = "lldb-manpages"; 119 - 120 - buildPhase = '' 121 - make docs-lldb-man 122 - ''; 123 - 124 - propagatedBuildInputs = []; 125 - 126 - # manually install lldb man page 127 - installPhase = '' 128 - mkdir -p $out/share/man/man1 129 - install docs/man/lldb.1 -t $out/share/man/man1/ 130 - ''; 131 - 132 - postPatch = null; 133 - postInstall = null; 134 - 135 - outputs = [ "out" ]; 136 - 137 - doCheck = false; 138 - 139 - meta = llvm_meta // { 140 - description = "man pages for LLDB ${version}"; 141 - }; 142 - })
···
+30 -5
pkgs/development/compilers/llvm/13/default.nix
··· 134 inherit llvm_meta; 135 }; 136 137 - lldb = callPackage ./lldb { 138 - inherit llvm_meta; 139 - inherit (darwin) libobjc bootstrap_cmds; 140 - inherit (darwin.apple_sdk.libs) xpc; 141 - inherit (darwin.apple_sdk.frameworks) Foundation Carbon Cocoa; 142 }; 143 144 # Below, is the LLVM bootstrapping logic. It handles building a
··· 134 inherit llvm_meta; 135 }; 136 137 + lldb = callPackage ../common/lldb.nix { 138 + patches = 139 + let 140 + resourceDirPatch = callPackage ({ runCommand, libclang }: (runCommand "resource-dir.patch" 141 + { 142 + clangLibDir = "${libclang.lib}/lib"; 143 + } '' 144 + substitute '${./lldb/resource-dir.patch}' "$out" --subst-var clangLibDir 145 + '')) { }; 146 + in 147 + [ 148 + ./lldb/procfs.patch 149 + resourceDirPatch 150 + ./lldb/gnu-install-dirs.patch 151 + ] 152 + # This is a stopgap solution if/until the macOS SDK used for x86_64 is 153 + # updated. 154 + # 155 + # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h` 156 + # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use 157 + # of this preprocessor symbol in `lldb` with its expansion. 158 + # 159 + # See here for some context: 160 + # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132 161 + ++ lib.optional ( 162 + stdenv.targetPlatform.isDarwin 163 + && !stdenv.targetPlatform.isAarch64 164 + && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0") 165 + ) ./lldb/cpu_subtype_arm64e_replacement.patch; 166 + inherit llvm_meta release_version; 167 }; 168 169 # Below, is the LLVM bootstrapping logic. It handles building a
-159
pkgs/development/compilers/llvm/13/lldb/default.nix
··· 1 - { lib, stdenv, llvm_meta 2 - , runCommand 3 - , src 4 - , cmake 5 - , zlib 6 - , ncurses 7 - , swig 8 - , which 9 - , libedit 10 - , libxml2 11 - , libllvm 12 - , libclang 13 - , python3 14 - , version 15 - , libobjc 16 - , xpc 17 - , Foundation 18 - , bootstrap_cmds 19 - , Carbon 20 - , Cocoa 21 - , lit 22 - , makeWrapper 23 - , darwin 24 - , enableManpages ? false 25 - }: 26 - 27 - stdenv.mkDerivation (rec { 28 - pname = "lldb"; 29 - inherit version; 30 - 31 - inherit src; 32 - sourceRoot = "source/${pname}"; 33 - 34 - patches = [ 35 - ./procfs.patch 36 - (runCommand "resource-dir.patch" { 37 - clangLibDir = "${libclang.lib}/lib"; 38 - } '' 39 - substitute '${./resource-dir.patch}' "$out" --subst-var clangLibDir 40 - '') 41 - ./gnu-install-dirs.patch 42 - ] 43 - # This is a stopgap solution if/until the macOS SDK used for x86_64 is 44 - # updated. 45 - # 46 - # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h` 47 - # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use 48 - # of this preprocessor symbol in `lldb` with its expansion. 49 - # 50 - # See here for some context: 51 - # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132 52 - ++ lib.optional ( 53 - stdenv.targetPlatform.isDarwin 54 - && !stdenv.targetPlatform.isAarch64 55 - && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0") 56 - ) ./cpu_subtype_arm64e_replacement.patch; 57 - 58 - 59 - outputs = [ "out" "lib" "dev" ]; 60 - 61 - nativeBuildInputs = [ 62 - cmake python3 which swig lit makeWrapper 63 - ] ++ lib.optionals enableManpages [ 64 - python3.pkgs.sphinx python3.pkgs.recommonmark 65 - ]; 66 - 67 - buildInputs = [ 68 - ncurses 69 - zlib 70 - libedit 71 - libxml2 72 - libllvm 73 - ] ++ lib.optionals stdenv.isDarwin [ 74 - libobjc 75 - xpc 76 - Foundation 77 - bootstrap_cmds 78 - Carbon 79 - Cocoa 80 - ]; 81 - 82 - hardeningDisable = [ "format" ]; 83 - 84 - cmakeFlags = [ 85 - "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" 86 - "-DLLVM_ENABLE_RTTI=OFF" 87 - "-DClang_DIR=${libclang.dev}/lib/cmake" 88 - "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" 89 - ] ++ lib.optionals stdenv.isDarwin [ 90 - "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" 91 - ] ++ lib.optionals (!stdenv.isDarwin) [ 92 - "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic 93 - ] ++ lib.optionals enableManpages [ 94 - "-DLLVM_ENABLE_SPHINX=ON" 95 - "-DSPHINX_OUTPUT_MAN=ON" 96 - "-DSPHINX_OUTPUT_HTML=OFF" 97 - ] ++ lib.optionals doCheck [ 98 - "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" 99 - "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" 100 - ]; 101 - 102 - doCheck = false; 103 - 104 - doInstallCheck = true; 105 - 106 - installCheckPhase = '' 107 - if [ ! -e "$lib/${python3.sitePackages}/lldb/_lldb.so" ] ; then 108 - echo "ERROR: python files not installed where expected!"; 109 - return 1; 110 - fi 111 - ''; 112 - 113 - postInstall = '' 114 - wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/ 115 - 116 - # Editor support 117 - # vscode: 118 - install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json 119 - mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 120 - ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 121 - ''; 122 - 123 - meta = llvm_meta // { 124 - homepage = "https://lldb.llvm.org/"; 125 - description = "A next-generation high-performance debugger"; 126 - longDescription = '' 127 - LLDB is a next generation, high-performance debugger. It is built as a set 128 - of reusable components which highly leverage existing libraries in the 129 - larger LLVM Project, such as the Clang expression parser and LLVM 130 - disassembler. 131 - ''; 132 - }; 133 - } // lib.optionalAttrs enableManpages { 134 - pname = "lldb-manpages"; 135 - 136 - buildPhase = '' 137 - make docs-lldb-man 138 - ''; 139 - 140 - propagatedBuildInputs = []; 141 - 142 - # manually install lldb man page 143 - installPhase = '' 144 - mkdir -p $out/share/man/man1 145 - install docs/man/lldb.1 -t $out/share/man/man1/ 146 - ''; 147 - 148 - postPatch = null; 149 - postInstall = null; 150 - 151 - outputs = [ "out" ]; 152 - 153 - doCheck = false; 154 - 155 - meta = llvm_meta // { 156 - broken = stdenv.isDarwin; 157 - description = "man pages for LLDB ${version}"; 158 - }; 159 - })
···
+30 -5
pkgs/development/compilers/llvm/14/default.nix
··· 135 inherit llvm_meta; 136 }; 137 138 - lldb = callPackage ./lldb { 139 - inherit llvm_meta; 140 - inherit (darwin) libobjc bootstrap_cmds; 141 - inherit (darwin.apple_sdk.libs) xpc; 142 - inherit (darwin.apple_sdk.frameworks) Foundation Carbon Cocoa; 143 }; 144 145 # Below, is the LLVM bootstrapping logic. It handles building a
··· 135 inherit llvm_meta; 136 }; 137 138 + lldb = callPackage ../common/lldb.nix { 139 + patches = 140 + let 141 + resourceDirPatch = callPackage ({ runCommand, libclang }: (runCommand "resource-dir.patch" 142 + { 143 + clangLibDir = "${libclang.lib}/lib"; 144 + } '' 145 + substitute '${./lldb/resource-dir.patch}' "$out" --subst-var clangLibDir 146 + '')) { }; 147 + in 148 + [ 149 + ./lldb/procfs.patch 150 + resourceDirPatch 151 + ./lldb/gnu-install-dirs.patch 152 + ] 153 + # This is a stopgap solution if/until the macOS SDK used for x86_64 is 154 + # updated. 155 + # 156 + # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h` 157 + # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use 158 + # of this preprocessor symbol in `lldb` with its expansion. 159 + # 160 + # See here for some context: 161 + # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132 162 + ++ lib.optional ( 163 + stdenv.targetPlatform.isDarwin 164 + && !stdenv.targetPlatform.isAarch64 165 + && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0") 166 + ) ./lldb/cpu_subtype_arm64e_replacement.patch; 167 + inherit llvm_meta release_version; 168 }; 169 170 # Below, is the LLVM bootstrapping logic. It handles building a
-167
pkgs/development/compilers/llvm/14/lldb/default.nix
··· 1 - { lib, stdenv, llvm_meta 2 - , runCommand 3 - , monorepoSrc 4 - , cmake 5 - , zlib 6 - , ncurses 7 - , swig 8 - , which 9 - , libedit 10 - , libxml2 11 - , libllvm 12 - , libclang 13 - , python3 14 - , version 15 - , libobjc 16 - , xpc 17 - , Foundation 18 - , bootstrap_cmds 19 - , Carbon 20 - , Cocoa 21 - , lit 22 - , makeWrapper 23 - , darwin 24 - , enableManpages ? false 25 - , lua5_3 26 - }: 27 - 28 - stdenv.mkDerivation (rec { 29 - pname = "lldb"; 30 - inherit version; 31 - 32 - src = runCommand "${pname}-src-${version}" {} '' 33 - mkdir -p "$out" 34 - cp -r ${monorepoSrc}/cmake "$out" 35 - cp -r ${monorepoSrc}/${pname} "$out" 36 - ''; 37 - 38 - sourceRoot = "${src.name}/${pname}"; 39 - 40 - patches = [ 41 - ./procfs.patch 42 - (runCommand "resource-dir.patch" { 43 - clangLibDir = "${libclang.lib}/lib"; 44 - } '' 45 - substitute '${./resource-dir.patch}' "$out" --subst-var clangLibDir 46 - '') 47 - ./gnu-install-dirs.patch 48 - ] 49 - # This is a stopgap solution if/until the macOS SDK used for x86_64 is 50 - # updated. 51 - # 52 - # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h` 53 - # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use 54 - # of this preprocessor symbol in `lldb` with its expansion. 55 - # 56 - # See here for some context: 57 - # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132 58 - ++ lib.optional ( 59 - stdenv.targetPlatform.isDarwin 60 - && !stdenv.targetPlatform.isAarch64 61 - && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0") 62 - ) ./cpu_subtype_arm64e_replacement.patch; 63 - 64 - outputs = [ "out" "lib" "dev" ]; 65 - 66 - nativeBuildInputs = [ 67 - cmake python3 which swig lit makeWrapper lua5_3 68 - ] ++ lib.optionals enableManpages [ 69 - python3.pkgs.sphinx python3.pkgs.recommonmark 70 - ]; 71 - 72 - buildInputs = [ 73 - ncurses 74 - zlib 75 - libedit 76 - libxml2 77 - libllvm 78 - ] ++ lib.optionals stdenv.isDarwin [ 79 - libobjc 80 - xpc 81 - Foundation 82 - bootstrap_cmds 83 - Carbon 84 - Cocoa 85 - ]; 86 - 87 - hardeningDisable = [ "format" ]; 88 - 89 - cmakeFlags = [ 90 - "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" 91 - "-DLLVM_ENABLE_RTTI=OFF" 92 - "-DClang_DIR=${libclang.dev}/lib/cmake" 93 - "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" 94 - ] ++ lib.optionals stdenv.isDarwin [ 95 - "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" 96 - ] ++ lib.optionals (!stdenv.isDarwin) [ 97 - "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic 98 - ] ++ lib.optionals enableManpages [ 99 - "-DLLVM_ENABLE_SPHINX=ON" 100 - "-DSPHINX_OUTPUT_MAN=ON" 101 - "-DSPHINX_OUTPUT_HTML=OFF" 102 - ] ++ lib.optionals doCheck [ 103 - "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" 104 - "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" 105 - ]; 106 - 107 - doCheck = false; 108 - 109 - doInstallCheck = true; 110 - 111 - installCheckPhase = '' 112 - if [ ! -e $lib/${python3.sitePackages}/lldb/_lldb*.so ] ; then 113 - echo "ERROR: python files not installed where expected!"; 114 - return 1; 115 - fi 116 - if [ ! -e "$lib/lib/lua/${lua5_3.luaversion}/lldb.so" ] ; then 117 - echo "ERROR: lua files not installed where expected!"; 118 - return 1; 119 - fi 120 - ''; 121 - 122 - postInstall = '' 123 - wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/ 124 - 125 - # Editor support 126 - # vscode: 127 - install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json 128 - mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 129 - ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 130 - ''; 131 - 132 - meta = llvm_meta // { 133 - homepage = "https://lldb.llvm.org/"; 134 - description = "A next-generation high-performance debugger"; 135 - longDescription = '' 136 - LLDB is a next generation, high-performance debugger. It is built as a set 137 - of reusable components which highly leverage existing libraries in the 138 - larger LLVM Project, such as the Clang expression parser and LLVM 139 - disassembler. 140 - ''; 141 - }; 142 - } // lib.optionalAttrs enableManpages { 143 - pname = "lldb-manpages"; 144 - 145 - buildPhase = '' 146 - make docs-lldb-man 147 - ''; 148 - 149 - propagatedBuildInputs = []; 150 - 151 - # manually install lldb man page 152 - installPhase = '' 153 - mkdir -p $out/share/man/man1 154 - install docs/man/lldb.1 -t $out/share/man/man1/ 155 - ''; 156 - 157 - postPatch = null; 158 - postInstall = null; 159 - 160 - outputs = [ "out" ]; 161 - 162 - doCheck = false; 163 - 164 - meta = llvm_meta // { 165 - description = "man pages for LLDB ${version}"; 166 - }; 167 - })
···
+30 -5
pkgs/development/compilers/llvm/15/default.nix
··· 183 inherit llvm_meta; 184 }; 185 186 - lldb = callPackage ./lldb { 187 - inherit llvm_meta; 188 - inherit (darwin) libobjc bootstrap_cmds; 189 - inherit (darwin.apple_sdk.libs) xpc; 190 - inherit (darwin.apple_sdk.frameworks) Foundation Carbon Cocoa; 191 }; 192 193 # Below, is the LLVM bootstrapping logic. It handles building a
··· 183 inherit llvm_meta; 184 }; 185 186 + lldb = callPackage ../common/lldb.nix { 187 + patches = 188 + let 189 + resourceDirPatch = callPackage ({ runCommand, libclang }: (runCommand "resource-dir.patch" 190 + { 191 + clangLibDir = "${libclang.lib}/lib"; 192 + } '' 193 + substitute '${./lldb/resource-dir.patch}' "$out" --subst-var clangLibDir 194 + '')) { }; 195 + in 196 + [ 197 + ./lldb/procfs.patch 198 + resourceDirPatch 199 + ./lldb/gnu-install-dirs.patch 200 + ] 201 + # This is a stopgap solution if/until the macOS SDK used for x86_64 is 202 + # updated. 203 + # 204 + # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h` 205 + # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use 206 + # of this preprocessor symbol in `lldb` with its expansion. 207 + # 208 + # See here for some context: 209 + # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132 210 + ++ lib.optional ( 211 + stdenv.targetPlatform.isDarwin 212 + && !stdenv.targetPlatform.isAarch64 213 + && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0") 214 + ) ./lldb/cpu_subtype_arm64e_replacement.patch; 215 + inherit llvm_meta release_version; 216 }; 217 218 # Below, is the LLVM bootstrapping logic. It handles building a
-186
pkgs/development/compilers/llvm/15/lldb/default.nix
··· 1 - { lib, stdenv, llvm_meta 2 - , runCommand 3 - , monorepoSrc 4 - , cmake 5 - , ninja 6 - , zlib 7 - , ncurses 8 - , swig 9 - , which 10 - , libedit 11 - , libxml2 12 - , libllvm 13 - , libclang 14 - , python3 15 - , version 16 - , libobjc 17 - , xpc 18 - , Foundation 19 - , bootstrap_cmds 20 - , Carbon 21 - , Cocoa 22 - , lit 23 - , makeWrapper 24 - , darwin 25 - , enableManpages ? false 26 - , lua5_3 27 - }: 28 - 29 - # TODO: we build the python bindings but don't expose them as a python package 30 - # TODO: expose the vscode extension? 31 - 32 - stdenv.mkDerivation (rec { 33 - pname = "lldb"; 34 - inherit version; 35 - 36 - src = runCommand "${pname}-src-${version}" {} '' 37 - mkdir -p "$out" 38 - cp -r ${monorepoSrc}/cmake "$out" 39 - cp -r ${monorepoSrc}/${pname} "$out" 40 - ''; 41 - 42 - sourceRoot = "${src.name}/${pname}"; 43 - 44 - patches = [ 45 - ./procfs.patch 46 - (runCommand "resource-dir.patch" { 47 - clangLibDir = "${libclang.lib}/lib"; 48 - } '' 49 - substitute '${./resource-dir.patch}' "$out" --subst-var clangLibDir 50 - '') 51 - ./gnu-install-dirs.patch 52 - ] 53 - # This is a stopgap solution if/until the macOS SDK used for x86_64 is 54 - # updated. 55 - # 56 - # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h` 57 - # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use 58 - # of this preprocessor symbol in `lldb` with its expansion. 59 - # 60 - # See here for some context: 61 - # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132 62 - ++ lib.optional ( 63 - stdenv.targetPlatform.isDarwin 64 - && !stdenv.targetPlatform.isAarch64 65 - && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0") 66 - ) ./cpu_subtype_arm64e_replacement.patch; 67 - 68 - outputs = [ "out" "lib" "dev" ]; 69 - 70 - nativeBuildInputs = [ 71 - cmake ninja python3 which swig lit makeWrapper lua5_3 72 - ] ++ lib.optionals enableManpages [ 73 - python3.pkgs.sphinx python3.pkgs.recommonmark 74 - ]; 75 - 76 - buildInputs = [ 77 - ncurses 78 - zlib 79 - libedit 80 - libxml2 81 - libllvm 82 - ] ++ lib.optionals stdenv.isDarwin [ 83 - libobjc 84 - xpc 85 - Foundation 86 - bootstrap_cmds 87 - Carbon 88 - Cocoa 89 - ] 90 - # The older libSystem used on x86_64 macOS is missing the 91 - # `<bsm/audit_session.h>` header which `lldb` uses. 92 - # 93 - # We copy this header over from macOS 10.12 SDK. 94 - # 95 - # See here for context: 96 - # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132 97 - ++ lib.optional ( 98 - stdenv.targetPlatform.isDarwin 99 - && !stdenv.targetPlatform.isAarch64 100 - ) ( 101 - runCommand "bsm-audit-session-header" { } '' 102 - install -Dm444 \ 103 - "${lib.getDev darwin.apple_sdk.sdk}/include/bsm/audit_session.h" \ 104 - "$out/include/bsm/audit_session.h" 105 - '' 106 - ); 107 - 108 - hardeningDisable = [ "format" ]; 109 - 110 - cmakeFlags = [ 111 - "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" 112 - "-DLLVM_ENABLE_RTTI=OFF" 113 - "-DClang_DIR=${libclang.dev}/lib/cmake" 114 - "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" 115 - ] ++ lib.optionals stdenv.isDarwin [ 116 - "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" 117 - ] ++ lib.optionals (!stdenv.isDarwin) [ 118 - "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic 119 - ] ++ lib.optionals enableManpages [ 120 - "-DLLVM_ENABLE_SPHINX=ON" 121 - "-DSPHINX_OUTPUT_MAN=ON" 122 - "-DSPHINX_OUTPUT_HTML=OFF" 123 - 124 - # docs reference `automodapi` but it's not added to the extensions list when 125 - # only building the manpages: 126 - # https://github.com/llvm/llvm-project/blob/af6ec9200b09039573d85e349496c4f5b17c3d7f/lldb/docs/conf.py#L54 127 - # 128 - # so, we just ignore the resulting errors 129 - "-DSPHINX_WARNINGS_AS_ERRORS=OFF" 130 - ] ++ lib.optionals doCheck [ 131 - "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" 132 - "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" 133 - ]; 134 - 135 - doCheck = false; 136 - 137 - installCheckPhase = '' 138 - if [ ! -e "$lib/${python3.sitePackages}/lldb/_lldb.so" ] ; then 139 - return 1; 140 - fi 141 - ''; 142 - 143 - postInstall = '' 144 - wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/ 145 - 146 - # Editor support 147 - # vscode: 148 - install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json 149 - mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 150 - ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 151 - ''; 152 - 153 - meta = llvm_meta // { 154 - homepage = "https://lldb.llvm.org/"; 155 - description = "A next-generation high-performance debugger"; 156 - longDescription = '' 157 - LLDB is a next generation, high-performance debugger. It is built as a set 158 - of reusable components which highly leverage existing libraries in the 159 - larger LLVM Project, such as the Clang expression parser and LLVM 160 - disassembler. 161 - ''; 162 - }; 163 - } // lib.optionalAttrs enableManpages { 164 - pname = "lldb-manpages"; 165 - 166 - ninjaFlags = [ "docs-lldb-man" ]; 167 - 168 - propagatedBuildInputs = []; 169 - 170 - # manually install lldb man page 171 - installPhase = '' 172 - mkdir -p $out/share/man/man1 173 - install docs/man/lldb.1 -t $out/share/man/man1/ 174 - ''; 175 - 176 - postPatch = null; 177 - postInstall = null; 178 - 179 - outputs = [ "out" ]; 180 - 181 - doCheck = false; 182 - 183 - meta = llvm_meta // { 184 - description = "man pages for LLDB ${version}"; 185 - }; 186 - })
···
+35 -5
pkgs/development/compilers/llvm/16/default.nix
··· 184 inherit llvm_meta; 185 }; 186 187 - lldb = callPackage ./lldb { 188 - inherit llvm_meta; 189 - inherit (darwin) libobjc bootstrap_cmds; 190 - inherit (darwin.apple_sdk.libs) xpc; 191 - inherit (darwin.apple_sdk.frameworks) Foundation Carbon Cocoa; 192 }; 193 194 # Below, is the LLVM bootstrapping logic. It handles building a
··· 184 inherit llvm_meta; 185 }; 186 187 + lldb = callPackage ../common/lldb.nix { 188 + src = callPackage ({ runCommand }: runCommand "lldb-src-${version}" {} '' 189 + mkdir -p "$out" 190 + cp -r ${monorepoSrc}/cmake "$out" 191 + cp -r ${monorepoSrc}/lldb "$out" 192 + '') { }; 193 + patches = 194 + let 195 + resourceDirPatch = callPackage ({ runCommand, libclang }: (runCommand "resource-dir.patch" 196 + { 197 + clangLibDir = "${libclang.lib}/lib"; 198 + } '' 199 + substitute '${./lldb/resource-dir.patch}' "$out" --subst-var clangLibDir 200 + '')) { }; 201 + in 202 + [ 203 + # FIXME: do we need this? ./procfs.patch 204 + resourceDirPatch 205 + ./lldb/gnu-install-dirs.patch 206 + ] 207 + # This is a stopgap solution if/until the macOS SDK used for x86_64 is 208 + # updated. 209 + # 210 + # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h` 211 + # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use 212 + # of this preprocessor symbol in `lldb` with its expansion. 213 + # 214 + # See here for some context: 215 + # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132 216 + ++ lib.optional ( 217 + stdenv.targetPlatform.isDarwin 218 + && !stdenv.targetPlatform.isAarch64 219 + && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0") 220 + ) ./lldb/cpu_subtype_arm64e_replacement.patch; 221 + inherit llvm_meta release_version; 222 }; 223 224 # Below, is the LLVM bootstrapping logic. It handles building a
-186
pkgs/development/compilers/llvm/16/lldb/default.nix
··· 1 - { lib, stdenv, llvm_meta 2 - , runCommand 3 - , monorepoSrc 4 - , cmake 5 - , ninja 6 - , zlib 7 - , ncurses 8 - , swig 9 - , which 10 - , libedit 11 - , libxml2 12 - , libllvm 13 - , libclang 14 - , python3 15 - , version 16 - , libobjc 17 - , xpc 18 - , Foundation 19 - , bootstrap_cmds 20 - , Carbon 21 - , Cocoa 22 - , lit 23 - , makeWrapper 24 - , darwin 25 - , enableManpages ? false 26 - , lua5_3 27 - }: 28 - 29 - # TODO: we build the python bindings but don't expose them as a python package 30 - # TODO: expose the vscode extension? 31 - 32 - stdenv.mkDerivation (rec { 33 - pname = "lldb"; 34 - inherit version; 35 - 36 - src = runCommand "${pname}-src-${version}" {} '' 37 - mkdir -p "$out" 38 - cp -r ${monorepoSrc}/cmake "$out" 39 - cp -r ${monorepoSrc}/${pname} "$out" 40 - ''; 41 - 42 - sourceRoot = "${src.name}/${pname}"; 43 - 44 - patches = [ 45 - # FIXME: do we need this? ./procfs.patch 46 - (runCommand "resource-dir.patch" { 47 - clangLibDir = "${libclang.lib}/lib"; 48 - } '' 49 - substitute '${./resource-dir.patch}' "$out" --subst-var clangLibDir 50 - '') 51 - ./gnu-install-dirs.patch 52 - ] 53 - # This is a stopgap solution if/until the macOS SDK used for x86_64 is 54 - # updated. 55 - # 56 - # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h` 57 - # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use 58 - # of this preprocessor symbol in `lldb` with its expansion. 59 - # 60 - # See here for some context: 61 - # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132 62 - ++ lib.optional ( 63 - stdenv.targetPlatform.isDarwin 64 - && !stdenv.targetPlatform.isAarch64 65 - && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0") 66 - ) ./cpu_subtype_arm64e_replacement.patch; 67 - 68 - outputs = [ "out" "lib" "dev" ]; 69 - 70 - nativeBuildInputs = [ 71 - cmake ninja python3 which swig lit makeWrapper lua5_3 72 - ] ++ lib.optionals enableManpages [ 73 - python3.pkgs.sphinx python3.pkgs.recommonmark 74 - ]; 75 - 76 - buildInputs = [ 77 - ncurses 78 - zlib 79 - libedit 80 - libxml2 81 - libllvm 82 - ] ++ lib.optionals stdenv.isDarwin [ 83 - libobjc 84 - xpc 85 - Foundation 86 - bootstrap_cmds 87 - Carbon 88 - Cocoa 89 - ] 90 - # The older libSystem used on x86_64 macOS is missing the 91 - # `<bsm/audit_session.h>` header which `lldb` uses. 92 - # 93 - # We copy this header over from macOS 10.12 SDK. 94 - # 95 - # See here for context: 96 - # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132 97 - ++ lib.optional ( 98 - stdenv.targetPlatform.isDarwin 99 - && !stdenv.targetPlatform.isAarch64 100 - ) ( 101 - runCommand "bsm-audit-session-header" { } '' 102 - install -Dm444 \ 103 - "${lib.getDev darwin.apple_sdk.sdk}/include/bsm/audit_session.h" \ 104 - "$out/include/bsm/audit_session.h" 105 - '' 106 - ); 107 - 108 - hardeningDisable = [ "format" ]; 109 - 110 - cmakeFlags = [ 111 - "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" 112 - "-DLLVM_ENABLE_RTTI=OFF" 113 - "-DClang_DIR=${libclang.dev}/lib/cmake" 114 - "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" 115 - ] ++ lib.optionals stdenv.isDarwin [ 116 - "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" 117 - ] ++ lib.optionals (!stdenv.isDarwin) [ 118 - "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic 119 - ] ++ lib.optionals enableManpages [ 120 - "-DLLVM_ENABLE_SPHINX=ON" 121 - "-DSPHINX_OUTPUT_MAN=ON" 122 - "-DSPHINX_OUTPUT_HTML=OFF" 123 - 124 - # docs reference `automodapi` but it's not added to the extensions list when 125 - # only building the manpages: 126 - # https://github.com/llvm/llvm-project/blob/af6ec9200b09039573d85e349496c4f5b17c3d7f/lldb/docs/conf.py#L54 127 - # 128 - # so, we just ignore the resulting errors 129 - "-DSPHINX_WARNINGS_AS_ERRORS=OFF" 130 - ] ++ lib.optionals doCheck [ 131 - "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" 132 - "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" 133 - ]; 134 - 135 - doCheck = false; 136 - 137 - installCheckPhase = '' 138 - if [ ! -e "$lib/${python3.sitePackages}/lldb/_lldb.so" ] ; then 139 - return 1; 140 - fi 141 - ''; 142 - 143 - postInstall = '' 144 - wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/ 145 - 146 - # Editor support 147 - # vscode: 148 - install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json 149 - mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 150 - ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 151 - ''; 152 - 153 - meta = llvm_meta // { 154 - homepage = "https://lldb.llvm.org/"; 155 - description = "A next-generation high-performance debugger"; 156 - longDescription = '' 157 - LLDB is a next generation, high-performance debugger. It is built as a set 158 - of reusable components which highly leverage existing libraries in the 159 - larger LLVM Project, such as the Clang expression parser and LLVM 160 - disassembler. 161 - ''; 162 - }; 163 - } // lib.optionalAttrs enableManpages { 164 - pname = "lldb-manpages"; 165 - 166 - ninjaFlags = [ "docs-lldb-man" ]; 167 - 168 - propagatedBuildInputs = []; 169 - 170 - # manually install lldb man page 171 - installPhase = '' 172 - mkdir -p $out/share/man/man1 173 - install docs/man/lldb.1 -t $out/share/man/man1/ 174 - ''; 175 - 176 - postPatch = null; 177 - postInstall = null; 178 - 179 - outputs = [ "out" ]; 180 - 181 - doCheck = false; 182 - 183 - meta = llvm_meta // { 184 - description = "man pages for LLDB ${version}"; 185 - }; 186 - })
···
+207
pkgs/development/compilers/llvm/common/lldb.nix
···
··· 1 + { lib 2 + , stdenv 3 + , llvm_meta 4 + , release_version 5 + , cmake 6 + , zlib 7 + , ncurses 8 + , swig 9 + , which 10 + , libedit 11 + , libxml2 12 + , libllvm 13 + , libclang 14 + , python3 15 + , version 16 + , darwin 17 + , lit 18 + , makeWrapper 19 + , lua5_3 20 + , ninja 21 + , runCommand 22 + , src ? null 23 + , monorepoSrc ? null 24 + , patches ? [ ] 25 + , enableManpages ? false 26 + }: 27 + 28 + let 29 + src' = 30 + if monorepoSrc != null then 31 + runCommand "lldb-src-${version}" { } '' 32 + mkdir -p "$out" 33 + cp -r ${monorepoSrc}/cmake "$out" 34 + cp -r ${monorepoSrc}/lldb "$out" 35 + '' else src; 36 + in 37 + 38 + stdenv.mkDerivation (rec { 39 + passthru.monorepoSrc = monorepoSrc; 40 + pname = "lldb"; 41 + inherit version; 42 + 43 + src = src'; 44 + inherit patches; 45 + 46 + outputs = [ "out" "lib" "dev" ]; 47 + 48 + sourceRoot = 49 + if lib.versionOlder release_version "13" then null 50 + else "${src.name}/${pname}"; 51 + 52 + nativeBuildInputs = [ 53 + cmake 54 + ] ++ lib.optionals (lib.versionAtLeast release_version "15") [ 55 + ninja 56 + ] ++ [ 57 + python3 58 + which 59 + swig 60 + lit 61 + makeWrapper 62 + ] ++ lib.optionals (lib.versionAtLeast release_version "14") [ 63 + lua5_3 64 + ] ++ lib.optionals enableManpages [ 65 + python3.pkgs.sphinx 66 + python3.pkgs.recommonmark 67 + ]; 68 + 69 + buildInputs = [ 70 + ncurses 71 + zlib 72 + libedit 73 + libxml2 74 + libllvm 75 + ] ++ lib.optionals stdenv.isDarwin [ 76 + darwin.libobjc 77 + darwin.apple_sdk.libs.xpc 78 + darwin.apple_sdk.frameworks.Foundation 79 + darwin.bootstrap_cmds 80 + darwin.apple_sdk.frameworks.Carbon 81 + darwin.apple_sdk.frameworks.Cocoa 82 + ] 83 + # The older libSystem used on x86_64 macOS is missing the 84 + # `<bsm/audit_session.h>` header which `lldb` uses. 85 + # 86 + # We copy this header over from macOS 10.12 SDK. 87 + # 88 + # See here for context: 89 + # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132 90 + ++ lib.optional ( 91 + stdenv.targetPlatform.isDarwin 92 + && !stdenv.targetPlatform.isAarch64 93 + && (lib.versionAtLeast release_version "15") 94 + ) ( 95 + runCommand "bsm-audit-session-header" { } '' 96 + install -Dm444 \ 97 + "${lib.getDev darwin.apple_sdk.sdk}/include/bsm/audit_session.h" \ 98 + "$out/include/bsm/audit_session.h" 99 + '' 100 + ); 101 + 102 + hardeningDisable = [ "format" ]; 103 + 104 + cmakeFlags = [ 105 + "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" 106 + "-DLLVM_ENABLE_RTTI=OFF" 107 + "-DClang_DIR=${libclang.dev}/lib/cmake" 108 + "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" 109 + ] ++ lib.optionals stdenv.isDarwin [ 110 + "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" 111 + ] ++ lib.optionals (!stdenv.isDarwin) [ 112 + "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic 113 + ] ++ lib.optionals enableManpages ([ 114 + "-DLLVM_ENABLE_SPHINX=ON" 115 + "-DSPHINX_OUTPUT_MAN=ON" 116 + "-DSPHINX_OUTPUT_HTML=OFF" 117 + ] ++ lib.optionals (lib.versionAtLeast release_version "15") [ 118 + # docs reference `automodapi` but it's not added to the extensions list when 119 + # only building the manpages: 120 + # https://github.com/llvm/llvm-project/blob/af6ec9200b09039573d85e349496c4f5b17c3d7f/lldb/docs/conf.py#L54 121 + # 122 + # so, we just ignore the resulting errors 123 + "-DSPHINX_WARNINGS_AS_ERRORS=OFF" 124 + ]) ++ lib.optionals doCheck [ 125 + "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" 126 + "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" 127 + ]; 128 + 129 + doCheck = false; 130 + 131 + # TODO: cleanup with mass-rebuild 132 + installCheckPhase = 133 + if ((lib.versions.major release_version) == "14") then '' 134 + if [ ! -e $lib/${python3.sitePackages}/lldb/_lldb*.so ] ; then 135 + echo "ERROR: python files not installed where expected!"; 136 + return 1; 137 + fi 138 + if [ ! -e "$lib/lib/lua/${lua5_3.luaversion}/lldb.so" ] ; then 139 + echo "ERROR: lua files not installed where expected!"; 140 + return 1; 141 + fi 142 + '' else if (((lib.versions.major release_version) == "15") || (lib.versions.major release_version) == "16") then '' 143 + if [ ! -e "$lib/${python3.sitePackages}/lldb/_lldb.so" ] ; then 144 + return 1; 145 + fi 146 + '' else '' 147 + if [ ! -e "$lib/${python3.sitePackages}/lldb/_lldb.so" ] ; then 148 + echo "ERROR: python files not installed where expected!"; 149 + return 1; 150 + fi 151 + ''; 152 + 153 + postInstall = '' 154 + wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/ 155 + 156 + # Editor support 157 + # vscode: 158 + install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json 159 + mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 160 + ln -s $out/bin/${if (lib.versionOlder release_version "12") then "llvm-vscode" else "lldb-vscode"} $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 161 + ''; 162 + 163 + meta = llvm_meta // { 164 + homepage = "https://lldb.llvm.org/"; 165 + description = "A next-generation high-performance debugger"; 166 + longDescription = '' 167 + LLDB is a next generation, high-performance debugger. It is built as a set 168 + of reusable components which highly leverage existing libraries in the 169 + larger LLVM Project, such as the Clang expression parser and LLVM 170 + disassembler. 171 + ''; 172 + # llvm <10 never built on aarch64-darwin since first introduction in nixpkgs 173 + broken = 174 + (lib.versionOlder release_version "11" && stdenv.isDarwin && stdenv.isAarch64) 175 + || (((lib.versions.major release_version) == "13") && stdenv.isDarwin); 176 + }; 177 + } // lib.optionalAttrs (lib.versionOlder release_version "15") { 178 + doInstallCheck = true; 179 + } // lib.optionalAttrs enableManpages { 180 + pname = "lldb-manpages"; 181 + 182 + buildPhase = 183 + if lib.versionOlder release_version "15" then '' 184 + make ${if (lib.versionOlder release_version "12") then "docs-man" else "docs-lldb-man"} 185 + '' else null; 186 + 187 + ninjaFlags = if lib.versionAtLeast release_version "15" then [ "docs-lldb-man" ] else null; 188 + 189 + propagatedBuildInputs = [ ]; 190 + 191 + # manually install lldb man page 192 + installPhase = '' 193 + mkdir -p $out/share/man/man1 194 + install docs/man/lldb.1 -t $out/share/man/man1/ 195 + ''; 196 + 197 + postPatch = null; 198 + postInstall = null; 199 + 200 + outputs = [ "out" ]; 201 + 202 + doCheck = false; 203 + 204 + meta = llvm_meta // { 205 + description = "man pages for LLDB ${version}"; 206 + }; 207 + })