tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
deno: make it easier to override librusty_v8
06kellyjac
4 years ago
9611f031
dd50d1df
+27
-26
3 changed files
expand all
collapse all
unified
split
pkgs
development
web
deno
default.nix
deps.nix
librusty_v8.nix
+6
-13
pkgs/development/web/deno/default.nix
···
1
1
{ stdenv
2
2
, lib
3
3
+
, callPackage
3
4
, fetchurl
4
5
, fetchFromGitHub
5
6
, rust
···
7
8
, installShellFiles
8
9
, Security
9
10
, CoreServices
11
11
+
, librusty_v8 ? callPackage ./librusty_v8.nix { }
10
12
}:
11
13
12
14
rustPlatform.buildRustPackage rec {
···
29
31
# The rusty_v8 package will try to download a `librusty_v8.a` release at build time to our read-only filesystem
30
32
# To avoid this we pre-download the file and place it in the locations it will require it in advance
31
33
preBuild =
32
32
-
let
33
33
-
inherit (import ./deps.nix { }) librusty_v8;
34
34
-
arch = rust.toRustTarget stdenv.hostPlatform;
35
35
-
librusty_v8_release = fetchurl {
36
36
-
url = "https://github.com/denoland/rusty_v8/releases/download/v${librusty_v8.version}/librusty_v8_release_${arch}.a";
37
37
-
sha256 = librusty_v8.sha256s.${stdenv.hostPlatform.system};
38
38
-
meta = { inherit (librusty_v8) version; };
39
39
-
};
40
40
-
in
34
34
+
let arch = rust.toRustTarget stdenv.hostPlatform; in
41
35
''
42
42
-
_rusty_v8_setup() {
36
36
+
_librusty_v8_setup() {
43
37
for v in "$@"; do
44
44
-
dir="target/$v/gn_out/obj"
45
45
-
mkdir -p "$dir" && cp "${librusty_v8_release}" "$dir/librusty_v8.a"
38
38
+
install -D ${librusty_v8} "target/$v/gn_out/obj/librusty_v8.a"
46
39
done
47
40
}
48
41
49
42
# Copy over the `librusty_v8.a` file inside target/XYZ/gn_out/obj, symlink not allowed
50
50
-
_rusty_v8_setup "debug" "release" "${arch}/release"
43
43
+
_librusty_v8_setup "debug" "release" "${arch}/release"
51
44
'';
52
45
53
46
# Tests have some inconsistencies between runs with output integration tests
-13
pkgs/development/web/deno/deps.nix
···
1
1
-
# auto-generated file -- DO NOT EDIT!
2
2
-
{}:
3
3
-
rec {
4
4
-
librusty_v8 = {
5
5
-
version = "0.20.0";
6
6
-
sha256s = {
7
7
-
x86_64-linux = "1y0av2hghdvk2qv8kgw29x833wy31i89z7z6hw4jd1y21ihqsdd5";
8
8
-
aarch64-linux = "0726ay48w74y79j892is8qxx0kg3m35lmbniwcgy37idxm06vx28";
9
9
-
x86_64-darwin = "0gmfdmd5dvxh5xyxsq3nk8fpvdmpczq7nmj1b2zsakl8v3j14jck";
10
10
-
aarch64-darwin = "1zw3pxp13s38wspv5lwcns02wzrqagay9zjxj2wiygfzzr5b2c88";
11
11
-
};
12
12
-
};
13
13
-
}
+21
pkgs/development/web/deno/librusty_v8.nix
···
1
1
+
# auto-generated file -- DO NOT EDIT!
2
2
+
{ rust, stdenv, fetchurl }:
3
3
+
4
4
+
let
5
5
+
arch = rust.toRustTarget stdenv.hostPlatform;
6
6
+
fetch_librusty_v8 = args: fetchurl {
7
7
+
name = "librusty_v8-${args.version}";
8
8
+
url = "https://github.com/denoland/rusty_v8/releases/download/v${args.version}/librusty_v8_release_${arch}.a";
9
9
+
sha256 = args.shas.${stdenv.hostPlatform.system};
10
10
+
meta = { inherit (args) version; };
11
11
+
};
12
12
+
in
13
13
+
fetch_librusty_v8 {
14
14
+
version = "0.20.0";
15
15
+
shas = {
16
16
+
x86_64-linux = "sha256-pTWNYQzChyYJh+afn1AMw/MxUE+Cv4k2FnM3+KDYCvg=";
17
17
+
aarch64-linux = "sha256-SPRtQO0tnuEf49GuSsuo403QO0Y6ioRkOp4cjohXRhw=";
18
18
+
x86_64-darwin = "sha256-k0kS5NiITqW/WEFWe/Bnt7Z9HZp2YN19L7DvVlptrj4=";
19
19
+
aarch64-darwin = "sha256-CDGxSv7fPR+5kF3+5NVTOH8ugLaM07Kv5mjoEW6/g/8=";
20
20
+
};
21
21
+
}