Skip to content

Commit 2b96639

Browse files
authored
manager-io-server: init at 25.12.21.3153
1 parent 5a49aa5 commit 2b96639

1 file changed

Lines changed: 83 additions & 0 deletions

File tree

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{ lib
2+
, stdenvNoCC
3+
, stdenv
4+
, fetchurl
5+
, patchelf
6+
, makeWrapper
7+
, icu
8+
, openssl
9+
, zlib
10+
}:
11+
12+
let
13+
pname = "manager-io-server";
14+
version = "25.12.21.3153";
15+
16+
arch =
17+
if stdenvNoCC.hostPlatform.isAarch64 then "arm64"
18+
else if stdenvNoCC.hostPlatform.isx86_64 then "x64"
19+
else throw "Unsupported platform: ${stdenvNoCC.hostPlatform.system}";
20+
21+
hashes = {
22+
x64 = "sha256-JbdFJzFOdik2bfp6xNIOPi50Vru8YAqskSqX+a2fJ/4=";
23+
arm64 = "sha256-VrWTshqFe0cygkcyA6ijEBzjwocMRdaWeiknkHCWk5k=";
24+
};
25+
26+
src = fetchurl {
27+
url = "https://github.com/Manager-io/Manager/releases/download/${version}/ManagerServer-linux-${arch}.tar.gz";
28+
hash = hashes.${arch} or (throw "Missing hash for arch=${arch}");
29+
};
30+
31+
rpath = lib.makeLibraryPath [
32+
stdenv.cc.cc
33+
icu
34+
openssl
35+
zlib
36+
];
37+
in
38+
stdenvNoCC.mkDerivation {
39+
inherit pname version src;
40+
41+
nativeBuildInputs = [ patchelf makeWrapper ];
42+
43+
# Avoid unintended fixups; we only do the patchelf we explicitly want.
44+
dontStrip = true;
45+
dontPatchELF = true;
46+
47+
unpackPhase = "true";
48+
49+
installPhase = ''
50+
runHook preInstall
51+
52+
mkdir -p "$out/libexec/${pname}"
53+
tar -xzf "$src" -C "$out/libexec/${pname}"
54+
chmod +x "$out/libexec/${pname}/ManagerServer"
55+
56+
runHook postInstall
57+
'';
58+
59+
postFixup = ''
60+
appDir="$out/libexec/${pname}"
61+
bin="$appDir/ManagerServer"
62+
63+
patchelf --set-interpreter "$(cat ${stdenv.cc}/nix-support/dynamic-linker)" "$bin"
64+
patchelf --set-rpath "${rpath}" "$bin"
65+
66+
mkdir -p "$out/bin"
67+
68+
# Keep upstream executable name (ManagerServer) and preserve caller PWD
69+
makeWrapper "$bin" "$out/bin/ManagerServer" \
70+
--set ASPNETCORE_ENVIRONMENT Production \
71+
--set DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 0 \
72+
--prefix LD_LIBRARY_PATH : "$appDir:${rpath}"
73+
'';
74+
75+
meta = with lib; {
76+
description = "Manager.io Server Edition (ManagerServer)";
77+
homepage = "https://www.manager.io/server-edition";
78+
license = licenses.unfree;
79+
platforms = [ "x86_64-linux" "aarch64-linux" ];
80+
mainProgram = "ManagerServer";
81+
sourceProvenance = [ sourceTypes.binaryNativeCode ];
82+
};
83+
}

0 commit comments

Comments
 (0)