From ab5549d0d280f8252b321a9252e74e7515abb472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Pitucha?= Date: Tue, 24 Mar 2026 09:50:15 +1100 Subject: [PATCH] construo: fix darwin build --- pkgs/by-name/co/construo/package.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/co/construo/package.nix b/pkgs/by-name/co/construo/package.nix index 370a8ab441b0..fdfe5ec1e49c 100644 --- a/pkgs/by-name/co/construo/package.nix +++ b/pkgs/by-name/co/construo/package.nix @@ -11,6 +11,7 @@ libGLU, withLibglut ? !stdenv.hostPlatform.isDarwin, libglut, + apple-sdk, }: stdenv.mkDerivation (finalAttrs: { @@ -29,13 +30,22 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optional withLibGL libGL ++ lib.optional withLibGLU libGLU - ++ lib.optional withLibglut libglut; + ++ lib.optional withLibglut libglut + ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk ]; + + postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace configure --replace-fail \ + '-I/System/Library/Frameworks/GLUT.framework/Headers/' \ + '-I${apple-sdk}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GLUT.framework/Headers/' + ''; preConfigure = '' substituteInPlace src/Makefile.in \ --replace games bin ''; + env.CXXFLAGS = "-std=c++98"; + meta = { description = "Masses and springs simulation game"; mainProgram = "construo.x11";