aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/tools/X11/nx-libs/default.nix
blob: c08a2fd21855035e840df4ecc3afc8f5f1407d8e (plain)
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
{ stdenv, autoconf, automake, fetchFromGitHub, libgcc, libjpeg_turbo
, libpng, libtool, libxml2, pkgconfig, which, xorg
, libtirpc
}:
stdenv.mkDerivation rec {
  pname = "nx-libs";
  version = "3.5.99.24";
  src = fetchFromGitHub {
    owner = "ArcticaProject";
    repo = "nx-libs";
    rev = version;
    sha256 = "0knx4phya90ahjxaflkvnnb7w22vdwjf7r78dhzmbmlccnlvwi7q";
  };

  nativeBuildInputs = [ autoconf automake libtool pkgconfig which
    xorg.gccmakedep xorg.imake ];
  buildInputs = [ libgcc libjpeg_turbo libpng libxml2 xorg.fontutil
    xorg.libXcomposite xorg.libXdamage xorg.libXdmcp xorg.libXext xorg.libXfont2
    xorg.libXinerama xorg.libXpm xorg.libXrandr xorg.libXtst xorg.pixman
    xorg.xkbcomp xorg.xkeyboardconfig libtirpc
  ];

  NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ];
  NIX_LDFLAGS = [ "-ltirpc" ];

  enableParallelBuilding = true;

  postPatch = ''
    patchShebangs .
    find . -type f -name Makefile -exec sed -i 's|^\(SHELL:=\)/bin/bash$|\1${stdenv.shell}|g' {} \;
    ln -s libNX_X11.so.6.3.0
  '';

  PREFIX=""; # Don't install to $out/usr/local
  installPhase = ''
    make DESTDIR="$out" install
    # See:
    # - https://salsa.debian.org/debian-remote-team/nx-libs/blob/bcc152100617dc59156015a36603a15db530a64f/debian/rules#L66-72
    # - https://github.com/ArcticaProject/nx-libs/issues/652
    patchelf --remove-needed "libX11.so.6" $out/bin/nxagent
  '';

  meta = {
    description = "NX X server based on Xnest";
    homepage = "https://github.com/ArcticaProject/nx-libs";
    license = stdenv.lib.licenses.gpl2;
    maintainers = with stdenv.lib.maintainers; [ jD91mZM2 ];
    platforms = stdenv.lib.platforms.linux;
  };
}