mirror of
https://github.com/roc-lang/roc.git
synced 2024-08-17 06:41:22 +03:00
feat(shell.nix): group linux only deps
This commit is contained in:
parent
aecf931305
commit
c4a9b57cac
113
shell.nix
113
shell.nix
@ -16,72 +16,67 @@ with {
|
||||
with (pkgs);
|
||||
|
||||
let
|
||||
darwin-frameworks =
|
||||
if isMacOS then
|
||||
with pkgs.darwin.apple_sdk.frameworks; [
|
||||
AppKit
|
||||
CoreFoundation
|
||||
CoreServices
|
||||
CoreVideo
|
||||
Foundation
|
||||
Metal
|
||||
Security
|
||||
]
|
||||
else
|
||||
[ ];
|
||||
darwin-frameworks = if isMacOS then
|
||||
with pkgs.darwin.apple_sdk.frameworks; [
|
||||
AppKit
|
||||
CoreFoundation
|
||||
CoreServices
|
||||
CoreVideo
|
||||
Foundation
|
||||
Metal
|
||||
Security
|
||||
]
|
||||
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 =
|
||||
[
|
||||
# build libraries
|
||||
rustc
|
||||
cargo
|
||||
clippy
|
||||
rustfmt
|
||||
cmake
|
||||
git
|
||||
python3
|
||||
llvmPkg
|
||||
clangPkg
|
||||
valgrind
|
||||
pkg-config
|
||||
zig
|
||||
# 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
|
||||
rust-analyzer
|
||||
# (import ./nix/zls.nix { inherit pkgs zig; })
|
||||
ccls
|
||||
];
|
||||
inputs = [
|
||||
# build libraries
|
||||
rustc
|
||||
cargo
|
||||
clippy
|
||||
rustfmt
|
||||
cmake
|
||||
git
|
||||
python3
|
||||
llvmPkg
|
||||
clangPkg
|
||||
valgrind
|
||||
pkg-config
|
||||
zig
|
||||
# llb deps
|
||||
libffi
|
||||
libxml2
|
||||
zlib
|
||||
# faster builds - see https://github.com/rtfeldman/roc/blob/trunk/BUILDING_FROM_SOURCE.md#use-lld-for-the-linker
|
||||
lldPkg
|
||||
# dev tools
|
||||
rust-analyzer
|
||||
# (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