Commit 3289fc5e authored by Sergey Volkov's avatar Sergey Volkov
Browse files

qwen-code: 0.0.6 -> 0.0.11

parent 1c64694e
Loading
Loading
Loading
Loading
+70 −0
Original line number Diff line number Diff line
From 0735b59eba183574e080d2912347d58e6e3d158e Mon Sep 17 00:00:00 2001
From: Sergey Volkov <taranarmo@gmail.com>
Date: Fri, 12 Sep 2025 20:06:24 +0200
Subject: [PATCH] Add missing resolved and integrity fields to several packages

---
 package-lock.json | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/package-lock.json b/package-lock.json
index 146686dc..9ad9009f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12574,6 +12574,8 @@
     },
     "packages/cli/node_modules/@testing-library/dom": {
       "version": "10.4.0",
+      "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.0.tgz",
+      "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==",
       "dev": true,
       "license": "MIT",
       "peer": true,
@@ -12609,6 +12611,8 @@
     },
     "packages/cli/node_modules/@testing-library/react": {
       "version": "16.3.0",
+      "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.0.tgz",
+      "integrity": "sha512-kFSyxiEDwv1WLl2fgsq6pPBbw5aWKrsY2/noi1Id0TK0UParSF62oFQFGHXIyaG4pp2tEub/Zlel+fjjZILDsw==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -12660,6 +12664,8 @@
     },
     "packages/cli/node_modules/aria-query": {
       "version": "5.3.0",
+      "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
+      "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
       "dev": true,
       "license": "Apache-2.0",
       "peer": true,
@@ -12669,6 +12675,8 @@
     },
     "packages/cli/node_modules/emoji-regex": {
       "version": "10.4.0",
+      "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz",
+      "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==",
       "license": "MIT"
     },
     "packages/cli/node_modules/react-is": {
@@ -12681,6 +12689,8 @@
     },
     "packages/cli/node_modules/string-width": {
       "version": "7.2.0",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
+      "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
       "license": "MIT",
       "dependencies": {
         "emoji-regex": "^10.3.0",
@@ -12815,6 +12825,8 @@
     },
     "packages/core/node_modules/ignore": {
       "version": "7.0.5",
+      "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",
+      "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",
       "license": "MIT",
       "engines": {
         "node": ">= 4"
-- 
2.51.0
+42 −11
Original line number Diff line number Diff line
@@ -2,25 +2,56 @@
  lib,
  buildNpmPackage,
  fetchFromGitHub,
  fetchNpmDeps,
  nix-update-script,
  jq,
}:

buildNpmPackage (finalAttrs: {
  pname = "qwen-code";
  version = "0.0.6";
  version = "0.0.11";

  src = fetchFromGitHub {
    owner = "QwenLM";
    repo = "qwen-code";
    tag = "v${finalAttrs.version}";
    hash = "sha256-s4+1hqdlJh5jOy6uZz608n5DzuBR+v/s+7D85oFwQIY=";
    hash = "sha256-5qKSWbc0NPpgvt36T/gRSgm1+o2Pbdw3tgfcGba6YSs=";
  };

  npmDeps = fetchNpmDeps {
    inherit (finalAttrs) src;
    hash = "sha256-cGO66hQxgpoxphtt/BPPDIBuAG8yQseCdzUdAO2mkr4=";
  };
  patches = [
    # similar to upstream gemini-cli some node deps are missing resolved and integrity fields
    # upstream the problem is solved in master and in v0.4+, eventually the fix should arrive to qwen
    ./add-missing-resolved-integrity-fields.patch
  ];

  npmDepsHash = "sha256-XvJO3ylm/ER5neSubci2w9OCTmqobmmXLbKmdQAqArY=";

  nativeBuildInputs = [
    jq
  ];

  postPatch = ''
    # patches below remove node-pty dependency which causes build fail on Darwin
    # should be conditional on platform but since package-lock.json is patched it changes its hash
    # though seems like this dependency is not really required by the package
    ${jq}/bin/jq '
      del(.packages."node_modules/node-pty") |
      del(.packages."node_modules/@lydell/node-pty") |
      del(.packages."node_modules/@lydell/node-pty-darwin-arm64") |
      del(.packages."node_modules/@lydell/node-pty-darwin-x64") |
      del(.packages."node_modules/@lydell/node-pty-linux-arm64") |
      del(.packages."node_modules/@lydell/node-pty-linux-x64") |
      del(.packages."node_modules/@lydell/node-pty-win32-arm64") |
      del(.packages."node_modules/@lydell/node-pty-win32-x64") |
      walk(
        if type == "object" and has("dependencies") then
          .dependencies |= with_entries(select(.key | contains("node-pty") | not))
        elif type == "object" and has("optionalDependencies") then
          .optionalDependencies |= with_entries(select(.key | contains("node-pty") | not))
        else .
        end
      )
    ' package-lock.json > package-lock.json.tmp && mv package-lock.json.tmp package-lock.json
  '';

  buildPhase = ''
    runHook preBuild
@@ -34,10 +65,10 @@ buildNpmPackage (finalAttrs: {
  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    cp -r bundle/* $out/
    patchShebangs $out
    ln -s $out/gemini.js $out/bin/qwen
    mkdir -p $out/bin $out/share/qwen-code
    cp -r bundle/* $out/share/qwen-code/
    patchShebangs $out/share/qwen-code
    ln -s $out/share/qwen-code/gemini.js $out/bin/qwen

    runHook postInstall
  '';