depot/third_party/nixpkgs/pkgs/development/tools/bpf-linker/default.nix
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

43 lines
1.1 KiB
Nix

{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, llvmPackages_14
, zlib
, ncurses
, libxml2
}:
rustPlatform.buildRustPackage rec {
pname = "bpf-linker";
version = "0.9.4";
src = fetchFromGitHub {
owner = "aya-rs";
repo = pname;
rev = "v${version}";
hash = "sha256-jYuBk78aGQLUeNF6d6kjGPuMxEF22XJquHcs23WVGm0=";
};
cargoHash = "sha256-X8EVpOxDHwE/wj/gly/wdZ6tsrMrz3kkDe9gEPbk6iw=";
buildNoDefaultFeatures = true;
buildFeatures = [ "system-llvm" ];
nativeBuildInputs = [ llvmPackages_14.llvm ];
buildInputs = [ zlib ncurses libxml2 ];
# fails with: couldn't find crate `core` with expected target triple bpfel-unknown-none
# rust-src and `-Z build-std=core` are required to properly run the tests
doCheck = false;
meta = with lib; {
description = "Simple BPF static linker";
homepage = "https://github.com/aya-rs/bpf-linker";
license = with licenses; [ asl20 mit ];
maintainers = with maintainers; [ nickcao ];
# llvm-sys crate locates llvm by calling llvm-config
# which is not available when cross compiling
broken = stdenv.buildPlatform != stdenv.hostPlatform;
};
}