{ lib, clangStdenv, meson, ninja, pkg-config, lld, glew, glfw, Cocoa, OpenGL, libX11, libXau, libXdmcp }: 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 ] # TODO: Wayland support. # NOTE: Also, even without Wayland, do we really need to link against libXau and # libXdmcp of all things?? ++ lib.optionals stdenv.isLinux [ libX11 libXau libXdmcp ]; 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"; }; }