2022-11-09 00:58:23 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, asciidoc
|
2022-12-08 23:44:42 +01:00
|
|
|
, boost
|
|
|
|
, cmake
|
|
|
|
, curl
|
2022-11-09 00:58:23 +01:00
|
|
|
, docbook_xsl
|
|
|
|
, docbook_xsl_ns
|
2022-12-08 23:44:42 +01:00
|
|
|
, fetchurl
|
|
|
|
, freetype
|
|
|
|
, glew
|
2022-11-09 00:58:23 +01:00
|
|
|
, jdk
|
2022-12-08 23:44:42 +01:00
|
|
|
, libdevil
|
|
|
|
, libGL
|
|
|
|
, libGLU
|
2022-11-09 00:58:23 +01:00
|
|
|
, libunwind
|
2022-12-08 23:44:42 +01:00
|
|
|
, libvorbis
|
|
|
|
, makeWrapper
|
2022-11-09 00:58:23 +01:00
|
|
|
, minizip
|
2022-12-08 23:44:42 +01:00
|
|
|
, openal
|
|
|
|
, p7zip
|
|
|
|
, python3
|
|
|
|
, SDL2
|
|
|
|
, xorg
|
|
|
|
, xz
|
|
|
|
, zlib
|
2010-11-13 08:47:04 +01:00
|
|
|
, withAI ? true # support for AI Interfaces and Skirmish AIs
|
|
|
|
}:
|
2014-02-08 18:16:28 +01:00
|
|
|
|
2010-11-13 08:47:04 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "spring";
|
2022-12-08 23:44:42 +01:00
|
|
|
version = "106.0";
|
2020-03-20 23:37:21 +01:00
|
|
|
|
2022-12-08 23:44:42 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://springrts.com/dl/buildbot/default/master/${version}/source/spring_${version}_src.tar.gz";
|
|
|
|
sha256 = "sha256-mSA4ioIv68NMEB72lYnwDb1QOuWr1VHwu4+grAoHlV0=";
|
2010-11-13 08:47:04 +01:00
|
|
|
};
|
|
|
|
|
2022-12-08 23:44:42 +01:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
|
2016-05-03 11:19:19 +02:00
|
|
|
substituteInPlace ./rts/build/cmake/FindAsciiDoc.cmake \
|
|
|
|
--replace "PATHS /usr /usr/share /usr/local /usr/local/share" "PATHS ${docbook_xsl}"\
|
|
|
|
--replace "xsl/docbook/manpages" "share/xml/docbook-xsl/manpages"
|
2020-03-20 23:37:21 +01:00
|
|
|
|
2022-12-08 23:44:42 +01:00
|
|
|
# The cmake included module correcly finds nix's glew, however
|
|
|
|
# it has to be the bundled FindGLEW for headless or dedicated builds
|
|
|
|
rm rts/build/cmake/FindGLEW.cmake
|
2016-05-03 11:19:19 +02:00
|
|
|
'';
|
|
|
|
|
2022-11-09 00:58:23 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON"
|
|
|
|
"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON"
|
|
|
|
"-DPREFER_STATIC_LIBS:BOOL=OFF"
|
|
|
|
];
|
2014-02-08 18:09:27 +01:00
|
|
|
|
2020-12-31 18:20:18 +01:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper docbook_xsl docbook_xsl_ns asciidoc ];
|
2022-11-09 00:58:23 +01:00
|
|
|
buildInputs = [
|
|
|
|
boost
|
2022-12-08 23:44:42 +01:00
|
|
|
curl
|
|
|
|
freetype
|
|
|
|
glew
|
2022-11-09 00:58:23 +01:00
|
|
|
libdevil
|
2022-12-08 23:44:42 +01:00
|
|
|
libGL
|
|
|
|
libGLU
|
|
|
|
libunwind
|
2022-11-09 00:58:23 +01:00
|
|
|
libvorbis
|
2022-12-08 23:44:42 +01:00
|
|
|
minizip
|
|
|
|
openal
|
|
|
|
p7zip
|
2022-11-09 00:58:23 +01:00
|
|
|
SDL2
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXcursor
|
2022-12-08 23:44:42 +01:00
|
|
|
xz
|
|
|
|
zlib
|
2022-11-09 00:58:23 +01:00
|
|
|
]
|
2022-12-08 23:44:42 +01:00
|
|
|
++ lib.optionals withAI [ python3 jdk ];
|
2014-09-04 21:02:14 +02:00
|
|
|
|
2014-02-09 23:52:59 +01:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/spring" \
|
2022-12-08 23:44:42 +01:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc ]}"
|
2014-02-09 23:52:59 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://springrts.com/";
|
2013-10-07 17:36:47 +02:00
|
|
|
description = "A powerful real-time strategy (RTS) game engine";
|
2022-11-09 00:58:23 +01:00
|
|
|
license = licenses.gpl2Plus;
|
2021-12-18 10:25:46 +01:00
|
|
|
maintainers = with maintainers; [ qknight domenkozar sorki ];
|
2022-12-08 23:44:42 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2023-03-03 19:43:12 +01:00
|
|
|
broken = true;
|
2010-11-13 08:47:04 +01:00
|
|
|
};
|
2011-12-11 19:35:23 +01:00
|
|
|
}
|