nixpkgs/pkgs/games/gargoyle/default.nix

68 lines
1.9 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, substituteAll, jam, cctools, pkgconfig
2019-06-19 23:20:34 +02:00
, SDL, SDL_mixer, SDL_sound, gtk2, libvorbis, smpeg }:
2017-03-19 00:22:48 +01:00
let
2017-08-26 00:24:21 +02:00
jamenv = ''
unset AR
'' + (if stdenv.isDarwin then ''
2017-03-19 00:22:48 +01:00
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${SDL.dev}/include/SDL"
export GARGLKINI="$out/Applications/Gargoyle.app/Contents/Resources/garglk.ini"
'' else ''
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/libexec/gargoyle"
export DESTDIR="$out"
export _BINDIR=libexec/gargoyle
export _APPDIR=libexec/gargoyle
export _LIBDIR=libexec/gargoyle
export GARGLKINI="$out/etc/garglk.ini"
2017-08-26 00:24:21 +02:00
'');
2017-03-19 00:22:48 +01:00
in
stdenv.mkDerivation {
2018-11-11 04:42:39 +01:00
name = "gargoyle-2018-10-06";
2017-03-19 00:22:48 +01:00
src = fetchFromGitHub {
owner = "garglk";
repo = "garglk";
2018-11-11 04:42:39 +01:00
rev = "d03391563fa75942fbf8f8deeeacf3a8be9fc3b0";
sha256 = "0icwgc25gp7krq6zf66hljydc6vps6bb4knywnrfgnfcmcalqqx9";
2017-03-19 00:22:48 +01:00
};
nativeBuildInputs = [ jam pkgconfig ] ++ stdenv.lib.optional stdenv.isDarwin cctools;
2017-03-19 00:22:48 +01:00
2018-11-11 04:42:39 +01:00
buildInputs = [ SDL SDL_mixer SDL_sound gtk2 ]
2019-06-19 23:20:34 +02:00
++ stdenv.lib.optionals stdenv.isDarwin [ smpeg libvorbis ];
2017-03-19 00:22:48 +01:00
buildPhase = jamenv + "jam -j$NIX_BUILD_CORES";
installPhase =
if stdenv.isDarwin then
(substituteAll {
inherit (stdenv) shell;
isExecutable = true;
src = ./darwin.sh;
})
else jamenv + ''
2017-03-19 00:22:48 +01:00
jam -j$NIX_BUILD_CORES install
mkdir -p "$out/bin"
ln -s ../libexec/gargoyle/gargoyle "$out/bin"
mkdir -p "$out/etc"
cp garglk/garglk.ini "$out/etc"
mkdir -p "$out/share/applications"
cp garglk/gargoyle.desktop "$out/share/applications"
mkdir -p "$out/share/icons/hicolor/32x32/apps"
cp garglk/gargoyle-house.png "$out/share/icons/hicolor/32x32/apps"
'';
enableParallelBuilding = true;
meta = with stdenv.lib; {
2017-03-19 00:22:48 +01:00
homepage = http://ccxvii.net/gargoyle/;
license = licenses.gpl2Plus;
description = "Interactive fiction interpreter GUI";
platforms = platforms.unix;
maintainers = with maintainers; [ orivej ];
};
}