diff --git a/pkgs/games/gemrb/default.nix b/pkgs/games/gemrb/default.nix index 9c5744f7291..77c9c7adaf9 100644 --- a/pkgs/games/gemrb/default.nix +++ b/pkgs/games/gemrb/default.nix @@ -1,32 +1,71 @@ -{ lib, stdenv, fetchFromGitHub, cmake -, freetype, SDL2, SDL2_mixer, openal, zlib, libpng, python2, libvorbis -, libiconv }: +{ lib +, stdenv +, fetchFromGitHub +, cmake +, SDL2 +, SDL2_mixer +, freetype +, libGL +, libiconv +, libpng +, libvlc +, libvorbis +, openal +, python2 # 0.9.0 crashes after character generation with py3, so stick to py2 for now +, zlib +}: +let + # the GLES backend on rpi is untested as I don't have the hardware + backend = + if (stdenv.isx86_32 || stdenv.isx86_64) then "OpenGL" else "GLES"; + +in stdenv.mkDerivation rec { pname = "gemrb"; - version = "0.8.7"; + version = "0.9.0"; src = fetchFromGitHub { owner = "gemrb"; repo = "gemrb"; rev = "v${version}"; - sha256 = "14j9mhrbi4gnrbv25nlsvcxzkylijzrnwbqqnrg7pr452lb3srpb"; + sha256 = "sha256-h/dNPY0QZ2m7aYgRla3r1E8APJqO99ePa2ABhhh3Aoc="; }; - # TODO: make libpng, libvorbis, sdl_mixer, freetype, vlc, glew (and other gl - # reqs) optional - buildInputs = [ freetype python2 openal SDL2 SDL2_mixer zlib libpng libvorbis libiconv ]; + buildInputs = [ + SDL2 + SDL2_mixer + freetype + libGL + libiconv + libpng + libvlc + libvorbis + openal + python2 + zlib + ]; nativeBuildInputs = [ cmake ]; - # TODO: add proper OpenGL support. We are currently (0.8.7) getting a shader - # error on execution when enabled. + LIBVLC_INCLUDE_PATH = "${lib.getDev libvlc}/include"; + LIBVLC_LIBRARY_PATH = "${lib.getLib libvlc}/lib"; + cmakeFlags = [ + # use the Mesa drivers for video on ARM (harmless on x86) + "-DDISABLE_VIDEOCORE=ON" "-DLAYOUT=opt" - # "-DOPENGL_BACKEND=GLES" - # "-DOpenGL_GL_PREFERENCE=GLVND" + "-DOPENGL_BACKEND=${backend}" + "-DOpenGL_GL_PREFERENCE=GLVND" ]; + postInstall = '' + for s in 36 48 72 96 144; do + install -Dm444 ../artwork/gemrb-logo-glow-''${s}px.png $out/share/icons/hicolor/''${s}x''${s}/gemrb.png + done + install -Dm444 ../artwork/gemrb-logo.png $out/share/icons/gemrb.png + ''; + meta = with lib; { description = "A reimplementation of the Infinity Engine, used by games such as Baldur's Gate"; longDescription = '' @@ -36,8 +75,7 @@ stdenv.mkDerivation rec { ruleset (Baldur's Gate and Icewind Dale series, Planescape: Torment). ''; homepage = "https://gemrb.org/"; - license = licenses.gpl2; + license = licenses.gpl2Only; maintainers = with maintainers; [ peterhoeg ]; - platforms = platforms.all; }; }