Skip to content

Commit 5a7a681

Browse files
authored
treewide: use rustPlatform.bindgenHook (#360427)
2 parents 08061fd + 3c352ba commit 5a7a681

File tree

8 files changed

+15
-63
lines changed

8 files changed

+15
-63
lines changed

pkgs/by-name/ca/caligula/package.nix

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{ lib
22
, rustPlatform
33
, fetchFromGitHub
4-
, llvmPackages
5-
, stdenv
6-
, darwin
74
}:
85

96
rustPlatform.buildRustPackage rec {
@@ -19,19 +16,9 @@ rustPlatform.buildRustPackage rec {
1916

2017
cargoHash = "sha256-ma7JVbWSiKfkCXCDwA8DFm2+KPrWR+8nSdgGSqehNg8=";
2118

22-
env = {
23-
LIBCLANG_PATH = "${lib.getLib llvmPackages.libclang}/lib";
24-
};
25-
26-
27-
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin (
28-
with darwin.apple_sdk.frameworks; [
29-
Cocoa
30-
IOKit
31-
Foundation
32-
DiskArbitration
33-
]
34-
);
19+
nativeBuildInputs = [
20+
rustPlatform.bindgenHook
21+
];
3522

3623
RUSTFLAGS = "--cfg tracing_unstable";
3724

pkgs/by-name/fe/fedimint/package.nix

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
11
{ lib
22
, buildPackages
3-
, clang
43
, fetchFromGitHub
5-
, libclang
6-
, libiconv
7-
, llvmPackages_12
84
, openssl
95
, pkg-config
106
, protobuf
117
, rustPlatform
12-
, stdenv
13-
, Security
14-
, SystemConfiguration
158
}:
16-
let
17-
# Rust rocksdb bindings have C++ compilation/linking errors on Darwin when using newer clang
18-
# Forcing it to clang 12 fixes the issue.
19-
buildRustPackage =
20-
if stdenv.hostPlatform.isDarwin then
21-
rustPlatform.buildRustPackage.override { stdenv = llvmPackages_12.stdenv; }
22-
else
23-
rustPlatform.buildRustPackage;
24-
in
25-
buildRustPackage rec {
9+
10+
rustPlatform.buildRustPackage rec {
2611
pname = "fedimint";
2712
version = "0.4.4";
2813

@@ -38,17 +23,11 @@ buildRustPackage rec {
3823
nativeBuildInputs = [
3924
protobuf
4025
pkg-config
41-
clang
42-
(lib.getLib libclang)
26+
rustPlatform.bindgenHook
4327
];
4428

4529
buildInputs = [
4630
openssl
47-
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
48-
Security
49-
libiconv
50-
Security
51-
SystemConfiguration
5231
];
5332

5433
outputs = [ "out" "fedimintCli" "fedimint" "gateway" "gatewayCli" "devimint" ];
@@ -79,7 +58,6 @@ buildRustPackage rec {
7958
PROTOC = "${buildPackages.protobuf}/bin/protoc";
8059
PROTOC_INCLUDE = "${protobuf}/include";
8160
OPENSSL_DIR = openssl.dev;
82-
LIBCLANG_PATH = "${lib.getLib libclang}/lib";
8361

8462
FEDIMINT_BUILD_FORCE_GIT_HASH = "0000000000000000000000000000000000000000";
8563

pkgs/by-name/li/libkrun/package.nix

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
, pipewire
1212
, virglrenderer
1313
, libkrunfw
14-
, llvmPackages
1514
, rustc
1615
, withGpu ? false
1716
, withSound ? false
@@ -38,8 +37,8 @@ stdenv.mkDerivation (finalAttrs: {
3837
};
3938

4039
nativeBuildInputs = [
41-
llvmPackages.clang
4240
rustPlatform.cargoSetupHook
41+
rustPlatform.bindgenHook
4342
cargo
4443
rustc
4544
] ++ lib.optional (sevVariant || withGpu) pkg-config;
@@ -52,8 +51,6 @@ stdenv.mkDerivation (finalAttrs: {
5251
++ lib.optional withSound pipewire
5352
++ lib.optional sevVariant openssl;
5453

55-
env.LIBCLANG_PATH = "${lib.getLib llvmPackages.clang-unwrapped}/lib/libclang.so";
56-
5754
makeFlags = [
5855
"PREFIX=${placeholder "out"}"
5956
] ++ lib.optional withGpu "GPU=1"

pkgs/by-name/ne/neothesia/package.nix

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
, alsa-lib
77
, wayland
88
, makeWrapper
9-
, llvmPackages
109
, libxkbcommon
1110
, vulkan-loader
1211
, xorg
@@ -33,8 +32,8 @@ rustPlatform.buildRustPackage {
3332

3433
nativeBuildInputs = [
3534
pkg-config
36-
llvmPackages.clang
3735
makeWrapper
36+
rustPlatform.bindgenHook
3837
];
3938

4039
cargoLock = {
@@ -54,10 +53,6 @@ rustPlatform.buildRustPackage {
5453
install -Dm 644 flatpak/com.github.polymeilex.neothesia.png $out/share/icons/hicolor/256x256/apps/com.github.polymeilex.neothesia.png
5554
'';
5655

57-
env = {
58-
LIBCLANG_PATH = "${lib.getLib llvmPackages.libclang}/lib";
59-
};
60-
6156
meta = {
6257
description = "Flashy Synthesia Like Software For Linux, Windows and macOS";
6358
homepage = "https://github.com/PolyMeilex/Neothesia";

pkgs/by-name/nu/nufmt/package.nix

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
fetchFromGitHub,
55
rustPlatform,
66
apple-sdk_11,
7-
llvmPackages,
87
nix-update-script,
9-
...
108
}:
9+
1110
rustPlatform.buildRustPackage {
1211
pname = "nufmt";
1312
version = "0-unstable-2024-11-21";
@@ -19,12 +18,14 @@ rustPlatform.buildRustPackage {
1918
hash = "sha256-ideILLOawU6BNawmr4lqt2LGkf29wvlwQe9gqgdYRiI=";
2019
};
2120

21+
nativeBuildInputs = [
22+
rustPlatform.bindgenHook
23+
];
24+
2225
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
2326
apple-sdk_11
2427
];
2528

26-
env.LIBCLANG_PATH = lib.optionalString stdenv.cc.isClang "${lib.getLib llvmPackages.libclang}/lib";
27-
2829
cargoHash = "sha256-MHZlXmHAYIiaB6Isutqjrh45jppRzTZRSE3VqzpFBBA=";
2930

3031
passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };

pkgs/by-name/se/servo/package.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ rustPlatform.buildRustPackage {
110110
perl
111111
pkg-config
112112
python3
113+
rustPlatform.bindgenHook
113114
taplo
114115
which
115116
yasm
@@ -142,8 +143,6 @@ rustPlatform.buildRustPackage {
142143
--prefix LD_LIBRARY_PATH : ${runtimePaths}
143144
'';
144145

145-
LIBCLANG_PATH = "${lib.getLib llvmPackages.libclang}/lib";
146-
147146
meta = {
148147
description = "The embeddable, independent, memory-safe, modular, parallel web rendering engine";
149148
homepage = "https://servo.org";

pkgs/os-specific/linux/scx/scx_rustscheds.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ rustPlatform.buildRustPackage {
2424

2525
nativeBuildInputs = [
2626
pkg-config
27-
llvmPackages.clang
27+
rustPlatform.bindgenHook
2828
];
2929
buildInputs = [
3030
elfutils
@@ -33,7 +33,6 @@ rustPlatform.buildRustPackage {
3333
];
3434

3535
env = {
36-
LIBCLANG_PATH = "${lib.getLib llvmPackages.libclang}/lib";
3736
BPF_CLANG = lib.getExe llvmPackages.clang;
3837
BPF_EXTRA_CFLAGS_PRE_INCL = lib.concatStringsSep " " [
3938
"-I${scx.cscheds.dev}/libbpf/src/usr/include"

pkgs/top-level/all-packages.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2345,10 +2345,6 @@ with pkgs;
23452345

23462346
fdroidcl = pkgs.callPackage ../development/mobile/fdroidcl { };
23472347

2348-
fedimint = callPackage ../by-name/fe/fedimint/package.nix {
2349-
inherit (darwin.apple_sdk.frameworks) Security SystemConfiguration;
2350-
};
2351-
23522348
flowgger = callPackage ../tools/misc/flowgger {
23532349
inherit (darwin.apple_sdk.frameworks) CoreServices;
23542350
};

0 commit comments

Comments
 (0)