-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathpackage.nix
More file actions
59 lines (49 loc) · 1.4 KB
/
package.nix
File metadata and controls
59 lines (49 loc) · 1.4 KB
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
{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
openssl,
onnxruntime,
stdenv,
darwinMinVersionHook,
}:
rustPlatform.buildRustPackage {
pname = "ck";
version = "0.7.4";
src = fetchFromGitHub {
owner = "BeaconBay";
repo = "ck";
tag = "0.7.4";
hash = "sha256-fUD/YeOMy8+oM1UA4clqto0i3gSZkyRuhxBnNb0KYTI=";
};
cargoHash = "sha256-ULuvrXV7+RsaHouuE2MuOWvR0KERkovGY8TVBeDIkjg=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [
openssl
onnxruntime
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
(darwinMinVersionHook "11.0")
];
cargoBuildFlags = [ "--package=ck-search" ];
# Tests require onnxruntime at runtime via @rpath
doCheck = false;
env = {
# Use system onnxruntime instead of downloading binaries
ORT_LIB_LOCATION = "${lib.getLib onnxruntime}/lib";
ORT_PREFER_DYNAMIC_LINK = "1";
};
postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
install_name_tool -add_rpath "${lib.getLib onnxruntime}/lib" $out/bin/ck
'';
passthru.category = "Utilities";
meta = with lib; {
description = "Local first semantic and hybrid BM25 grep / search tool for use by AI and humans!";
homepage = "https://github.com/BeaconBay/ck";
changelog = "https://github.com/BeaconBay/ck/releases/tag/${version}";
license = licenses.mit;
sourceProvenance = with sourceTypes; [ fromSource ];
mainProgram = "ck";
};
}