ctucx.git: nixfiles

ctucx' nixfiles

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 { lib, stdenvNoCC, fetchurl, fetchzip, autoPatchelfHook, libcxx, readline }:

stdenvNoCC.mkDerivation rec {
  pname = "PocketMine-MP";
  version = "5.21.1";

  php = fetchzip {
    url = "https://github.com/pmmp/PHP-Binaries/releases/download/php-8.2-latest/PHP-Linux-x86_64-PM5.tar.gz";
    hash = "sha256-OO7wGQxJ/0+WiNILd8IE3xwBVFjfcD/AiK0E9aGi2gw=";
  };

  dontUnpack = true;
  src = fetchurl {
    url  = "https://github.com/pmmp/${pname}/releases/download/${version}/PocketMine-MP.phar";
    hash = "sha256-cZH+GAMBdpQwXeqIPSLZWk2oEtWD/4ZgjPYySomZqSQ=";
  };

  nativeBuildInputs = [
    autoPatchelfHook
  ];

  buildInputs = [
    libcxx
    readline
  ];

  installPhase = ''
    runHook preInstall

    mkdir $out;
    cp -r ${php}/php7/. $out/

    cp $src $out/PocketMine-MP.phar

    runHook postInstall
  '';

  meta = with lib; {
    description = "A server software for Minecraft: Bedrock Edition in PHP.";
    homepage = "https://github.com/pmmp/PocketMine-MP";
    license = with licenses; [ gpl3Only ];
    platforms = platforms.linux;
  };
}