Revert bindgenHook workarounds

Fixed in https://github.com/NixOS/nixpkgs/pull/215060.

This reverts commit 365d739bca.
This reverts commit db443f1932.
This reverts commit 9869ab4a85.
This commit is contained in:
Zhaofeng Li 2023-03-21 18:45:34 -06:00
parent 1a3b6513b0
commit 63f64ee8c4
3 changed files with 2 additions and 25 deletions

View file

@ -8,7 +8,6 @@
{ stdenv
, lib
, craneLib
, llvmPackages
, rustPlatform
, runCommand
, writeReferencesToFile
@ -33,6 +32,7 @@ let
};
nativeBuildInputs = [
rustPlatform.bindgenHook
pkg-config
installShellFiles
];
@ -68,12 +68,6 @@ let
cargoExtraArgs = "-p attic-client -p attic-server";
# Temporary workaround for https://github.com/NixOS/nixpkgs/pull/207352#issuecomment-1418363441
preBuild = ''
export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib"
export BINDGEN_EXTRA_CLANG_ARGS="$(< ${llvmPackages.clang}/nix-support/cc-cflags) $(< ${llvmPackages.clang}/nix-support/libc-cflags) $(< ${llvmPackages.clang}/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"
'';
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
if [[ -f $out/bin/attic ]]; then
installShellCompletion --cmd attic \
@ -135,12 +129,6 @@ let
doCheck = true;
# Temporary workaround for https://github.com/NixOS/nixpkgs/pull/207352#issuecomment-1418363441
preBuild = ''
export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib"
export BINDGEN_EXTRA_CLANG_ARGS="$(< ${llvmPackages.clang}/nix-support/cc-cflags) $(< ${llvmPackages.clang}/nix-support/libc-cflags) $(< ${llvmPackages.clang}/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"
'';
buildPhaseCargoCommand = "";
checkPhaseCargoCommand = "cargoWithProfile test --no-run --message-format=json >cargo-test.json";
doInstallCargoArtifacts = false;

View file

@ -117,11 +117,6 @@
RUST_SRC_PATH = "${pkgs.rustPlatform.rustcSrc}/library";
ATTIC_DISTRIBUTOR = "dev";
shellHook = ''
export LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib"
export BINDGEN_EXTRA_CLANG_ARGS="$(< ${pkgs.llvmPackages.clang}/nix-support/cc-cflags) $(< ${pkgs.llvmPackages.clang}/nix-support/libc-cflags) $(< ${pkgs.llvmPackages.clang}/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"
'';
};
demo = pkgs.mkShell {

View file

@ -7,7 +7,6 @@
{ lib, stdenv, rustPlatform
, pkg-config
, installShellFiles
, llvmPackages
, nix
, boost
, darwin
@ -32,6 +31,7 @@ in rustPlatform.buildRustPackage rec {
};
nativeBuildInputs = [
rustPlatform.bindgenHook
pkg-config
installShellFiles
];
@ -50,12 +50,6 @@ in rustPlatform.buildRustPackage rec {
ATTIC_DISTRIBUTOR = "attic";
# Temporary workaround for https://github.com/NixOS/nixpkgs/pull/207352#issuecomment-1418363441
preBuild = ''
export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib"
export BINDGEN_EXTRA_CLANG_ARGS="$(< ${llvmPackages.clang}/nix-support/cc-cflags) $(< ${llvmPackages.clang}/nix-support/libc-cflags) $(< ${llvmPackages.clang}/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"
'';
# Recursive Nix is not stable yet
doCheck = false;