From a97d8c1717787e1de7e7edbe18f7889bbbf38a49 Mon Sep 17 00:00:00 2001
From: Pablo Lopez
Date: Wed, 25 Feb 2026 01:40:08 +0200
Subject: [PATCH] fix: mac build (#84)
* fix: mac build
- fix error: `error: darwin.apple_sdk_11_0 has been removed as it was a legacy compatibility stub`
- fix librln hash
- bumped nim-ffi
* fix: typo
---
nix/default.nix | 9 ++-------
nix/libchat.nix | 7 +------
nix/librln.nix | 2 +-
nix/shell.nix | 7 ++-----
vendor/nim-ffi | 2 +-
5 files changed, 7 insertions(+), 20 deletions(-)
diff --git a/nix/default.nix b/nix/default.nix
index b5e538d..4ebf73b 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -1,5 +1,5 @@
{ lib, stdenv, nim, which, pkg-config, writeScriptBin,
- openssl, miniupnpc, libnatpmp, darwin ? null,
+ openssl, miniupnpc, libnatpmp,
src, # logos-chat source (self from flake, with submodules=1)
libchatDrv, # result of libchat.nix
librln }: # result of librln.nix
@@ -43,12 +43,7 @@ in stdenv.mkDerivation {
# which doesn't exist. Point XDG_CACHE_HOME at /tmp so Nim writes its cache there.
XDG_CACHE_HOME = "/tmp";
- buildInputs = [ openssl miniupnpc libnatpmp ]
- ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
- Security
- CoreFoundation
- SystemConfiguration
- ]);
+ buildInputs = [ openssl miniupnpc libnatpmp ];
configurePhase = ''
runHook preConfigure
diff --git a/nix/libchat.nix b/nix/libchat.nix
index 1a7fc44..393b6d0 100644
--- a/nix/libchat.nix
+++ b/nix/libchat.nix
@@ -1,5 +1,4 @@
-{ lib, stdenv, rust-bin, makeRustPlatform, perl, pkg-config, cmake,
- darwin ? null }:
+{ lib, stdenv, rust-bin, makeRustPlatform, perl, pkg-config, cmake }:
let
rustToolchain = rust-bin.fromRustupToolchainFile ../vendor/libchat/rust_toolchain.toml;
@@ -20,10 +19,6 @@ in rPlatform.buildRustPackage {
};
nativeBuildInputs = [ perl pkg-config cmake ];
- buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
- Security
- SystemConfiguration
- ]);
doCheck = false;
installPhase = ''
diff --git a/nix/librln.nix b/nix/librln.nix
index 21923ee..ee83d67 100644
--- a/nix/librln.nix
+++ b/nix/librln.nix
@@ -12,7 +12,7 @@ let
"x86_64-linux" = "sha256-FVXW7HHbmxxp6vy7Ji5iy0Y483P9JJXUnkyE84j3gZk=";
"aarch64-linux" = "sha256-E5dir4E/UT0XiaKJxnEXRz9pIGRwWHr5fHkRPYN6T80=";
"x86_64-darwin" = "sha256-FyuXn7hlecZMDhghE6CknVWNN9JMOADzVUVIUxknO78=";
- "aarch64-darwin" = "sha256-8buoDdGtPDtrVQh7oIpmd9OYqTkS5byGgjo7zhNLn84=";
+ "aarch64-darwin" = "sha256-q8O4NXA+czpq6faFi4E44pl4rGe3DUHflIvBwWZ/ngI=";
};
triplet = triplets.${stdenv.hostPlatform.system};
tarball = fetchurl {
diff --git a/nix/shell.nix b/nix/shell.nix
index 97c9f27..ea5a5e8 100644
--- a/nix/shell.nix
+++ b/nix/shell.nix
@@ -2,18 +2,15 @@
let
libExt = if stdenv.isDarwin then "dylib" else "so";
- darwinDeps = lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
- Security CoreFoundation SystemConfiguration
- ]);
in pkgs.mkShell {
buildInputs = with pkgs; [
nim cargo rustc clippy rustfmt
git cmake gnumake which pkg-config
openssl miniupnpc libnatpmp
- ] ++ darwinDeps;
+ ];
shellHook = ''
- export CONVERSATIONS_LIB="${libchatDrv}/lib/liblogos_chat.${libExt}"
+ export CONVERSATIONS_LIB="${libchatDrv}/lib/liblibchat.${libExt}"
echo "logos-chat dev shell. CONVERSATIONS_LIB=$CONVERSATIONS_LIB"
echo "Build: make liblogoschat"
echo "Nix build: nix build '.?submodules=1#'"
diff --git a/vendor/nim-ffi b/vendor/nim-ffi
index c2c03f1..bb8a3e7 160000
--- a/vendor/nim-ffi
+++ b/vendor/nim-ffi
@@ -1 +1 @@
-Subproject commit c2c03f1f0f300ec3aab8b733fe97575f452f6133
+Subproject commit bb8a3e7e221c36effd528605a6eb8ecd0f8b22dd