stardust: unbreak and refactor (#388247)

This commit is contained in:
7c6f434c
2025-03-09 12:10:23 +00:00
committed by GitHub
2 changed files with 35 additions and 14 deletions
+22 -14
View File
@@ -5,8 +5,7 @@
zlib,
libtiff,
libxml2,
SDL,
xorgproto,
SDL_compat,
libX11,
libXi,
libXmu,
@@ -15,21 +14,27 @@
libGL,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "stardust";
version = "0.1.13";
src = fetchurl {
url = "http://iwar.free.fr/IMG/gz/${pname}-${version}.tar.gz";
sha256 = "19rs9lz5y5g2yiq1cw0j05b11digw40gar6rw8iqc7bk3s8355xp";
url = "http://iwar.free.fr/spip/IMG/gz/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
hash = "sha256-t5cykB5zHYYj4tlk9QDhL7YQVgEScBZw9OIVXz5NOqc=";
};
strictDeps = true;
enableParallelBuilding = true;
nativeBuildInputs = [
SDL_compat
libxml2
];
buildInputs = [
zlib
libtiff
libxml2
SDL
xorgproto
SDL_compat
libX11
libXi
libXmu
@@ -38,20 +43,23 @@ stdenv.mkDerivation rec {
libGL
];
installFlags = [ "bindir=\${out}/bin" ];
patches = [ ./pointer-fix.patch ];
installFlags = [ "bindir=${placeholder "out"}/bin" ];
hardeningDisable = [ "format" ];
postConfigure = ''
substituteInPlace config.h \
--replace '#define PACKAGE ""' '#define PACKAGE "stardust"'
--replace-fail '#define PACKAGE ""' '#define PACKAGE "stardust"'
'';
meta = with lib; {
meta = {
description = "Space flight simulator";
homepage = "http://iwar.free.fr/spip/rubrique2.html";
mainProgram = "stardust";
maintainers = [ maintainers.raskin ];
platforms = platforms.linux;
license = licenses.gpl2Plus;
maintainers = with lib.maintainers; [ raskin ];
platforms = lib.platforms.linux;
license = lib.licenses.gpl2Plus;
};
}
})
@@ -0,0 +1,13 @@
diff --git a/src/obj.c b/src/obj.c
index 66d528b..ab08a4f 100644
--- a/src/obj.c
+++ b/src/obj.c
@@ -183,7 +183,7 @@ static short intnpar(char *line, int mode, struct face *face) {
*/
#define ALLOC_MORE 100
GLuint obj_load(Obj *object, const char *obj_file) {
- gzFile *gzp = NULL;
+ gzFile gzp = NULL;
char line[1024], command[1024];
char filename_mtl[256] = "\0";