2021-09-18 10:52:07 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitLab
|
2022-03-30 09:31:56 +00:00
|
|
|
, fetchpatch
|
2021-09-18 10:52:07 +00:00
|
|
|
, openssl
|
2022-03-30 09:31:56 +00:00
|
|
|
, libGL
|
2021-09-18 10:52:07 +00:00
|
|
|
, vulkan-loader
|
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
|
|
|
, libxkbcommon
|
|
|
|
, libX11
|
|
|
|
, libXrandr
|
|
|
|
, libXi
|
|
|
|
, libXcursor
|
2022-12-28 21:21:41 +00:00
|
|
|
, udev
|
|
|
|
, alsa-lib
|
|
|
|
, stdenv
|
|
|
|
, libxcb
|
2021-09-18 10:52:07 +00:00
|
|
|
, pkg-config
|
|
|
|
, makeWrapper
|
2022-12-28 21:21:41 +00:00
|
|
|
, writeShellScript
|
|
|
|
, patchelf
|
2021-09-18 10:52:07 +00:00
|
|
|
}:
|
2022-12-28 21:21:41 +00:00
|
|
|
let
|
|
|
|
version = "0.10.0";
|
|
|
|
# Patch for airshipper to install veloren
|
|
|
|
patch = let
|
|
|
|
runtimeLibs = [
|
|
|
|
udev
|
|
|
|
alsa-lib
|
|
|
|
stdenv.cc.cc.lib
|
|
|
|
libxkbcommon
|
|
|
|
libxcb
|
|
|
|
libX11
|
|
|
|
libXcursor
|
|
|
|
libXrandr
|
|
|
|
libXi
|
|
|
|
vulkan-loader
|
|
|
|
libGL
|
|
|
|
];
|
|
|
|
in
|
|
|
|
writeShellScript "patch" ''
|
|
|
|
echo "making binaries executable"
|
|
|
|
chmod +x {veloren-voxygen,veloren-server-cli}
|
|
|
|
echo "patching dynamic linkers"
|
|
|
|
${patchelf}/bin/patchelf \
|
|
|
|
--set-interpreter "${stdenv.cc.bintools.dynamicLinker}" \
|
|
|
|
veloren-server-cli
|
|
|
|
${patchelf}/bin/patchelf \
|
|
|
|
--set-interpreter "${stdenv.cc.bintools.dynamicLinker}" \
|
|
|
|
--set-rpath "${lib.makeLibraryPath runtimeLibs}" \
|
|
|
|
veloren-voxygen
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage {
|
2021-09-18 10:52:07 +00:00
|
|
|
pname = "airshipper";
|
2022-12-28 21:21:41 +00:00
|
|
|
inherit version;
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "Veloren";
|
|
|
|
repo = "airshipper";
|
|
|
|
rev = "v${version}";
|
2022-12-28 21:21:41 +00:00
|
|
|
sha256 = "sha256-5zP1Ye1fJNQp8eWKwdxLqBr4qzBfWEEBsJ9s7+8idL4=";
|
2021-09-18 10:52:07 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"octocrab-0.15.4" = "sha256-uKHLlb0EyWF0Ho8FP38DFZsEWXiAG8FEYzJgwO9W90U=";
|
|
|
|
};
|
|
|
|
};
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
libxkbcommon
|
|
|
|
libX11
|
|
|
|
libXrandr
|
|
|
|
libXi
|
|
|
|
libXcursor
|
|
|
|
];
|
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
RUSTC_BOOTSTRAP = 1; # We need rust unstable features
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postInstall = ''
|
2022-03-30 09:31:56 +00:00
|
|
|
install -Dm444 -t "$out/share/applications" "client/assets/net.veloren.airshipper.desktop"
|
2022-12-28 21:21:41 +00:00
|
|
|
install -Dm444 "client/assets/net.veloren.airshipper.png" "$out/share/icons/net.veloren.airshipper.png"
|
2021-09-18 10:52:07 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup =
|
|
|
|
let
|
|
|
|
libPath = lib.makeLibraryPath [
|
2022-03-30 09:31:56 +00:00
|
|
|
libGL
|
2021-09-18 10:52:07 +00:00
|
|
|
vulkan-loader
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
libxkbcommon
|
|
|
|
libX11
|
|
|
|
libXrandr
|
|
|
|
libXi
|
|
|
|
libXcursor
|
|
|
|
];
|
2022-03-30 09:31:56 +00:00
|
|
|
in
|
|
|
|
''
|
2021-09-18 10:52:07 +00:00
|
|
|
patchelf --set-rpath "${libPath}" "$out/bin/airshipper"
|
2022-12-28 21:21:41 +00:00
|
|
|
wrapProgram "$out/bin/airshipper" --set VELOREN_PATCHER "${patch}"
|
2021-09-18 10:52:07 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
cargoBuildFlags = [ "--package" "airshipper" ];
|
|
|
|
cargoTestFlags = [ "--package" "airshipper" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-01-25 14:12:00 +00:00
|
|
|
description = "Provides automatic updates for the voxel RPG Veloren";
|
2021-09-18 10:52:07 +00:00
|
|
|
homepage = "https://www.veloren.net";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ yusdacra ];
|
|
|
|
};
|
|
|
|
}
|