nixpkgs/pkgs/games/spring/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

93 lines
1.9 KiB
Nix
Raw Normal View History

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
, withAI ? true # support for AI Interfaces and Skirmish AIs
}:
stdenv.mkDerivation rec {
pname = "spring";
2022-12-08 23:44:42 +01:00
version = "106.0";
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=";
};
2022-12-08 23:44:42 +01:00
postPatch = ''
patchShebangs .
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"
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
'';
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"
];
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 ];
postInstall = ''
wrapProgram "$out/bin/spring" \
2022-12-08 23:44:42 +01:00
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc ]}"
'';
meta = with lib; {
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" ];
broken = true;
};
}