2022-07-11 12:29:38 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, requireFile
|
|
|
|
, openal
|
|
|
|
, curl
|
|
|
|
, libogg
|
|
|
|
, libvorbis
|
|
|
|
, SDL2
|
|
|
|
, SDL2_image
|
|
|
|
, zlib
|
|
|
|
, clang
|
|
|
|
, libtheora
|
2019-08-20 12:39:09 +00:00
|
|
|
, unfree_assets ? false }:
|
|
|
|
|
2023-08-08 17:18:26 +00:00
|
|
|
let
|
2019-08-20 12:39:09 +00:00
|
|
|
pname = "keeperrl";
|
2022-07-11 12:29:38 +00:00
|
|
|
version = "alpha34";
|
2019-08-20 12:39:09 +00:00
|
|
|
|
2023-08-08 17:39:02 +00:00
|
|
|
free_src = fetchFromGitHub {
|
2019-08-20 12:39:09 +00:00
|
|
|
owner = "miki151";
|
2023-08-08 17:18:26 +00:00
|
|
|
repo = pname;
|
2019-08-20 12:39:09 +00:00
|
|
|
rev = version;
|
2022-07-11 12:29:38 +00:00
|
|
|
sha256 = "sha256-0sww+ppctXvxMouclG3OdXpcNgrrOZJw9z8s2GhJ+IE=";
|
2019-08-20 12:39:09 +00:00
|
|
|
};
|
|
|
|
|
2023-08-08 17:18:26 +00:00
|
|
|
assets = requireFile rec {
|
2019-08-20 12:39:09 +00:00
|
|
|
name = "keeperrl_data_${version}.tar.gz";
|
|
|
|
message = ''
|
|
|
|
This nix expression requires that the KeeperRL art assets are already
|
|
|
|
part of the store. These can be obtained from a purchased copy of the game
|
|
|
|
and found in the "data" directory. Make a tar archive of this directory
|
|
|
|
with
|
|
|
|
|
|
|
|
"tar czf ${name} data"
|
|
|
|
|
|
|
|
Then add this archive to the nix store with
|
|
|
|
|
|
|
|
"nix-prefetch-url file://\$PWD/${name}".
|
|
|
|
'';
|
2022-07-11 12:29:38 +00:00
|
|
|
sha256 = "0115pxdzdyma2vicxgr0j21pp82gxdyrlj090s8ihp0b50f0nlll";
|
2023-08-08 17:18:26 +00:00
|
|
|
};
|
|
|
|
in
|
2019-08-20 12:39:09 +00:00
|
|
|
|
2023-08-08 17:18:26 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit pname version;
|
2019-08-20 12:39:09 +00:00
|
|
|
|
2023-08-08 17:39:02 +00:00
|
|
|
srcs = [ free_src ] ++ lib.optional unfree_assets assets;
|
2019-08-20 12:39:09 +00:00
|
|
|
|
2023-08-08 17:39:02 +00:00
|
|
|
sourceRoot = free_src.name;
|
2023-08-08 17:18:26 +00:00
|
|
|
|
2021-01-15 04:31:39 +00:00
|
|
|
postUnpack = lib.optionalString unfree_assets ''
|
2019-08-20 12:39:09 +00:00
|
|
|
mv data $sourceRoot
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [
|
2022-07-11 12:29:38 +00:00
|
|
|
openal curl libogg libvorbis libtheora SDL2 SDL2_image zlib clang
|
2019-08-20 12:39:09 +00:00
|
|
|
];
|
|
|
|
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString [
|
2019-08-20 12:39:09 +00:00
|
|
|
"-I${SDL2.dev}/include/SDL2"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-07-11 12:29:38 +00:00
|
|
|
makeFlags = [
|
|
|
|
"OPT=true"
|
|
|
|
"RELEASE=true"
|
|
|
|
"DATA_DIR=$(out)/share"
|
|
|
|
"ENABLE_LOCAL_USER_DIR=true"
|
|
|
|
"NO_STEAMWORKS=true"
|
|
|
|
];
|
2019-08-20 12:39:09 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 keeper $out/bin/keeper
|
|
|
|
install -Dm755 appconfig.txt $out/share/appconfig.txt
|
|
|
|
|
|
|
|
cp -r data_free $out/share
|
|
|
|
cp -r data_contrib $out/share
|
2021-01-15 04:31:39 +00:00
|
|
|
${lib.optionalString unfree_assets "cp -r data $out/share"}
|
2019-08-20 12:39:09 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-08-20 12:39:09 +00:00
|
|
|
description = "A dungeon management rogue-like";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "keeper";
|
2019-08-20 12:39:09 +00:00
|
|
|
homepage = "https://keeperrl.com/";
|
|
|
|
license = licenses.gpl2;
|
2022-07-11 12:29:38 +00:00
|
|
|
maintainers = with maintainers; [ onny ];
|
2019-08-20 12:39:09 +00:00
|
|
|
# TODO: Add OS X
|
2022-08-01 16:33:27 +00:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2019-08-20 12:39:09 +00:00
|
|
|
};
|
|
|
|
}
|