nixpkgs/pkgs/games/megaglest/default.nix

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

68 lines
2.1 KiB
Nix
Raw Normal View History

2021-01-15 04:31:39 +00:00
{ lib, stdenv, cmake, pkg-config, git, curl, SDL2, xercesc, openal, lua, libvlc
2022-12-03 02:28:32 +00:00
, libjpeg, wxGTK30, cppunit, ftgl, glew, libogg, libvorbis, buildEnv, libpng
, fontconfig, freetype, xorg, makeWrapper, bash, which, gnome, libGLU, glib
, fetchFromGitHub, fetchpatch
}:
2014-10-11 16:55:08 +00:00
let
2018-01-04 13:43:35 +00:00
version = "3.13.0";
2014-10-11 16:55:08 +00:00
lib-env = buildEnv {
name = "megaglest-lib-env";
2018-01-04 13:43:35 +00:00
paths = [ SDL2 xorg.libSM xorg.libICE xorg.libX11 xorg.libXext
2014-10-11 16:55:08 +00:00
xercesc openal libvorbis lua libjpeg libpng curl fontconfig ftgl freetype
2022-12-03 02:28:32 +00:00
stdenv.cc.cc glew libGLU wxGTK30 ];
2014-10-11 16:55:08 +00:00
};
path-env = buildEnv {
name = "megaglest-path-env";
paths = [ bash which gnome.zenity ];
2014-10-11 16:55:08 +00:00
};
in
stdenv.mkDerivation {
2019-08-13 21:52:01 +00:00
pname = "megaglest";
inherit version;
2014-10-11 16:55:08 +00:00
2017-12-21 19:53:42 +00:00
src = fetchFromGitHub {
owner = "MegaGlest";
repo = "megaglest-source";
2019-09-08 23:38:31 +00:00
rev = version;
2017-12-21 19:53:42 +00:00
fetchSubmodules = true;
2018-01-04 13:43:35 +00:00
sha256 = "0fb58a706nic14ss89zrigphvdiwy5s9dwvhscvvgrfvjpahpcws";
2014-10-11 16:55:08 +00:00
};
patches = [
# Pull upstream fix for -fno-common toolchains
(fetchpatch {
name = "fno-common.patch";
url = "https://github.com/MegaGlest/megaglest-source/commit/5a3520540276a6fd06f7c88e571b6462978e3eab.patch";
sha256 = "0y554kjw56dikq87vs709pmq97hdx9hvqsk27f81v4g90m3b3qhi";
})
];
nativeBuildInputs = [ cmake pkg-config makeWrapper git ];
2022-12-03 02:28:32 +00:00
buildInputs = [ curl SDL2 xercesc openal lua libpng libjpeg libvlc wxGTK30
glib cppunit fontconfig freetype ftgl glew libogg libvorbis libGLU ];
2014-10-11 16:55:08 +00:00
cmakeFlags = [
2022-10-14 03:13:11 +00:00
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
"-DBUILD_MEGAGLEST=On"
"-DBUILD_MEGAGLEST_MAP_EDITOR=On"
"-DBUILD_MEGAGLEST_MODEL_IMPORT_EXPORT_TOOLS=On"
"-DBUILD_MEGAGLEST_MODEL_VIEWER=On"
];
2014-10-11 16:55:08 +00:00
postInstall = ''
for i in $out/bin/*; do
wrapProgram $i \
--prefix LD_LIBRARY_PATH ":" "${lib-env}/lib" \
--prefix PATH ":" "${path-env}/bin"
done
'';
2021-01-15 04:31:39 +00:00
meta = with lib; {
description = "An entertaining free (freeware and free software) and open source cross-platform 3D real-time strategy (RTS) game";
license = licenses.gpl3;
homepage = "https://megaglest.org/";
maintainers = [ maintainers.matejc ];
platforms = platforms.linux;
2014-10-11 16:55:08 +00:00
};
}