diff --git a/pkgs/by-name/st/stardust/package.nix b/pkgs/by-name/st/stardust/package.nix index 53d67ab628d0..f53096c5fc4d 100644 --- a/pkgs/by-name/st/stardust/package.nix +++ b/pkgs/by-name/st/stardust/package.nix @@ -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; }; -} +}) diff --git a/pkgs/by-name/st/stardust/pointer-fix.patch b/pkgs/by-name/st/stardust/pointer-fix.patch new file mode 100644 index 000000000000..0dece3c2039e --- /dev/null +++ b/pkgs/by-name/st/stardust/pointer-fix.patch @@ -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";