summary refs log tree commit diff
path: root/default.nix
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-04-14 14:41:31 +0200
committerMel <einebeere@gmail.com>2024-04-14 14:41:31 +0200
commitfbc76cef9fa96862be253dff5d891c14a93d2791 (patch)
treeb20fbee981a96985d756f6f81dd997c869912c49 /default.nix
parent727983e0a7033e0b778c38e0a0b51a5bc0e9fc2b (diff)
downloadmeowcraft-fbc76cef9fa96862be253dff5d891c14a93d2791.tar.zst
meowcraft-fbc76cef9fa96862be253dff5d891c14a93d2791.zip
Build static GLFW and GLEW dependencies
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix17
1 files changed, 10 insertions, 7 deletions
diff --git a/default.nix b/default.nix
index afaf4e9..5fb4943 100644
--- a/default.nix
+++ b/default.nix
@@ -1,4 +1,5 @@
-{ lib, stdenv, meson, ninja, pkg-config, glew, glfw }:
+{ lib, stdenv, meson, ninja, pkg-config, lld, glew, glfw, Cocoa, OpenGL }:
+
 
 stdenv.mkDerivation {
   pname = "meowcraft";
@@ -6,16 +7,18 @@ stdenv.mkDerivation {
 
   src = ./.;
 
-  nativeBuildInputs = [ meson ninja pkg-config ];
-  buildInputs = [ glew glfw ];
-  # NOTE: Don't packages usually also add the Apple SDKs as buildInputs?
-  # Like OpenGL.framework, etc.? It seems to work without them, but I'm not sure.
+  nativeBuildInputs = [ meson ninja pkg-config lld ];
+  buildInputs = [ glew glfw ]
+    ++ lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
 
   mesonFlags = [
-    "--buildtype" "release"
-    "--prefix" "${placeholder "out"}"
+    "--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";