-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathdefault.nix
42 lines (41 loc) · 1.22 KB
/
default.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
{
pkgs ? import <nixpkgs> { },
debug ? false,
}:
let
src = ./.;
deps = import ./nix/deps.nix { inherit pkgs; };
kimeVersion = builtins.readFile ./VERSION;
testArgs = if debug then "" else "--release";
inherit (pkgs) llvmPackages_18 rustPlatform qt5;
in
llvmPackages_18.stdenv.mkDerivation {
name = "kime";
inherit src;
buildInputs = deps.kimeBuildInputs;
nativeBuildInputs = deps.kimeNativeBuildInputs ++ [ rustPlatform.cargoSetupHook ];
version = kimeVersion;
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
#hash = "0000000000000000000000000000000000000000000000000000";
hash = "sha256-2MG6xigiKdvQX8PR457d6AXswTRPRJBPERvZqemjv24=";
};
LIBCLANG_PATH = "${llvmPackages_18.libclang.lib}/lib";
dontUseCmakeConfigure = true;
dontWrapQtApps = true;
buildPhase = if debug then "bash scripts/build.sh -ad" else "bash scripts/build.sh -ar";
installPhase = ''
KIME_BIN_DIR=bin \
KIME_INSTALL_HEADER=1 \
KIME_INCLUDE_DIR=include \
KIME_ICON_DIR=share/icons \
KIME_LIB_DIR=lib \
KIME_DOC_DIR=share/doc/kime \
KIME_QT5_DIR=lib/qt-${qt5.qtbase.version} \
bash scripts/install.sh "$out"
'';
doCheck = true;
checkPhase = ''
cargo test ${testArgs}
'';
}