diff --git a/pkgs/games/ldmud/default.nix b/pkgs/games/ldmud/default.nix index 8287b3274c7d..5dcd6dfbc80e 100644 --- a/pkgs/games/ldmud/default.nix +++ b/pkgs/games/ldmud/default.nix @@ -7,7 +7,7 @@ , libiconv , pcre , libgcrypt -, libxcrypt +, libxcrypt-legacy , json_c , libxml2 , ipv6Support ? false @@ -37,11 +37,13 @@ stdenv.mkDerivation rec { sha256 = "sha256-PkrjP7tSZMaj61Hsn++7+CumhqFPLbf0+eAI6afP9HA="; }; + patches = [ ./libxml2-2.12.0-compat.patch ./mysql-compat.patch ]; + sourceRoot = "${src.name}/src"; nativeBuildInputs = [ autoreconfHook pkg-config bison ]; - buildInputs = [ libgcrypt libxcrypt pcre json_c libxml2 ] + buildInputs = [ libgcrypt libxcrypt-legacy pcre json_c libxml2 ] ++ lib.optional mccpSupport zlib ++ lib.optional mysqlSupport libmysqlclient ++ lib.optional postgresSupport libpq ++ lib.optional sqliteSupport sqlite ++ lib.optional tlsSupport openssl diff --git a/pkgs/games/ldmud/libxml2-2.12.0-compat.patch b/pkgs/games/ldmud/libxml2-2.12.0-compat.patch new file mode 100644 index 000000000000..372bdc8cafbd --- /dev/null +++ b/pkgs/games/ldmud/libxml2-2.12.0-compat.patch @@ -0,0 +1,18 @@ +diff --git src/pkg-xml2.c src/pkg-xml2.c +index 048ca38c..9ea4de35 100644 +--- src/pkg-xml2.c ++++ src/pkg-xml2.c +@@ -507,8 +507,13 @@ f_xml_generate (svalue_t *sp) + return sp; + } + ++#if LIBXML_VERSION >= 21200 ++static void ++xml_pkg_error_handler(void * userData, const xmlError *error) ++#else + static void + xml_pkg_error_handler(void * userData, xmlErrorPtr error) ++#endif + { + if (error) + { diff --git a/pkgs/games/ldmud/mysql-compat.patch b/pkgs/games/ldmud/mysql-compat.patch new file mode 100644 index 000000000000..36aabfc08cef --- /dev/null +++ b/pkgs/games/ldmud/mysql-compat.patch @@ -0,0 +1,13 @@ +diff --git src/autoconf/configure.ac src/autoconf/configure.ac +index 156e97f4..6d70bf33 100644 +--- src/autoconf/configure.ac ++++ src/autoconf/configure.ac +@@ -1410,7 +1410,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + +-struct MYSQL * foo(void) ++struct st_mysql * foo(void) + { + static MYSQL var; +