status-react/nix/shell.nix
Anton Iakimov 7e56e35f56
nix: add missing Apple SDKs to fix make test on macOS
Fixes following error:
```
ld: framework not found IOKit
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [status_nodejs_addon.target.mk:175: Release/status_nodejs_addon.node] Error 1
```
The `make test` target started to fail on macOS after #14944.

This PR adds 2 Apple SDK frameworks to default shell: `IOKit` and `CoreServices`

The other 2 mentioned in `binding.gyp` are not added, but build is ok.

Resolves: https://github.com/status-im/status-mobile/issues/16356

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-06-24 10:56:21 +02:00

47 lines
1.3 KiB
Nix

#
# Defines the default shell that is used when target is not specified.
# It is also merged with all the other shells for a complete set of tools.
#
{ config ? {}
, pkgs ? import ./pkgs.nix { inherit config; } }:
let
inherit (pkgs) mkShell;
in mkShell {
name = "status-mobile-shell"; # for identifying all shells
buildInputs = let
appleSDKFrameworks = (with pkgs.darwin.apple_sdk.frameworks; [
IOKit CoreServices
]);
in
with pkgs; lib.unique ([
# core utilities that should always be present in a shell
bash curl wget file unzip flock procps
git gnumake jq ncurses gnugrep parallel
lsof # used in start-react-native.sh
# build specific utilities
clojure maven watchman
# lint specific utilities
clj-kondo zprint
# other nice to have stuff
yarn nodejs python310
] # and some special cases
++ lib.optionals stdenv.isDarwin ([ cocoapods clang tcl ] ++ appleSDKFrameworks)
++ lib.optionals (!stdenv.isDarwin) [ gcc8 ]
);
# avoid terminal issues
TERM="xterm";
# default locale
LANG="en_US.UTF-8";
LANGUAGE="en_US.UTF-8";
# just a nicety for easy access to node scripts
shellHook = ''
export STATUS_MOBILE_HOME=$(git rev-parse --show-toplevel)
export PATH="$STATUS_MOBILE_HOME/node_modules/.bin:$PATH"
'';
}