summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorDaniel McCarney <daniel@binaryparadox.net>2022-11-06 19:44:37 -0500
committerDaniel McCarney <daniel@binaryparadox.net>2022-11-07 12:36:05 -0500
commitae5ed8ce226db3913adf7b1107487f53bd8c69da (patch)
treecd9d67e7606d3f454c2ecc739686617e31e9d8f6 /pkgs/games
parent39cc274424dedd846d8d7cf3b167f4b5ceacc5f0 (diff)
mudlet: 4.15.1 -> 4.16.0
This commit updates Mudlet from version 4.15.1 to 4.16.0. This requires
fixing a lua 5.1 compatibility regression in luasql-sqlite3 by using
a packageOverride to set the version to a commit before the regression.
This resolves an "undefined symbol: lua_isinteger" error that will
occur at application runtime otherwise.

Similarly, prior to this commit running Mudlet would produce errors in
the console window related to not finding the required `.so` for the
Discord integration to function.

This commit also wires through the required `libdiscord-rpc.so` from the
discord-rpc package. On startup Mudlet now prints:
> Discord integration loaded. Using functions from: "libdiscord-rpc.so"
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/mudlet/default.nix41
1 files changed, 34 insertions, 7 deletions
diff --git a/pkgs/games/mudlet/default.nix b/pkgs/games/mudlet/default.nix
index b2696d7278873..74bae74e56d1b 100644
--- a/pkgs/games/mudlet/default.nix
+++ b/pkgs/games/mudlet/default.nix
@@ -18,24 +18,50 @@
 , pugixml
 , qtbase
 , qtmultimedia
+, discord-rpc
 , yajl
 }:
 
 let
-  luaEnv = lua.withPackages(ps: with ps; [
-    luazip luafilesystem lrexlib-pcre luasql-sqlite3 lua-yajl luautf8
+  overrideLua =
+    let
+      packageOverrides = self: super: {
+        # luasql-sqlite3 master branch broke compatibility with lua 5.1. Pin to
+        # an earlier commit.
+        # https://github.com/lunarmodules/luasql/issues/147
+        luasql-sqlite3 = super.luaLib.overrideLuarocks super.luasql-sqlite3
+          (drv: {
+            version = "2.6.0-1-custom";
+            src = fetchFromGitHub {
+              owner = "lunarmodules";
+              repo = "luasql";
+              rev = "8c58fd6ee32faf750daf6e99af015a31402578d1";
+              hash = "sha256-XlTB5O81yWCrx56m0cXQp7EFzeOyfNeqGbuiYqMrTUk=";
+            };
+          });
+      };
+    in
+    lua.override { inherit packageOverrides; };
+
+  luaEnv = overrideLua.withPackages (ps: with ps; [
+    luazip
+    luafilesystem
+    lrexlib-pcre
+    luasql-sqlite3
+    lua-yajl
+    luautf8
   ]);
 in
 stdenv.mkDerivation rec {
   pname = "mudlet";
-  version = "4.15.1";
+  version = "4.16.0";
 
   src = fetchFromGitHub {
     owner = "Mudlet";
     repo = "Mudlet";
     rev = "Mudlet-${version}";
     fetchSubmodules = true;
-    hash = "sha256-GnTQc0Jh4YaQnfy7fYsTCACczlzWCQ+auKYoU9ET83M=";
+    hash = "sha256-HrrEbcMv35IGmYD1L1zmdcpYdFM2PLBEqPY+jMJioTA=";
   };
 
   nativeBuildInputs = [
@@ -60,6 +86,7 @@ stdenv.mkDerivation rec {
     qtbase
     qtmultimedia
     yajl
+    discord-rpc
   ];
 
   cmakeFlags = [
@@ -70,7 +97,7 @@ stdenv.mkDerivation rec {
   WITH_FONTS = "NO";
   WITH_UPDATER = "NO";
 
-  installPhase =  ''
+  installPhase = ''
     runHook preInstall
 
     mkdir -pv $out/lib
@@ -89,7 +116,7 @@ stdenv.mkDerivation rec {
     makeQtWrapper $out/mudlet $out/bin/mudlet \
       --set LUA_CPATH "${luaEnv}/lib/lua/${lua.luaversion}/?.so" \
       --prefix LUA_PATH : "$NIX_LUA_PATH" \
-      --prefix LD_LIBRARY_PATH : "${libsForQt5.qtkeychain}/lib/" \
+      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libsForQt5.qtkeychain discord-rpc ]}" \
       --chdir "$out";
 
     runHook postInstall
@@ -98,7 +125,7 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     description = "Crossplatform mud client";
     homepage = "https://www.mudlet.org/";
-    maintainers = [ maintainers.wyvie maintainers.pstn ];
+    maintainers = with maintainers; [ wyvie pstn cpu ];
     platforms = platforms.linux;
     license = licenses.gpl2Plus;
   };