bore: fix build on darwin

This commit is contained in:
Weijia Wang 2023-05-28 02:40:50 +03:00
parent 1a89cfae1f
commit 83a615f695

View file

@ -1,4 +1,4 @@
{ lib, stdenv, rustPlatform, fetchFromBitbucket, llvmPackages, Libsystem, SystemConfiguration, installShellFiles }: { lib, stdenv, rustPlatform, fetchFromBitbucket, Libsystem, SystemConfiguration, installShellFiles }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "bore"; pname = "bore";
@ -14,20 +14,21 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "1xlbfzmy0wjyz3jpr17r4ma4i79d9b32yqwwi10vrcjzr7vsyhmx"; cargoSha256 = "1xlbfzmy0wjyz3jpr17r4ma4i79d9b32yqwwi10vrcjzr7vsyhmx";
cargoBuildFlags = [ "-p" pname ]; cargoBuildFlags = [ "-p" pname ];
# error[E0793]: reference to packed field is unaligned
doCheck = !stdenv.isDarwin;
# FIXME cant test --all-targets and --doc in a single invocation # FIXME cant test --all-targets and --doc in a single invocation
cargoTestFlags = [ "--all-targets" "--workspace" ]; cargoTestFlags = [ "--all-targets" "--workspace" ];
checkFeatures = [ "std" ]; checkFeatures = [ "std" ];
nativeBuildInputs = [ installShellFiles ] nativeBuildInputs = [ installShellFiles ]
++ lib.optional stdenv.isDarwin llvmPackages.libclang; ++ lib.optional stdenv.isDarwin rustPlatform.bindgenHook;
buildInputs = lib.optionals stdenv.isDarwin [ buildInputs = lib.optionals stdenv.isDarwin [
Libsystem Libsystem
SystemConfiguration SystemConfiguration
]; ];
LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
postInstall = '' postInstall = ''
installManPage $src/bore/doc/bore.1 installManPage $src/bore/doc/bore.1
''; '';