Merge pull request #14775 from rardiol/freeorion

freeorion: init at 0.4.5
This commit is contained in:
Nikolay Amiantov 2016-04-19 03:09:46 +04:00
commit 05e713e7a5
5 changed files with 81 additions and 0 deletions

@ -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;

@ -0,0 +1,41 @@
{ stdenv, fetchurl, cmake, boost, SDL2, python2, freetype, openal, libogg, libvorbis, zlib, libpng, libtiff, libjpeg, mesa, glew, doxygen
, libxslt, makeWrapper }:
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 makeWrapper ];
# cherry pick for acceptable performance https://github.com/freeorion/freeorion/commit/92455f97c28055e296718230d2e3744eccd738ec
patches = [ ./92455f9.patch ];
enableParallelBuilding = true;
postInstall = ''
mkdir -p $out/fixpaths
# We need final slashes for XSLT replace to work properly
substitute ${./fix-paths.xslt} $out/fixpaths/fix-paths.xslt \
--subst-var-by nixStore "$NIX_STORE/" \
--subst-var-by out "$out/"
substitute ${./fix-paths.sh} $out/fixpaths/fix-paths \
--subst-var-by libxsltBin ${libxslt.bin} \
--subst-var out
chmod +x $out/fixpaths/fix-paths
wrapProgram $out/bin/freeorion \
--run $out/fixpaths/fix-paths
'';
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;
};
}

@ -0,0 +1,6 @@
#!/bin/sh
if [ -e ~/.freeorion/config.xml ]; then
@libxsltBin@/bin/xsltproc -o ~/.freeorion/config.xml @out@/fixpaths/fix-paths.xslt ~/.freeorion/config.xml
fi
exit 0

@ -0,0 +1,13 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="no" indent="yes" />
<xsl:template match='node() | @*'>
<xsl:copy>
<xsl:apply-templates select='node() | @*'/>
</xsl:copy>
</xsl:template>
<xsl:template match='//text()[starts-with(., "@nixStore@")]'>
<xsl:value-of select='concat("@out@", substring-after(substring-after(., "@nixStore@"), "/"))'/>
</xsl:template>
</xsl:stylesheet>

@ -14771,6 +14771,8 @@ in
freedink = callPackage ../games/freedink { };
freeorion = callPackage ../games/freeorion { };
fsg = callPackage ../games/fsg {
wxGTK = wxGTK28.override { unicode = false; };
};