mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-11 18:58:24 +03:00
feat(shell.nix): group linux only deps
This commit is contained in:
parent
aecf931305
commit
c4a9b57cac
43
shell.nix
43
shell.nix
@ -16,8 +16,7 @@ with {
|
||||
with (pkgs);
|
||||
|
||||
let
|
||||
darwin-frameworks =
|
||||
if isMacOS then
|
||||
darwin-frameworks = if isMacOS then
|
||||
with pkgs.darwin.apple_sdk.frameworks; [
|
||||
AppKit
|
||||
CoreFoundation
|
||||
@ -29,12 +28,24 @@ let
|
||||
]
|
||||
else
|
||||
[ ];
|
||||
|
||||
linux-only = if !isMacOS then [
|
||||
vulkan-headers
|
||||
vulkan-loader
|
||||
vulkan-tools
|
||||
vulkan-validation-layers
|
||||
xorg.libX11
|
||||
xorg.libXcursor
|
||||
xorg.libXrandr
|
||||
xorg.libXi
|
||||
] else
|
||||
[ ];
|
||||
|
||||
llvmPkg = pkgs.llvm_10;
|
||||
lldPkg = pkgs.lld_10; # this should match llvm's version
|
||||
clangPkg = pkgs.clang_10; # this should match llvm's version
|
||||
zig = import ./nix/zig.nix { inherit pkgs isMacOS; };
|
||||
inputs =
|
||||
[
|
||||
inputs = [
|
||||
# build libraries
|
||||
rustc
|
||||
cargo
|
||||
@ -51,12 +62,7 @@ let
|
||||
# llb deps
|
||||
libffi
|
||||
libxml2
|
||||
xorg.libX11
|
||||
zlib
|
||||
vulkan-headers
|
||||
vulkan-loader
|
||||
vulkan-tools
|
||||
vulkan-validation-layers
|
||||
# faster builds - see https://github.com/rtfeldman/roc/blob/trunk/BUILDING_FROM_SOURCE.md#use-lld-for-the-linker
|
||||
lldPkg
|
||||
# dev tools
|
||||
@ -64,24 +70,13 @@ let
|
||||
# (import ./nix/zls.nix { inherit pkgs zig; })
|
||||
ccls
|
||||
];
|
||||
|
||||
in mkShell {
|
||||
buildInputs = inputs ++ darwin-frameworks;
|
||||
buildInputs = inputs ++ darwin-frameworks ++ linux-only;
|
||||
LLVM_SYS_100_PREFIX = "${llvmPkg}";
|
||||
|
||||
APPEND_LIBRARY_PATH = stdenv.lib.makeLibraryPath [
|
||||
pkgconfig
|
||||
vulkan-headers
|
||||
vulkan-loader
|
||||
vulkan-tools
|
||||
vulkan-validation-layers
|
||||
xorg.libX11
|
||||
xorg.libXcursor
|
||||
xorg.libXrandr
|
||||
xorg.libXi
|
||||
libcxx
|
||||
libcxxabi
|
||||
libunwind
|
||||
];
|
||||
APPEND_LIBRARY_PATH = stdenv.lib.makeLibraryPath
|
||||
([ pkgconfig libcxx libcxxabi libunwind ] ++ linux-only);
|
||||
|
||||
# Aliases don't work cross shell, so we do this
|
||||
shellHook = ''
|
||||
|
Loading…
Reference in New Issue
Block a user