summary refs log tree commit diff
path: root/default.nix
blob: 5fb494349ec9c7ebf3840a8b52ea7792d18b12de (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
{ lib, stdenv, meson, ninja, pkg-config, lld, glew, glfw, Cocoa, OpenGL }:


stdenv.mkDerivation {
  pname = "meowcraft";
  version = "0.0.1";

  src = ./.;

  nativeBuildInputs = [ meson ninja pkg-config lld ];
  buildInputs = [ glew glfw ]
    ++ lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];

  mesonFlags = [
    "--buildtype=release"
    "--prefix=${placeholder "out"}"
  ];

  # FIXME: Currently the built binary on darwin can not be run outside
  # of the nix store, because of it's dependencies on the nix libc++ and libc++abi dylibs.

  meta = with lib; {
    description = "a dumb minecraft in c++ and opengl.";
    homepage = "https://git.rnrd.eu/meowcraft";
    license = licenses.free; # TODO: Choose a specific license.
    platforms = [ "x86_64-darwin" ];
    mainProgram = "meowcraft";
  };
}