-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathflake.nix
71 lines (68 loc) · 2.05 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
description = "april-asr flake";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-onnxruntime114.url = "github:nixos/nixpkgs/c7d48290f9da479dcab26eac5db6299739c595c2";
};
outputs = {
self,
nixpkgs,
nixpkgs-onnxruntime114,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
# TODO: remove once https://github.com/NixOS/nixpkgs/pull/226734 is merged
(
final: prev: {
onnxruntime = nixpkgs-onnxruntime114.legacyPackages.${prev.system}.onnxruntime;
}
)
];
};
inherit (pkgs) lib;
inherit (pkgs.stdenv.hostPlatform) isDarwin;
in {
packages = rec {
onnxruntime_1_14 =
if isDarwin
then pkgs.onnxruntime
else
(pkgs.onnxruntime.overrideAttrs
(final: {
buildInputs = final.buildInputs ++ [pkgs.protobuf];
}))
.override {
pythonSupport = false;
useOneDNN = false;
};
april-asr = pkgs.stdenv.mkDerivation {
src = ./.;
name = "april-asr";
nativeBuildInputs = with pkgs; [
cmake
pkg-config
];
buildInputs = [onnxruntime_1_14];
outputs = ["out" "dev"];
meta = with lib; {
description = "Speech-to-text library in C";
homepage = "https://github.com/abb128/april-asr";
license = licenses.gpl3;
};
};
default = april-asr;
};
devShells.default = pkgs.mkShell {
inherit (self.packages.${system}.default) buildInputs nativeBuildInputs;
shellHook = ''
export LD_LIBRARY_PATH=${self.packages.${system}.onnxruntime_1_14}/lib
'';
};
}
);
}