forked from pontaoski/Challah
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.nix
54 lines (47 loc) · 1.14 KB
/
build.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
{ rev
, stdenv
, lib
, wrapQtAppsHook
, makeWrapper
, protobuf
, libsForQt5
, gst_all_1
, qbs
, cmake
, pkg-config
, json-glib
, harmony-protocol
, protoc-gen-hrpc
}: stdenv.mkDerivation {
pname = "challah";
version = builtins.substring 0 8 rev;
buildInputs =
[ protobuf json-glib harmony-protocol protoc-gen-hrpc ]
++ (with gst_all_1; [ gst-plugins-bad gst-plugins-base gstreamer ])
++ (with libsForQt5; [ full kirigami2 ]);
nativeBuildInputs = [ wrapQtAppsHook makeWrapper qbs cmake pkg-config ];
src = builtins.fetchGit {
inherit rev;
url = "https://github.com/harmony-development/Challah.git";
submodules = true;
allRefs = true;
};
preConfigure = ''
export HOME=/tmp/challah-tmp-build-home/
mkdir -p $HOME
'';
configurePhase = ''
runHook preConfigure
qbs setup-toolchains --detect
qbs resolve profile:gcc products.HarmonyProtocol.protocolPath:"${harmony-protocol}/include/harmony-protocols"
'';
buildPhase = ''
qbs build
'';
installPhase = ''
mkdir -p $out
qbs install --install-root $out
mv $out/usr/local/* $out
rm -r $out/usr $out/bin/Challah.debug
'';
}