diff options
author | Mitsuhiro Nakamura <m.nacamura@gmail.com> | 2018-07-06 01:47:43 +0900 |
---|---|---|
committer | Mitsuhiro Nakamura <m.nacamura@gmail.com> | 2018-07-18 00:33:42 +0900 |
commit | 206e271e32a5d356d60c329c13fa18cd1cbd9ba1 (patch) | |
tree | a6c44499e305a5d03d4f8aff20ca9b7b75e357be /pkgs/games/cataclysm-dda/common.nix | |
parent | 464cf105c630109e19db8d183e229a749c0558db (diff) | |
download | nixlib-206e271e32a5d356d60c329c13fa18cd1cbd9ba1.tar nixlib-206e271e32a5d356d60c329c13fa18cd1cbd9ba1.tar.gz nixlib-206e271e32a5d356d60c329c13fa18cd1cbd9ba1.tar.bz2 nixlib-206e271e32a5d356d60c329c13fa18cd1cbd9ba1.tar.lz nixlib-206e271e32a5d356d60c329c13fa18cd1cbd9ba1.tar.xz nixlib-206e271e32a5d356d60c329c13fa18cd1cbd9ba1.tar.zst nixlib-206e271e32a5d356d60c329c13fa18cd1cbd9ba1.zip |
cataclysm-dda{,-git}: move common attributes to common.nix
Diffstat (limited to 'pkgs/games/cataclysm-dda/common.nix')
-rw-r--r-- | pkgs/games/cataclysm-dda/common.nix | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/pkgs/games/cataclysm-dda/common.nix b/pkgs/games/cataclysm-dda/common.nix new file mode 100644 index 000000000000..389a9a61394b --- /dev/null +++ b/pkgs/games/cataclysm-dda/common.nix @@ -0,0 +1,96 @@ +{ stdenv, fetchFromGitHub, pkgconfig, gettext, lua, ncurses +, tiles, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, freetype, Cocoa +, debug +}: + +let + inherit (stdenv.lib) optionals; + + cursesDeps = [ gettext lua ncurses ]; + + tilesDeps = [ SDL2 SDL2_image SDL2_mixer SDL2_ttf freetype ] + ++ optionals stdenv.isDarwin [ Cocoa ]; + + common = { + nativeBuildInputs = [ pkgconfig ]; + + buildInputs = cursesDeps ++ optionals tiles tilesDeps; + + postPatch = '' + patchShebangs . + ''; + + makeFlags = [ + "PREFIX=$(out)" "LUA=1" "USE_HOME_DIR=1" "LANGUAGES=all" + ] ++ optionals (!debug) [ + "RELEASE=1" + ] ++ optionals tiles [ + "TILES=1" "SOUND=1" + ] ++ optionals stdenv.isDarwin [ + "NATIVE=osx" "CLANG=1" + ]; + + dontStrip = debug; + + meta = with stdenv.lib; { + description = "A free, post apocalyptic, zombie infested rogue-like"; + longDescription = '' + Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world. + Surviving is difficult: you have been thrown, ill-equipped, into a + landscape now riddled with monstrosities of which flesh eating zombies are + neither the strangest nor the deadliest. + + Yet with care and a little luck, many things are possible. You may try to + eke out an existence in the forests silently executing threats and + providing sustenance with your longbow. You can ride into town in a + jerry-rigged vehicle, all guns blazing, to settle matters in a fug of + smoke from your molotovs. You could take a more measured approach and + construct an impregnable fortress, surrounded by traps to protect you from + the horrors without. The longer you survive, the more skilled and adapted + you will get and the better equipped and armed to deal with the threats + you are presented with. + + In the course of your ordeal there will be opportunities and temptations + to improve or change your very nature. There are tales of survivors fitted + with extraordinary cybernetics giving great power and stories too of + gravely mutated survivors who, warped by their ingestion of exotic + substances or radiation, now more closely resemble insects, birds or fish + than their original form. + ''; + homepage = https://cataclysmdda.org/; + license = licenses.cc-by-sa-30; + platforms = platforms.unix; + }; + }; + + utils = { + fetchFromCleverRaven = { rev, sha256 }: + fetchFromGitHub { + owner = "CleverRaven"; + repo = "Cataclysm-DDA"; + inherit rev sha256; + }; + + installXDGAppLauncher = '' + launcher="$out/share/applications/cataclysm-dda.desktop" + install -D -m 444 data/xdg/com.cataclysmdda.cataclysm-dda.desktop -T "$launcher" + sed -i "$launcher" -e "s,\(Exec=\)\(cataclysm-tiles\),\1$out/bin/\2," + install -D -m 444 data/xdg/cataclysm-dda.svg -t $out/share/icons/hicolor/scalable/apps + ''; + + installMacOSAppLauncher = '' + app=$out/Applications/Cataclysm.app + install -D -m 444 data/osx/Info.plist -t $app/Contents + install -D -m 444 data/osx/AppIcon.icns -t $app/Contents/Resources + mkdir $app/Contents/MacOS + launcher=$app/Contents/MacOS/Cataclysm.sh + cat << EOF > $launcher + #!${stdenv.shell} + $out/bin/cataclysm-tiles + EOF + chmod 555 $launcher + ''; + }; +in + +{ inherit common utils; } |