feat: Added stuff
This commit is contained in:
29
flake.nix
29
flake.nix
@@ -88,25 +88,41 @@
|
||||
".hpp"
|
||||
".cpp"
|
||||
".cc"
|
||||
".mnn"
|
||||
".onnx"
|
||||
];
|
||||
in
|
||||
lib.cleanSourceWith {
|
||||
filter = sourceFilters;
|
||||
src = ./.;
|
||||
};
|
||||
commonArgs =
|
||||
commonArgs = let
|
||||
ort_static = pkgs.onnxruntime.overrideAttrs (old: {
|
||||
cmakeFlags =
|
||||
old.cmakeFlags
|
||||
++ [
|
||||
"-Donnxruntime_BUILD_SHARED_LIB=OFF"
|
||||
"-Donnxruntime_BUILD_STATIC_LIB=ON"
|
||||
];
|
||||
});
|
||||
in
|
||||
{
|
||||
inherit src;
|
||||
pname = name;
|
||||
stdenv = p: p.clangStdenv;
|
||||
doCheck = false;
|
||||
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
|
||||
ORT_LIB_LOCATION = "${ort_static}";
|
||||
ORT_ENV_SYSTEM_LIB_LOCATION = "${ort_static}/lib";
|
||||
# ORT_ENV_PREFER_DYNAMIC_LINK = true;
|
||||
nativeBuildInputs = with pkgs; [
|
||||
cmake
|
||||
pkg-config
|
||||
];
|
||||
buildInputs = with pkgs;
|
||||
[onnxruntime]
|
||||
[
|
||||
# onnxruntime
|
||||
]
|
||||
++ (lib.optionals pkgs.stdenv.isDarwin [
|
||||
libiconv
|
||||
apple-sdk_13
|
||||
@@ -160,9 +176,11 @@
|
||||
inherit cargoArtifacts;
|
||||
}
|
||||
// {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
installShellFiles
|
||||
];
|
||||
nativeBuildInputs = with pkgs;
|
||||
commonArgs.nativeBuildInputs
|
||||
++ [
|
||||
installShellFiles
|
||||
];
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd ${name} \
|
||||
--bash <($out/bin/${name} completions bash) \
|
||||
@@ -189,6 +207,7 @@
|
||||
cmake
|
||||
mnn
|
||||
cargo-make
|
||||
hyperfine
|
||||
]
|
||||
++ (lib.optionals pkgs.stdenv.isDarwin [
|
||||
apple-sdk_13
|
||||
|
||||
Reference in New Issue
Block a user