summaryrefslogtreecommitdiff
path: root/pkgs/mcping/default.nix
blob: 11892e8fca45646cb4a01511cf21c909e8a357b0 (plain)
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
{
  stdenv,
  fetchFromGitHub,
  lib,
}:
stdenv.mkDerivation rec {
  name = "mcping";
  version = "27-11-2019";

  src = fetchFromGitHub {
    owner = "theodik";
    repo = name;
    rev = "a4f8a711ed1b39f48aa655b58caccb26bb4d7ddb";
    hash = "sha256-BVZOjOqptEbva6kmI0oYNmodbLuL0nxKdWn/+EZG91U=";
  };

  patches = [
    ./0001-print-usage-to-stderr.patch
    ./0002-fix-sign-compare.patch
  ];
  buildPhase = ''
    cc -o mcping -Wall -Wextra mcping.c
  '';

  installPhase = ''
    mkdir -p $out/bin
    mv mcping $out/bin
  '';

  meta = with lib; {
    description = "Query minecraft server via SLP (Server Listing Ping) to retrieve basic information";
    homepage = "https://github.com/theodik/mcping";
    license = licenses.mit;
    platforms = platforms.all;
  };
}