Skip to content

Commit

Permalink
work-around NixOS/nixpkgs#298859
Browse files Browse the repository at this point in the history
  • Loading branch information
vlaci committed Mar 25, 2024
1 parent 6bb577e commit 844ea29
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions pyperscan.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
inputs:

{ lib
, callPackage
, stdenv
, makeRustPlatform
, rustPlatform
Expand All @@ -14,6 +15,7 @@ inputs:
, hyperscan
, vectorscan
, python3
, util-linux
, ruff
, vendorHyperscan ? false
, vendorVectorscan ? false
Expand Down Expand Up @@ -98,12 +100,16 @@ let
(optionals vendorHyperscan [ "-F hyperscan" ])
++ (optionals (vendorVectorscan) [ "-F vectorscan" ]);

nativeBuildInputs = with rustPlatform; [
bindgenHook
cargoSetupHook
(maturinBuildHook.override { pkgsHostTarget = { inherit maturin cargo rustc; }; })
] ++ optional (vendor && stdenv.isLinux) util-linux
++ optional coverage cargo-llvm-cov;
nativeBuildInputs =
let
rustHooks = callPackage "${inputs.nixpkgs}/pkgs/build-support/rust/hooks" { };
in
[
rustPlatform.cargoSetupHook
rustPlatform.bindgenHook
(rustHooks.maturinBuildHook.override { pkgsHostTarget = { inherit maturin cargo rustc; }; })
] ++ optional (vendor && stdenv.isLinux) util-linux
++ optional coverage cargo-llvm-cov;

preConfigure = optionalString coverage ''
source <(cargo llvm-cov show-env --export-prefix)
Expand Down

0 comments on commit 844ea29

Please sign in to comment.