2019-07-19 19:50:45 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, SDL2, SDL2_mixer, SDL2_ttf, libsodium, pkg-config }:
|
2019-10-21 00:10:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-12-31 21:52:24 +00:00
|
|
|
version = "1.0.0";
|
2019-07-19 19:50:45 +00:00
|
|
|
pname = "devilutionx";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "diasurgical";
|
|
|
|
repo = "devilutionX";
|
2019-10-21 00:10:52 +00:00
|
|
|
rev = version;
|
2019-12-31 21:52:24 +00:00
|
|
|
sha256 = "0lx903gchda4bgr71469yn63rx5ya6xv9j1azx18nrv3sskrphn4";
|
2019-07-19 19:50:45 +00:00
|
|
|
};
|
|
|
|
|
2019-10-31 21:46:24 +00:00
|
|
|
NIX_CFLAGS_COMPILE = [
|
|
|
|
"-I${SDL2_ttf}/include/SDL2"
|
|
|
|
''-DTTF_FONT_PATH="${placeholder "out"}/share/fonts/truetype/CharisSILB.ttf"''
|
|
|
|
];
|
2019-07-19 19:50:45 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
|
|
|
buildInputs = [ libsodium SDL2 SDL2_mixer SDL2_ttf ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2019-10-21 00:10:52 +00:00
|
|
|
'' + (if stdenv.isDarwin then ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
mv devilutionx.app $out/Applications
|
|
|
|
'' else ''
|
2019-10-31 21:46:24 +00:00
|
|
|
install -Dm755 -t $out/bin devilutionx
|
|
|
|
install -Dt $out/share/fonts/truetype ../Packaging/resources/CharisSILB.ttf
|
|
|
|
|
|
|
|
# TODO: icons and .desktop (see Packages/{debian,fedora}/*)
|
2019-10-21 00:10:52 +00:00
|
|
|
'') + ''
|
2019-07-19 19:50:45 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = "https://github.com/diasurgical/devilutionX";
|
|
|
|
description = "Diablo build for modern operating systems";
|
2019-10-21 00:10:52 +00:00
|
|
|
longDescription = "In order to play this game a copy of diabdat.mpq is required. Place a copy of diabdat.mpq in ~/.local/share/diasurgical/devilution before executing the game.";
|
2019-07-19 19:50:45 +00:00
|
|
|
license = licenses.unlicense;
|
|
|
|
maintainers = [ maintainers.karolchmist ];
|
|
|
|
platforms = platforms.linux ++ platforms.darwin ++ platforms.windows;
|
|
|
|
};
|
|
|
|
}
|