···134134 inherit llvm_meta;
135135 };
136136137137- lldb = callPackage ./lldb {
138138- inherit llvm_meta;
139139- inherit (darwin) libobjc bootstrap_cmds;
140140- inherit (darwin.apple_sdk.libs) xpc;
141141- inherit (darwin.apple_sdk.frameworks) Foundation Carbon Cocoa;
137137+ lldb = callPackage ../common/lldb.nix {
138138+ patches =
139139+ let
140140+ resourceDirPatch = callPackage ({ runCommand, libclang }: (runCommand "resource-dir.patch"
141141+ {
142142+ clangLibDir = "${libclang.lib}/lib";
143143+ } ''
144144+ substitute '${./lldb/resource-dir.patch}' "$out" --subst-var clangLibDir
145145+ '')) { };
146146+ in
147147+ [
148148+ ./lldb/procfs.patch
149149+ resourceDirPatch
150150+ ./lldb/gnu-install-dirs.patch
151151+ ]
152152+ # This is a stopgap solution if/until the macOS SDK used for x86_64 is
153153+ # updated.
154154+ #
155155+ # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h`
156156+ # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use
157157+ # of this preprocessor symbol in `lldb` with its expansion.
158158+ #
159159+ # See here for some context:
160160+ # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132
161161+ ++ lib.optional (
162162+ stdenv.targetPlatform.isDarwin
163163+ && !stdenv.targetPlatform.isAarch64
164164+ && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0")
165165+ ) ./lldb/cpu_subtype_arm64e_replacement.patch;
166166+ inherit llvm_meta release_version;
142167 };
143168144169 # Below, is the LLVM bootstrapping logic. It handles building a
···11-{ lib, stdenv, llvm_meta
22-, runCommand
33-, src
44-, cmake
55-, zlib
66-, ncurses
77-, swig
88-, which
99-, libedit
1010-, libxml2
1111-, libllvm
1212-, libclang
1313-, python3
1414-, version
1515-, libobjc
1616-, xpc
1717-, Foundation
1818-, bootstrap_cmds
1919-, Carbon
2020-, Cocoa
2121-, lit
2222-, makeWrapper
2323-, darwin
2424-, enableManpages ? false
2525-}:
2626-2727-stdenv.mkDerivation (rec {
2828- pname = "lldb";
2929- inherit version;
3030-3131- inherit src;
3232- sourceRoot = "source/${pname}";
3333-3434- patches = [
3535- ./procfs.patch
3636- (runCommand "resource-dir.patch" {
3737- clangLibDir = "${libclang.lib}/lib";
3838- } ''
3939- substitute '${./resource-dir.patch}' "$out" --subst-var clangLibDir
4040- '')
4141- ./gnu-install-dirs.patch
4242- ]
4343- # This is a stopgap solution if/until the macOS SDK used for x86_64 is
4444- # updated.
4545- #
4646- # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h`
4747- # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use
4848- # of this preprocessor symbol in `lldb` with its expansion.
4949- #
5050- # See here for some context:
5151- # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132
5252- ++ lib.optional (
5353- stdenv.targetPlatform.isDarwin
5454- && !stdenv.targetPlatform.isAarch64
5555- && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0")
5656- ) ./cpu_subtype_arm64e_replacement.patch;
5757-5858-5959- outputs = [ "out" "lib" "dev" ];
6060-6161- nativeBuildInputs = [
6262- cmake python3 which swig lit makeWrapper
6363- ] ++ lib.optionals enableManpages [
6464- python3.pkgs.sphinx python3.pkgs.recommonmark
6565- ];
6666-6767- buildInputs = [
6868- ncurses
6969- zlib
7070- libedit
7171- libxml2
7272- libllvm
7373- ] ++ lib.optionals stdenv.isDarwin [
7474- libobjc
7575- xpc
7676- Foundation
7777- bootstrap_cmds
7878- Carbon
7979- Cocoa
8080- ];
8181-8282- hardeningDisable = [ "format" ];
8383-8484- cmakeFlags = [
8585- "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}"
8686- "-DLLVM_ENABLE_RTTI=OFF"
8787- "-DClang_DIR=${libclang.dev}/lib/cmake"
8888- "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit"
8989- ] ++ lib.optionals stdenv.isDarwin [
9090- "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON"
9191- ] ++ lib.optionals (!stdenv.isDarwin) [
9292- "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
9393- ] ++ lib.optionals enableManpages [
9494- "-DLLVM_ENABLE_SPHINX=ON"
9595- "-DSPHINX_OUTPUT_MAN=ON"
9696- "-DSPHINX_OUTPUT_HTML=OFF"
9797- ] ++ lib.optionals doCheck [
9898- "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
9999- "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++"
100100- ];
101101-102102- doCheck = false;
103103-104104- doInstallCheck = true;
105105-106106- installCheckPhase = ''
107107- if [ ! -e "$lib/${python3.sitePackages}/lldb/_lldb.so" ] ; then
108108- echo "ERROR: python files not installed where expected!";
109109- return 1;
110110- fi
111111- '';
112112-113113- postInstall = ''
114114- wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/
115115-116116- # Editor support
117117- # vscode:
118118- install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json
119119- mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
120120- ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
121121- '';
122122-123123- meta = llvm_meta // {
124124- homepage = "https://lldb.llvm.org/";
125125- description = "A next-generation high-performance debugger";
126126- longDescription = ''
127127- LLDB is a next generation, high-performance debugger. It is built as a set
128128- of reusable components which highly leverage existing libraries in the
129129- larger LLVM Project, such as the Clang expression parser and LLVM
130130- disassembler.
131131- '';
132132- };
133133-} // lib.optionalAttrs enableManpages {
134134- pname = "lldb-manpages";
135135-136136- buildPhase = ''
137137- make docs-lldb-man
138138- '';
139139-140140- propagatedBuildInputs = [];
141141-142142- # manually install lldb man page
143143- installPhase = ''
144144- mkdir -p $out/share/man/man1
145145- install docs/man/lldb.1 -t $out/share/man/man1/
146146- '';
147147-148148- postPatch = null;
149149- postInstall = null;
150150-151151- outputs = [ "out" ];
152152-153153- doCheck = false;
154154-155155- meta = llvm_meta // {
156156- broken = stdenv.isDarwin;
157157- description = "man pages for LLDB ${version}";
158158- };
159159-})
+30-5
pkgs/development/compilers/llvm/14/default.nix
···135135 inherit llvm_meta;
136136 };
137137138138- lldb = callPackage ./lldb {
139139- inherit llvm_meta;
140140- inherit (darwin) libobjc bootstrap_cmds;
141141- inherit (darwin.apple_sdk.libs) xpc;
142142- inherit (darwin.apple_sdk.frameworks) Foundation Carbon Cocoa;
138138+ lldb = callPackage ../common/lldb.nix {
139139+ patches =
140140+ let
141141+ resourceDirPatch = callPackage ({ runCommand, libclang }: (runCommand "resource-dir.patch"
142142+ {
143143+ clangLibDir = "${libclang.lib}/lib";
144144+ } ''
145145+ substitute '${./lldb/resource-dir.patch}' "$out" --subst-var clangLibDir
146146+ '')) { };
147147+ in
148148+ [
149149+ ./lldb/procfs.patch
150150+ resourceDirPatch
151151+ ./lldb/gnu-install-dirs.patch
152152+ ]
153153+ # This is a stopgap solution if/until the macOS SDK used for x86_64 is
154154+ # updated.
155155+ #
156156+ # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h`
157157+ # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use
158158+ # of this preprocessor symbol in `lldb` with its expansion.
159159+ #
160160+ # See here for some context:
161161+ # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132
162162+ ++ lib.optional (
163163+ stdenv.targetPlatform.isDarwin
164164+ && !stdenv.targetPlatform.isAarch64
165165+ && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0")
166166+ ) ./lldb/cpu_subtype_arm64e_replacement.patch;
167167+ inherit llvm_meta release_version;
143168 };
144169145170 # Below, is the LLVM bootstrapping logic. It handles building a
···11-{ lib, stdenv, llvm_meta
22-, runCommand
33-, monorepoSrc
44-, cmake
55-, zlib
66-, ncurses
77-, swig
88-, which
99-, libedit
1010-, libxml2
1111-, libllvm
1212-, libclang
1313-, python3
1414-, version
1515-, libobjc
1616-, xpc
1717-, Foundation
1818-, bootstrap_cmds
1919-, Carbon
2020-, Cocoa
2121-, lit
2222-, makeWrapper
2323-, darwin
2424-, enableManpages ? false
2525-, lua5_3
2626-}:
2727-2828-stdenv.mkDerivation (rec {
2929- pname = "lldb";
3030- inherit version;
3131-3232- src = runCommand "${pname}-src-${version}" {} ''
3333- mkdir -p "$out"
3434- cp -r ${monorepoSrc}/cmake "$out"
3535- cp -r ${monorepoSrc}/${pname} "$out"
3636- '';
3737-3838- sourceRoot = "${src.name}/${pname}";
3939-4040- patches = [
4141- ./procfs.patch
4242- (runCommand "resource-dir.patch" {
4343- clangLibDir = "${libclang.lib}/lib";
4444- } ''
4545- substitute '${./resource-dir.patch}' "$out" --subst-var clangLibDir
4646- '')
4747- ./gnu-install-dirs.patch
4848- ]
4949- # This is a stopgap solution if/until the macOS SDK used for x86_64 is
5050- # updated.
5151- #
5252- # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h`
5353- # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use
5454- # of this preprocessor symbol in `lldb` with its expansion.
5555- #
5656- # See here for some context:
5757- # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132
5858- ++ lib.optional (
5959- stdenv.targetPlatform.isDarwin
6060- && !stdenv.targetPlatform.isAarch64
6161- && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0")
6262- ) ./cpu_subtype_arm64e_replacement.patch;
6363-6464- outputs = [ "out" "lib" "dev" ];
6565-6666- nativeBuildInputs = [
6767- cmake python3 which swig lit makeWrapper lua5_3
6868- ] ++ lib.optionals enableManpages [
6969- python3.pkgs.sphinx python3.pkgs.recommonmark
7070- ];
7171-7272- buildInputs = [
7373- ncurses
7474- zlib
7575- libedit
7676- libxml2
7777- libllvm
7878- ] ++ lib.optionals stdenv.isDarwin [
7979- libobjc
8080- xpc
8181- Foundation
8282- bootstrap_cmds
8383- Carbon
8484- Cocoa
8585- ];
8686-8787- hardeningDisable = [ "format" ];
8888-8989- cmakeFlags = [
9090- "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}"
9191- "-DLLVM_ENABLE_RTTI=OFF"
9292- "-DClang_DIR=${libclang.dev}/lib/cmake"
9393- "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit"
9494- ] ++ lib.optionals stdenv.isDarwin [
9595- "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON"
9696- ] ++ lib.optionals (!stdenv.isDarwin) [
9797- "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
9898- ] ++ lib.optionals enableManpages [
9999- "-DLLVM_ENABLE_SPHINX=ON"
100100- "-DSPHINX_OUTPUT_MAN=ON"
101101- "-DSPHINX_OUTPUT_HTML=OFF"
102102- ] ++ lib.optionals doCheck [
103103- "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
104104- "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++"
105105- ];
106106-107107- doCheck = false;
108108-109109- doInstallCheck = true;
110110-111111- installCheckPhase = ''
112112- if [ ! -e $lib/${python3.sitePackages}/lldb/_lldb*.so ] ; then
113113- echo "ERROR: python files not installed where expected!";
114114- return 1;
115115- fi
116116- if [ ! -e "$lib/lib/lua/${lua5_3.luaversion}/lldb.so" ] ; then
117117- echo "ERROR: lua files not installed where expected!";
118118- return 1;
119119- fi
120120- '';
121121-122122- postInstall = ''
123123- wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/
124124-125125- # Editor support
126126- # vscode:
127127- install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json
128128- mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
129129- ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
130130- '';
131131-132132- meta = llvm_meta // {
133133- homepage = "https://lldb.llvm.org/";
134134- description = "A next-generation high-performance debugger";
135135- longDescription = ''
136136- LLDB is a next generation, high-performance debugger. It is built as a set
137137- of reusable components which highly leverage existing libraries in the
138138- larger LLVM Project, such as the Clang expression parser and LLVM
139139- disassembler.
140140- '';
141141- };
142142-} // lib.optionalAttrs enableManpages {
143143- pname = "lldb-manpages";
144144-145145- buildPhase = ''
146146- make docs-lldb-man
147147- '';
148148-149149- propagatedBuildInputs = [];
150150-151151- # manually install lldb man page
152152- installPhase = ''
153153- mkdir -p $out/share/man/man1
154154- install docs/man/lldb.1 -t $out/share/man/man1/
155155- '';
156156-157157- postPatch = null;
158158- postInstall = null;
159159-160160- outputs = [ "out" ];
161161-162162- doCheck = false;
163163-164164- meta = llvm_meta // {
165165- description = "man pages for LLDB ${version}";
166166- };
167167-})
+30-5
pkgs/development/compilers/llvm/15/default.nix
···183183 inherit llvm_meta;
184184 };
185185186186- lldb = callPackage ./lldb {
187187- inherit llvm_meta;
188188- inherit (darwin) libobjc bootstrap_cmds;
189189- inherit (darwin.apple_sdk.libs) xpc;
190190- inherit (darwin.apple_sdk.frameworks) Foundation Carbon Cocoa;
186186+ lldb = callPackage ../common/lldb.nix {
187187+ patches =
188188+ let
189189+ resourceDirPatch = callPackage ({ runCommand, libclang }: (runCommand "resource-dir.patch"
190190+ {
191191+ clangLibDir = "${libclang.lib}/lib";
192192+ } ''
193193+ substitute '${./lldb/resource-dir.patch}' "$out" --subst-var clangLibDir
194194+ '')) { };
195195+ in
196196+ [
197197+ ./lldb/procfs.patch
198198+ resourceDirPatch
199199+ ./lldb/gnu-install-dirs.patch
200200+ ]
201201+ # This is a stopgap solution if/until the macOS SDK used for x86_64 is
202202+ # updated.
203203+ #
204204+ # The older 10.12 SDK used on x86_64 as of this writing has a `mach/machine.h`
205205+ # header that does not define `CPU_SUBTYPE_ARM64E` so we replace the one use
206206+ # of this preprocessor symbol in `lldb` with its expansion.
207207+ #
208208+ # See here for some context:
209209+ # https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132
210210+ ++ lib.optional (
211211+ stdenv.targetPlatform.isDarwin
212212+ && !stdenv.targetPlatform.isAarch64
213213+ && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0")
214214+ ) ./lldb/cpu_subtype_arm64e_replacement.patch;
215215+ inherit llvm_meta release_version;
191216 };
192217193218 # Below, is the LLVM bootstrapping logic. It handles building a