mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-22 19:40:14 -04:00
Abstract out the apple sdk bits into a shared library
This commit is contained in:
parent
8e075d681c
commit
1d924fb702
@ -1,5 +1,5 @@
|
||||
{ pkgs, rust-wasm }:
|
||||
with pkgs;
|
||||
mkShell {
|
||||
buildInputs = (if stdenv.isDarwin then [ pkgs.darwin.apple_sdk.frameworks.Security ] else [ ]) ++ (with pkgs; [wasm-bindgen-cli wasm-pack llvm clang rust-wasm]);
|
||||
buildInputs = (lib.darwin-sdk pkgs) ++ (with pkgs; [wasm-bindgen-cli wasm-pack llvm clang rust-wasm]);
|
||||
}
|
@ -1,3 +1,6 @@
|
||||
let
|
||||
lib = import ../lib/lib.nix;
|
||||
in
|
||||
{pkgs ? (import <nixpkgs>) {},
|
||||
# Because it's a workspace we need the other crates available as source
|
||||
root,
|
||||
@ -12,11 +15,7 @@ with pkgs;
|
||||
inherit version;
|
||||
buildInputs = [ rust-wasm libclang ];
|
||||
# However the crate we are building has it's root in specific crate.
|
||||
nativeBuildInputs = (if stdenv.isDarwin then (with pkgs.darwin.apple_sdk.frameworks; [
|
||||
xcbuild
|
||||
Security
|
||||
fixDarwinDylibNames
|
||||
]) else [ ]) ++ [llvm clang rust-bindgen];
|
||||
nativeBuildInputs = (lib.darwin-sdk pkgs) ++ [llvm clang rust-bindgen];
|
||||
src = root;
|
||||
cargoBuildOptions = opts: opts ++ ["-p" "${pname}" ];
|
||||
postPatch = ''
|
||||
|
7
nix/lib/lib.nix
Normal file
7
nix/lib/lib.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
darwin-sdk = pkgs: with pkgs; (if stdenv.isDarwin then (with darwin.apple_sdk.frameworks; [
|
||||
xcbuild
|
||||
Security
|
||||
fixDarwinDylibNames
|
||||
]) else [ ]);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user