File tree 1 file changed +13
-8
lines changed
1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 42
42
] ++ pkgs . lib . optionals pkgs . stdenv . isDarwin [
43
43
pkgs . darwin . apple_sdk . frameworks . Cocoa
44
44
] ;
45
- stdenv = if pkgs . stdenv . isLinux then pkgs . stdenv
46
- else if pkgs . stdenv . isDarwin then pkgs . clang18Stdenv
47
- else throw "Unsupported platform" ;
45
+ stdenv =
46
+ if pkgs . stdenv . isLinux then pkgs . stdenv
47
+ else if pkgs . stdenv . isDarwin then pkgs . clang18Stdenv
48
+ else throw "Unsupported platform" ;
49
+ cargoDeps = pkgs . rustPlatform . importCargoLock {
50
+ lockFile = ./src/jit/Cargo.lock ;
51
+ } ;
48
52
in
49
53
{
50
54
packages . default = stdenv . mkDerivation
51
55
{
52
- cargoDeps = pkgs . rustPlatform . importCargoLock {
53
- lockFile = ./src/jit/Cargo.lock ;
54
- } ;
56
+ cargoDeps = cargoDeps ;
55
57
cargoRoot = "src/jit" ;
56
58
pname = "dgb-n64" ;
57
59
version = "0.0.1-${ shortRev } " ;
88
90
devShells . default = pkgs . mkShell . override { stdenv = stdenv ; }
89
91
{
90
92
buildInputs = devShellTools ++ tools ++ libs ;
91
- shellHook = if stdenv . isLinux then ''
93
+ shellHook = ''
94
+ # So the cargo dependencies get cached offline, just in case
95
+ export cargoDeps=${ cargoDeps }
96
+ '' + ( if stdenv . isLinux then ''
92
97
export LD_LIBRARY_PATH="${ pkgs . vulkan-loader } /lib";
93
98
'' else if stdenv . isDarwin then ''
94
99
export DYLD_FALLBACK_LIBRARY_PATH="${ pkgs . darwin . moltenvk } /lib";
95
- '' else throw "Unsupported platform" ;
100
+ '' else throw "Unsupported platform" ) ;
96
101
} ;
97
102
}
98
103
) ;
You can’t perform that action at this time.
0 commit comments