2021-06-28 23:13:55 +00:00
|
|
|
{ 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
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
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";
|
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
withVLC = stdenv.isDarwin;
|
|
|
|
|
|
|
|
inherit (lib) optional optionalString;
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gemrb";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "0.9.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-09-25 04:45:31 +00:00
|
|
|
owner = "gemrb";
|
|
|
|
repo = "gemrb";
|
|
|
|
rev = "v${version}";
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "sha256-h/dNPY0QZ2m7aYgRla3r1E8APJqO99ePa2ABhhh3Aoc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
SDL2_mixer
|
|
|
|
freetype
|
|
|
|
libGL
|
|
|
|
libiconv
|
|
|
|
libpng
|
|
|
|
libvorbis
|
|
|
|
openal
|
|
|
|
python2
|
|
|
|
zlib
|
2021-07-03 03:11:41 +00:00
|
|
|
]
|
|
|
|
++ optional withVLC libvlc;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
# libvlc isn't being detected properly as of 0.9.0, so set it
|
|
|
|
LIBVLC_INCLUDE_PATH = optionalString withVLC "${lib.getDev libvlc}/include";
|
|
|
|
LIBVLC_LIBRARY_PATH = optionalString withVLC "${lib.getLib libvlc}/lib";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
cmakeFlags = [
|
2021-07-03 03:11:41 +00:00
|
|
|
"-DDATA_DIR=${placeholder "out"}/share/gemrb"
|
|
|
|
"-DEXAMPLE_CONF_DIR=${placeholder "out"}/share/doc/gemrb/examples"
|
|
|
|
"-DSYSCONF_DIR=/etc"
|
2021-06-28 23:13:55 +00:00
|
|
|
# use the Mesa drivers for video on ARM (harmless on x86)
|
|
|
|
"-DDISABLE_VIDEOCORE=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DLAYOUT=opt"
|
2021-06-28 23:13:55 +00:00
|
|
|
"-DOPENGL_BACKEND=${backend}"
|
|
|
|
"-DOpenGL_GL_PREFERENCE=GLVND"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A reimplementation of the Infinity Engine, used by games such as Baldur's Gate";
|
|
|
|
longDescription = ''
|
|
|
|
GemRB (Game engine made with pre-Rendered Background) is a portable
|
|
|
|
open-source implementation of Bioware's Infinity Engine. It was written to
|
|
|
|
support pseudo-3D role playing games based on the Dungeons & Dragons
|
|
|
|
ruleset (Baldur's Gate and Icewind Dale series, Planescape: Torment).
|
|
|
|
'';
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://gemrb.org/";
|
2021-06-28 23:13:55 +00:00
|
|
|
license = licenses.gpl2Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
|
|
|
};
|
|
|
|
}
|