2019-06-16 21:59:06 +02:00
|
|
|
{ stdenv, file, fetchurl, makeWrapper,
|
2018-12-19 14:14:09 +01:00
|
|
|
autoPatchelfHook, jsoncpp, libpulseaudio }:
|
2018-10-27 10:38:47 +02:00
|
|
|
let
|
2020-10-02 16:46:53 +02:00
|
|
|
versionMajor = "6.12";
|
|
|
|
versionMinor = "3";
|
|
|
|
versionBuild_x86_64 = "7";
|
|
|
|
versionBuild_i686 = "8";
|
2018-10-27 10:38:47 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-02-24 12:11:22 +01:00
|
|
|
pname = "nomachine-client";
|
2018-10-27 10:38:47 +02:00
|
|
|
version = "${versionMajor}.${versionMinor}";
|
2020-05-14 10:09:17 +02:00
|
|
|
|
2018-10-27 10:38:47 +02:00
|
|
|
src =
|
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
2020-05-14 23:03:09 +02:00
|
|
|
urls = [
|
|
|
|
"https://download.nomachine.com/download/${versionMajor}/Linux/nomachine_${version}_${versionBuild_x86_64}_x86_64.tar.gz"
|
|
|
|
"https://web.archive.org/web/https://download.nomachine.com/download/${versionMajor}/Linux/nomachine_${version}_${versionBuild_x86_64}_x86_64.tar.gz"
|
|
|
|
];
|
2020-10-02 16:46:53 +02:00
|
|
|
sha256 = "1dqsqwxbd77g6gc0hvjmmg4flm3vwwv5y98m8d9wxyybp37vkmgd";
|
2018-10-27 10:38:47 +02:00
|
|
|
}
|
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then
|
|
|
|
fetchurl {
|
2020-05-14 23:03:09 +02:00
|
|
|
urls = [
|
|
|
|
"https://download.nomachine.com/download/${versionMajor}/Linux/nomachine_${version}_${versionBuild_i686}_i686.tar.gz"
|
|
|
|
"https://web.archive.org/web/https://download.nomachine.com/download/${versionMajor}/Linux/nomachine_${version}_${versionBuild_i686}_i686.tar.gz"
|
|
|
|
];
|
2020-10-02 16:46:53 +02:00
|
|
|
sha256 = "1q14hxjy66s5cpq19rshscsm679csb6p16c5p2agh5zd64cr4am6";
|
2018-10-27 10:38:47 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
throw "NoMachine client is not supported on ${stdenv.hostPlatform.system}";
|
2020-05-14 10:09:17 +02:00
|
|
|
|
2018-10-27 10:38:47 +02:00
|
|
|
postUnpack = ''
|
|
|
|
mv $(find . -type f -name nxclient.tar.gz) .
|
|
|
|
mv $(find . -type f -name nxplayer.tar.gz) .
|
|
|
|
rm -r NX/
|
|
|
|
tar xf nxclient.tar.gz
|
|
|
|
tar xf nxplayer.tar.gz
|
|
|
|
rm $(find . -maxdepth 1 -type f)
|
|
|
|
'';
|
2020-05-14 10:09:17 +02:00
|
|
|
|
2018-10-27 10:38:47 +02:00
|
|
|
nativeBuildInputs = [ file makeWrapper autoPatchelfHook ];
|
2018-12-19 14:14:09 +01:00
|
|
|
buildInputs = [ jsoncpp libpulseaudio ];
|
2018-10-27 10:38:47 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
rm bin/nxplayer bin/nxclient
|
|
|
|
|
|
|
|
mkdir -p $out/NX
|
|
|
|
cp -r bin lib share $out/NX/
|
|
|
|
|
|
|
|
ln -s $out/NX/bin $out/bin
|
|
|
|
|
|
|
|
for i in share/icons/*; do
|
|
|
|
if [[ -d "$i" ]]; then
|
|
|
|
mkdir -p "$out/share/icons/hicolor/$(basename $i)/apps"
|
|
|
|
cp "$i"/* "$out/share/icons/hicolor/$(basename $i)/apps/"
|
|
|
|
fi
|
|
|
|
done
|
2020-05-14 10:09:17 +02:00
|
|
|
|
2018-10-27 10:38:47 +02:00
|
|
|
mkdir $out/share/applications
|
|
|
|
cp share/applnk/player/xdg/*.desktop $out/share/applications/
|
|
|
|
cp share/applnk/client/xdg-mime/*.desktop $out/share/applications/
|
|
|
|
|
|
|
|
mkdir -p $out/share/mime/packages
|
|
|
|
cp share/applnk/client/xdg-mime/*.xml $out/share/mime/packages/
|
|
|
|
|
|
|
|
for i in $out/share/applications/*.desktop; do
|
|
|
|
substituteInPlace "$i" --replace /usr/NX/bin $out/bin
|
|
|
|
done
|
|
|
|
'';
|
2020-05-14 10:09:17 +02:00
|
|
|
|
2018-10-27 10:38:47 +02:00
|
|
|
postFixup = ''
|
|
|
|
makeWrapper $out/bin/nxplayer.bin $out/bin/nxplayer --set NX_SYSTEM $out/NX
|
|
|
|
makeWrapper $out/bin/nxclient.bin $out/bin/nxclient --set NX_SYSTEM $out/NX
|
2018-12-19 14:14:09 +01:00
|
|
|
|
|
|
|
# libnxcau.so needs libpulse.so.0 for audio to work, but doesn't
|
|
|
|
# have a DT_NEEDED entry for it.
|
|
|
|
patchelf --add-needed libpulse.so.0 $out/NX/lib/libnxcau.so
|
2018-10-27 10:38:47 +02:00
|
|
|
'';
|
2020-05-14 10:09:17 +02:00
|
|
|
|
2018-10-27 10:38:47 +02:00
|
|
|
dontBuild = true;
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "NoMachine remote desktop client (nxplayer)";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.nomachine.com/";
|
2018-10-27 10:38:47 +02:00
|
|
|
license = {
|
|
|
|
fullName = "NoMachine 6 End-User License Agreement";
|
2020-04-01 03:11:51 +02:00
|
|
|
url = "https://www.nomachine.com/licensing-6";
|
2018-10-27 10:38:47 +02:00
|
|
|
free = false;
|
|
|
|
};
|
|
|
|
maintainers = with maintainers; [ talyz ];
|
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
};
|
|
|
|
}
|
2020-05-14 10:09:17 +02:00
|
|
|
|