lol
1{ stdenv
2, lib
3, fetchFromGitHub
4, rustPlatform
5, pkg-config
6, alsa-lib
7, openssl
8, withTTS ? false
9, speechd
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "blightmud";
14 version = "5.3.0";
15
16 src = fetchFromGitHub {
17 owner = pname;
18 repo = pname;
19 rev = "v${version}";
20 sha256 = "sha256-e9Uo0IJYL9/6/nNL27zfUYnsTwDaOJOcR2CY6t++jDE=";
21 };
22
23 cargoHash = "sha256-QSgTpmSojZrwZ0RsUL6c2xO310RZX3gkyGl6oNf6pYI=";
24
25 buildFeatures = lib.optional withTTS "tts";
26
27 nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ];
28
29 buildInputs = [ alsa-lib openssl ] ++ lib.optionals withTTS [ speechd ];
30
31 checkFlags =
32 let
33 # Most of Blightmud's unit tests pass without trouble in the isolated
34 # Nixpkgs build env. The following tests need to be skipped.
35 skipList = [
36 "test_connect"
37 "test_gmcp_negotiation"
38 "test_ttype_negotiation"
39 "test_reconnect"
40 "test_is_connected"
41 "test_mud"
42 "test_server"
43 "test_lua_script"
44 "timer_test"
45 "validate_assertion_fail"
46 "regex_smoke_test"
47 ];
48 skipFlag = test: "--skip " + test;
49 in
50 builtins.concatStringsSep " " (builtins.map skipFlag skipList);
51
52 meta = with lib; {
53 description = "A terminal MUD client written in Rust";
54 longDescription = ''
55 Blightmud is a terminal client for connecting to Multi User Dungeon (MUD)
56 games. It is written in Rust and supports TLS, GMCP, MSDP, MCCP2, tab
57 completion, text searching and a split view for scrolling. Blightmud can
58 be customized with Lua scripting for aliases, triggers, timers, customized
59 status bars, and more. Blightmud supports several accessibility features
60 including an optional built-in text-to-speech engine and a screen reader
61 friendly mode.
62 '';
63 homepage = "https://github.com/Blightmud/Blightmud";
64 license = licenses.gpl3Plus;
65 maintainers = with maintainers; [ cpu ];
66 platforms = platforms.linux;
67 };
68}