From fbc76cef9fa96862be253dff5d891c14a93d2791 Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 14 Apr 2024 14:41:31 +0200 Subject: Build static GLFW and GLEW dependencies --- default.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'default.nix') 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"; -- cgit 1.4.1