From 06acfb853fb6598237b944bb129da66593f228e6 Mon Sep 17 00:00:00 2001 From: talyz Date: Sat, 27 Oct 2018 10:38:47 +0200 Subject: [PATCH] nomachine-client: init at 6.3.6_1 Packages mainly the nxplayer part of the client, since the tray doesn't work very well without the server / a complete installation. Use the shipped libs, since nxplayer really doesn't like any others. I believe they use internally modified versions of many libs. Audio doesn't work: the libasound.so shipped looks for the alsa config files in the wrong place, and even if it finds them, it still doesn't work. Using the one from alsaLib doesn't work either and adds instability. --- maintainers/maintainer-list.nix | 5 ++ pkgs/tools/admin/nomachine-client/default.nix | 83 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 90 insertions(+) create mode 100644 pkgs/tools/admin/nomachine-client/default.nix diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 22ea07b9f118..f04e02bb1c79 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -4143,6 +4143,11 @@ github = "taku0"; name = "Takuo Yonezawa"; }; + talyz = { + email = "kim.lindberger@gmail.com"; + github = "talyz"; + name = "Kim Lindberger"; + }; tari = { email = "peter@taricorp.net"; github = "tari"; diff --git a/pkgs/tools/admin/nomachine-client/default.nix b/pkgs/tools/admin/nomachine-client/default.nix new file mode 100644 index 000000000000..be616c1bf9e0 --- /dev/null +++ b/pkgs/tools/admin/nomachine-client/default.nix @@ -0,0 +1,83 @@ +{ stdenv, lib, file, fetchurl, makeWrapper, autoPatchelfHook, jsoncpp }: +let + versionMajor = "6.3"; + versionMinor = "6_1"; +in + stdenv.mkDerivation rec { + name = "nomachine-client-${version}"; + version = "${versionMajor}.${versionMinor}"; + + src = + if stdenv.hostPlatform.system == "x86_64-linux" then + fetchurl { + url = "https://download.nomachine.com/download/${versionMajor}/Linux/nomachine_${version}_x86_64.tar.gz"; + sha256 = "1035j2z2rqmdfb8cfm1pakd05c575640604b8lkljmilpky9mw5d"; + } + else if stdenv.hostPlatform.system == "i686-linux" then + fetchurl { + url = "https://download.nomachine.com/download/${versionMajor}/Linux/nomachine_${version}_i686.tar.gz"; + sha256 = "07j9f6mlq9m01ch8ik5dybi283vrp5dlv156jr5n7n2chzk34kf3"; + } + else + throw "NoMachine client is not supported on ${stdenv.hostPlatform.system}"; + + 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) + ''; + + nativeBuildInputs = [ file makeWrapper autoPatchelfHook ]; + buildInputs = [ jsoncpp ]; + + 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 + + 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 + ''; + + 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 + ''; + + dontBuild = true; + dontStrip = true; + + meta = with stdenv.lib; { + description = "NoMachine remote desktop client (nxplayer)"; + homepage = https://www.nomachine.com/; + license = { + fullName = "NoMachine 6 End-User License Agreement"; + url = https://www.nomachine.com/licensing-6; + free = false; + }; + maintainers = with maintainers; [ talyz ]; + platforms = [ "x86_64-linux" "i686-linux" ]; + }; + } + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 57f65c28deb2..99b95e7345a9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4362,6 +4362,8 @@ with pkgs; nms = callPackage ../tools/misc/nms { }; + nomachine-client = callPackage ../tools/admin/nomachine-client { }; + notify-desktop = callPackage ../tools/misc/notify-desktop {}; nkf = callPackage ../tools/text/nkf {};