0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

blackvoxel: init at 2.5 (#386453)

This commit is contained in:
Gaétan Lepage 2025-03-10 00:22:04 +01:00 committed by GitHub
commit 2ffb1163b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,84 @@
{
lib,
stdenv,
fetchFromGitHub,
makeDesktopItem,
imagemagick,
glew110,
SDL_compat,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "blackvoxel";
version = "2.5";
src = fetchFromGitHub {
owner = "Blackvoxel";
repo = "Blackvoxel";
tag = finalAttrs.version;
hash = "sha256-Uj3TfxAsLddsPiWDcLKjpduqvgVjnESZM4YPHT90YYY=";
};
nativeBuildInputs = [ imagemagick ];
buildInputs = [
glew110
SDL_compat
];
enableParallelBuilding = true;
postPatch = ''
substituteInPlace src/sc_Squirrel3/sq/Makefile --replace-fail " -m64" ""
substituteInPlace src/sc_Squirrel3/sqstdlib/Makefile --replace-fail " -m64" ""
substituteInPlace src/sc_Squirrel3/squirrel/Makefile --replace-fail " -m64" ""
'';
buildFlags = [ "BV_DATA_LOCATION_DIR=${placeholder "out"}/data" ];
# data/gui/gametype_back.bmp isn't exactly the official icon but since
# there is no official icon we use that one
postBuild = ''
convert gui/gametype_back.bmp blackvoxel.png
'';
installFlags = [
"doinstall=true"
"BV_DATA_INSTALL_DIR=${placeholder "out"}/data"
"BV_BINARY_INSTALL_DIR=${placeholder "out"}/bin"
];
postInstall = ''
install -Dm644 blackvoxel.png $out/share/icons/hicolor/1024x1024/apps/blackvoxel.png
'';
desktopItems = [
(makeDesktopItem {
name = "blackvoxel";
desktopName = "Blackvoxel";
exec = "blackvoxel";
icon = "blackvoxel";
categories = [ "Game" ];
})
];
passthru.updateScript = nix-update-script { };
meta = {
description = "A Sci-Fi game with industry and automation";
homepage = "https://www.blackvoxel.com";
changelog = "https://github.com/Blackvoxel/Blackvoxel/releases/tag/${finalAttrs.version}";
license = with lib.licenses; [
# blackvoxel
gpl3Plus
# Squirrel
mit
];
maintainers = with lib.maintainers; [
ethancedwards8
marcin-serwin
];
platforms = lib.platforms.linux;
};
})