30 packageOverrides = self: super: {
31 # luasql-sqlite3 master branch broke compatibility with lua 5.1. Pin to
33 # https://github.com/lunarmodules/luasql/issues/147
34 luasql-sqlite3 = super.luaLib.overrideLuarocks super.luasql-sqlite3
36 version = "2.6.0-1-custom";
37 src = fetchFromGitHub {
38 owner = "lunarmodules";
40 rev = "8c58fd6ee32faf750daf6e99af015a31402578d1";
41 hash = "sha256-XlTB5O81yWCrx56m0cXQp7EFzeOyfNeqGbuiYqMrTUk=";
46 lua.override { inherit packageOverrides; };
48 luaEnv = overrideLua.withPackages (ps: with ps; [
57 stdenv.mkDerivation rec {
61 src = fetchFromGitHub {
64 rev = "Mudlet-${version}";
65 fetchSubmodules = true;
66 hash = "sha256-K75frptePKfHeGQNXaX4lKsLwO6Rs6AAka6hvP8MA+k=";
71 name = "darwin-AppKit.patch";
72 url = "https://github.com/Mudlet/Mudlet/commit/68cdd404f81a6d16c80068c45fe0f10802f08d9e.patch";
73 hash = "sha256-74FtcjOR/lu9ohtcoup0+gUfCQRznO48zMmb97INhdY=";
100 ] ++ lib.optional stdenv.hostPlatform.isDarwin [
105 # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
106 "-DCMAKE_SKIP_BUILD_RPATH=ON"
116 cp 3rdparty/edbee-lib/edbee-lib/qslog/lib/libQsLog${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib
117 mkdir -pv $out/share/mudlet
118 cp -r ../src/mudlet-lua/lua $out/share/mudlet/
120 mkdir -pv $out/share/pixmaps
121 cp -r ../mudlet.png $out/share/pixmaps/
123 cp -r ../translations $out/share/
125 '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
126 mkdir -p $out/Applications
127 cp -r src/mudlet.app/ $out/Applications/mudlet.app
128 mv $out/Applications/mudlet.app/Contents/MacOS/mudlet $out/Applications/mudlet.app/Contents/MacOS/mudlet-unwrapped
129 makeQtWrapper $out/Applications/Mudlet.app/Contents/MacOS/mudlet-unwrapped $out/Applications/Mudlet.app/Contents/MacOS/mudlet \
130 --set LUA_CPATH "${luaEnv}/lib/lua/${lua.luaversion}/?.so" \
131 --prefix LUA_PATH : "$NIX_LUA_PATH" \
132 --prefix DYLD_LIBRARY_PATH : "${lib.makeLibraryPath [ libsForQt5.qtkeychain discord-rpc ]}:$out/lib" \
135 '' + lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
137 cp src/mudlet $out/bin/mudlet-unwrapped
138 makeQtWrapper $out/bin/mudlet-unwrapped $out/bin/mudlet \
139 --set LUA_CPATH "${luaEnv}/lib/lua/${lua.luaversion}/?.so" \
140 --prefix LUA_PATH : "$NIX_LUA_PATH" \
141 --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libsForQt5.qtkeychain discord-rpc ]}" \
144 mkdir -pv $out/share/applications
145 cp ../mudlet.desktop $out/share/applications/
152 description = "Crossplatform mud client";
153 homepage = "https://www.mudlet.org/";
154 maintainers = with maintainers; [ wyvie pstn cpu felixalbrigtsen ];
155 platforms = platforms.linux ++ platforms.darwin;
156 license = licenses.gpl2Plus;
157 mainProgram = "mudlet";