mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 02:44:30 +00:00
openmw-tes3mp: 0.7.0-alpha -> 2019-06-09
Closes #64587. abbradar: clarify source of CrabNet revision.
This commit is contained in:
parent
3670450fc6
commit
32e72ad896
@ -1,102 +1,77 @@
|
|||||||
{ stdenv, fetchFromGitHub, qtbase, openscenegraph, mygui, bullet, ffmpeg, boost, cmake, SDL2, unshield, openal
|
{ stdenv, cmake, openmw, fetchFromGitHub, luajit, makeWrapper }:
|
||||||
, libXt, writeScriptBin, makeWrapper, ncurses, libGL, luajit }:
|
|
||||||
|
# revisions are taken from https://github.com/GrimKriegor/TES3MP-deploy
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "0.7.0-alpha";
|
# TES3MP_STABLE_VERSION_FILE
|
||||||
TES3MP = fetchFromGitHub {
|
compatHash = "292536439eeda58becdb7e441fe2e61ebb74529e";
|
||||||
owner = "TES3MP";
|
rakNet = fetchFromGitHub {
|
||||||
repo = "openmw-tes3mp";
|
|
||||||
rev = version;
|
|
||||||
sha256 = "012f50f9jd29qcdww2vk4habg6pmxvxl0q6rrjq8xchb0566712q";
|
|
||||||
};
|
|
||||||
CallFF = fetchFromGitHub {
|
|
||||||
owner = "Koncord";
|
|
||||||
repo = "CallFF";
|
|
||||||
rev = "da94b59ffe95d45bf98b9264e3d1279c9f6ebb6b";
|
|
||||||
sha256 = "10wgiqmknh0av968c6r74n5n2izxsx8qawfrab57kkmj9h0zp0pm";
|
|
||||||
};
|
|
||||||
CrabNet = fetchFromGitHub {
|
|
||||||
owner = "TES3MP";
|
owner = "TES3MP";
|
||||||
repo = "CrabNet";
|
repo = "CrabNet";
|
||||||
rev = "ab1306050fe0f5b0f9c4f56893a79e56a9459567";
|
# usually fixed:
|
||||||
sha256 = "03q76pjv9mdi7w832b23q1mj4r2wb0hsnh4kpvwai607g04l0pp0";
|
# https://github.com/GrimKriegor/TES3MP-deploy/blob/d2a4a5d3acb64b16d9b8ca85906780aeea8d311b/tes3mp-deploy.sh#L589
|
||||||
|
rev = "4eeeaad2f6c11aeb82070df35169694b4fb7b04b";
|
||||||
|
sha256 = "0p0li9l1i5lcliswm5w9jql0zff9i6fwhiq0bl130m4i7vpr4cr3";
|
||||||
};
|
};
|
||||||
CoreScripts = fetchFromGitHub {
|
rakNetLibrary = stdenv.mkDerivation {
|
||||||
|
name = "RakNetLibrary";
|
||||||
|
src = rakNet;
|
||||||
|
nativeBuildInputs = [ cmake ];
|
||||||
|
installPhase = ''
|
||||||
|
install -Dm755 lib/libRakNetLibStatic.a $out/lib/libRakNetLibStatic.a
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
coreScripts = fetchFromGitHub {
|
||||||
owner = "TES3MP";
|
owner = "TES3MP";
|
||||||
repo = "CoreScripts";
|
repo = "CoreScripts";
|
||||||
rev = "1e9f69f98051b2639b18203f989ffbd0a4b427ea";
|
# usually latest master
|
||||||
sha256 = "03ysi7rh0k78kv4slvmkxpymxvdpr8b6hwr1lvjdgq7rq0ljy0lg";
|
rev = "71e15fa3b1d5131b6607ba1589f41c06672ce376";
|
||||||
|
sha256 = "1kwii8rpsxjmz4dh06wb0qaix17hq5s1qsvysv6n6209vlclfxjg";
|
||||||
};
|
};
|
||||||
|
in openmw.overrideAttrs (oldAttrs: rec {
|
||||||
fakegit = writeScriptBin "git" ''
|
version = "2019-06-09";
|
||||||
#! ${stdenv.shell}
|
name = "openmw-tes3mp-${version}";
|
||||||
'';
|
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
inherit version;
|
|
||||||
name = "tes3mp-${version}";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "GrimKriegor";
|
owner = "TES3MP";
|
||||||
repo = "TES3MP-deploy";
|
repo = "openmw-tes3mp";
|
||||||
rev = "1dd78a3e2cf9f4fe85bf7ca9c393251968a9c325";
|
# usually latest in stable branch (e.g. 0.7.0)
|
||||||
sha256 = "1bp9c4kds9q0xhbn4sxb7n0f6rvb45gzx7ljdgc56wz4j5rfi3xn";
|
rev = "01804af100785bc2c162d568258d9662012627a3";
|
||||||
|
sha256 = "0j99v9vvmic0bqw3y4550k1dy058lwvs9s9qcjmxh1wkqkvrpdnp";
|
||||||
};
|
};
|
||||||
|
|
||||||
dontUseCmakeConfigure = true;
|
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ makeWrapper ];
|
||||||
|
buildInputs = oldAttrs.buildInputs ++ [ luajit ];
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake makeWrapper fakegit ];
|
cmakeFlags = oldAttrs.cmakeFlags ++ [
|
||||||
buildInputs = [ boost ffmpeg qtbase bullet mygui openscenegraph SDL2 unshield openal libXt
|
"-DBUILD_OPENCS=OFF"
|
||||||
ncurses libGL luajit ];
|
"-DRakNet_INCLUDES=${rakNet}/include"
|
||||||
|
"-DRakNet_LIBRARY_RELEASE=${rakNetLibrary}/lib/libRakNetLibStatic.a"
|
||||||
|
"-DRakNet_LIBRARY_DEBUG=${rakNetLibrary}/lib/libRakNetLibStatic.a"
|
||||||
|
];
|
||||||
|
|
||||||
buildPhase = ''
|
preConfigure = ''
|
||||||
mkdir dependencies keepers
|
substituteInPlace files/version.in \
|
||||||
cp --no-preserve=mode -r ${TES3MP} code
|
--subst-var-by OPENMW_VERSION_COMMITHASH ${compatHash}
|
||||||
cp --no-preserve=mode -r ${CallFF} dependencies/callff
|
|
||||||
cp --no-preserve=mode -r ${CrabNet} dependencies/raknet
|
|
||||||
cp --no-preserve=mode -r ${CoreScripts} keepers/CoreScripts
|
|
||||||
|
|
||||||
substituteInPlace tes3mp-deploy.sh \
|
|
||||||
--replace "-DBUILD_OPENCS=OFF" "-DBUILD_OPENCS=OFF -DCMAKE_INSTALL_PREFIX=$out"
|
|
||||||
patchShebangs tes3mp-deploy.sh
|
|
||||||
echo y | ./tes3mp-deploy.sh -i -c $NIX_BUILD_CORES
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
postInstall = ''
|
||||||
prefix=$out/opt/tes3mp
|
# components/process/processinvoker.cpp: path.prepend(QLatin1String("./"))
|
||||||
mkdir -p $prefix/build $out/etc/openmw $out/bin
|
wrapProgram $out/bin/tes3mp-browser \
|
||||||
for i in build/*; do
|
--run "cd $out/bin"
|
||||||
if [ -f "$i" ] && [ -x "$i" ]; then
|
|
||||||
mv "$i" $prefix/build
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
mv build/resources $prefix/build
|
|
||||||
mv build/{settings-default.cfg,openmw.cfg,gamecontrollerdb.txt} $out/etc/openmw
|
|
||||||
mv keepers $prefix
|
|
||||||
mv build/tes3mp-credits.md $prefix/build
|
|
||||||
mv -f $prefix/keepers/version $prefix/build/resources
|
|
||||||
|
|
||||||
for i in tes3mp.sh tes3mp-browser.sh tes3mp-server.sh
|
|
||||||
do
|
|
||||||
bin="$out/bin/''${i%.sh}"
|
|
||||||
mv $i $bin
|
|
||||||
substituteInPlace $bin \
|
|
||||||
--replace build/ $prefix/build/
|
|
||||||
chmod +x $bin
|
|
||||||
done
|
|
||||||
ln -s $prefix/keepers/*.cfg $out/etc/openmw/
|
|
||||||
|
|
||||||
wrapProgram $out/bin/tes3mp-server \
|
wrapProgram $out/bin/tes3mp-server \
|
||||||
--run "mkdir -p ~/.config/openmw" \
|
--run "mkdir -p ~/.config/openmw" \
|
||||||
--run "cd ~/.config/openmw" \
|
--run "cd ~/.config/openmw" \
|
||||||
--run "[ -d CoreScripts ] || cp --no-preserve=mode -r $prefix/keepers/CoreScripts ." \
|
--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 "[ -f tes3mp-server.cfg ] || echo \"[Plugins] home = \$HOME/.config/openmw/CoreScripts\" > tes3mp-server.cfg" \
|
||||||
|
--run "cd $out/bin"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Multiplayer for TES3:Morrowind based on OpenMW";
|
description = "Multiplayer for TES3:Morrowind based on OpenMW";
|
||||||
homepage = "https://tes3mp.com/";
|
homepage = https://tes3mp.com/;
|
||||||
license = licenses.gpl3;
|
license = licenses.gpl3;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
maintainers = with maintainers; [ gnidorah ];
|
maintainers = with maintainers; [ gnidorah ];
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user