mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(minecraft): bedrock server
This commit is contained in:
parent
f05b50b53e
commit
9f98934a17
11 changed files with 383 additions and 11 deletions
|
|
@ -6,6 +6,7 @@
|
|||
in rec {
|
||||
default = nixlib.composeManyExtensions [
|
||||
barcodebuddy
|
||||
minecraft
|
||||
krb5
|
||||
nfs
|
||||
nginx
|
||||
|
|
@ -13,6 +14,7 @@ in rec {
|
|||
];
|
||||
barcodebuddy = import ./barcodebuddy.nix;
|
||||
krb5 = import ./krb5.nix;
|
||||
minecraft = import ./minecraft.nix;
|
||||
nfs = import ./nfs.nix;
|
||||
nginx = import ./nginx.nix;
|
||||
samba = import ./samba.nix;
|
||||
|
|
|
|||
57
overlays/minecraft.nix
Normal file
57
overlays/minecraft.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
final: prev: let
|
||||
inherit (final) lib;
|
||||
in {
|
||||
minecraft-bedrock-server-libCrypto = let
|
||||
inherit (final) minecraft-bedrock-server;
|
||||
in minecraft-bedrock-server.stdenv.mkDerivation {
|
||||
pname = "${minecraft-bedrock-server.pname}-libcrypto";
|
||||
inherit (minecraft-bedrock-server) version src sourceRoot;
|
||||
nativeBuildInputs = with final; [
|
||||
autoPatchelfHook
|
||||
curl
|
||||
gcc-unwrapped
|
||||
openssl
|
||||
unzip
|
||||
];
|
||||
installPhase = ''
|
||||
install -m755 -D libCrypto.so $out/lib/libCrypto.so
|
||||
'';
|
||||
fixupPhase = ''
|
||||
autoPatchelf $out/lib/libCrypto.so
|
||||
'';
|
||||
meta.broken = true;
|
||||
};
|
||||
|
||||
minecraft-bedrock-server-patchdebug = let
|
||||
# https://github.com/minecraft-linux/server-modloader/tree/master?tab=readme-ov-file#getting-mods-to-work-on-newer-versions-116
|
||||
python = final.python3.withPackages (p: [ p.lief ]);
|
||||
script = ''
|
||||
import lief
|
||||
import sys
|
||||
|
||||
lib_symbols = lief.parse(sys.argv[1])
|
||||
for s in filter(lambda e: e.exported, lib_symbols.static_symbols):
|
||||
lib_symbols.add_dynamic_symbol(s)
|
||||
lib_symbols.write(sys.argv[2])
|
||||
'';
|
||||
name = "minecraft-bedrock-server-patchdebug";
|
||||
in final.writeTextFile {
|
||||
name = "${name}.py";
|
||||
destination = "/bin/${name}";
|
||||
executable = true;
|
||||
text = ''
|
||||
#!${lib.getExe python}
|
||||
${script}
|
||||
'';
|
||||
meta.mainProgram = name;
|
||||
};
|
||||
|
||||
minecraft-bedrock-server-patchelf = prev.patchelf.overrideDerivation (old: {
|
||||
postPatch = ''
|
||||
substituteInPlace src/patchelf.cc \
|
||||
--replace "32 * 1024 * 1024" "512 * 1024 * 1024"
|
||||
'';
|
||||
});
|
||||
|
||||
minecraft-bedrock-server = final.callPackage ../packages/minecraft-bedrock.nix { };
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue