Commit 59c2e8e2 authored by Euan Kemp's avatar Euan Kemp
Browse files

anki: 2.1.60 -> 2.1.61

Rote update
parent 899080fc
Loading
Loading
Loading
Loading
+12 −21
Original line number Diff line number Diff line
@@ -2011,7 +2011,9 @@ dependencies = [
 "anki",
 "futures",
 "itertools",
 "lazy_static",
 "linkcheck",
 "regex",
 "reqwest",
 "strum",
 "tokio",
@@ -2406,9 +2408,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"

[[package]]
name = "openssl"
version = "0.10.45"
version = "0.10.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1"
checksum = "518915b97df115dd36109bfa429a48b8f737bd05508cf9588977b599648926d2"
dependencies = [
 "bitflags",
 "cfg-if",
@@ -2438,9 +2440,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"

[[package]]
name = "openssl-sys"
version = "0.9.80"
version = "0.9.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7"
checksum = "666416d899cf077260dac8698d60a60b435a46d57e82acb1be3d0dad87284e5b"
dependencies = [
 "autocfg",
 "cc",
@@ -3167,15 +3169,6 @@ version = "0.6.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"

[[package]]
name = "remove_dir_all"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
dependencies = [
 "winapi",
]

[[package]]
name = "reqwest"
version = "0.11.13"
@@ -3804,16 +3797,15 @@ checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d"

[[package]]
name = "tempfile"
version = "3.3.0"
version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95"
dependencies = [
 "cfg-if",
 "fastrand",
 "libc",
 "redox_syscall",
 "remove_dir_all",
 "winapi",
 "rustix",
 "windows-sys",
]

[[package]]
@@ -4413,12 +4405,11 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca"

[[package]]
name = "walkdir"
version = "2.3.2"
version = "2.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698"
dependencies = [
 "same-file",
 "winapi",
 "winapi-util",
]

+5 −11
Original line number Diff line number Diff line
@@ -22,14 +22,14 @@

let
  pname = "anki";
  version = "2.1.60";
  rev = "76d8807315fcc2675e7fa44d9ddf3d4608efc487";
  version = "2.1.61";
  rev = "0c1eaf4ce66c1b90867af9a79b95d9e507262cf8";

  src = fetchFromGitHub {
    owner = "ankitects";
    repo = "anki";
    rev = version;
    hash = "sha256-hNrf6asxF7r7QK2XO150yiRjyHAYKN8OFCFYX0SAiwA=";
    hash = "sha256-prTGilOw7SfxWevnMsuGq8Zp5uLfVHzTkoAU57NzqHk=";
    fetchSubmodules = true;
  };

@@ -86,7 +86,7 @@ let

  yarnOfflineCache = fetchYarnDeps {
    yarnLock = "${src}/yarn.lock";
    hash = "sha256-bAtmMGWi5ETIidFFnG3jzJg2mSBnH5ONO2/Lr9A3PpQ=";
    hash = "sha256-jP0ltYVB52LolGtN/GGjM4I7ira16rRTXfyJlrdjTX4=";
  };

  # https://discourse.nixos.org/t/mkyarnpackage-lockfile-has-incorrect-entry/21586/3
@@ -122,13 +122,7 @@ python3.pkgs.buildPythonApplication {
  patches = [
    ./patches/gl-fixup.patch
    ./patches/no-update-check.patch
    # Upstreamed in https://github.com/ankitects/anki/pull/2446
    # We can drop these once we update to an anki version that includes them
    # already
    ./patches/0001-Don-t-download-nodejs-if-NODE_BINARY-is-set.patch
    ./patches/0002-Allow-setting-YARN_BINARY-for-the-build-system.patch
    # Not upstreamed
    ./patches/0003-Skip-formatting-python-code.patch
    ./patches/0001-Skip-formatting-python-code.patch
  ];

  inherit cargoDeps;
+0 −53
Original line number Diff line number Diff line
From 53740ca75d167fab5c403a462e21ecd717b1dafa Mon Sep 17 00:00:00 2001
From: Euan Kemp <euank@euank.com>
Date: Fri, 17 Mar 2023 22:38:04 +0900
Subject: [PATCH 1/2] Don't download nodejs if NODE_BINARY is set

Some build environments, such as nixpkgs, restrict network access and
thus would prefer to not download anything at all. Setting PROTOC_BINARY
and friends makes the build system not download stuff, and the same
should be true for nodejs
---
 build/ninja_gen/src/node.rs | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/build/ninja_gen/src/node.rs b/build/ninja_gen/src/node.rs
index df05e149d..d08c7011e 100644
--- a/build/ninja_gen/src/node.rs
+++ b/build/ninja_gen/src/node.rs
@@ -105,16 +105,6 @@ pub fn setup_node(
     binary_exports: &[&'static str],
     mut data_exports: HashMap<&str, Vec<Cow<str>>>,
 ) -> Result<()> {
-    download_and_extract(
-        build,
-        "node",
-        archive,
-        hashmap! {
-            "bin" => vec![if cfg!(windows) { "node.exe" } else { "bin/node" }],
-            "npm" => vec![if cfg!(windows) { "npm.cmd " } else { "bin/npm" }]
-        },
-    )?;
-
     let node_binary = match std::env::var("NODE_BINARY") {
         Ok(path) => {
             assert!(
@@ -124,6 +114,15 @@ pub fn setup_node(
             path.into()
         }
         Err(_) => {
+            download_and_extract(
+                build,
+                "node",
+                archive,
+                hashmap! {
+                    "bin" => vec![if cfg!(windows) { "node.exe" } else { "bin/node" }],
+                    "npm" => vec![if cfg!(windows) { "npm.cmd " } else { "bin/npm" }]
+                },
+            )?;
             inputs![":extract:node:bin"]
         }
     };
-- 
2.39.2
+0 −36
Original line number Diff line number Diff line
From 16af7d4cabcf10797bd110c905a9d7694bde0fb4 Mon Sep 17 00:00:00 2001
From: Euan Kemp <euank@euank.com>
Date: Fri, 17 Mar 2023 23:07:05 +0900
Subject: [PATCH 2/2] Allow setting YARN_BINARY for the build system

---
 build/ninja_gen/src/node.rs | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/build/ninja_gen/src/node.rs b/build/ninja_gen/src/node.rs
index d08c7011e..c1e2ce1b3 100644
--- a/build/ninja_gen/src/node.rs
+++ b/build/ninja_gen/src/node.rs
@@ -129,7 +129,18 @@ pub fn setup_node(
     let node_binary = build.expand_inputs(node_binary);
     build.variable("node_binary", &node_binary[0]);
 
-    build.add("yarn", YarnSetup {})?;
+    match std::env::var("YARN_BINARY") {
+        Ok(path) => {
+            assert!(
+                Utf8Path::new(&path).is_absolute(),
+                "YARN_BINARY must be absolute"
+            );
+            build.add_resolved_files_to_group("yarn:bin", &vec![path]);
+        },
+        Err(_) => {
+            build.add("yarn", YarnSetup {})?;
+        },
+    };
 
     for binary in binary_exports {
         data_exports.insert(
-- 
2.39.2