about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/remote/x2goclient/default.nix
blob: 854fee0b6b6563481dbf6af4fd0ee5dfb7023985 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{ lib
, fetchurl
, cups
, libssh
, libXpm
, nx-libs
, openldap
, openssh
, qt5
, qtbase
, qtsvg
, qtx11extras
, qttools
, phonon
, pkg-config
}:

qt5.mkDerivation rec {
  pname = "x2goclient";
  version = "4.1.2.2";

  src = fetchurl {
    url = "https://code.x2go.org/releases/source/${pname}/${pname}-${version}.tar.gz";
    sha256 = "yZUyZ8QPpnEZrZanO6yx8mYZbaIFnwzc0bjVGZQh0So=";
  };

  buildInputs = [
    cups
    libssh
    libXpm
    nx-libs
    openldap
    openssh
    qtbase
    qtsvg
    qtx11extras
    qttools
    phonon
  ];

  nativeBuildInputs = [
    pkg-config
    qt5.wrapQtAppsHook
  ];

  postPatch = ''
     substituteInPlace src/onmainwindow.cpp --replace "/usr/sbin/sshd" "${openssh}/bin/sshd"
     substituteInPlace Makefile \
       --replace "SHELL=/bin/bash" "SHELL=$SHELL" \
       --replace "lrelease-qt4" "${qttools.dev}/bin/lrelease" \
       --replace "qmake-qt4" "${qtbase.dev}/bin/qmake" \
       --replace "-o root -g root" ""
  '';

  makeFlags = [ "PREFIX=$(out)" "ETCDIR=$(out)/etc" "build_client" "build_man" ];

  installTargets = [ "install_client" "install_man" ];

  qtWrapperArgs = [ "--suffix PATH : ${nx-libs}/bin:${openssh}/libexec" "--set QT_QPA_PLATFORM xcb" ];

  meta = with lib; {
    description = "Graphical NoMachine NX3 remote desktop client";
    homepage = "http://x2go.org/";
    maintainers = with maintainers; [ ];
    license = licenses.gpl2;
    platforms = platforms.linux;
  };
}