hyperrogue: 13.0v -> 13.0w

This commit is contained in:
linsui
2024-12-30 13:58:28 +08:00
parent 070ae1c71f
commit 6c707bfe4e
+62 -31
View File
@@ -2,35 +2,48 @@
lib,
stdenv,
fetchFromGitHub,
makeDesktopItem,
copyDesktopItems,
pkg-config,
SDL,
SDL_ttf,
SDL_gfx,
SDL_mixer,
libpng,
glew,
dejavu_fonts,
makeDesktopItem,
fontconfig,
versionCheckHook,
nix-update-script,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "hyperrogue";
version = "13.0v";
version = "13.0w";
src = fetchFromGitHub {
owner = "zenorogue";
repo = "hyperrogue";
rev = "v${version}";
sha256 = "sha256-bH5dnXLWU2D6Y70u7Cy2vqsli1GhID9af4J+21NSPHk=";
tag = "v${finalAttrs.version}";
sha256 = "sha256-/ERMR4JtlIsZ5mvPKTjcjiUfX5/7DTqT0Zc/LEFdZ+M=";
};
env = {
FONTCONFIG = 1;
HYPERROGUE_USE_GLEW = 1;
HYPERROGUE_USE_PNG = 1;
HYPERROGUE_USE_ROGUEVIZ = 1;
};
CXXFLAGS = [
"-I${lib.getDev SDL}/include/SDL"
"-DHYPERPATH='\"${placeholder "out"}/share/hyperrogue/\"'"
"-DRESOURCEDESTDIR=HYPERPATH"
"-DHYPERFONTPATH='\"${dejavu_fonts}/share/fonts/truetype/\"'"
];
HYPERROGUE_USE_GLEW = 1;
HYPERROGUE_USE_PNG = 1;
nativeBuildInputs = [
pkg-config
copyDesktopItems
];
buildInputs = [
SDL
@@ -39,22 +52,27 @@ stdenv.mkDerivation rec {
SDL_mixer
libpng
glew
fontconfig
];
desktopItem = makeDesktopItem {
name = "hyperrogue";
desktopName = "HyperRogue";
genericName = "HyperRogue";
comment = meta.description;
icon = "hyperrogue";
exec = "hyperrogue";
categories = [
"Game"
"AdventureGame"
];
};
desktopItems = [
(makeDesktopItem {
name = "hyperrogue";
desktopName = "HyperRogue";
genericName = "HyperRogue";
comment = finalAttrs.meta.description;
icon = "hyperrogue";
exec = "hyperrogue";
categories = [
"Game"
"AdventureGame"
];
})
];
installPhase = ''
runHook preInstall
install -d $out/share/hyperrogue/{sounds,music}
install -m 555 -D hyperrogue $out/bin/hyperrogue
@@ -62,8 +80,6 @@ stdenv.mkDerivation rec {
install -m 444 -D music/* $out/share/hyperrogue/music
install -m 444 -D sounds/* $out/share/hyperrogue/sounds
install -m 444 -D ${desktopItem}/share/applications/hyperrogue.desktop \
$out/share/applications/hyperrogue.desktop
install -m 444 -D hyperroid/app/src/main/res/drawable-ldpi/icon.png \
$out/share/icons/hicolor/36x36/apps/hyperrogue.png
install -m 444 -D hyperroid/app/src/main/res/drawable-mdpi/icon.png \
@@ -76,16 +92,31 @@ stdenv.mkDerivation rec {
$out/share/icons/hicolor/144x144/apps/hyperrogue.png
install -m 444 -D hyperroid/app/src/main/res/drawable-xxxhdpi/icon.png \
$out/share/icons/hicolor/192x192/apps/hyperrogue.png
runHook postInstall
'';
enableParallelBuilding = true;
meta = with lib; {
homepage = "https://www.roguetemple.com/z/hyper/";
description = "A roguelike game set in hyperbolic geometry";
mainProgram = "hyperrogue";
maintainers = with maintainers; [ rardiol ];
license = licenses.gpl2Plus;
platforms = platforms.all;
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = [ "--version" ];
doInstallCheck = !stdenv.hostPlatform.isDarwin;
passthru = {
updateScript = nix-update-script { };
};
}
meta = {
description = "Roguelike game set in hyperbolic geometry";
homepage = "https://www.roguetemple.com/z/hyper/";
changelog = "https://github.com/zenorogue/hyperrogue/releases/tag/v${finalAttrs.version}";
mainProgram = "hyperrogue";
maintainers = with lib.maintainers; [ rardiol ];
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.all;
};
})