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