Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIBCLANG_PATH hook #67725

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pkgs/applications/version-management/pijul/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ rustPlatform.buildRustPackage rec {
};

nativeBuildInputs = [ pkgconfig clang ];
bulidInputs = [ libclang ];

postInstall = ''
mkdir -p $out/share/{bash-completion/completions,zsh/site-functions,fish/vendor_completions.d}
Expand All @@ -18,8 +19,6 @@ rustPlatform.buildRustPackage rec {
$out/bin/pijul generate-completions --fish > $out/share/fish/vendor_completions.d/pijul.fish
'';

LIBCLANG_PATH = libclang + "/lib";

buildInputs = [ openssl libsodium nettle libclang ] ++ stdenv.lib.optionals stdenv.isDarwin
(with darwin.apple_sdk.frameworks; [ CoreServices Security ]);

Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/compilers/llvm/7/clang/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ let

outputs = [ "out" "lib" "python" ];

setupHook = ../../clang-setup-hook.sh;

# Clang expects to find LLVMgold in its own prefix
postInstall = ''
if [ -e ${llvm}/lib/LLVMgold.so ]; then
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/compilers/llvm/8/clang/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ let
./compiler-rt-baremetal.patch
];

setupHook = ../../clang-setup-hook.sh;

postPatch = ''
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \
-e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/compilers/llvm/clang-setup-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export LIBCLANG_PATH="@lib@/lib"
2 changes: 0 additions & 2 deletions pkgs/development/interpreters/wasmtime/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [ python cmake clang ];
buildInputs = [ llvmPackages.libclang ];

LIBCLANG_PATH = "${llvmPackages.libclang}/lib";

meta = with lib; {
description = "Standalone JIT-style runtime for WebAsssembly, using Cranelift";
homepage = https://github.com/CraneStation/wasmtime;
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/tools/rq/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ buildRustPackage rec {
buildInputs = [ llvmPackages.clang-unwrapped v8 ];

configurePhase = ''
export LIBCLANG_PATH="${llvmPackages.clang-unwrapped}/lib"
export V8_SOURCE="${v8}"
'';

Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/tools/rust/bindgen/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ rustPlatform.buildRustPackage rec {

propagatedBuildInputs = [ clang ]; # to populate NIX_CXXSTDLIB_COMPILE

configurePhase = ''
export LIBCLANG_PATH="${libclang}/lib"
'';

postInstall = ''
mv $out/bin/{bindgen,.bindgen-wrapped};
substituteAll ${./wrapper.sh} $out/bin/bindgen
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/tools/rust/cargo-expand/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ rustPlatform.buildRustPackage rec {
buildInputs = [ llvmPackages.libclang ]
++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;

LIBCLANG_PATH = "${llvmPackages.libclang}/lib";

meta = with stdenv.lib; {
description = "A utility and Cargo subcommand designed to let people expand macros in their Rust source code";
homepage = https://github.com/dtolnay/cargo-expand;
Expand Down
8 changes: 2 additions & 6 deletions pkgs/tools/backup/rdedup/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@ rustPlatform.buildRustPackage rec {
./v3.1.1-fix-Cargo.lock.patch
];

nativeBuildInputs = [ pkgconfig llvmPackages.libclang clang_39 ];
buildInputs = [ openssl libsodium lzma ]
nativeBuildInputs = [ pkgconfig clang_39 ];
buildInputs = [ openssl libsodium lzma llvmPackages.libclang ]
++ (stdenv.lib.optional stdenv.isDarwin Security);

configurePhase = ''
export LIBCLANG_PATH="${llvmPackages.libclang}/lib"
'';

meta = with stdenv.lib; {
description = "Data deduplication with compression and public key encryption";
homepage = https://github.com/dpc/rdedup;
Expand Down
4 changes: 1 addition & 3 deletions pkgs/tools/security/sequoia/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ rustPlatform.buildRustPackage rec {
cargo
rustc
git
llvmPackages.libclang
llvmPackages.clang
ensureNewerSourcesForZipFilesHook
] ++
Expand All @@ -42,6 +41,7 @@ rustPlatform.buildRustPackage rec {
sqlite
nettle
capnproto
llvmPackages.libclang
]
++ lib.optionals pythonSupport [ pythonPackages.python pythonPackages.cffi ]
++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]
Expand All @@ -55,8 +55,6 @@ rustPlatform.buildRustPackage rec {
"build-release"
];

LIBCLANG_PATH = "${llvmPackages.libclang}/lib";

postPatch = ''
# otherwise, the check fails because we delete the `.git` in the unpack phase
substituteInPlace openpgp-ffi/Makefile \
Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7386,6 +7386,7 @@ in
};

clang = llvmPackages.clang;
libclang = llvmPackages.libclang;
clang-manpages = llvmPackages.clang-manpages;

clang-sierraHack = clang.override {
Expand Down