2022-02-18 18:52:26 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2024-01-21 05:45:08 +01:00
|
|
|
, fetchpatch
|
2022-02-18 18:52:26 +01:00
|
|
|
, cmake
|
|
|
|
, git
|
|
|
|
, pkg-config
|
|
|
|
, qttools
|
|
|
|
, which
|
|
|
|
, wrapQtAppsHook
|
|
|
|
, boost
|
|
|
|
, hunspell
|
|
|
|
, libGLU
|
|
|
|
, libsForQt5
|
|
|
|
, libsecret
|
|
|
|
, libzip
|
|
|
|
, lua
|
|
|
|
, pcre
|
|
|
|
, pugixml
|
|
|
|
, qtbase
|
|
|
|
, qtmultimedia
|
2022-11-07 01:44:37 +01:00
|
|
|
, discord-rpc
|
2022-02-18 18:52:26 +01:00
|
|
|
, yajl
|
2024-01-21 05:45:08 +01:00
|
|
|
, AppKit
|
2022-02-18 18:52:26 +01:00
|
|
|
}:
|
2014-09-15 15:37:24 +02:00
|
|
|
|
2019-09-07 13:22:44 +02:00
|
|
|
let
|
2022-11-07 01:44:37 +01:00
|
|
|
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
|
2021-09-11 23:56:43 +02:00
|
|
|
]);
|
2019-09-07 13:22:44 +02:00
|
|
|
in
|
2014-09-15 15:37:24 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "mudlet";
|
2023-05-14 17:07:45 +02:00
|
|
|
version = "4.17.2";
|
2019-09-07 13:22:44 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Mudlet";
|
|
|
|
repo = "Mudlet";
|
|
|
|
rev = "Mudlet-${version}";
|
|
|
|
fetchSubmodules = true;
|
2023-05-14 17:07:45 +02:00
|
|
|
hash = "sha256-K75frptePKfHeGQNXaX4lKsLwO6Rs6AAka6hvP8MA+k=";
|
2014-09-15 15:37:24 +02:00
|
|
|
};
|
|
|
|
|
2024-01-21 05:45:08 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "darwin-AppKit.patch";
|
|
|
|
url = "https://github.com/Mudlet/Mudlet/commit/68cdd404f81a6d16c80068c45fe0f10802f08d9e.patch";
|
|
|
|
hash = "sha256-74FtcjOR/lu9ohtcoup0+gUfCQRznO48zMmb97INhdY=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-02-18 18:52:26 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
git
|
|
|
|
pkg-config
|
|
|
|
qttools
|
|
|
|
which
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
2015-09-27 17:28:24 +02:00
|
|
|
buildInputs = [
|
2022-02-18 18:52:26 +01:00
|
|
|
boost
|
|
|
|
hunspell
|
|
|
|
libGLU
|
|
|
|
libsForQt5.qtkeychain
|
|
|
|
libsecret
|
|
|
|
libzip
|
|
|
|
luaEnv
|
|
|
|
pcre
|
|
|
|
pugixml
|
|
|
|
qtbase
|
|
|
|
qtmultimedia
|
|
|
|
yajl
|
2022-11-07 01:44:37 +01:00
|
|
|
discord-rpc
|
2024-01-21 05:45:08 +01:00
|
|
|
] ++ lib.optional stdenv.isDarwin [
|
|
|
|
AppKit
|
2015-09-27 17:28:24 +02:00
|
|
|
];
|
2014-09-15 15:37:24 +02:00
|
|
|
|
2022-07-17 16:42:15 +02:00
|
|
|
cmakeFlags = [
|
|
|
|
# RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=ON"
|
|
|
|
];
|
|
|
|
|
2019-09-07 13:22:44 +02:00
|
|
|
WITH_FONTS = "NO";
|
|
|
|
WITH_UPDATER = "NO";
|
|
|
|
|
2022-11-07 01:44:37 +01:00
|
|
|
installPhase = ''
|
2022-02-18 18:52:26 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
2019-09-12 16:43:09 +02:00
|
|
|
mkdir -pv $out/lib
|
2024-01-21 05:45:08 +01:00
|
|
|
cp 3rdparty/edbee-lib/edbee-lib/qslog/lib/libQsLog${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib
|
2019-09-07 13:22:44 +02:00
|
|
|
mkdir -pv $out/share/mudlet
|
|
|
|
cp -r ../src/mudlet-lua/lua $out/share/mudlet/
|
2014-09-15 15:37:24 +02:00
|
|
|
|
2019-09-07 13:22:44 +02:00
|
|
|
mkdir -pv $out/share/pixmaps
|
|
|
|
cp -r ../mudlet.png $out/share/pixmaps/
|
|
|
|
|
2023-05-14 17:07:45 +02:00
|
|
|
cp -r ../translations $out/share/
|
|
|
|
|
2024-01-21 05:45:08 +01:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
cp -r src/mudlet.app/ $out/Applications/mudlet.app
|
|
|
|
mv $out/Applications/mudlet.app/Contents/MacOS/mudlet $out/Applications/mudlet.app/Contents/MacOS/mudlet-unwrapped
|
|
|
|
makeQtWrapper $out/Applications/Mudlet.app/Contents/MacOS/mudlet-unwrapped $out/Applications/Mudlet.app/Contents/MacOS/mudlet \
|
|
|
|
--set LUA_CPATH "${luaEnv}/lib/lua/${lua.luaversion}/?.so" \
|
|
|
|
--prefix LUA_PATH : "$NIX_LUA_PATH" \
|
|
|
|
--prefix DYLD_LIBRARY_PATH : "${lib.makeLibraryPath [ libsForQt5.qtkeychain discord-rpc ]}:$out/lib" \
|
|
|
|
--chdir "$out";
|
|
|
|
|
|
|
|
'' + lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
mkdir -pv $out/bin
|
|
|
|
cp src/mudlet $out/bin/mudlet-unwrapped
|
|
|
|
makeQtWrapper $out/bin/mudlet-unwrapped $out/bin/mudlet \
|
2022-02-18 18:52:26 +01:00
|
|
|
--set LUA_CPATH "${luaEnv}/lib/lua/${lua.luaversion}/?.so" \
|
|
|
|
--prefix LUA_PATH : "$NIX_LUA_PATH" \
|
2022-11-07 01:44:37 +01:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libsForQt5.qtkeychain discord-rpc ]}" \
|
2022-03-14 19:06:00 +01:00
|
|
|
--chdir "$out";
|
2022-02-18 18:52:26 +01:00
|
|
|
|
2024-01-21 05:45:08 +01:00
|
|
|
mkdir -pv $out/share/applications
|
|
|
|
cp ../mudlet.desktop $out/share/applications/
|
|
|
|
|
|
|
|
'' + ''
|
2022-02-18 18:52:26 +01:00
|
|
|
runHook postInstall
|
2014-09-15 15:37:24 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2014-09-15 15:37:24 +02:00
|
|
|
description = "Crossplatform mud client";
|
2022-02-18 18:52:26 +01:00
|
|
|
homepage = "https://www.mudlet.org/";
|
2024-01-21 05:45:08 +01:00
|
|
|
maintainers = with maintainers; [ wyvie pstn cpu felixalbrigtsen ];
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2022-02-18 18:52:26 +01:00
|
|
|
license = licenses.gpl2Plus;
|
2023-11-23 22:09:35 +01:00
|
|
|
mainProgram = "mudlet";
|
2014-09-15 15:37:24 +02:00
|
|
|
};
|
|
|
|
}
|