summaryrefslogtreecommitdiffstats
path: root/pkgs/games/freeorion
diff options
context:
space:
mode:
authorRicardo Ardissone <ricardo.ardissone@gmail.com>2016-04-15 20:37:09 -0300
committerRicardo Ardissone <ricardo.ardissone@gmail.com>2016-04-18 04:45:21 -0300
commit3ce9294eebec3c6e5189a407842d6bf9effb0bd7 (patch)
tree03a51c3d438d4c07b9f0677b26f108f946afdaea /pkgs/games/freeorion
parent551296a1cec0b9751ab96c420a7481e322ea127d (diff)
freeorion: init at 0.4.5
Diffstat (limited to 'pkgs/games/freeorion')
-rw-r--r--pkgs/games/freeorion/92455f9.patch19
-rw-r--r--pkgs/games/freeorion/default.nix23
2 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/games/freeorion/92455f9.patch b/pkgs/games/freeorion/92455f9.patch
new file mode 100644
index 000000000000..e40ee78de6df
--- /dev/null
+++ b/pkgs/games/freeorion/92455f9.patch
@@ -0,0 +1,19 @@
+diff -Naur GG/src/Font.cpp
+--- /GG/src/Font.cpp
++++ /GG/src/Font.cpp
+@@ -1586,8 +1586,13 @@
+ using boost::lexical_cast;
+ FT_UInt index = FT_Get_Char_Index(face, ch);
+ if (index) {
+- if (FT_Load_Glyph(face, index, FT_LOAD_DEFAULT))
+- ThrowBadGlyph("GG::Font::GetGlyphBitmap : Freetype could not load the glyph for character '%1%'", ch);
++ if (FT_Load_Glyph(face, index, FT_LOAD_DEFAULT)) {
++ // loading of a glpyh failed so we replace it with
++ // the 'Replacement Character' at codepoint 0xFFFD
++ FT_UInt tmp_index = FT_Get_Char_Index(face, 0xFFFD);
++ if (FT_Load_Glyph(face, tmp_index, FT_LOAD_DEFAULT))
++ ThrowBadGlyph("GG::Font::GetGlyphBitmap : Freetype could not load the glyph for character '%1%'", ch);
++ }
+
+ FT_GlyphSlot glyph = face->glyph;
+
diff --git a/pkgs/games/freeorion/default.nix b/pkgs/games/freeorion/default.nix
new file mode 100644
index 000000000000..a3b0a11e177f
--- /dev/null
+++ b/pkgs/games/freeorion/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, cmake, boost, SDL2, python2, freetype, openal, libogg, libvorbis, zlib, libpng, libtiff, libjpeg, mesa, glew, doxygen }:
+
+stdenv.mkDerivation rec {
+ version = "0.4.5";
+ name = "freeorion-${version}";
+
+ src = fetchurl {
+ url = "https://github.com/freeorion/freeorion/releases/download/v0.4.5/FreeOrion_v0.4.5_2015-09-01.f203162_Source.tar.gz";
+ sha256 = "3b99b92eeac72bd059566dbabfab54368989ba83f72e769bc94eb8dd4fe414c0";
+ };
+
+ buildInputs = [ cmake boost SDL2 python2 freetype openal libogg libvorbis zlib libpng libtiff libjpeg mesa glew doxygen ];
+
+ # cherry pick for acceptable performance https://github.com/freeorion/freeorion/commit/92455f97c28055e296718230d2e3744eccd738ec
+ patches = [ ./92455f9.patch ];
+
+ meta = with stdenv.lib; {
+ description = "A free, open source, turn-based space empire and galactic conquest (4X) computer game";
+ homepage = "http://www.freeorion.org";
+ license = [ licenses.gpl2 licenses.cc-by-sa-30 ];
+ platforms = platforms.linux;
+ };
+}