2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, SDL2, SDL2_mixer, SDL2_ttf, libsodium, pkg-config }:
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-04-08 16:26:57 +00:00
|
|
|
pname = "devilutionx";
|
|
|
|
version = "1.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "diasurgical";
|
|
|
|
repo = "devilutionX";
|
2021-04-08 16:26:57 +00:00
|
|
|
rev = version;
|
2021-04-05 15:23:46 +00:00
|
|
|
sha256 = "03w3bgmzwsbycx3fzvn47fsmabl069gw77yn2fqg89wlgaw1yrr9";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = [
|
|
|
|
"-I${SDL2_ttf}/include/SDL2"
|
|
|
|
''-DTTF_FONT_PATH="${placeholder "out"}/share/fonts/truetype/CharisSILB.ttf"''
|
|
|
|
];
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBINARY_RELEASE=ON"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
|
|
|
buildInputs = [ libsodium SDL2 SDL2_mixer SDL2_ttf ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
'' + (if stdenv.isDarwin then ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
mv devilutionx.app $out/Applications
|
|
|
|
'' else ''
|
|
|
|
install -Dm755 -t $out/bin devilutionx
|
|
|
|
install -Dt $out/share/fonts/truetype ../Packaging/resources/CharisSILB.ttf
|
|
|
|
|
|
|
|
# TODO: icons and .desktop (see Packages/{debian,fedora}/*)
|
|
|
|
'') + ''
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/diasurgical/devilutionX";
|
|
|
|
description = "Diablo build for modern operating systems";
|
|
|
|
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.";
|
|
|
|
license = licenses.unlicense;
|
|
|
|
maintainers = [ maintainers.karolchmist ];
|
2021-04-05 15:23:46 +00:00
|
|
|
platforms = platforms.linux ++ platforms.windows;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|