nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenvNoCC, stdenv
2, lib
3, dpkg, autoPatchelfHook, makeWrapper
4, fetchurl
5, alsa-lib, openssl, udev
6, libglvnd
7, libX11, libXcursor, libXi, libXrandr
8, libpulseaudio
9, libva
10, ffmpeg
11}:
12
13stdenvNoCC.mkDerivation {
14 pname = "parsec-bin";
15 version = "150_86e";
16
17 src = fetchurl {
18 url = "https://web.archive.org/web/20230124210253/https://builds.parsecgaming.com/package/parsec-linux.deb";
19 sha256 = "sha256-wwBy86TdrHaH9ia40yh24yd5G84WTXREihR+9I6o6uU=";
20 };
21
22 unpackPhase = ''
23 runHook preUnpack
24
25 dpkg-deb -x $src .
26
27 runHook postUnpack
28 '';
29
30 nativeBuildInputs = [ dpkg autoPatchelfHook makeWrapper ];
31
32 buildInputs = [
33 stdenv.cc.cc # libstdc++
34 libglvnd
35 libX11
36 ];
37
38 runtimeDependenciesPath = lib.makeLibraryPath [
39 stdenv.cc.cc
40 libglvnd
41 openssl
42 udev
43 alsa-lib
44 libpulseaudio
45 libva
46 ffmpeg
47 libX11
48 libXcursor
49 libXi
50 libXrandr
51 ];
52
53 prepareParsec = ''
54 if [[ ! -e "$HOME/.parsec/appdata.json" ]]; then
55 mkdir -p "$HOME/.parsec"
56 cp --no-preserve=mode,ownership,timestamps ${placeholder "out"}/share/parsec/skel/* "$HOME/.parsec/"
57 fi
58 '';
59
60 installPhase = ''
61 runHook preInstall
62
63 mkdir $out
64 mv usr/* $out
65
66 wrapProgram $out/bin/parsecd \
67 --prefix LD_LIBRARY_PATH : "$runtimeDependenciesPath" \
68 --run "$prepareParsec"
69
70 substituteInPlace $out/share/applications/parsecd.desktop \
71 --replace "/usr/bin/parsecd" "parsecd" \
72 --replace "/usr/share/icons" "${placeholder "out"}/share/icons"
73
74 runHook postInstall
75 '';
76
77 meta = with lib; {
78 homepage = "https://parsecgaming.com/";
79 changelog = "https://parsec.app/changelog";
80 description = "Remote streaming service client";
81 license = licenses.unfree;
82 maintainers = with maintainers; [ arcnmx ];
83 platforms = platforms.linux;
84 mainProgram = "parsecd";
85 };
86}