From e3799acaab2fe6005b8b945b7dc082b140df17d0 Mon Sep 17 00:00:00 2001 From: Mars Date: Sun, 11 May 2025 15:50:43 -0400 Subject: [PATCH] whar --- flake.nix | 16 ++++++++++------ src/OS/macos/bridge.hpp | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index dd9943c..abdb9ff 100644 --- a/flake.nix +++ b/flake.nix @@ -249,7 +249,7 @@ }; }; - devShell = mkShell.override {inherit stdenv;} rec { + devShell = mkShell.override {inherit stdenv;} { packages = [ alejandra @@ -273,11 +273,15 @@ LD_LIBRARY_PATH = "${lib.makeLibraryPath deps}"; NIX_ENFORCE_NO_NATIVE = 0; - SDKROOT = lib.optionalString stdenv.isDarwin "${pkgs.pkgsStatic.apple-sdk_15}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isysroot ${SDKROOT}"; - NIX_CXXFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isysroot ${SDKROOT}"; - NIX_OBJCFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isysroot ${SDKROOT}"; - NIX_OBJCXXFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isysroot ${SDKROOT}"; + + shellHook = lib.optionalString pkgs.stdenv.hostPlatform.isDarwin '' + export SDKROOT=${pkgs.pkgsStatic.apple-sdk_15}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk + export DEVELOPER_DIR=${pkgs.pkgsStatic.apple-sdk_15} + export NIX_CFLAGS_COMPILE="-isysroot $SDKROOT" + export NIX_CXXFLAGS_COMPILE="-isysroot $SDKROOT" + export NIX_OBJCFLAGS_COMPILE="-isysroot $SDKROOT" + export NIX_OBJCXXFLAGS_COMPILE="-isysroot $SDKROOT" + ''; }; } ); diff --git a/src/OS/macos/bridge.hpp b/src/OS/macos/bridge.hpp index c5f787f..f2a28f9 100644 --- a/src/OS/macos/bridge.hpp +++ b/src/OS/macos/bridge.hpp @@ -20,8 +20,8 @@ using util::types::MediaInfo, util::types::String, util::types::Result; @end #else extern "C++" { - fn GetCurrentPlayingInfo() -> Result; - fn GetMacOSVersion() -> Result; + fn GetCurrentPlayingInfo() -> Result; + fn GetMacOSVersion() -> Result; } #endif #endif