From c3d6f5163e9c65eb7d31145b6926196d92911403 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 30 Aug 2024 07:01:30 +0100 Subject: [PATCH] freedroidrpg: 0.16.1 -> 1.0 Changes: https://www.freedroid.org/2023/01/22/release-1-0/ --- pkgs/games/freedroidrpg/default.nix | 17 ++++++----------- pkgs/games/freedroidrpg/drop-build-deps.patch | 6 +++--- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/pkgs/games/freedroidrpg/default.nix b/pkgs/games/freedroidrpg/default.nix index 702e259b9789..b41b91855ee0 100644 --- a/pkgs/games/freedroidrpg/default.nix +++ b/pkgs/games/freedroidrpg/default.nix @@ -1,24 +1,17 @@ -{ fetchurl, fetchpatch, lib, stdenv, pkg-config, gettext, python3, SDL, SDL_image, SDL_gfx, SDL_mixer, libogg, libvorbis, lua5_3, libjpeg, libpng, zlib, libiconv }: +{ fetchurl, lib, stdenv, pkg-config, gettext, glew, python3, SDL, SDL_image, SDL_gfx, SDL_mixer, libogg, libvorbis, lua5_3, libjpeg, libpng, zlib, libiconv }: let - version = "0.16.1"; + version = "1.0"; in stdenv.mkDerivation { pname = "freedroidrpg"; inherit version; src = fetchurl { url = "ftp://ftp.osuosl.org/pub/freedroid/freedroidRPG-${lib.versions.majorMinor version}/freedroidRPG-${version}.tar.gz"; - sha256 = "0n4kn38ncmcy3lrxmq8fjry6c1z50z4q1zcqfig0j4jb0dsz2va2"; + hash = "sha256-eZW3C1lCSOoU0bTvWVOXpgGDAxyZFjsBwainDM7zu88="; }; patches = [ - # Pull upstream fix for -fno-common tolchains. - (fetchpatch { - name = "fno-common.patch"; - url = "https://gitlab.com/freedroid/freedroid-src/-/commit/e610d427374226b79da5258d979936459f30c761.patch"; - sha256 = "1s7sw4dkc7b6i72j6x47driq6v0k3wss48l9ivd4fw40n3iaxjb1"; - }) - # Do not embed build flags in the binary to reduce closure size. ./drop-build-deps.patch ]; @@ -26,9 +19,11 @@ in stdenv.mkDerivation { nativeBuildInputs = [ pkg-config gettext python3 ]; buildInputs = [ - SDL SDL_image SDL_gfx SDL_mixer libogg libvorbis lua5_3 libjpeg libpng zlib + glew SDL SDL_image SDL_gfx SDL_mixer libogg libvorbis lua5_3 libjpeg libpng zlib ] ++ lib.optional stdenv.isDarwin libiconv; + enableParallelBuilding = true; + meta = with lib; { description = "Isometric 3D RPG similar to game Diablo"; mainProgram = "freedroidRPG"; diff --git a/pkgs/games/freedroidrpg/drop-build-deps.patch b/pkgs/games/freedroidrpg/drop-build-deps.patch index d9f2d37b57c7..8bc29fb022dd 100644 --- a/pkgs/games/freedroidrpg/drop-build-deps.patch +++ b/pkgs/games/freedroidrpg/drop-build-deps.patch @@ -2,10 +2,10 @@ Do not embed paths to build-only depends (-I...SDL2-dev and friends) into savefile lua comments. --- a/src/savestruct_internal.c +++ b/src/savestruct_internal.c -@@ -486,8 +486,8 @@ void save_game_data(struct auto_string *strout) +@@ -571,8 +571,8 @@ void save_game_data(struct auto_string *strout) autostr_append(strout, - "SAVEGAME: %s %s %s;sizeof(tux_t)=%d;sizeof(enemy)=%d;sizeof(bullet)=%d;MAXBULLETS=%d\n", - SAVEGAME_VERSION, SAVEGAME_REVISION, VERSION, (int)sizeof(tux_t), (int)sizeof(enemy), (int)sizeof(bullet), (int)MAXBULLETS); + "SAVEGAME: %s %s %s;sizeof(tux_t)=%d;sizeof(enemy)=%d;sizeof(bullet)=%d\n", + SAVEGAME_VERSION, SAVEGAME_REVISION, VERSION, (int)sizeof(tux_t), (int)sizeof(enemy), (int)sizeof(bullet)); - autostr_append(strout, "BUILD_CFLAGS: %s\n", BUILD_CFLAGS); - autostr_append(strout, "BUILD_LDFLAGS: %s\n", BUILD_LDFLAGS); + autostr_append(strout, "BUILD_CFLAGS: %s\n", "");