16 , mysqlSupport ? false
18 , postgresSupport ? false
20 , sqliteSupport ? false
24 , pythonSupport ? false
29 stdenv.mkDerivation rec {
33 src = fetchFromGitHub {
37 sha256 = "sha256-2TaFt+T9B5Df6KWRQcbhY1E1D6NISb0oqLgyX47f5lI=";
40 sourceRoot = "${src.name}/src";
43 [ autoreconfHook pkg-config bison ];
44 buildInputs = [ libgcrypt libxcrypt pcre json_c libxml2 ]
45 ++ lib.optional mccpSupport zlib ++ lib.optional mysqlSupport libmysqlclient
46 ++ lib.optional postgresSupport postgresql
47 ++ lib.optional sqliteSupport sqlite ++ lib.optional tlsSupport openssl
48 ++ lib.optional pythonSupport python310
49 ++ lib.optionals stdenv.isDarwin [ libiconv ];
51 # To support systems without autoconf LD puts its configure.ac in a non-default
52 # location and uses a helper script. We skip that script and symlink the .ac
53 # file to where the autoreconfHook find it.
55 ln -fs ./autoconf/configure.ac ./
60 "--enable-filename-spaces"
62 "--enable-use-xml=xml2"
63 (lib.enableFeature ipv6Support "use-ipv6")
64 (lib.enableFeature mccpSupport "use-mccp")
65 (lib.enableFeature mysqlSupport "use-mysql")
66 (lib.enableFeature postgresSupport "use-pgsql")
67 (lib.enableFeature sqliteSupport "use-sqlite")
68 (lib.enableFeatureAs tlsSupport "use-tls" "ssl")
69 (lib.enableFeature pythonSupport "use-python")
72 preConfigure = lib.optionalString mysqlSupport ''
73 export CPPFLAGS="-I${lib.getDev libmysqlclient}/include/mysql"
74 export LDFLAGS="-L${libmysqlclient}/lib/mysql"
77 installTargets = [ "install-driver" "install-utils" "install-headers" ];
80 mkdir -p "$out/share/"
81 cp -v ../COPYRIGHT $out/share/
85 description = "A gamedriver for LPMuds including a LPC compiler, interpreter and runtime";
86 homepage = "https://ldmud.eu";
87 changelog = "https://github.com/ldmud/ldmud/blob/${version}/HISTORY";
89 LDMud started as a project to clean up and modernize Amylaar's LPMud
90 gamedriver. Primary goals are full documentation, a commented source body
91 and out-of-the-box support for the major mudlibs, of which the commented
92 source body has been pretty much completed. During the course of work
93 a lot of bug fixes and improvements found their way into the driver - much
94 more than originally expected, and definitely enough to make LDMud
95 a driver in its own right.
97 # See https://github.com/ldmud/ldmud/blob/master/COPYRIGHT
98 license = licenses.unfreeRedistributable;
99 platforms = with platforms; linux ++ darwin;
100 maintainers = with maintainers; [ cpu ];