Merge pull request #224152 from devusb/sunshine
This commit is contained in:
commit
e473a34365
|
@ -3,6 +3,7 @@
|
||||||
, callPackage
|
, callPackage
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, fetchurl
|
, fetchurl
|
||||||
|
, fetchpatch
|
||||||
, autoPatchelfHook
|
, autoPatchelfHook
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
, buildNpmPackage
|
, buildNpmPackage
|
||||||
|
@ -29,6 +30,7 @@
|
||||||
, amf-headers
|
, amf-headers
|
||||||
, svt-av1
|
, svt-av1
|
||||||
, vulkan-loader
|
, vulkan-loader
|
||||||
|
, libappindicator
|
||||||
, cudaSupport ? false
|
, cudaSupport ? false
|
||||||
, cudaPackages ? {}
|
, cudaPackages ? {}
|
||||||
}:
|
}:
|
||||||
|
@ -42,28 +44,35 @@ let
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "sunshine";
|
pname = "sunshine";
|
||||||
version = "0.18.4";
|
version = "0.19.1";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "LizardByte";
|
owner = "LizardByte";
|
||||||
repo = "Sunshine";
|
repo = "Sunshine";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "sha256-nPUWBka/fl1oTB0vTv6qyL7EHh7ptFnxwfV/jYtloTc=";
|
sha256 = "sha256-fifwctVrSkAcMK8juAirIbIP64H7GKEwC+sUR/U6Q3Y=";
|
||||||
fetchSubmodules = true;
|
fetchSubmodules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# remove pre-built ffmpeg; use ffmpeg from nixpkgs
|
# remove pre-built ffmpeg; use ffmpeg from nixpkgs
|
||||||
patches = [ ./ffmpeg.diff ];
|
patches = [
|
||||||
|
./ffmpeg.diff
|
||||||
|
# fix for X11 not being added to libraries unless prebuilt FFmpeg is used: https://github.com/LizardByte/Sunshine/pull/1166
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://github.com/LizardByte/Sunshine/commit/a067da6cae72cf36f76acc06fcf1e814032af886.patch";
|
||||||
|
sha256 = "sha256-HMxM7luiFBEmFkvQtkdAMMSjAaYPEFX3LL0T/ActUhM=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
# fetch node_modules needed for webui
|
# fetch node_modules needed for webui
|
||||||
ui = buildNpmPackage {
|
ui = buildNpmPackage {
|
||||||
inherit src version;
|
inherit src version;
|
||||||
pname = "sunshine-ui";
|
pname = "sunshine-ui";
|
||||||
npmDepsHash = "sha256-k8Vfi/57AbGxYFPYSNh8bv4KqHnZjk3BDp8SJQHzuR8=";
|
npmDepsHash = "sha256-sdwvM/Irejo8DgMHJWWCxwOykOK9foqLFFd/tuzrkxI=";
|
||||||
|
|
||||||
dontNpmBuild = true;
|
dontNpmBuild = true;
|
||||||
|
|
||||||
# use generated package-lock.json upstream does not provide one
|
# use generated package-lock.json as upstream does not provide one
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
cp ${./package-lock.json} ./package-lock.json
|
cp ${./package-lock.json} ./package-lock.json
|
||||||
'';
|
'';
|
||||||
|
@ -94,6 +103,7 @@ stdenv.mkDerivation rec {
|
||||||
xorg.libXfixes
|
xorg.libXfixes
|
||||||
xorg.libXrandr
|
xorg.libXrandr
|
||||||
xorg.libXtst
|
xorg.libXtst
|
||||||
|
xorg.libXi
|
||||||
openssl
|
openssl
|
||||||
libopus
|
libopus
|
||||||
boost
|
boost
|
||||||
|
@ -110,6 +120,7 @@ stdenv.mkDerivation rec {
|
||||||
mesa
|
mesa
|
||||||
amf-headers
|
amf-headers
|
||||||
svt-av1
|
svt-av1
|
||||||
|
libappindicator
|
||||||
] ++ lib.optionals cudaSupport [
|
] ++ lib.optionals cudaSupport [
|
||||||
cudaPackages.cudatoolkit
|
cudaPackages.cudatoolkit
|
||||||
];
|
];
|
||||||
|
@ -121,21 +132,18 @@ stdenv.mkDerivation rec {
|
||||||
libxcb
|
libxcb
|
||||||
];
|
];
|
||||||
|
|
||||||
CXXFLAGS = [
|
|
||||||
"-Wno-format-security"
|
|
||||||
];
|
|
||||||
CFLAGS = [
|
|
||||||
"-Wno-format-security"
|
|
||||||
];
|
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-Wno-dev"
|
"-Wno-dev"
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
# fix hardcoded libevdev path
|
# fix hardcoded libevdev and icon path
|
||||||
substituteInPlace CMakeLists.txt \
|
substituteInPlace CMakeLists.txt \
|
||||||
--replace '/usr/include/libevdev-1.0' '${libevdev}/include/libevdev-1.0'
|
--replace '/usr/include/libevdev-1.0' '${libevdev}/include/libevdev-1.0' \
|
||||||
|
--replace '/usr/share' "$out/share"
|
||||||
|
|
||||||
|
substituteInPlace packaging/linux/sunshine.desktop \
|
||||||
|
--replace '@PROJECT_NAME@' 'Sunshine'
|
||||||
|
|
||||||
# add FindFFMPEG to source tree
|
# add FindFFMPEG to source tree
|
||||||
cp ${findFfmpeg} cmake/FindFFMPEG.cmake
|
cp ${findFfmpeg} cmake/FindFFMPEG.cmake
|
||||||
|
@ -153,6 +161,12 @@ stdenv.mkDerivation rec {
|
||||||
--set LD_LIBRARY_PATH ${lib.makeLibraryPath [ vulkan-loader ]}
|
--set LD_LIBRARY_PATH ${lib.makeLibraryPath [ vulkan-loader ]}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
install -Dm644 ../packaging/linux/${pname}.desktop $out/share/applications/${pname}.desktop
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru.updateScript = ./updater.sh;
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Sunshine is a Game stream host for Moonlight.";
|
description = "Sunshine is a Game stream host for Moonlight.";
|
||||||
homepage = "https://github.com/LizardByte/Sunshine";
|
homepage = "https://github.com/LizardByte/Sunshine";
|
||||||
|
|
42
pkgs/servers/sunshine/package-lock.json
generated
42
pkgs/servers/sunshine/package-lock.json
generated
|
@ -1,28 +1,28 @@
|
||||||
{
|
{
|
||||||
"name": "Sunshine",
|
"name": "sunshine",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-free": "6.2.1",
|
"@fortawesome/fontawesome-free": "6.4.0",
|
||||||
"bootstrap": "5.2.3",
|
"bootstrap": "5.2.3",
|
||||||
"vue": "2.6.12"
|
"vue": "2.6.12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@fortawesome/fontawesome-free": {
|
"node_modules/@fortawesome/fontawesome-free": {
|
||||||
"version": "6.2.1",
|
"version": "6.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.4.0.tgz",
|
||||||
"integrity": "sha512-viouXhegu/TjkvYQoiRZK3aax69dGXxgEjpvZW81wIJdxm5Fnvp3VVIP4VHKqX4SvFw6qpmkILkD4RJWAdrt7A==",
|
"integrity": "sha512-0NyytTlPJwB/BF5LtRV8rrABDbe3TdTXqNB3PdZ+UUUZAEIrdOJdmABqKjt4AXwIoJNaRVVZEXxpNrqvE1GAYQ==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@popperjs/core": {
|
"node_modules/@popperjs/core": {
|
||||||
"version": "2.11.6",
|
"version": "2.11.7",
|
||||||
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz",
|
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.7.tgz",
|
||||||
"integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==",
|
"integrity": "sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw==",
|
||||||
"peer": true,
|
"peer": true,
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
|
@ -52,29 +52,5 @@
|
||||||
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.12.tgz",
|
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.12.tgz",
|
||||||
"integrity": "sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg=="
|
"integrity": "sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg=="
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@fortawesome/fontawesome-free": {
|
|
||||||
"version": "6.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.2.1.tgz",
|
|
||||||
"integrity": "sha512-viouXhegu/TjkvYQoiRZK3aax69dGXxgEjpvZW81wIJdxm5Fnvp3VVIP4VHKqX4SvFw6qpmkILkD4RJWAdrt7A=="
|
|
||||||
},
|
|
||||||
"@popperjs/core": {
|
|
||||||
"version": "2.11.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz",
|
|
||||||
"integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==",
|
|
||||||
"peer": true
|
|
||||||
},
|
|
||||||
"bootstrap": {
|
|
||||||
"version": "5.2.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.3.tgz",
|
|
||||||
"integrity": "sha512-cEKPM+fwb3cT8NzQZYEu4HilJ3anCrWqh3CHAok1p9jXqMPsPTBhU25fBckEJHJ/p+tTxTFTsFQGM+gaHpi3QQ==",
|
|
||||||
"requires": {}
|
|
||||||
},
|
|
||||||
"vue": {
|
|
||||||
"version": "2.6.12",
|
|
||||||
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.12.tgz",
|
|
||||||
"integrity": "sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg=="
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
23
pkgs/servers/sunshine/updater.sh
Executable file
23
pkgs/servers/sunshine/updater.sh
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
#! /usr/bin/env nix-shell
|
||||||
|
#! nix-shell -i bash -p gnugrep gnused coreutils curl wget jq nix-update prefetch-npm-deps nodejs
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
pushd "$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
|
version=$(curl -s "https://api.github.com/repos/LizardByte/sunshine/tags" | jq -r .[0].name | grep -oP "^v\K.*")
|
||||||
|
url="https://raw.githubusercontent.com/LizardByte/sunshine/v$version/"
|
||||||
|
|
||||||
|
if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then
|
||||||
|
echo "Already up to date!"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f package-lock.json package.json
|
||||||
|
wget "$url/package.json"
|
||||||
|
npm i --package-lock-only
|
||||||
|
npm_hash=$(prefetch-npm-deps package-lock.json)
|
||||||
|
sed -i 's#npmDepsHash = "[^"]*"#npmDepsHash = "'"$npm_hash"'"#' default.nix
|
||||||
|
rm -f package.json
|
||||||
|
|
||||||
|
popd
|
||||||
|
nix-update sunshine --version $version
|
Loading…
Reference in a new issue