2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, cmake, openmw, fetchFromGitHub, luajit, makeWrapper, mygui }:
|
2019-07-18 17:51:46 +01:00
|
|
|
|
|
|
|
# revisions are taken from https://github.com/GrimKriegor/TES3MP-deploy
|
2017-08-01 15:44:28 +01:00
|
|
|
|
|
|
|
let
|
2019-07-18 17:51:46 +01:00
|
|
|
# TES3MP_STABLE_VERSION_FILE
|
|
|
|
compatHash = "292536439eeda58becdb7e441fe2e61ebb74529e";
|
|
|
|
rakNet = fetchFromGitHub {
|
2017-08-01 15:44:28 +01:00
|
|
|
owner = "TES3MP";
|
2019-01-13 14:19:29 +00:00
|
|
|
repo = "CrabNet";
|
2019-07-18 17:51:46 +01:00
|
|
|
# usually fixed:
|
|
|
|
# https://github.com/GrimKriegor/TES3MP-deploy/blob/d2a4a5d3acb64b16d9b8ca85906780aeea8d311b/tes3mp-deploy.sh#L589
|
|
|
|
rev = "4eeeaad2f6c11aeb82070df35169694b4fb7b04b";
|
|
|
|
sha256 = "0p0li9l1i5lcliswm5w9jql0zff9i6fwhiq0bl130m4i7vpr4cr3";
|
|
|
|
};
|
|
|
|
rakNetLibrary = stdenv.mkDerivation {
|
|
|
|
name = "RakNetLibrary";
|
|
|
|
src = rakNet;
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 lib/libRakNetLibStatic.a $out/lib/libRakNetLibStatic.a
|
|
|
|
'';
|
2017-08-01 15:44:28 +01:00
|
|
|
};
|
2019-07-18 17:51:46 +01:00
|
|
|
coreScripts = fetchFromGitHub {
|
2017-08-01 15:44:28 +01:00
|
|
|
owner = "TES3MP";
|
2019-01-13 14:19:29 +00:00
|
|
|
repo = "CoreScripts";
|
2019-10-26 13:12:37 +01:00
|
|
|
# usually latest in stable branch (e.g. 0.7.0)
|
2020-02-15 06:58:58 +00:00
|
|
|
rev = "24aae91d9ddad38cdb3b0e0a13af59f142803e94";
|
|
|
|
sha256 = "1rfmxxr9ircfagdpbdrzl26msdhx1i3g974cblbv69078cradfh3";
|
2017-08-01 15:44:28 +01:00
|
|
|
};
|
2020-06-18 17:49:27 +01:00
|
|
|
# https://github.com/TES3MP/openmw-tes3mp/issues/555
|
|
|
|
mygui_ = mygui.overrideAttrs (oldAttrs: rec {
|
|
|
|
version = "3.2.2";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MyGUI";
|
|
|
|
repo = "mygui";
|
|
|
|
rev = "MyGUI${version}";
|
|
|
|
sha256 = "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw";
|
|
|
|
};
|
|
|
|
});
|
2019-07-18 17:51:46 +01:00
|
|
|
in openmw.overrideAttrs (oldAttrs: rec {
|
2020-02-15 06:58:58 +00:00
|
|
|
version = "2019-11-19";
|
2019-07-18 17:51:46 +01:00
|
|
|
name = "openmw-tes3mp-${version}";
|
2017-08-01 15:44:28 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-07-18 17:51:46 +01:00
|
|
|
owner = "TES3MP";
|
|
|
|
repo = "openmw-tes3mp";
|
|
|
|
# usually latest in stable branch (e.g. 0.7.0)
|
2020-02-15 06:58:58 +00:00
|
|
|
rev = "ad9ee80641a3e22d0780daca051df7f4e90f3615";
|
|
|
|
sha256 = "03a1vldiv5lk7yq6lhicx3qz8hjfxhind2dj0w9lg5839ljyk6jv";
|
2017-08-01 15:44:28 +01:00
|
|
|
};
|
|
|
|
|
2019-07-18 17:51:46 +01:00
|
|
|
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ makeWrapper ];
|
2020-06-18 17:49:27 +01:00
|
|
|
buildInputs = [ luajit mygui_ ] ++ oldAttrs.buildInputs;
|
2017-08-01 15:44:28 +01:00
|
|
|
|
2019-07-18 17:51:46 +01:00
|
|
|
cmakeFlags = oldAttrs.cmakeFlags ++ [
|
|
|
|
"-DBUILD_OPENCS=OFF"
|
|
|
|
"-DRakNet_INCLUDES=${rakNet}/include"
|
|
|
|
"-DRakNet_LIBRARY_RELEASE=${rakNetLibrary}/lib/libRakNetLibStatic.a"
|
|
|
|
"-DRakNet_LIBRARY_DEBUG=${rakNetLibrary}/lib/libRakNetLibStatic.a"
|
|
|
|
];
|
2017-08-01 15:44:28 +01:00
|
|
|
|
2020-06-18 17:49:27 +01:00
|
|
|
# https://github.com/TES3MP/openmw-tes3mp/issues/552
|
2020-05-20 18:25:36 +01:00
|
|
|
patches = [
|
|
|
|
./tes3mp.patch
|
|
|
|
];
|
|
|
|
NIX_CFLAGS_COMPILE = "-fpermissive";
|
|
|
|
|
2019-07-18 17:51:46 +01:00
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace files/version.in \
|
|
|
|
--subst-var-by OPENMW_VERSION_COMMITHASH ${compatHash}
|
2017-08-01 15:44:28 +01:00
|
|
|
'';
|
|
|
|
|
2019-07-18 17:51:46 +01:00
|
|
|
postInstall = ''
|
|
|
|
# components/process/processinvoker.cpp: path.prepend(QLatin1String("./"))
|
|
|
|
wrapProgram $out/bin/tes3mp-browser \
|
|
|
|
--run "cd $out/bin"
|
2017-08-01 15:44:28 +01:00
|
|
|
wrapProgram $out/bin/tes3mp-server \
|
|
|
|
--run "mkdir -p ~/.config/openmw" \
|
|
|
|
--run "cd ~/.config/openmw" \
|
2019-07-18 17:51:46 +01:00
|
|
|
--run "[ -d CoreScripts ] || cp --no-preserve=mode -r ${coreScripts} CoreScripts" \
|
|
|
|
--run "[ -f tes3mp-server.cfg ] || echo \"[Plugins] home = \$HOME/.config/openmw/CoreScripts\" > tes3mp-server.cfg" \
|
|
|
|
--run "cd $out/bin"
|
2017-08-01 15:44:28 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-08-01 15:44:28 +01:00
|
|
|
description = "Multiplayer for TES3:Morrowind based on OpenMW";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://tes3mp.com/";
|
2017-08-01 15:44:28 +01:00
|
|
|
license = licenses.gpl3;
|
2020-01-22 19:06:40 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
2017-08-01 15:44:28 +01:00
|
|
|
maintainers = with maintainers; [ gnidorah ];
|
|
|
|
};
|
2019-07-18 17:51:46 +01:00
|
|
|
})
|