nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenvNoCC,
3 stdenv,
4 lib,
5 dpkg,
6 autoPatchelfHook,
7 makeWrapper,
8 fetchurl,
9 alsa-lib,
10 openssl,
11 udev,
12 libglvnd,
13 libX11,
14 libXcursor,
15 libXi,
16 libXrandr,
17 libXfixes,
18 libpulseaudio,
19 libva,
20 ffmpeg_7,
21 libpng,
22 libjpeg8,
23 curl,
24 vulkan-loader,
25 zenity,
26}:
27
28stdenvNoCC.mkDerivation {
29 pname = "parsec-bin";
30 version = "150_97c";
31
32 src = fetchurl {
33 url = "https://web.archive.org/web/20250226223019/https://builds.parsec.app/package/parsec-linux.deb";
34 sha256 = "sha256-8Wkbo6l1NGBPX2QMJszq+u9nLM96tu7WYRTQq6/CzM8=";
35 };
36
37 nativeBuildInputs = [
38 dpkg
39 autoPatchelfHook
40 makeWrapper
41 ];
42
43 buildInputs = [
44 stdenv.cc.cc # libstdc++
45 libglvnd
46 libX11
47 ];
48
49 runtimeDependenciesPath = lib.makeLibraryPath [
50 stdenv.cc.cc
51 libglvnd
52 openssl
53 udev
54 alsa-lib
55 libpulseaudio
56 libva
57 ffmpeg_7
58 libpng
59 libjpeg8
60 curl
61 libX11
62 libXcursor
63 libXi
64 libXrandr
65 libXfixes
66 vulkan-loader
67 ];
68
69 binPath = lib.makeBinPath [
70 zenity
71 ];
72
73 prepareParsec = ''
74 if [[ ! -e "$HOME/.parsec/appdata.json" ]]; then
75 mkdir -p "$HOME/.parsec"
76 cp --no-preserve=mode,ownership,timestamps ${placeholder "out"}/share/parsec/skel/* "$HOME/.parsec/"
77 fi
78 '';
79
80 installPhase = ''
81 runHook preInstall
82
83 mkdir $out
84 mv usr/* $out
85
86 wrapProgram $out/bin/parsecd \
87 --prefix PATH : "$binPath" \
88 --prefix LD_LIBRARY_PATH : "$runtimeDependenciesPath" \
89 --run "$prepareParsec"
90
91 substituteInPlace $out/share/applications/parsecd.desktop \
92 --replace "/usr/bin/parsecd" "parsecd" \
93 --replace "/usr/share/icons" "${placeholder "out"}/share/icons"
94
95 runHook postInstall
96 '';
97
98 # Only the main binary needs to be patched, the wrapper script handles
99 # everything else. The libraries in `share/parsec/skel` would otherwise
100 # contain dangling references when copied out of the nix store.
101 dontAutoPatchelf = true;
102
103 fixupPhase = ''
104 runHook preFixup
105
106 autoPatchelf $out/bin
107
108 runHook postFixup
109 '';
110
111 meta = with lib; {
112 homepage = "https://parsec.app/";
113 changelog = "https://parsec.app/changelog";
114 description = "Remote streaming service client";
115 license = licenses.unfree;
116 maintainers = with maintainers; [
117 arcnmx
118 pabloaul
119 ];
120 platforms = platforms.linux;
121 mainProgram = "parsecd";
122 };
123}