Skip to content

Commit

Permalink
Merge pull request #221462 from 06kellyjac/deno
Browse files Browse the repository at this point in the history
deno: 1.31.1 -> 1.32.4
  • Loading branch information
SuperSandro2000 authored Apr 13, 2023
2 parents c30d89d + 7d54a86 commit ea38d91
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 42 deletions.
29 changes: 8 additions & 21 deletions pkgs/development/web/deno/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,25 @@
, lib
, callPackage
, fetchFromGitHub
, fetchpatch
, rustPlatform
, installShellFiles
, tinycc
, libiconv
, libobjc
, Security
, CoreServices
, Metal
, Foundation
, QuartzCore
, darwin
, librusty_v8 ? callPackage ./librusty_v8.nix { }
}:

rustPlatform.buildRustPackage rec {
pname = "deno";
version = "1.31.1";
version = "1.32.3";

src = fetchFromGitHub {
owner = "denoland";
repo = pname;
rev = "v${version}";
hash = "sha256-0S5BSXWnv4DMcc8cijRQx6NyDReg5aJJT65TeNFlkkw=";
hash = "sha256-zltMn8ped1Euia/zRCvkpSUzJwFTpbZgrnot21x5tSA=";
};
cargoHash = "sha256-7Xfnc91yQiAwAF5fvtiwnELUDb7LJeye3GtXNzYkUo8=";

cargoPatches = [
# resolved in 1.31.2
(fetchpatch {
name = "CVE-2023-28446.patch";
url = "https://github.com/denoland/deno/commit/78d430103a8f6931154ddbbe19d36f3b8630286d.patch";
hash = "sha256-kXwr9wWxk1OaaubCr8pfmSp3TrJMQkbAg72nIHp/seA=";
})
];
cargoHash = "sha256-XDs3f44ta9MaJlaMWRVkNZd9DaOfoSHJluUmL68DWOw=";

postPatch = ''
# upstream uses lld on aarch64-darwin for faster builds
Expand All @@ -44,8 +29,10 @@ rustPlatform.buildRustPackage rec {
'';

nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin
[ libiconv libobjc Security CoreServices Metal Foundation QuartzCore ];
buildInputs = lib.optionals stdenv.isDarwin (
[ libiconv darwin.libobjc ] ++
(with darwin.apple_sdk.frameworks; [ Security CoreServices Metal Foundation QuartzCore ])
);

buildAndTestSubdir = "cli";

Expand Down
10 changes: 5 additions & 5 deletions pkgs/development/web/deno/librusty_v8.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ let
};
in
fetch_librusty_v8 {
version = "0.63.0";
version = "0.68.0";
shas = {
x86_64-linux = "sha256-D1NLAFMD1B4NOaBFsKBin5Gs+hmNC9LgNy3Z+w/1VGs=";
aarch64-linux = "sha256-3V2WWMCjJNiuCRmx66ISBk+pzvCKCqvOE9F3YWESABo=";
x86_64-darwin = "sha256-rUWSHxlFDT4cDoTLhSgRr04+2/oroeIiWURHbNDcMF8=";
aarch64-darwin = "sha256-LaoIjHrBqWn0BIpAOaiHAg5qCGoPlSHtFhiAi4og9q0=";
x86_64-linux = "sha256-yq7YPD2TM6Uw0EvCqIsZ/lbE1RLgIg7a42qDVrr5fX4=";
aarch64-linux = "sha256-uZFm3hAeyEUUXqRJFLM3OBVfglH3AecjFKVgeJZu3L0=";
x86_64-darwin = "sha256-YkxoggK0I4rT/KNJ30StDPLUc02Mdjwal3JH+s/YTQo=";
aarch64-darwin = "sha256-aXE7W3sSzbhvC661BYTTHyHlihmVVtFSv85nSjGOLkU=";
};
}
22 changes: 11 additions & 11 deletions pkgs/development/web/deno/update/src.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ interface Replacer {

const log = logger("src");

const prefetchSha256 = (nixpkgs: string, version: string) =>
const prefetchHash = (nixpkgs: string, version: string) =>
run("nix-prefetch", ["-f", nixpkgs, "deno.src", "--rev", version]);
const prefetchCargoSha256 = (nixpkgs: string) =>
const prefetchCargoHash = (nixpkgs: string) =>
run(
"nix-prefetch",
[`{ sha256 }: (import ${nixpkgs} {}).deno.cargoDeps.overrideAttrs (_: { inherit sha256; })`],
[`{ sha256 }: (import ${nixpkgs} {}).deno.cargoDeps.overrideAttrs (_: { hash = sha256; })`],
);

const replace = (str: string, replacers: Replacer[]) =>
Expand All @@ -45,23 +45,23 @@ export async function updateSrc(
denoVersion: string,
) {
log("Starting src update");
const trimVersion = denoVersion.substr(1);
log("Fetching sha256 for:", trimVersion);
const sha256 = await prefetchSha256(nixpkgs, denoVersion);
const trimVersion = denoVersion.substring(1);
log("Fetching hash for:", trimVersion);
const sha256 = await prefetchHash(nixpkgs, denoVersion);
log("sha256 to update:", sha256);
await updateNix(
filePath,
[
genVerReplacer("version", trimVersion),
genShaReplacer("sha256", sha256),
genShaReplacer("hash", sha256),
],
);
log("Fetching cargoSha256 for:", sha256);
const cargoSha256 = await prefetchCargoSha256(nixpkgs);
log("cargoSha256 to update:", cargoSha256);
log("Fetching cargoHash for:", sha256);
const cargoHash = await prefetchCargoHash(nixpkgs);
log("cargoHash to update:", cargoHash);
await updateNix(
filePath,
[genShaReplacer("cargoSha256", cargoSha256)],
[genShaReplacer("cargoHash", cargoHash)],
);
log("Finished src update");
}
6 changes: 1 addition & 5 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6624,11 +6624,7 @@ with pkgs;

deer = callPackage ../shells/zsh/zsh-deer { };

deno = callPackage ../development/web/deno {
inherit (darwin) libobjc;
inherit (darwin.apple_sdk.frameworks)
Security CoreServices Metal Foundation QuartzCore;
};
deno = callPackage ../development/web/deno { };

detox = callPackage ../tools/misc/detox { };

Expand Down

0 comments on commit ea38d91

Please sign in to comment.