summary refs log tree commit diff
path: root/pkgs/games/airshipper/default.nix
blob: bc6f2a8dc71e825564614c88b3c75defe696af97 (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
69
70
71
72
73
74
{ lib
, rustPlatform
, fetchFromGitLab
, openssl
, vulkan-loader
, wayland
, wayland-protocols
, libxkbcommon
, libX11
, libXrandr
, libXi
, libXcursor
, pkg-config
, makeWrapper
}:

rustPlatform.buildRustPackage rec {
  pname = "airshipper";
  version = "0.7.0";

  src = fetchFromGitLab {
    owner = "Veloren";
    repo = "airshipper";
    rev = "v${version}";
    sha256 = "sha256-nOE9ZNHxLEAnMkuBSpxmeq3DxkRIlcoase6AxU+eFug=";
  };

  cargoSha256 = "sha256-s3seKVEhXyOVlt3a8cubzRWoB4SVQpdCmq12y0FpDUw=";

  buildInputs = [
    openssl
    wayland
    wayland-protocols
    libxkbcommon
    libX11
    libXrandr
    libXi
    libXcursor
  ];
  nativeBuildInputs = [ pkg-config makeWrapper ];

  postInstall = ''
    mkdir -p "$out/share/applications" && mkdir -p "$out/share/icons"
    cp "client/assets/net.veloren.airshipper.desktop" "$out/share/applications"
    cp "client/assets/logo.ico" "$out/share/icons/net.veloren.airshipper.ico"
  '';

  postFixup =
    let
      libPath = lib.makeLibraryPath [
        vulkan-loader
        wayland
        wayland-protocols
        libxkbcommon
        libX11
        libXrandr
        libXi
        libXcursor
      ];
    in ''
      patchelf --set-rpath "${libPath}" "$out/bin/airshipper"
    '';

  doCheck = false;
  cargoBuildFlags = [ "--package" "airshipper" ];
  cargoTestFlags = [ "--package" "airshipper" ];

  meta = with lib; {
    description = "Provides automatic updates for the voxel RPG Veloren.";
    homepage = "https://www.veloren.net";
    license = licenses.gpl3;
    maintainers = with maintainers; [ yusdacra ];
  };
}