35 libayatana-appindicator,
40 todesk-unwrapped = stdenv.mkDerivation (finalAttrs: {
41 pname = "todesk-unwrapped";
44 url = "https://newdl.todesk.com/linux/todesk-v${finalAttrs.version}-amd64.deb";
45 hash = "sha256-v7VpXXFVaKI99RpzUWfAc6eE7NHGJeFrNeUTbVuX+yg=";
51 nativeBuildInputs = [ dpkg ];
55 dpkg -x $src ./todesk-src
62 cp -r todesk-src/* "$out"
63 cp "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" "$out/opt/todesk/bin/libappindicator3.so.1"
64 mv "$out/opt/todesk/bin" "$out/bin"
65 cp "$out/bin/libmfx.so.1" "$out/lib"
66 cp "$out/bin/libglut.so.3" "$out/lib"
67 mkdir "$out/opt/todesk/config"
68 mkdir "$out/opt/todesk/bin"
69 mkdir -p "$out/share/applications"
70 mkdir "$out/share/icons"
111 "--bind /var/lib/todesk /opt/todesk/config" # create the folder before bind to avoid permission denided.
112 "--bind ${todesk-unwrapped}/bin /opt/todesk/bin"
113 "--bind /var/lib/todesk /etc/todesk" # service write uuid here. Such a pain!
114 ]; # soft link doesn't work so that we should bind ourselves
115 runScript = writeShellScript "ToDesk.sh" ''
116 export LIBVA_DRIVER_NAME=iHD
117 export LIBVA_DRIVERS_PATH=${todesk-unwrapped}/bin
118 if [ "''${1}" = 'service' ]
120 /opt/todesk/bin/ToDesk_Service
122 /opt/todesk/bin/ToDesk
124 ''; # a small script to choose what to exec
125 extraInstallCommands = ''
126 mkdir -p "$out/share/applications"
127 mkdir -p "$out/share/icons"
128 cp ${todesk-unwrapped}/usr/share/applications/todesk.desktop $out/share/applications
129 cp -rf ${todesk-unwrapped}/usr/share/icons/* $out/share/icons
130 substituteInPlace "$out/share/applications/todesk.desktop" \
131 --replace-fail '/opt/todesk/bin/ToDesk' "$out/bin/todesk desktop"
132 substituteInPlace "$out/share/applications/todesk.desktop" \
133 --replace-fail '/opt/todesk/bin' "${todesk-unwrapped}/lib"
136 description = "Remote Desktop Application";
137 homepage = "https://www.todesk.com/linux.html";
138 license = lib.licenses.unfree;
139 platforms = [ "x86_64-linux" ];
140 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
141 maintainers = with lib.maintainers; [ bot-wxt1221 ];
142 mainProgram = "todesk";