Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Darkest Dungeon (GoG) derivation #118

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft
100 changes: 100 additions & 0 deletions pkgs/darkest-dungeon/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
lib,
requireFile,
makeDesktopItem,
copyDesktopItems,
autoPatchelfHook,
makeBinaryWrapper,
stdenvNoCC,
zip,
unzip,
# Runtime deps.
SDL2,
libcxx,
libGL,
fmodex,
libmx,
libX11,
libXext,
libxcb,
libXau,
libXdmcp,
}: let
commonDeps = [
SDL2
libcxx
libGL
fmodex
libmx
fmodex
libX11
libXext
libxcb
libXau
libXdmcp
];
in
stdenvNoCC.mkDerivation rec {
pname = "darkest-dungeon";
version = "24839_28859";

# The official installer must be provided by the end user.
src = requireFile {
name = "darkest_dungeon_${version}.sh";
url = "https://www.gog.com/game/darkest_dungeon";
sha256 = "2b235b43d8d6ab4b2a4b80b627ce2a9c31c1b4bee16fc6f9dda68c29cb5da99c";
};

nativeBuildInputs =
[
autoPatchelfHook
makeBinaryWrapper
unzip
zip
copyDesktopItems
]
++ commonDeps;

desktopItems = [
(makeDesktopItem {
name = pname;
desktopName = "Darkest Dungeon";
genericName = "Loosing your will to live; the game";
exec = "darkest";
icon = pname;
comment = "Darkest Dungeon GoG version";
categories = ["Game"];
})
];

unpackCmd = "${unzip}/bin/unzip $src 'data/noarch/game/*' 'data/noarch/support/icon.png' -d . || true";

sourceRoot = ".";

installPhase = ''
mkdir -p $out/share/${pname}
mkdir -p $out/share/icons/hicolor

# Only copies this folder since the rest is useless.
mv data/noarch/game/* $out/share/${pname}

# Installs the icon.
mv data/noarch/support/icon.png $out/share/icons/hicolor/${pname}.png

# Creates the wrapper for the game.
makeBinaryWrapper $out/share/${pname}/darkest.bin.x86_64 $out/bin/darkest \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath commonDeps}
'';

# Metadata
meta = with lib; {
description = "The game that would drive you into utter maddness";
longDescription = "Darkest Dungeon GoG version. Without any DLCs";
homepage = "https://www.darkestdungeon.com";
downloadPage = "https://www.gog.com/game/darkest_dungeon";
license = licenses.unfree;
mainProgram = "darkest";
maintainers = with maintainers; [notevil];
platforms = ["x86_64-linux"];
};
}
2 changes: 2 additions & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
// extra))
.${wine};
in {
darkest-dungeon = pkgs.callPackage ./darkest-dungeon {};

dxvk = pkgs.callPackage ./dxvk {inherit pins;};
dxvk-w32 = pkgs.pkgsCross.mingw32.callPackage ./dxvk {inherit pins;};
dxvk-w64 = pkgs.pkgsCross.mingwW64.callPackage ./dxvk {inherit pins;};
Expand Down