2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, SDL2, SDL2_mixer, SDL2_ttf, libsodium, pkg-config }:
|
2021-04-08 23:18:46 +01:00
|
|
|
|
2019-10-21 01:10:52 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2021-04-04 23:45:02 +01:00
|
|
|
pname = "devilutionx";
|
2021-04-14 08:04:12 +01:00
|
|
|
version = "1.2.1";
|
2019-07-19 20:50:45 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "diasurgical";
|
|
|
|
repo = "devilutionX";
|
2021-04-08 09:44:45 +01:00
|
|
|
rev = version;
|
2021-04-14 08:04:12 +01:00
|
|
|
sha256 = "sha256-PgYlNO1p78d0uiL474bDJOL++SxJfeBLK65czdaylHU=";
|
2019-07-19 20:50:45 +01:00
|
|
|
};
|
|
|
|
|
2021-04-08 23:18:46 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Source/init.cpp --replace "/usr/share/diasurgical/devilutionx/" "${placeholder "out"}/share/diasurgical/devilutionx/"
|
|
|
|
'';
|
|
|
|
|
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 20:50:45 +01:00
|
|
|
|
2020-10-25 08:18:42 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBINARY_RELEASE=ON"
|
2021-04-08 23:18:46 +01:00
|
|
|
"-DVERSION_NUM=${version}"
|
2020-10-25 08:18:42 +00:00
|
|
|
];
|
|
|
|
|
2019-07-19 20:50:45 +01:00
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
|
|
|
buildInputs = [ libsodium SDL2 SDL2_mixer SDL2_ttf ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2019-10-21 01:10:52 +01: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
|
2021-04-08 23:18:46 +01:00
|
|
|
install -Dt $out/share/diasurgical/devilutionx ../Packaging/resources/devilutionx.mpq
|
2019-10-31 21:46:24 +00:00
|
|
|
|
|
|
|
# TODO: icons and .desktop (see Packages/{debian,fedora}/*)
|
2019-10-21 01:10:52 +01:00
|
|
|
'') + ''
|
2019-07-19 20:50:45 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-07-19 20:50:45 +01:00
|
|
|
homepage = "https://github.com/diasurgical/devilutionX";
|
|
|
|
description = "Diablo build for modern operating systems";
|
2019-10-21 01:10:52 +01: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 20:50:45 +01:00
|
|
|
license = licenses.unlicense;
|
|
|
|
maintainers = [ maintainers.karolchmist ];
|
2020-10-25 08:18:42 +00:00
|
|
|
platforms = platforms.linux ++ platforms.windows;
|
2019-07-19 20:50:45 +01:00
|
|
|
};
|
|
|
|
}
|