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-08 23:58:23 +00:00
{ lib
, stdenv
, asciidoc
2022-12-08 22:44:42 +00:00
, boost
, cmake
, curl
2022-11-08 23:58:23 +00:00
, docbook_xsl
, docbook_xsl_ns
2022-12-08 22:44:42 +00:00
, fetchurl
, freetype
, glew
2022-11-08 23:58:23 +00:00
, jdk
2022-12-08 22:44:42 +00:00
, libdevil
, libGL
, libGLU
2022-11-08 23:58:23 +00:00
, libunwind
2022-12-08 22:44:42 +00:00
, libvorbis
, makeWrapper
2022-11-08 23:58:23 +00:00
, minizip
2022-12-08 22:44:42 +00: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 22:44:42 +00:00
version = "106.0";
2022-12-08 22:44:42 +00: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 22:44:42 +00: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 22:44:42 +00: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-08 23:58:23 +00: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 17:20:18 +00:00
nativeBuildInputs = [ cmake makeWrapper docbook_xsl docbook_xsl_ns asciidoc ];
2022-11-08 23:58:23 +00:00
buildInputs = [
boost
2022-12-08 22:44:42 +00:00
curl
freetype
glew
2022-11-08 23:58:23 +00:00
libdevil
2022-12-08 22:44:42 +00:00
libGL
libGLU
libunwind
2022-11-08 23:58:23 +00:00
libvorbis
2022-12-08 22:44:42 +00:00
minizip
openal
p7zip
2022-11-08 23:58:23 +00:00
SDL2
xorg.libX11
xorg.libXcursor
2022-12-08 22:44:42 +00:00
xz
zlib
2022-11-08 23:58:23 +00:00
]
2022-12-08 22:44:42 +00:00
++ lib.optionals withAI [ python3 jdk ];
postInstall = ''
wrapProgram "$out/bin/spring" \
2022-12-08 22:44:42 +00:00
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc ]}"
'';
meta = with lib; {
homepage = "https://springrts.com/";
description = "Powerful real-time strategy (RTS) game engine";
2022-11-08 23:58:23 +00:00
license = licenses.gpl2Plus;
2021-12-18 09:25:46 +00:00
maintainers = with maintainers; [ qknight domenkozar sorki ];
2022-12-08 22:44:42 +00:00
platforms = [ "x86_64-linux" ];
broken = true;
};
}