2021-05-29 03:03:59 +03:00
|
|
|
{}:
|
2020-10-24 22:22:51 +03:00
|
|
|
|
2020-11-24 09:00:16 +03:00
|
|
|
let
|
2021-07-20 16:20:27 +03:00
|
|
|
sources = import nix/sources.nix { };
|
|
|
|
pkgs = import sources.nixpkgs { };
|
2020-11-11 20:55:00 +03:00
|
|
|
|
2021-06-01 01:40:26 +03:00
|
|
|
darwinInputs =
|
|
|
|
with pkgs;
|
|
|
|
lib.optionals stdenv.isDarwin (
|
|
|
|
with pkgs.darwin.apple_sdk.frameworks; [
|
|
|
|
AppKit
|
|
|
|
CoreFoundation
|
|
|
|
CoreServices
|
|
|
|
CoreVideo
|
|
|
|
Foundation
|
|
|
|
Metal
|
|
|
|
Security
|
|
|
|
]
|
|
|
|
);
|
2020-11-11 20:55:00 +03:00
|
|
|
|
2021-06-01 01:40:26 +03:00
|
|
|
linuxInputs =
|
|
|
|
with pkgs;
|
|
|
|
lib.optionals stdenv.isLinux [
|
|
|
|
valgrind
|
|
|
|
vulkan-headers
|
|
|
|
vulkan-loader
|
|
|
|
vulkan-tools
|
|
|
|
vulkan-validation-layers
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libxcb
|
|
|
|
];
|
2020-11-11 20:55:00 +03:00
|
|
|
|
2021-06-08 03:33:57 +03:00
|
|
|
llvmPkgs = pkgs.llvmPackages_12;
|
2020-10-29 04:22:54 +03:00
|
|
|
|
2021-06-01 02:02:39 +03:00
|
|
|
zig = import ./nix/zig.nix { inherit pkgs; };
|
2021-06-01 01:40:26 +03:00
|
|
|
|
|
|
|
inputs = with pkgs;[
|
|
|
|
# build libraries
|
|
|
|
rustc
|
|
|
|
cargo
|
|
|
|
clippy
|
|
|
|
rustfmt
|
|
|
|
cmake
|
|
|
|
git
|
|
|
|
python3
|
2021-06-16 05:09:21 +03:00
|
|
|
llvmPkgs.llvm.dev
|
2021-06-01 01:40:26 +03:00
|
|
|
llvmPkgs.clang
|
|
|
|
pkg-config
|
|
|
|
zig
|
2020-11-10 20:22:11 +03:00
|
|
|
|
2021-06-01 01:40:26 +03:00
|
|
|
# lib deps
|
|
|
|
llvmPkgs.libcxx
|
|
|
|
llvmPkgs.libcxxabi
|
|
|
|
libffi
|
|
|
|
libunwind
|
|
|
|
libxml2
|
|
|
|
ncurses
|
|
|
|
zlib
|
|
|
|
libiconv
|
|
|
|
|
|
|
|
# faster builds - see https://github.com/rtfeldman/roc/blob/trunk/BUILDING_FROM_SOURCE.md#use-lld-for-the-linker
|
|
|
|
llvmPkgs.lld
|
|
|
|
];
|
|
|
|
in
|
|
|
|
pkgs.mkShell
|
|
|
|
{
|
|
|
|
buildInputs = inputs ++ darwinInputs ++ linuxInputs;
|
2020-09-05 23:58:33 +03:00
|
|
|
|
2021-06-01 01:40:26 +03:00
|
|
|
# Additional Env vars
|
2021-06-16 05:09:21 +03:00
|
|
|
LLVM_SYS_120_PREFIX = "${llvmPkgs.llvm.dev}";
|
2021-06-01 01:40:26 +03:00
|
|
|
LD_LIBRARY_PATH =
|
|
|
|
with pkgs;
|
|
|
|
lib.makeLibraryPath
|
|
|
|
(
|
|
|
|
[
|
|
|
|
pkg-config
|
|
|
|
stdenv.cc.cc.lib
|
|
|
|
llvmPkgs.libcxx
|
|
|
|
llvmPkgs.libcxxabi
|
|
|
|
libunwind
|
|
|
|
libffi
|
|
|
|
ncurses
|
|
|
|
zlib
|
|
|
|
]
|
|
|
|
++ linuxInputs
|
|
|
|
);
|
|
|
|
}
|