From 0b2474a476b8d54967c7362c2d6bdfc76af1f05b Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 14 Apr 2024 22:42:57 +0200 Subject: Nix build on x86_64-linux (not static yet) --- default.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'default.nix') diff --git a/default.nix b/default.nix index 5fb4943..2c39828 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,8 @@ -{ lib, stdenv, meson, ninja, pkg-config, lld, glew, glfw, Cocoa, OpenGL }: - +{ 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"; @@ -9,7 +11,11 @@ stdenv.mkDerivation { nativeBuildInputs = [ meson ninja pkg-config lld ]; buildInputs = [ glew glfw ] - ++ lib.optionals stdenv.isDarwin [ Cocoa OpenGL ]; + ++ 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" @@ -23,7 +29,7 @@ stdenv.mkDerivation { 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" ]; + platforms = [ "x86_64-linux" "x86_64-darwin" ]; mainProgram = "meowcraft"; }; } \ No newline at end of file -- cgit 1.4.1