Unverified Commit 21a39d90 authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

yara-x: build and install C library (#381813)

parents aa865623 5030b608
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
{
  lib,
  rust,
  stdenv,
  fetchFromGitHub,
  rustPlatform,
  installShellFiles,
  cargo-c,
  testers,
  yara-x,
}:
@@ -24,9 +26,18 @@ rustPlatform.buildRustPackage rec {

  nativeBuildInputs = [
    installShellFiles
    cargo-c
  ];

  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
  postBuild = ''
    ${rust.envVars.setEnv} cargo cbuild --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget}
  '';

  postInstall =
    ''
      ${rust.envVars.setEnv} cargo cinstall --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget}
    ''
    + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
      installShellCompletion --cmd yr \
        --bash <($out/bin/yr completion bash) \
        --fish <($out/bin/yr completion fish) \