From a3b22afe4a7a5f56872982416f336d30ebc0ba4f Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Fri, 31 May 2024 19:17:12 +0200 Subject: [PATCH 1/2] astromenace: 1.4.1 -> 1.4.2 --- pkgs/games/astromenace/default.nix | 81 ++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 22 deletions(-) diff --git a/pkgs/games/astromenace/default.nix b/pkgs/games/astromenace/default.nix index f50739d114a0..1967cf06351c 100644 --- a/pkgs/games/astromenace/default.nix +++ b/pkgs/games/astromenace/default.nix @@ -1,33 +1,70 @@ -{ fetchurl, lib, stdenv, cmake, xorg, libGLU, libGL, SDL, openal, fontconfig, freealut, freetype, libogg, libvorbis, runtimeShell }: +{ lib +, stdenv +, fetchFromGitHub +, fetchpatch +, cmake +, ninja +, makeWrapper +, xorg +, libGLU +, libGL +, SDL2 +, openal +, fontconfig +, freealut +, freetype +, libogg +, libvorbis +, runtimeShell +}: stdenv.mkDerivation rec { pname = "astromenace"; - version = "1.4.1"; + version = "1.4.2"; - src = fetchurl { - url = "mirror://sourceforge/openastromenace/astromenace-src-${version}.tar.bz2"; - sha256 = "1rkz6lwjcd5mwv72kf07ghvx6z46kf3xs250mjbmnmjpn7r5sxwv"; + src = fetchFromGitHub { + owner = "viewizard"; + repo = "astromenace"; + rev = "v${version}"; + hash = "sha256-VFFFYHsBxkURHqOBeuRuIxRKsy8baw2izOZ/qXUkiW8="; }; - nativeBuildInputs = [ cmake ]; - buildInputs = [ xorg.libICE xorg.libX11 xorg.libXinerama libGLU libGL SDL openal fontconfig freealut freetype libogg libvorbis ]; + patches = [ + (fetchpatch { + url = "https://src.fedoraproject.org/rpms/astromenace/raw/5e6bc02d115a53007dc47ef8223d8eaa25607588/f/astromenace-gcc13.patch"; + hash = "sha256-pkmTVR86vS+KCICxAp+d7upNWVnSNxwdKmxnbtqIvgU="; + }) + ]; - postBuild = '' - ./AstroMenace --pack --rawdata=../RAW_VFS_DATA - ''; + nativeBuildInputs = [ + cmake + ninja + makeWrapper + ]; + + buildInputs = [ + xorg.libICE + xorg.libX11 + xorg.libXinerama + libGLU + libGL + SDL2 + openal + fontconfig + freealut + freetype + libogg + libvorbis + ]; installPhase = '' - mkdir -p $out/bin - - cp AstroMenace $out - cp gamedata.vfs $out - - cat > $out/bin/AstroMenace << EOF - #!${runtimeShell} - $out/AstroMenace --dir=$out - EOF - - chmod 755 $out/bin/AstroMenace + runHook preInstall + mkdir -p $out/share/astromenace + install -Dm644 gamedata.vfs $out/share/astromenace/gamedata.vfs + install -Dm755 astromenace $out/bin/astromenace + wrapProgram $out/bin/astromenace \ + --add-flags "--dir=$out/share/astromenace" + runHook postInstall ''; meta = with lib; { @@ -35,6 +72,6 @@ stdenv.mkDerivation rec { homepage = "https://www.viewizard.com/"; license = licenses.gpl3Plus; platforms = platforms.linux; - mainProgram = "AstroMenace"; + mainProgram = "astromenace"; }; } From 9e5283f3604e8602671a9139b491c40d2dbee812 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Fri, 31 May 2024 19:18:06 +0200 Subject: [PATCH 2/2] astromenace: add fgaz to maintainers --- pkgs/games/astromenace/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/games/astromenace/default.nix b/pkgs/games/astromenace/default.nix index 1967cf06351c..54fbf7a1c8b0 100644 --- a/pkgs/games/astromenace/default.nix +++ b/pkgs/games/astromenace/default.nix @@ -73,5 +73,6 @@ stdenv.mkDerivation rec { license = licenses.gpl3Plus; platforms = platforms.linux; mainProgram = "astromenace"; + maintainers = with maintainers; [ fgaz ]; }; }