summary refs log tree commit diff
path: root/pkgs/games/spring
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/games/spring')
-rw-r--r--pkgs/games/spring/default.nix27
-rw-r--r--pkgs/games/spring/springlobby.nix21
2 files changed, 27 insertions, 21 deletions
diff --git a/pkgs/games/spring/default.nix b/pkgs/games/spring/default.nix
index b130a7b5f77..21aca573062 100644
--- a/pkgs/games/spring/default.nix
+++ b/pkgs/games/spring/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, cmake, lzma, boost, libdevil, zlib, p7zip
+{ lib, stdenv, fetchFromGitHub, cmake, xz, boost, libdevil, zlib, p7zip
 , openal, libvorbis, glew, freetype, xorg, SDL2, libGLU, libGL
-, asciidoc, libxslt, docbook_xsl, docbook_xsl_ns, curl, makeWrapper
+, asciidoc, docbook_xsl, docbook_xsl_ns, curl, makeWrapper
 , jdk ? null, python ? null, systemd, libunwind, which, minizip
 , withAI ? true # support for AI Interfaces and Skirmish AIs
 }:
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   # taken from https://github.com/spring/spring/commits/maintenance
   src = fetchFromGitHub {
     owner = "spring";
-    repo = "spring";
+    repo = pname;
     inherit rev;
     sha256 = "1nx68d894yfmqc6df72hmk75ph26fqdvlmmq58cca0vbwpz9hf5v";
     fetchSubmodules = true;
@@ -40,26 +40,27 @@ stdenv.mkDerivation rec {
                 "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON"
                 "-DPREFER_STATIC_LIBS:BOOL=OFF"];
 
-  buildInputs = [ cmake lzma boost libdevil zlib p7zip openal libvorbis freetype SDL2
-    xorg.libX11 xorg.libXcursor libGLU libGL glew asciidoc libxslt docbook_xsl curl makeWrapper
-    docbook_xsl_ns systemd libunwind which minizip ]
-    ++ stdenv.lib.optional withAI jdk
-    ++ stdenv.lib.optional withAI python;
-
-  enableParallelBuilding = true;
+  nativeBuildInputs = [ cmake makeWrapper docbook_xsl docbook_xsl_ns asciidoc ];
+  buildInputs = [ xz boost libdevil zlib p7zip openal libvorbis freetype SDL2
+    xorg.libX11 xorg.libXcursor libGLU libGL glew curl
+    systemd libunwind which minizip ]
+    ++ lib.optional withAI jdk
+    ++ lib.optional withAI python;
 
   NIX_CFLAGS_COMPILE = "-fpermissive"; # GL header minor incompatibility
 
   postInstall = ''
     wrapProgram "$out/bin/spring" \
-      --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ stdenv.cc.cc systemd ]}"
+      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc systemd ]}"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://springrts.com/";
     description = "A powerful real-time strategy (RTS) game engine";
     license = licenses.gpl2;
-    maintainers = [ maintainers.phreedom maintainers.qknight maintainers.domenkozar maintainers.sorki ];
+    maintainers = with maintainers; [ phreedom qknight domenkozar sorki ];
     platforms = platforms.linux;
+    # error: 'snprintf' was not declared in this scope
+    broken = true;
   };
 }
diff --git a/pkgs/games/spring/springlobby.nix b/pkgs/games/spring/springlobby.nix
index 9912675ee67..009457a9dad 100644
--- a/pkgs/games/spring/springlobby.nix
+++ b/pkgs/games/spring/springlobby.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, wxGTK30, openal, pkgconfig, curl, libtorrentRasterbar
+{ lib, stdenv, fetchurl, fetchpatch, cmake, wxGTK30, openal, pkg-config, curl, libtorrent-rasterbar
 , libpng, libX11, gettext, boost, libnotify, gtk2, doxygen, spring
 , makeWrapper, glib, minizip, alure, pcre, jsoncpp }:
 
@@ -11,15 +11,20 @@ stdenv.mkDerivation rec {
     sha256 = "1r1g2hw9ipsmsmzbhsi7bxqra1za6x7j1kw12qzl5psqyq8rqbgs";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config gettext doxygen makeWrapper ];
   buildInputs = [
-    cmake wxGTK30 openal curl gettext libtorrentRasterbar pcre jsoncpp
-    boost libpng libX11 libnotify gtk2 doxygen makeWrapper glib minizip alure
+    wxGTK30 openal curl libtorrent-rasterbar pcre jsoncpp
+    boost libpng libX11 libnotify gtk2 glib minizip alure
   ];
 
-  patches = [ ./revert_58b423e.patch ./fix-certs.patch ]; # Allows springLobby to continue using system installed spring until #707 is fixed
-
-  enableParallelBuilding = true;
+  patches = [
+    ./revert_58b423e.patch # Allows springLobby to continue using system installed spring until #707 is fixed
+    ./fix-certs.patch
+    (fetchpatch {
+      url = "https://github.com/springlobby/springlobby/commit/252c4cb156c1442ed9b4faec3f26265bc7c295ff.patch";
+      sha256 = "sha256-Nq1F5fRPnCkZwl9KgrfuUmpIMK3hUOyZQYIKElWpmzU=";
+    })
+  ];
 
   postInstall = ''
     wrapProgram $out/bin/springlobby \
@@ -27,7 +32,7 @@ stdenv.mkDerivation rec {
       --set SPRING_BUNDLE_DIR "${spring}/lib"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://springlobby.info/";
     repositories.git = "git://github.com/springlobby/springlobby.git";
     description = "Cross-platform lobby client for the Spring RTS project";