1 { lib, stdenv, fetchurl, fetchpatch, pkg-config, perl, unzip, autoPatchelfHook, ncurses, SDL2, alsa-lib }:
3 stdenv.mkDerivation rec {
8 url = "mirror://sourceforge/${pname}/${pname}-${version}-src.tgz";
9 sha256 = "19m76bisipp1h3bc8mbq83b851rx3lbysxb0azpbr5nbqr2f8xyi";
13 # Cherry-picks from the upstream Synchronet tree, removing calls to `pthread_yield`.
14 # See upstream issue: https://gitlab.synchro.net/main/sbbs/-/issues/299
16 url = "https://gitlab.synchro.net/main/sbbs/-/commit/851627df99f48d8eaad33d3a98ef309b4371f359.patch";
17 hash = "sha256-DbFAeJnrwFyfEpZgZFN8etqX6vQ3ca2TJwaqp0aHeo4=";
19 ./0001-use-sched-yield-53264f2b.patch
21 # We can't use sourceRoot, as the cherry-picked patches apply to files outside of it.
22 postPatch = ''cd src/syncterm'';
26 "-DXPDEV_DONT_DEFINE_INTTYPES"
30 ] ++ (lib.optionals stdenv.hostPlatform.isLinux [
31 "-DUSE_ALSA_SOUND" # Don't use OSS for beeps.
39 nativeBuildInputs = [ autoPatchelfHook pkg-config SDL2 perl unzip ]; # SDL2 for `sdl2-config`.
40 buildInputs = [ ncurses SDL2 ]
41 ++ (lib.optional stdenv.hostPlatform.isLinux alsa-lib);
42 runtimeDependencies = [ ncurses SDL2 ]; # Both of these are dlopen()'ed at runtime.
45 # error: unsupported option '-fsanitize=safe-stack' for target 'x86_64-apple-darwin'
46 broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) || stdenv.hostPlatform.isDarwin;
47 homepage = "https://syncterm.bbsdev.net/";
48 description = "BBS terminal emulator";
49 mainProgram = "syncterm";
50 maintainers = with maintainers; [ embr ];
51 platforms = platforms.unix;
52 license = licenses.gpl2Plus;