From 0ff027e0aebfc60db4a984dc7f2d2e760906d74d Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 30 Nov 2024 08:39:09 -0500 Subject: [PATCH 01/12] nufmt: use rustPlatform.bindgenHook --- pkgs/by-name/nu/nufmt/package.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/nu/nufmt/package.nix b/pkgs/by-name/nu/nufmt/package.nix index d13f2834c674..8c956cb82080 100644 --- a/pkgs/by-name/nu/nufmt/package.nix +++ b/pkgs/by-name/nu/nufmt/package.nix @@ -4,10 +4,9 @@ fetchFromGitHub, rustPlatform, apple-sdk_11, - llvmPackages, nix-update-script, - ... }: + rustPlatform.buildRustPackage { pname = "nufmt"; version = "0-unstable-2024-11-21"; @@ -19,12 +18,14 @@ rustPlatform.buildRustPackage { hash = "sha256-ideILLOawU6BNawmr4lqt2LGkf29wvlwQe9gqgdYRiI="; }; + nativeBuildInputs = [ + rustPlatform.bindgenHook + ]; + buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_11 ]; - env.LIBCLANG_PATH = lib.optionalString stdenv.cc.isClang "${lib.getLib llvmPackages.libclang}/lib"; - cargoHash = "sha256-MHZlXmHAYIiaB6Isutqjrh45jppRzTZRSE3VqzpFBBA="; passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; }; From b20782310e89b55f4b11e2471b261fe7df64fdc0 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 30 Nov 2024 08:39:49 -0500 Subject: [PATCH 02/12] neothesia: use rustPlatform.bindgenHook --- pkgs/by-name/ne/neothesia/package.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkgs/by-name/ne/neothesia/package.nix b/pkgs/by-name/ne/neothesia/package.nix index f474a82d2bf1..26f09906f40d 100644 --- a/pkgs/by-name/ne/neothesia/package.nix +++ b/pkgs/by-name/ne/neothesia/package.nix @@ -35,6 +35,7 @@ rustPlatform.buildRustPackage { pkg-config llvmPackages.clang makeWrapper + rustPlatform.bindgenHook ]; cargoLock = { @@ -54,10 +55,6 @@ rustPlatform.buildRustPackage { install -Dm 644 flatpak/com.github.polymeilex.neothesia.png $out/share/icons/hicolor/256x256/apps/com.github.polymeilex.neothesia.png ''; - env = { - LIBCLANG_PATH = "${lib.getLib llvmPackages.libclang}/lib"; - }; - meta = { description = "Flashy Synthesia Like Software For Linux, Windows and macOS"; homepage = "https://github.com/PolyMeilex/Neothesia"; From c56b3749469d9e3de67307ab048c358b2de99d59 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 30 Nov 2024 08:40:30 -0500 Subject: [PATCH 03/12] libkrun: use rustPlatform.bindgenHook --- pkgs/by-name/li/libkrun/package.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/by-name/li/libkrun/package.nix b/pkgs/by-name/li/libkrun/package.nix index 61da30b13478..3b84fb6a9847 100644 --- a/pkgs/by-name/li/libkrun/package.nix +++ b/pkgs/by-name/li/libkrun/package.nix @@ -40,6 +40,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ llvmPackages.clang rustPlatform.cargoSetupHook + rustPlatform.bindgenHook cargo rustc ] ++ lib.optional (sevVariant || withGpu) pkg-config; @@ -52,8 +53,6 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional withSound pipewire ++ lib.optional sevVariant openssl; - env.LIBCLANG_PATH = "${lib.getLib llvmPackages.clang-unwrapped}/lib/libclang.so"; - makeFlags = [ "PREFIX=${placeholder "out"}" ] ++ lib.optional withGpu "GPU=1" From b88f9fe294723f9b111c9b949d419f56a776b433 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 30 Nov 2024 08:41:11 -0500 Subject: [PATCH 04/12] caligula: use rustPlatform.bindgenHook --- pkgs/by-name/ca/caligula/package.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/ca/caligula/package.nix b/pkgs/by-name/ca/caligula/package.nix index b423fa01beca..da88e59572f1 100644 --- a/pkgs/by-name/ca/caligula/package.nix +++ b/pkgs/by-name/ca/caligula/package.nix @@ -19,10 +19,9 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-ma7JVbWSiKfkCXCDwA8DFm2+KPrWR+8nSdgGSqehNg8="; - env = { - LIBCLANG_PATH = "${lib.getLib llvmPackages.libclang}/lib"; - }; - + nativeBuildInputs = [ + rustPlatform.bindgenHook + ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin ( with darwin.apple_sdk.frameworks; [ From f9b5b1f98c36b5a44a2ac0d2bf9c4df096b3a9f4 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 30 Nov 2024 08:41:38 -0500 Subject: [PATCH 05/12] caligula: use new darwin sdk pattern --- pkgs/by-name/ca/caligula/package.nix | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pkgs/by-name/ca/caligula/package.nix b/pkgs/by-name/ca/caligula/package.nix index da88e59572f1..75cc0534138c 100644 --- a/pkgs/by-name/ca/caligula/package.nix +++ b/pkgs/by-name/ca/caligula/package.nix @@ -1,9 +1,6 @@ { lib , rustPlatform , fetchFromGitHub -, llvmPackages -, stdenv -, darwin }: rustPlatform.buildRustPackage rec { @@ -23,15 +20,6 @@ rustPlatform.buildRustPackage rec { rustPlatform.bindgenHook ]; - buildInputs = lib.optionals stdenv.hostPlatform.isDarwin ( - with darwin.apple_sdk.frameworks; [ - Cocoa - IOKit - Foundation - DiskArbitration - ] - ); - RUSTFLAGS = "--cfg tracing_unstable"; meta = with lib; { From bbd2561c7fe75915afb5791acf184cd801451f8e Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 30 Nov 2024 08:42:31 -0500 Subject: [PATCH 06/12] fedimint: use rustPlatform.bindgenHook --- pkgs/by-name/fe/fedimint/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/fe/fedimint/package.nix b/pkgs/by-name/fe/fedimint/package.nix index a3d2d5c7f97a..179227a49c12 100644 --- a/pkgs/by-name/fe/fedimint/package.nix +++ b/pkgs/by-name/fe/fedimint/package.nix @@ -40,6 +40,7 @@ buildRustPackage rec { pkg-config clang (lib.getLib libclang) + rustPlatform.bindgenHook ]; buildInputs = [ @@ -79,7 +80,6 @@ buildRustPackage rec { PROTOC = "${buildPackages.protobuf}/bin/protoc"; PROTOC_INCLUDE = "${protobuf}/include"; OPENSSL_DIR = openssl.dev; - LIBCLANG_PATH = "${lib.getLib libclang}/lib"; FEDIMINT_BUILD_FORCE_GIT_HASH = "0000000000000000000000000000000000000000"; From 52614866fd27628245f961fedcc1e963316537da Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 30 Nov 2024 08:43:10 -0500 Subject: [PATCH 07/12] servo: use rustPlatform.bindgenHook --- pkgs/by-name/se/servo/package.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/by-name/se/servo/package.nix b/pkgs/by-name/se/servo/package.nix index af6fb95d9585..26bac5cf3487 100644 --- a/pkgs/by-name/se/servo/package.nix +++ b/pkgs/by-name/se/servo/package.nix @@ -110,6 +110,7 @@ rustPlatform.buildRustPackage { perl pkg-config python3 + rustPlatform.bindgenHook taplo which yasm @@ -142,8 +143,6 @@ rustPlatform.buildRustPackage { --prefix LD_LIBRARY_PATH : ${runtimePaths} ''; - LIBCLANG_PATH = "${lib.getLib llvmPackages.libclang}/lib"; - meta = { description = "The embeddable, independent, memory-safe, modular, parallel web rendering engine"; homepage = "https://servo.org"; From 682cf788e1c70474ea4e15caa87951ea367fcd69 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 30 Nov 2024 08:43:54 -0500 Subject: [PATCH 08/12] scx.rustscheds: use rustPlatform.bindgenHook --- pkgs/os-specific/linux/scx/scx_rustscheds.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/scx/scx_rustscheds.nix b/pkgs/os-specific/linux/scx/scx_rustscheds.nix index a5601cd4fcc1..3600735f31d6 100644 --- a/pkgs/os-specific/linux/scx/scx_rustscheds.nix +++ b/pkgs/os-specific/linux/scx/scx_rustscheds.nix @@ -25,6 +25,7 @@ rustPlatform.buildRustPackage { nativeBuildInputs = [ pkg-config llvmPackages.clang + rustPlatform.bindgenHook ]; buildInputs = [ elfutils @@ -33,7 +34,6 @@ rustPlatform.buildRustPackage { ]; env = { - LIBCLANG_PATH = "${lib.getLib llvmPackages.libclang}/lib"; BPF_CLANG = lib.getExe llvmPackages.clang; BPF_EXTRA_CFLAGS_PRE_INCL = lib.concatStringsSep " " [ "-I${scx.cscheds.dev}/libbpf/src/usr/include" From f826c0aafaea04387c9dee913149aff5801b479b Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 30 Nov 2024 08:51:52 -0500 Subject: [PATCH 09/12] fedimint: drop various darwin workarounds, use new sdk pattern --- pkgs/by-name/fe/fedimint/package.nix | 26 ++------------------------ pkgs/top-level/all-packages.nix | 4 ---- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/pkgs/by-name/fe/fedimint/package.nix b/pkgs/by-name/fe/fedimint/package.nix index 179227a49c12..246375fff66a 100644 --- a/pkgs/by-name/fe/fedimint/package.nix +++ b/pkgs/by-name/fe/fedimint/package.nix @@ -1,28 +1,13 @@ { lib , buildPackages -, clang , fetchFromGitHub -, libclang -, libiconv -, llvmPackages_12 , openssl , pkg-config , protobuf , rustPlatform -, stdenv -, Security -, SystemConfiguration }: -let - # Rust rocksdb bindings have C++ compilation/linking errors on Darwin when using newer clang - # Forcing it to clang 12 fixes the issue. - buildRustPackage = - if stdenv.hostPlatform.isDarwin then - rustPlatform.buildRustPackage.override { stdenv = llvmPackages_12.stdenv; } - else - rustPlatform.buildRustPackage; -in -buildRustPackage rec { + +rustPlatform.buildRustPackage rec { pname = "fedimint"; version = "0.4.4"; @@ -38,18 +23,11 @@ buildRustPackage rec { nativeBuildInputs = [ protobuf pkg-config - clang - (lib.getLib libclang) rustPlatform.bindgenHook ]; buildInputs = [ openssl - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - Security - libiconv - Security - SystemConfiguration ]; outputs = [ "out" "fedimintCli" "fedimint" "gateway" "gatewayCli" "devimint" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e6d18c1a3849..99b261a4a55e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2345,10 +2345,6 @@ with pkgs; fdroidcl = pkgs.callPackage ../development/mobile/fdroidcl { }; - fedimint = callPackage ../by-name/fe/fedimint/package.nix { - inherit (darwin.apple_sdk.frameworks) Security SystemConfiguration; - }; - flowgger = callPackage ../tools/misc/flowgger { inherit (darwin.apple_sdk.frameworks) CoreServices; }; From 1a827e70dc1bf6a86d63893e858a0c8a3e5ee657 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 30 Nov 2024 08:52:29 -0500 Subject: [PATCH 10/12] libkrun: drop clang from nativeBuildInputs --- pkgs/by-name/li/libkrun/package.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/by-name/li/libkrun/package.nix b/pkgs/by-name/li/libkrun/package.nix index 3b84fb6a9847..92a03018ca42 100644 --- a/pkgs/by-name/li/libkrun/package.nix +++ b/pkgs/by-name/li/libkrun/package.nix @@ -11,7 +11,6 @@ , pipewire , virglrenderer , libkrunfw -, llvmPackages , rustc , withGpu ? false , withSound ? false @@ -38,7 +37,6 @@ stdenv.mkDerivation (finalAttrs: { }; nativeBuildInputs = [ - llvmPackages.clang rustPlatform.cargoSetupHook rustPlatform.bindgenHook cargo From 23a60b0966dddc90f5b8610efc63055360ae1a94 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 30 Nov 2024 08:52:59 -0500 Subject: [PATCH 11/12] neothesia: drop clang from nativeBuildInputs --- pkgs/by-name/ne/neothesia/package.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/by-name/ne/neothesia/package.nix b/pkgs/by-name/ne/neothesia/package.nix index 26f09906f40d..2b918d74cac1 100644 --- a/pkgs/by-name/ne/neothesia/package.nix +++ b/pkgs/by-name/ne/neothesia/package.nix @@ -6,7 +6,6 @@ , alsa-lib , wayland , makeWrapper -, llvmPackages , libxkbcommon , vulkan-loader , xorg @@ -33,7 +32,6 @@ rustPlatform.buildRustPackage { nativeBuildInputs = [ pkg-config - llvmPackages.clang makeWrapper rustPlatform.bindgenHook ]; From 3c352ba05186f705a27c641d73e7a23f4583d271 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 30 Nov 2024 08:53:40 -0500 Subject: [PATCH 12/12] scx.rustscheds: drop clang from nativeBuildInputs --- pkgs/os-specific/linux/scx/scx_rustscheds.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/os-specific/linux/scx/scx_rustscheds.nix b/pkgs/os-specific/linux/scx/scx_rustscheds.nix index 3600735f31d6..1502f6fbb352 100644 --- a/pkgs/os-specific/linux/scx/scx_rustscheds.nix +++ b/pkgs/os-specific/linux/scx/scx_rustscheds.nix @@ -24,7 +24,6 @@ rustPlatform.buildRustPackage { nativeBuildInputs = [ pkg-config - llvmPackages.clang rustPlatform.bindgenHook ]; buildInputs = [