summary refs log tree commit diff
path: root/pkgs/applications/terminal-emulators/syncterm/default.nix
blob: e2b51614633dfaff9128504a4c4c8918b16df6df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ lib, stdenv, fetchurl, pkg-config, perl, unzip, autoPatchelfHook, ncurses, SDL2, alsa-lib }:

stdenv.mkDerivation rec {
  pname = "syncterm";
  version = "1.1";

  src = fetchurl {
    url = "mirror://sourceforge/${pname}/${pname}-${version}-src.tgz";
    sha256 = "19m76bisipp1h3bc8mbq83b851rx3lbysxb0azpbr5nbqr2f8xyi";
  };
  sourceRoot = "${pname}-${version}/src/syncterm";

  CFLAGS = [
    "-DHAS_INTTYPES_H"
    "-DXPDEV_DONT_DEFINE_INTTYPES"

    "-Wno-unused-result"
    "-Wformat-overflow=0"
  ] ++ (lib.optionals stdenv.isLinux [
    "-DUSE_ALSA_SOUND" # Don't use OSS for beeps.
  ]);
  makeFlags = [
    "PREFIX=$(out)"
    "RELEASE=1"
    "USE_SDL_AUDIO=1"
  ];

  nativeBuildInputs = [ autoPatchelfHook pkg-config SDL2 perl unzip ]; # SDL2 for `sdl2-config`.
  buildInputs = [ ncurses SDL2 ]
    ++ (lib.optional stdenv.isLinux alsa-lib);
  runtimeDependencies = [ ncurses SDL2 ]; # Both of these are dlopen()'ed at runtime.

  meta = with lib; {
    # error: unsupported option '-fsanitize=safe-stack' for target 'x86_64-apple-darwin'
    broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
    homepage = "https://syncterm.bbsdev.net/";
    description = "BBS terminal emulator";
    maintainers = with maintainers; [ embr ];
    platforms = platforms.unix;
    license = licenses.gpl2Plus;
  };
}