forked from rgerganov/shanocast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcast_receiver.nix
54 lines (53 loc) · 1.11 KB
/
cast_receiver.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
{ stdenv
, darwin
, lib
, ninja
, gn
, pkg-config
, python3
, ffmpeg
, SDL2
, src
}:
stdenv.mkDerivation {
name = "shanocast";
inherit src;
NIX_CFLAGS_COMPILE =
if stdenv.isLinux
then
(toString [ "-Wno-error=maybe-uninitialized" "-Wno-error=stringop-overflow" "-Wno-error=ignored-attributes" ])
else
(toString ["-Wno-error=uninitialized"]);
ninjaFlags = [ "cast_receiver" ];
prePatch = ''
substituteInPlace build/config/sysroot.gni --replace 'sysroot_platform = "bullseye"' ""
substituteInPlace build/config/BUILD.gn --replace '--target=aarch64-linux-gnu' ""
'';
gnFlags = [
"is_clang=${lib.boolToString stdenv.cc.isClang}"
"cast_allow_developer_certificate=true"
"have_ffmpeg=true"
"have_libsdl2=true"
];
installPhase = ''
mkdir -p $out/bin
mv cast_receiver $out/bin/shanocast
'';
patches = [
./shanocast.patch
];
buildInputs = [
ffmpeg
SDL2
] ++ lib.optionals stdenv.isDarwin [
darwin.IOKit
];
nativeBuildInputs = [
gn
ninja
pkg-config
python3
] ++ lib.optionals stdenv.isDarwin [
darwin.cctools
];
}