2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, libtheora, xvidcore, libGLU, libGL, SDL, SDL_ttf, SDL_mixer
|
2020-04-24 23:36:52 +00:00
|
|
|
, curl, libjpeg, libpng, gettext, cunit, enableEditor?false }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-06-28 23:13:55 +00:00
|
|
|
pname = "ufoai";
|
|
|
|
version = "2.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2021-06-28 23:13:55 +00:00
|
|
|
url = "mirror://sourceforge/ufoai/ufoai-${version}-source.tar.bz2";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "0kxrbcjrharcwz319s90m789i4my9285ihp5ax6kfhgif2vn2ji5";
|
|
|
|
};
|
|
|
|
|
|
|
|
srcData = fetchurl {
|
2021-06-28 23:13:55 +00:00
|
|
|
url = "mirror://sourceforge/ufoai/ufoai-${version}-data.tar";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1drhh08cqqkwv1yz3z4ngkplr23pqqrdx6cp8c3isy320gy25cvb";
|
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# Workaround build failure on -fno-common toolchains:
|
|
|
|
# ld: r_gl.h:52: multiple definition of `qglGenBuffers';
|
|
|
|
# r_gl.h:52: first defined here
|
|
|
|
# TODO: drop once release contains upstream fix:
|
|
|
|
# https://github.com/ufoai/ufoai/commit/8a3075fffdad294e
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preConfigure = ''tar xvf "${srcData}"'';
|
|
|
|
|
|
|
|
configureFlags = [ "--enable-release" "--enable-sse" ]
|
2021-01-15 22:18:51 +00:00
|
|
|
++ lib.optional enableEditor "--enable-uforadiant";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libtheora xvidcore libGLU libGL SDL SDL_ttf SDL_mixer
|
|
|
|
curl libjpeg libpng gettext cunit
|
|
|
|
];
|
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
NIX_CFLAGS_LINK = [
|
|
|
|
# to avoid occasional runtime error in finding libgcc_s.so.1
|
|
|
|
"-lgcc_s"
|
|
|
|
# tests are underlinked against libm:
|
|
|
|
# ld: release-linux-x86_64/testall/client/sound/s_mix.c.o: undefined reference to symbol 'acos@@GLIBC_2.2.5'
|
|
|
|
"-lm"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://ufoai.org";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Squad-based tactical strategy game in the tradition of X-Com";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
hydraPlatforms = [];
|
|
|
|
};
|
|
|
|
}
|