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

let
  stdenv = clangStdenv;
in
stdenv.mkDerivation {
  pname = "meowcraft";
  version = "0.0.1";

  src = ./.;

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

  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-linux" "x86_64-darwin" ];
    mainProgram = "meowcraft";
  };
}