Commit 39645367 authored by WheelsForReals's avatar WheelsForReals
Browse files

tigervnc: support building w0vncserver

parent f796ccca
Loading
Loading
Loading
Loading
+22 −4
Original line number Diff line number Diff line
@@ -43,6 +43,12 @@
  ffmpeg,
  autoconf,
  automake,
  libuuid,
  libxkbcommon,
  pipewire,
  wayland,
  wayland-scanner,
  waylandSupport ? stdenv.hostPlatform.isLinux,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -61,7 +67,7 @@ stdenv.mkDerivation (finalAttrs: {
      sed -i -e '/^\$cmd \.= " -pn";/a$cmd .= " -xkbdir ${xkeyboard_config}/etc/X11/xkb";' unix/vncserver/vncserver.in
      fontPath=
      substituteInPlace vncviewer/vncviewer.cxx \
         --replace '"/usr/bin/ssh' '"${openssh}/bin/ssh'
         --replace-fail '"/usr/bin/ssh' '"${openssh}/bin/ssh'
      source_top="$(pwd)"
    ''
    + ''
@@ -73,9 +79,12 @@ stdenv.mkDerivation (finalAttrs: {
  dontUseCmakeBuildDir = true;

  cmakeFlags = [
    "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
    "-DCMAKE_INSTALL_SBINDIR=${placeholder "out"}/bin"
    "-DCMAKE_INSTALL_LIBEXECDIR=${placeholder "out"}/bin"
    (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" (placeholder "out"))
    (lib.cmakeFeature "CMAKE_INSTALL_SBINDIR" "${placeholder "out"}/bin")
    (lib.cmakeFeature "CMAKE_INSTALL_LIBEXECDIR" "${placeholder "out"}/bin")
  ]
  ++ lib.optionals stdenv.hostPlatform.isLinux [
    (lib.cmakeBool "ENABLE_WAYLAND" waylandSupport)
  ];

  env.NIX_CFLAGS_COMPILE = toString [
@@ -172,6 +181,12 @@ stdenv.mkDerivation (finalAttrs: {
      libxdamage
    ]
    ++ xorg-server.buildInputs
    ++ lib.optionals waylandSupport [
      libuuid
      libxkbcommon
      pipewire
      wayland
    ]
  );

  nativeBuildInputs = [
@@ -189,6 +204,9 @@ stdenv.mkDerivation (finalAttrs: {
      zlib
    ]
    ++ xorg-server.nativeBuildInputs
    ++ lib.optionals waylandSupport [
      wayland-scanner
    ]
  );

  propagatedBuildInputs = lib.optional stdenv.hostPlatform.isLinux xorg-server.propagatedBuildInputs;