forked from replit/rfbproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrfbproxy.nix
45 lines (40 loc) · 1.3 KB
/
rfbproxy.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
{ stdenv, openssl, libpulseaudio, protobuf, lame, libopus, git, runCommand
, copyPathToStore, rev, pkg-config, lib, defaultCrateOverrides, buildRustCrate
, buildPackages, fetchurl }@pkgs:
let
generatedBuild = import ./Cargo.nix {
inherit pkgs;
buildRustCrateForPkgs = pkgs:
pkgs.buildRustCrate.override {
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
"opus-sys" = attrs: {
nativeBuildInputs = [ pkg-config ];
buildInputs = [ libopus ];
};
"libpulse-sys" = attrs: {
nativeBuildInputs = [ pkg-config ];
buildInputs = [ libpulseaudio ];
};
"libpulse-simple-sys" = attrs: {
nativeBuildInputs = [ pkg-config ];
buildInputs = [ libpulseaudio ];
};
rfbproxy = attrs: {
buildInputs = [ openssl protobuf lame ];
nativeBuildInputs = [ pkg-config ];
# needed for internal protobuf c wrapper library
PROTOC = "${protobuf}/bin/protoc";
PROTOC_INCLUDE = "${protobuf}/include";
};
};
};
};
crate2nix = generatedBuild.rootCrate.build;
in stdenv.mkDerivation {
pname = "rfbproxy";
version = rev;
src = crate2nix;
installPhase = ''
cp -r ${crate2nix} $out
'';
}