2023-10-09 19:29:22 +00:00
|
|
|
{ stdenvNoCC
|
|
|
|
, stdenv
|
2022-10-21 18:38:19 +00:00
|
|
|
, lib
|
2023-10-09 19:29:22 +00:00
|
|
|
, dpkg
|
|
|
|
, autoPatchelfHook
|
|
|
|
, makeWrapper
|
2022-10-21 18:38:19 +00:00
|
|
|
, fetchurl
|
2023-10-09 19:29:22 +00:00
|
|
|
, alsa-lib
|
|
|
|
, openssl
|
|
|
|
, udev
|
2022-10-21 18:38:19 +00:00
|
|
|
, libglvnd
|
2023-10-09 19:29:22 +00:00
|
|
|
, libX11
|
|
|
|
, libXcursor
|
|
|
|
, libXi
|
|
|
|
, libXrandr
|
|
|
|
, libXfixes
|
2022-10-21 18:38:19 +00:00
|
|
|
, libpulseaudio
|
|
|
|
, libva
|
2024-01-02 11:29:13 +00:00
|
|
|
, ffmpeg_5
|
2023-10-09 19:29:22 +00:00
|
|
|
, libpng
|
|
|
|
, libjpeg8
|
|
|
|
, curl
|
2024-01-02 11:29:13 +00:00
|
|
|
, vulkan-loader
|
|
|
|
, gnome
|
|
|
|
, zenity ? gnome.zenity
|
2022-10-21 18:38:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation {
|
|
|
|
pname = "parsec-bin";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "150_91a";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-01-02 11:29:13 +00:00
|
|
|
url = "https://web.archive.org/web/20231209190803if_/https://builds.parsec.app/package/parsec-linux.deb";
|
|
|
|
sha256 = "sha256-/qugI7k0NYpq7p9l9auD2Pp+SFoFZ9jAZswpreVfgO4=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
runHook preUnpack
|
|
|
|
|
|
|
|
dpkg-deb -x $src .
|
|
|
|
|
|
|
|
runHook postUnpack
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ dpkg autoPatchelfHook makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
stdenv.cc.cc # libstdc++
|
|
|
|
libglvnd
|
|
|
|
libX11
|
|
|
|
];
|
|
|
|
|
|
|
|
runtimeDependenciesPath = lib.makeLibraryPath [
|
|
|
|
stdenv.cc.cc
|
|
|
|
libglvnd
|
|
|
|
openssl
|
|
|
|
udev
|
|
|
|
alsa-lib
|
|
|
|
libpulseaudio
|
|
|
|
libva
|
2024-01-02 11:29:13 +00:00
|
|
|
ffmpeg_5
|
2023-10-09 19:29:22 +00:00
|
|
|
libpng
|
|
|
|
libjpeg8
|
|
|
|
curl
|
2022-10-21 18:38:19 +00:00
|
|
|
libX11
|
|
|
|
libXcursor
|
|
|
|
libXi
|
|
|
|
libXrandr
|
2023-10-09 19:29:22 +00:00
|
|
|
libXfixes
|
2024-01-02 11:29:13 +00:00
|
|
|
vulkan-loader
|
|
|
|
];
|
|
|
|
|
|
|
|
binPath = lib.makeBinPath [
|
|
|
|
zenity
|
2022-10-21 18:38:19 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
prepareParsec = ''
|
|
|
|
if [[ ! -e "$HOME/.parsec/appdata.json" ]]; then
|
|
|
|
mkdir -p "$HOME/.parsec"
|
|
|
|
cp --no-preserve=mode,ownership,timestamps ${placeholder "out"}/share/parsec/skel/* "$HOME/.parsec/"
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir $out
|
|
|
|
mv usr/* $out
|
|
|
|
|
|
|
|
wrapProgram $out/bin/parsecd \
|
2024-01-02 11:29:13 +00:00
|
|
|
--prefix PATH : "$binPath" \
|
2022-10-21 18:38:19 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "$runtimeDependenciesPath" \
|
|
|
|
--run "$prepareParsec"
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
substituteInPlace $out/share/applications/parsecd.desktop \
|
|
|
|
--replace "/usr/bin/parsecd" "parsecd" \
|
|
|
|
--replace "/usr/share/icons" "${placeholder "out"}/share/icons"
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# Only the main binary needs to be patched, the wrapper script handles
|
|
|
|
# everything else. The libraries in `share/parsec/skel` would otherwise
|
|
|
|
# contain dangling references when copied out of the nix store.
|
|
|
|
dontAutoPatchelf = true;
|
|
|
|
|
|
|
|
fixupPhase = ''
|
|
|
|
runHook preFixup
|
|
|
|
|
|
|
|
autoPatchelf $out/bin
|
|
|
|
|
|
|
|
runHook postFixup
|
|
|
|
'';
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
meta = with lib; {
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://parsec.app/";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://parsec.app/changelog";
|
2022-10-21 18:38:19 +00:00
|
|
|
description = "Remote streaming service client";
|
|
|
|
license = licenses.unfree;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ arcnmx pabloaul ];
|
2022-10-21 18:38:19 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
mainProgram = "parsecd";
|
|
|
|
};
|
|
|
|
}
|