From a9b384668b8d5b0dad6d1d2317fb3e78130d7b76 Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Fri, 11 Jul 2025 18:50:06 -0400 Subject: [PATCH 1/3] ldmud: apply some small modernizations Catches up with some best practices. --- pkgs/by-name/ld/ldmud/package.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/ld/ldmud/package.nix b/pkgs/by-name/ld/ldmud/package.nix index fa85bacb6c23..90c46c1c35c8 100644 --- a/pkgs/by-name/ld/ldmud/package.nix +++ b/pkgs/by-name/ld/ldmud/package.nix @@ -26,15 +26,15 @@ python310, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "ldmud"; version = "3.6.7"; src = fetchFromGitHub { owner = "ldmud"; repo = "ldmud"; - rev = version; - sha256 = "sha256-PkrjP7tSZMaj61Hsn++7+CumhqFPLbf0+eAI6afP9HA="; + tag = finalAttrs.version; + hash = "sha256-PkrjP7tSZMaj61Hsn++7+CumhqFPLbf0+eAI6afP9HA="; }; patches = [ @@ -42,13 +42,14 @@ stdenv.mkDerivation rec { ./mysql-compat.patch ]; - sourceRoot = "${src.name}/src"; + sourceRoot = "${finalAttrs.src.name}/src"; nativeBuildInputs = [ autoreconfHook pkg-config bison ]; + buildInputs = [ libgcrypt @@ -105,7 +106,7 @@ stdenv.mkDerivation rec { meta = { description = "Gamedriver for LPMuds including a LPC compiler, interpreter and runtime"; homepage = "https://ldmud.eu"; - changelog = "https://github.com/ldmud/ldmud/blob/${version}/HISTORY"; + changelog = "https://github.com/ldmud/ldmud/blob/${finalAttrs.version}/HISTORY"; longDescription = '' LDMud started as a project to clean up and modernize Amylaar's LPMud gamedriver. Primary goals are full documentation, a commented source body @@ -120,4 +121,4 @@ stdenv.mkDerivation rec { platforms = with lib.platforms; linux ++ darwin; maintainers = with lib.maintainers; [ cpu ]; }; -} +}) From 468fd1ddba67abf549c9ac9cc8d5facb970dd9cb Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Sun, 13 Jul 2025 14:11:49 -0400 Subject: [PATCH 2/3] ldmud: fix MacOS iconv link time errors The LDMud autotools build needs some help finding the right libiconv on MacOS systems. Without nudging it the right direction with LDFLAGS the system libiconv is used and produces missing symbol errors at link-time. --- pkgs/by-name/ld/ldmud/package.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/ld/ldmud/package.nix b/pkgs/by-name/ld/ldmud/package.nix index 90c46c1c35c8..c1ffc7f2f97e 100644 --- a/pkgs/by-name/ld/ldmud/package.nix +++ b/pkgs/by-name/ld/ldmud/package.nix @@ -87,10 +87,14 @@ stdenv.mkDerivation (finalAttrs: { (lib.enableFeature pythonSupport "use-python") ]; - preConfigure = lib.optionalString mysqlSupport '' - export CPPFLAGS="-I${lib.getDev libmysqlclient}/include/mysql" - export LDFLAGS="-L${libmysqlclient}/lib/mysql" - ''; + preConfigure = + lib.optionalString mysqlSupport '' + export CPPFLAGS="-I${lib.getDev libmysqlclient}/include/mysql" + export LDFLAGS="-L${libmysqlclient}/lib/mysql" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + export LDFLAGS="$LDFLAGS -L${libiconv}/lib -liconv" + ''; installTargets = [ "install-driver" From 7ed1c991f11b15762da41ed337ab4dd5e0adbc11 Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Fri, 11 Jul 2025 19:08:47 -0400 Subject: [PATCH 3/3] ldmud: 3.6.7 -> 3.6.8 Notably this update allows dropping the libxm2 compat patch since the fix has landed upstream. See https://groups.google.com/g/ldmud-talk/c/yCvuj6WWEBk/m/40BonmTqCwAJ for more information. --- .../ld/ldmud/libxml2-2.12.0-compat.patch | 18 ------------------ pkgs/by-name/ld/ldmud/package.nix | 5 ++--- 2 files changed, 2 insertions(+), 21 deletions(-) delete mode 100644 pkgs/by-name/ld/ldmud/libxml2-2.12.0-compat.patch diff --git a/pkgs/by-name/ld/ldmud/libxml2-2.12.0-compat.patch b/pkgs/by-name/ld/ldmud/libxml2-2.12.0-compat.patch deleted file mode 100644 index 372bdc8cafbd..000000000000 --- a/pkgs/by-name/ld/ldmud/libxml2-2.12.0-compat.patch +++ /dev/null @@ -1,18 +0,0 @@ -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/by-name/ld/ldmud/package.nix b/pkgs/by-name/ld/ldmud/package.nix index c1ffc7f2f97e..f97923fa4e59 100644 --- a/pkgs/by-name/ld/ldmud/package.nix +++ b/pkgs/by-name/ld/ldmud/package.nix @@ -28,17 +28,16 @@ stdenv.mkDerivation (finalAttrs: { pname = "ldmud"; - version = "3.6.7"; + version = "3.6.8"; src = fetchFromGitHub { owner = "ldmud"; repo = "ldmud"; tag = finalAttrs.version; - hash = "sha256-PkrjP7tSZMaj61Hsn++7+CumhqFPLbf0+eAI6afP9HA="; + hash = "sha256-ojOLM1vkuwuF0vXx6lCH0+OlyLkkOOnTJEUiZPpUhzo="; }; patches = [ - ./libxml2-2.12.0-compat.patch ./mysql-compat.patch ];