nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchDebianPatch,
6 cmake,
7 pkg-config,
8 fluidsynth,
9 fmt,
10 freetype,
11 libjpeg,
12 libopenmpt,
13 libpng,
14 libsndfile,
15 libvorbis,
16 mpg123,
17 qt6,
18}:
19
20stdenv.mkDerivation rec {
21 pname = "gargoyle";
22 version = "2023.1";
23
24 src = fetchFromGitHub {
25 owner = "garglk";
26 repo = "garglk";
27 tag = version;
28 hash = "sha256-XsN5FXWJb3DSOjipxr/HW9R7QS+7iEaITERTrbGEMwA=";
29 };
30
31 patches = [
32 (fetchDebianPatch {
33 pname = "gargoyle-free";
34 version = "2023.1+dfsg";
35 debianRevision = "4";
36 patch = "ftbfs_gcc14.patch";
37 hash = "sha256-eMx/RlUpq5Ez+1L8VZo40Y3h2ZKkqiQEmKTlkZRMXnI=";
38 })
39 ];
40
41 postPatch = ''
42 substituteInPlace garglk/garglk.pc.in \
43 --replace "\''${prefix}/@CMAKE_INSTALL_LIBDIR@" "@CMAKE_INSTALL_FULL_LIBDIR@" \
44 --replace "\''${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" "@CMAKE_INSTALL_FULL_INCLUDEDIR@"
45 '';
46
47 nativeBuildInputs = [
48 cmake
49 pkg-config
50 qt6.wrapQtAppsHook
51 ];
52
53 buildInputs = [
54 fluidsynth
55 fmt
56 freetype
57 libjpeg
58 libopenmpt
59 libpng
60 libsndfile
61 libvorbis
62 mpg123
63 qt6.qtbase
64 qt6.qtmultimedia
65 ]
66 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
67 qt6.qtwayland
68 ];
69
70 cmakeFlags = [
71 (lib.cmakeFeature "INTERFACE" "QT")
72 (lib.cmakeFeature "SOUND" "QT")
73 (lib.cmakeBool "WITH_QT6" true)
74 # fatal error: 'macglk_startup.h' file not found
75 (lib.cmakeBool "WITH_AGILITY" (!stdenv.hostPlatform.isDarwin))
76 (lib.cmakeBool "WITH_LEVEL9" (!stdenv.hostPlatform.isDarwin))
77 (lib.cmakeBool "WITH_MAGNETIC" (!stdenv.hostPlatform.isDarwin))
78 ];
79
80 meta = with lib; {
81 homepage = "http://ccxvii.net/gargoyle/";
82 license = licenses.gpl2Plus;
83 description = "Interactive fiction interpreter GUI";
84 mainProgram = "gargoyle";
85 platforms = platforms.unix;
86 maintainers = with maintainers; [ orivej ];
87 };
88}