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

gargoyle: 2019.1.1 -> 2023.1 #276280

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions pkgs/games/gargoyle/darwin.sh

This file was deleted.

68 changes: 15 additions & 53 deletions pkgs/games/gargoyle/default.nix
Original file line number Diff line number Diff line change
@@ -1,72 +1,34 @@
{ lib, stdenv, fetchFromGitHub, substituteAll, jam, cctools, pkg-config
, SDL, SDL_mixer, SDL_sound, gtk2, libvorbis, smpeg }:

let

jamenv = ''
unset AR
'' + (if stdenv.isDarwin then ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${lib.getDev SDL}/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"
'');

in
{ lib, fetchFromGitHub, stdenv, cmake, pkg-config
, SDL2, SDL2_mixer, fmt, freetype, libjpeg_turbo
, qt5, libsndfile
}:

stdenv.mkDerivation rec {
pname = "gargoyle";
version = "2019.1.1";
version = "2023.1";

allowSubstitutes = false;

src = fetchFromGitHub {
owner = "garglk";
repo = "garglk";
rev = version;
sha256 = "0w54avmbp4i4zps2rb4acmpa641s6wvwbrln4vbdhcz97fx48nzz";
sha256 = "sha256-XsN5FXWJb3DSOjipxr/HW9R7QS+7iEaITERTrbGEMwA=";
};

nativeBuildInputs = [ jam pkg-config ] ++ lib.optional stdenv.isDarwin cctools;
nativeBuildInputs = [ cmake qt5.wrapQtAppsHook pkg-config ];

buildInputs = [ SDL SDL_mixer SDL_sound gtk2 ]
++ lib.optionals stdenv.isDarwin [ smpeg libvorbis ];
buildInputs = [
SDL2 SDL2_mixer fmt freetype libjpeg_turbo qt5.qtbase libsndfile
];

# Workaround build failure on -fno-common toolchains:
# ld: build/linux.release/alan3/Location.o:(.bss+0x0): multiple definition of
# `logFile'; build/linux.release/alan3/act.o:(.bss+0x0): first defined here
# TODO: drop once updated to 2022.1 or later.
env.NIX_CFLAGS_COMPILE = "-fcommon";

buildPhase = jamenv + "jam -j$NIX_BUILD_CORES";

installPhase =
if stdenv.isDarwin then
(substituteAll {
inherit (stdenv) shell;
isExecutable = true;
src = ./darwin.sh;
})
else jamenv + ''
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"
preFixup = ''
sed 's/\/\//\//g' -i $out/lib/pkgconfig/garglk.pc
'';

enableParallelBuilding = true;

meta = with lib; {
broken = stdenv.isDarwin;
homepage = "http://ccxvii.net/gargoyle/";
homepage = "https://ccxvii.net/gargoyle/";
license = licenses.gpl2Plus;
description = "Interactive fiction interpreter GUI";
platforms = platforms.unix;
Expand Down
4 changes: 1 addition & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37818,9 +37818,7 @@ with pkgs;

garden-of-coloured-lights = callPackage ../games/garden-of-coloured-lights { allegro = allegro4; };

gargoyle = callPackage ../games/gargoyle {
inherit (darwin) cctools;
};
gargoyle = callPackage ../games/gargoyle { };

gav = callPackage ../games/gav { };

Expand Down