24 if stdenv.hostPlatform.isDarwin then
26 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${lib.getDev SDL}/include/SDL"
27 export GARGLKINI="$out/Applications/Gargoyle.app/Contents/Resources/garglk.ini"
31 export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/libexec/gargoyle"
33 export _BINDIR=libexec/gargoyle
34 export _APPDIR=libexec/gargoyle
35 export _LIBDIR=libexec/gargoyle
36 export GARGLKINI="$out/etc/garglk.ini"
42 stdenv.mkDerivation rec {
46 src = fetchFromGitHub {
50 sha256 = "0w54avmbp4i4zps2rb4acmpa641s6wvwbrln4vbdhcz97fx48nzz";
56 ] ++ lib.optional stdenv.hostPlatform.isDarwin cctools;
65 ++ lib.optionals stdenv.hostPlatform.isDarwin [
70 # Workaround build failure on -fno-common toolchains:
71 # ld: build/linux.release/alan3/Location.o:(.bss+0x0): multiple definition of
72 # `logFile'; build/linux.release/alan3/act.o:(.bss+0x0): first defined here
73 # TODO: drop once updated to 2022.1 or later.
74 env.NIX_CFLAGS_COMPILE = "-fcommon";
76 buildPhase = jamenv + "jam -j$NIX_BUILD_CORES";
79 if stdenv.hostPlatform.isDarwin then
81 inherit (stdenv) shell;
88 jam -j$NIX_BUILD_CORES install
90 ln -s ../libexec/gargoyle/gargoyle "$out/bin"
92 cp garglk/garglk.ini "$out/etc"
93 mkdir -p "$out/share/applications"
94 cp garglk/gargoyle.desktop "$out/share/applications"
95 mkdir -p "$out/share/icons/hicolor/32x32/apps"
96 cp garglk/gargoyle-house.png "$out/share/icons/hicolor/32x32/apps"
99 enableParallelBuilding = true;
102 broken = stdenv.hostPlatform.isDarwin;
103 homepage = "http://ccxvii.net/gargoyle/";
104 license = licenses.gpl2Plus;
105 description = "Interactive fiction interpreter GUI";
106 mainProgram = "gargoyle";
107 platforms = platforms.unix;
108 maintainers = with maintainers; [ orivej ];