Unverified Commit 95b10892 authored by Michele Guerini Rocco's avatar Michele Guerini Rocco Committed by GitHub
Browse files

veloren: fix wayland support (#446250)

parents 21227d10 0b34dae4
Loading
Loading
Loading
Loading
+32 −17
Original line number Diff line number Diff line
@@ -7,8 +7,15 @@
  alsa-lib,
  udev,
  shaderc,
  xorg,
  libxcb,
  libxkbcommon,
  autoPatchelfHook,
  libX11,
  libXi,
  libXcursor,
  libXrandr,
  wayland,
  stdenv,
}:

let
@@ -47,12 +54,18 @@ rustPlatform.buildRustPackage {
    EOF
  '';

  nativeBuildInputs = [ pkg-config ];
  nativeBuildInputs = [
    autoPatchelfHook
    pkg-config
  ];

  buildInputs = [
    alsa-lib
    udev
    xorg.libxcb
    libxcb
    libxkbcommon
    shaderc
    stdenv.cc.cc # libgcc_s.so.1
  ];

  buildNoDefaultFeatures = true;
@@ -77,18 +90,20 @@ rustPlatform.buildRustPackage {
  # Some tests require internet access
  doCheck = false;

  postFixup = ''
    # Add required but not explicitly requested libraries
    patchelf --add-rpath '${
      lib.makeLibraryPath [
        xorg.libX11
        xorg.libXi
        xorg.libXcursor
        xorg.libXrandr
  appendRunpaths = [
    (lib.makeLibraryPath (
      [
        libX11
        libXi
        libXcursor
        libXrandr
        vulkan-loader
      ]
    }' "$out/bin/veloren-voxygen"
  '';
      ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform wayland) [
        wayland
      ]
    ))
  ];

  postInstall = ''
    # Icons
@@ -99,13 +114,13 @@ rustPlatform.buildRustPackage {
    mkdir -p "$out/share/veloren"; cp -ar assets "$out/share/veloren/"
  '';

  meta = with lib; {
  meta = {
    description = "Open world, open source voxel RPG";
    homepage = "https://www.veloren.net";
    license = licenses.gpl3;
    license = lib.licenses.gpl3Only;
    mainProgram = "veloren-voxygen";
    platforms = platforms.linux;
    maintainers = with maintainers; [
    platforms = lib.platforms.linux;
    maintainers = with lib.maintainers; [
      rnhmjoj
      tomodachi94
    ];