63 lines
1.5 KiB
Nix
63 lines
1.5 KiB
Nix
{ stdenv, lib,
|
|
pkgconfig, cmake, ffmpeg, libdrm, libpulseaudio, xorg,
|
|
libcap, wayland, libopus, boost, openssl, libevdev, mesa,
|
|
fetchgit
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "sunehine";
|
|
version = "0.10.1";
|
|
|
|
src = fetchgit {
|
|
url = "https://github.com/loki-47-6F-64/sunshine.git";
|
|
rev = "v${version}";
|
|
sha256 = "1aw8bis5v7rb3ixl378gqm34rx3sja7pp5g6kjd9b0yvl1bgxai6";
|
|
deepClone = true;
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
pkgconfig cmake
|
|
];
|
|
|
|
buildInputs = [
|
|
wayland # Wayland
|
|
libdrm libcap # KMS
|
|
xorg.libxcb xorg.libX11 xorg.libXtst xorg.libXrandr xorg.libXfixes libevdev # X11
|
|
libopus libpulseaudio boost ffmpeg openssl # Common
|
|
];
|
|
|
|
propagatedBuildInputs = [ mesa ];
|
|
|
|
cmakeFlags = [
|
|
"-DSUNSHINE_ENABLE_X11=off"
|
|
"-DSUNSHINE_ENABLE_CUDA=off"
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
|
];
|
|
NIX_CFLAGS_COMPILE = "-Wformat";
|
|
|
|
patches = [ ./fuck.patch ];
|
|
|
|
preConfigure = ''
|
|
# Fix hardcoded path to libevdev
|
|
sed \
|
|
-e "s|/usr/include/libevdev-1.0|${libevdev}/include/libevdev-1.0|" \
|
|
-e "s|@@SUNSHINE_ASSETS_DIR@@|$out/share/sunshine|" \
|
|
--in-place CMakeLists.txt
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
mkdir -p $out/share/sunshine/
|
|
cp -r ../assets $out/share/sunshine/assets
|
|
mv sunshine $out/bin/sunshine
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Host for Moonlight Streaming Client ";
|
|
homepage = "https://github.com/loki-47-6F-64/sunshine";
|
|
license = licenses.gpl3;
|
|
maintainers = [ ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|