19 # the GLES backend on rpi is untested as I don't have the hardware
21 if stdenv.hostPlatform.isx86 then "OpenGL" else "GLES";
23 withVLC = stdenv.isDarwin;
25 inherit (lib) optional optionalString;
28 stdenv.mkDerivation rec {
32 src = fetchFromGitHub {
36 hash = "sha256-riea48Jc9zYb19mf5sBunTp5l27PGRFd/B5KdCUWr6Y=";
51 ++ optional withVLC libvlc;
53 nativeBuildInputs = [ cmake ];
55 # libvlc isn't being detected properly as of 0.9.0, so set it
56 LIBVLC_INCLUDE_PATH = optionalString withVLC "${lib.getDev libvlc}/include";
57 LIBVLC_LIBRARY_PATH = optionalString withVLC "${lib.getLib libvlc}/lib";
60 "-DDATA_DIR=${placeholder "out"}/share/gemrb"
61 "-DEXAMPLE_CONF_DIR=${placeholder "out"}/share/doc/gemrb/examples"
63 # use the Mesa drivers for video on ARM (harmless on x86)
64 "-DDISABLE_VIDEOCORE=ON"
66 "-DOPENGL_BACKEND=${backend}"
67 "-DOpenGL_GL_PREFERENCE=GLVND"
71 for s in 36 48 72 96 144; do
72 install -Dm444 ../artwork/gemrb-logo-glow-''${s}px.png $out/share/icons/hicolor/''${s}x''${s}/gemrb.png
74 install -Dm444 ../artwork/gemrb-logo.png $out/share/icons/gemrb.png
78 description = "A reimplementation of the Infinity Engine, used by games such as Baldur's Gate";
80 GemRB (Game engine made with pre-Rendered Background) is a portable
81 open-source implementation of Bioware's Infinity Engine. It was written to
82 support pseudo-3D role playing games based on the Dungeons & Dragons
83 ruleset (Baldur's Gate and Icewind Dale series, Planescape: Torment).
85 homepage = "https://gemrb.org/";
86 license = licenses.gpl2Only;
87 maintainers = with maintainers; [ peterhoeg ];