Commit 83a615f6 authored by Weijia Wang's avatar Weijia Wang
Browse files

bore: fix build on darwin

parent 1a89cfae
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
{ lib, stdenv, rustPlatform, fetchFromBitbucket, llvmPackages, Libsystem, SystemConfiguration, installShellFiles }:
{ lib, stdenv, rustPlatform, fetchFromBitbucket, Libsystem, SystemConfiguration, installShellFiles }:

rustPlatform.buildRustPackage rec {
  pname = "bore";
@@ -14,20 +14,21 @@ rustPlatform.buildRustPackage rec {
  cargoSha256 = "1xlbfzmy0wjyz3jpr17r4ma4i79d9b32yqwwi10vrcjzr7vsyhmx";
  cargoBuildFlags = [ "-p" pname ];

  # error[E0793]: reference to packed field is unaligned
  doCheck = !stdenv.isDarwin;

  # FIXME can’t test --all-targets and --doc in a single invocation
  cargoTestFlags = [ "--all-targets" "--workspace" ];
  checkFeatures = [ "std" ];

  nativeBuildInputs = [ installShellFiles ]
    ++ lib.optional stdenv.isDarwin llvmPackages.libclang;
    ++ lib.optional stdenv.isDarwin rustPlatform.bindgenHook;

  buildInputs = lib.optionals stdenv.isDarwin [
    Libsystem
    SystemConfiguration
  ];

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

  postInstall = ''
    installManPage $src/bore/doc/bore.1
  '';