From e1ce68683f67050af23c3626ced1198d3289e40c Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Mon, 10 May 2021 14:11:27 +0800 Subject: [PATCH] freeorion: 0.4.9 -> 0.4.10.1 --- pkgs/games/freeorion/default.nix | 72 ++++++++++++++++++++++++------- pkgs/games/freeorion/fix-paths.sh | 2 +- 2 files changed, 58 insertions(+), 16 deletions(-) diff --git a/pkgs/games/freeorion/default.nix b/pkgs/games/freeorion/default.nix index de25fa691d5..dea5190d976 100644 --- a/pkgs/games/freeorion/default.nix +++ b/pkgs/games/freeorion/default.nix @@ -1,39 +1,81 @@ -{ lib, stdenv, fetchFromGitHub, cmake, doxygen, graphviz, makeWrapper -, boost168, SDL2, python2, freetype, openal, libogg, libvorbis, zlib, libpng, libtiff -, libjpeg, libGLU, libGL, glew, libxslt +{ lib +, stdenv +, fetchFromGitHub +, cmake +, doxygen +, graphviz +, makeWrapper +, cppcheck +, boost16x +, SDL2 +, python3 +, freetype +, openal +, libogg +, libvorbis +, zlib +, libpng +, libtiff +, libjpeg +, libGLU +, libGL +, glew +, libxslt }: stdenv.mkDerivation rec { - version = "0.4.9"; + version = "0.4.10.1"; pname = "freeorion"; src = fetchFromGitHub { - owner = "freeorion"; - repo = "freeorion"; + owner = "freeorion"; + repo = "freeorion"; rev = "v${version}"; - sha256 = "18xigx4qla225ybf7mc1w8zfm81nhcm1i5181n5l2fbndvslb1wf"; + sha256 = "sha256-Itt2JIStx+JsnMMBvbeJXSEJpaS/pd1UMvPGNd50k7I="; }; buildInputs = [ - (boost168.override { enablePython = true; }) - SDL2 python2 freetype openal libogg libvorbis zlib libpng libtiff libjpeg libGLU libGL glew ]; + (boost16x.override { enablePython = true; python = python3; }) + (python3.withPackages (p: with p; [ pycodestyle ])) + SDL2 + freetype + glew + libGL + libGLU + libjpeg + libogg + libpng + libtiff + libvorbis + openal + zlib + ]; - nativeBuildInputs = [ cmake doxygen graphviz makeWrapper ]; + nativeBuildInputs = [ + cmake + cppcheck + doxygen + graphviz + makeWrapper + ]; + + # as of 0.4.10.1 FreeOrion doesn't work with "-DOpenGL_GL_PREFERENCE=GLVND" + cmakeFlags = [ "-DOpenGL_GL_PREFERENCE=LEGACY" ]; postInstall = '' - mkdir -p $out/fixpaths + mkdir -p $out/libexec # We need final slashes for XSLT replace to work properly - substitute ${./fix-paths.xslt} $out/fixpaths/fix-paths.xslt \ + substitute ${./fix-paths.xslt} $out/share/freeorion/fix-paths.xslt \ --subst-var-by nixStore "$NIX_STORE/" \ --subst-var-by out "$out/" - substitute ${./fix-paths.sh} $out/fixpaths/fix-paths \ + substitute ${./fix-paths.sh} $out/libexec/fix-paths \ --subst-var-by libxsltBin ${libxslt.bin} \ --subst-var-by shell ${stdenv.shell} \ --subst-var out - chmod +x $out/fixpaths/fix-paths + chmod +x $out/libexec/fix-paths wrapProgram $out/bin/freeorion \ - --run $out/fixpaths/fix-paths \ + --run $out/libexec/fix-paths \ --prefix LD_LIBRARY_PATH : $out/lib/freeorion ''; diff --git a/pkgs/games/freeorion/fix-paths.sh b/pkgs/games/freeorion/fix-paths.sh index 3f82533dd60..def017ddc5b 100644 --- a/pkgs/games/freeorion/fix-paths.sh +++ b/pkgs/games/freeorion/fix-paths.sh @@ -1,6 +1,6 @@ #!@shell@ if [ -e ~/.config/freeorion/config.xml ]; then - @libxsltBin@/bin/xsltproc -o ~/.config/freeorion/config.xml @out@/fixpaths/fix-paths.xslt ~/.config/freeorion/config.xml + @libxsltBin@/bin/xsltproc -o ~/.config/freeorion/config.xml @out@/share/freeorion/fix-paths.xslt ~/.config/freeorion/config.xml fi exit 0