Merge pull request #14775 from rardiol/freeorion

freeorion: init at 0.4.5

+81
+19
pkgs/games/freeorion/92455f9.patch
··· 1 + diff -Naur GG/src/Font.cpp 2 + --- /GG/src/Font.cpp 3 + +++ /GG/src/Font.cpp 4 + @@ -1586,8 +1586,13 @@ 5 + using boost::lexical_cast; 6 + FT_UInt index = FT_Get_Char_Index(face, ch); 7 + if (index) { 8 + - if (FT_Load_Glyph(face, index, FT_LOAD_DEFAULT)) 9 + - ThrowBadGlyph("GG::Font::GetGlyphBitmap : Freetype could not load the glyph for character '%1%'", ch); 10 + + if (FT_Load_Glyph(face, index, FT_LOAD_DEFAULT)) { 11 + + // loading of a glpyh failed so we replace it with 12 + + // the 'Replacement Character' at codepoint 0xFFFD 13 + + FT_UInt tmp_index = FT_Get_Char_Index(face, 0xFFFD); 14 + + if (FT_Load_Glyph(face, tmp_index, FT_LOAD_DEFAULT)) 15 + + ThrowBadGlyph("GG::Font::GetGlyphBitmap : Freetype could not load the glyph for character '%1%'", ch); 16 + + } 17 + 18 + FT_GlyphSlot glyph = face->glyph; 19 +
+41
pkgs/games/freeorion/default.nix
··· 1 + { stdenv, fetchurl, cmake, boost, SDL2, python2, freetype, openal, libogg, libvorbis, zlib, libpng, libtiff, libjpeg, mesa, glew, doxygen 2 + , libxslt, makeWrapper }: 3 + 4 + stdenv.mkDerivation rec { 5 + version = "0.4.5"; 6 + name = "freeorion-${version}"; 7 + 8 + src = fetchurl { 9 + url = "https://github.com/freeorion/freeorion/releases/download/v0.4.5/FreeOrion_v0.4.5_2015-09-01.f203162_Source.tar.gz"; 10 + sha256 = "3b99b92eeac72bd059566dbabfab54368989ba83f72e769bc94eb8dd4fe414c0"; 11 + }; 12 + 13 + buildInputs = [ cmake boost SDL2 python2 freetype openal libogg libvorbis zlib libpng libtiff libjpeg mesa glew doxygen makeWrapper ]; 14 + 15 + # cherry pick for acceptable performance https://github.com/freeorion/freeorion/commit/92455f97c28055e296718230d2e3744eccd738ec 16 + patches = [ ./92455f9.patch ]; 17 + 18 + enableParallelBuilding = true; 19 + 20 + postInstall = '' 21 + mkdir -p $out/fixpaths 22 + # We need final slashes for XSLT replace to work properly 23 + substitute ${./fix-paths.xslt} $out/fixpaths/fix-paths.xslt \ 24 + --subst-var-by nixStore "$NIX_STORE/" \ 25 + --subst-var-by out "$out/" 26 + substitute ${./fix-paths.sh} $out/fixpaths/fix-paths \ 27 + --subst-var-by libxsltBin ${libxslt.bin} \ 28 + --subst-var out 29 + chmod +x $out/fixpaths/fix-paths 30 + 31 + wrapProgram $out/bin/freeorion \ 32 + --run $out/fixpaths/fix-paths 33 + ''; 34 + 35 + meta = with stdenv.lib; { 36 + description = "A free, open source, turn-based space empire and galactic conquest (4X) computer game"; 37 + homepage = "http://www.freeorion.org"; 38 + license = [ licenses.gpl2 licenses.cc-by-sa-30 ]; 39 + platforms = platforms.linux; 40 + }; 41 + }
+6
pkgs/games/freeorion/fix-paths.sh
··· 1 + #!/bin/sh 2 + 3 + if [ -e ~/.freeorion/config.xml ]; then 4 + @libxsltBin@/bin/xsltproc -o ~/.freeorion/config.xml @out@/fixpaths/fix-paths.xslt ~/.freeorion/config.xml 5 + fi 6 + exit 0
+13
pkgs/games/freeorion/fix-paths.xslt
··· 1 + <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 2 + <xsl:output method="xml" omit-xml-declaration="no" indent="yes" /> 3 + 4 + <xsl:template match='node() | @*'> 5 + <xsl:copy> 6 + <xsl:apply-templates select='node() | @*'/> 7 + </xsl:copy> 8 + </xsl:template> 9 + 10 + <xsl:template match='//text()[starts-with(., "@nixStore@")]'> 11 + <xsl:value-of select='concat("@out@", substring-after(substring-after(., "@nixStore@"), "/"))'/> 12 + </xsl:template> 13 + </xsl:stylesheet>
+2
pkgs/top-level/all-packages.nix
··· 14771 14771 14772 14772 freedink = callPackage ../games/freedink { }; 14773 14773 14774 + freeorion = callPackage ../games/freeorion { }; 14775 + 14774 14776 fsg = callPackage ../games/fsg { 14775 14777 wxGTK = wxGTK28.override { unicode = false; }; 14776 14778 };