diff options
Diffstat (limited to 'pkgs/development/node-packages/overrides.nix')
-rw-r--r-- | pkgs/development/node-packages/overrides.nix | 135 |
1 files changed, 29 insertions, 106 deletions
diff --git a/pkgs/development/node-packages/overrides.nix b/pkgs/development/node-packages/overrides.nix index c725197bddb66..355e262ab06f8 100644 --- a/pkgs/development/node-packages/overrides.nix +++ b/pkgs/development/node-packages/overrides.nix @@ -23,23 +23,19 @@ final: prev: { prePatch = '' export NG_CLI_ANALYTICS=false ''; + nativeBuildInputs = [ pkgs.installShellFiles ]; + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + for shell in bash zsh; do + installShellCompletion --cmd ng \ + --$shell <($out/bin/ng completion script) + done + ''; }; "@electron-forge/cli" = prev."@electron-forge/cli".override { buildInputs = [ final.node-gyp-build ]; }; - autoprefixer = prev.autoprefixer.override { - nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ]; - postInstall = '' - wrapProgram "$out/bin/autoprefixer" \ - --prefix NODE_PATH : ${final.postcss}/lib/node_modules - ''; - passthru.tests = { - simple-execution = callPackage ./package-tests/autoprefixer.nix { inherit (final) autoprefixer; }; - }; - }; - bower2nix = prev.bower2nix.override { nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ]; postInstall = '' @@ -72,14 +68,6 @@ final: prev: { ''; }; - grammarly-languageserver = prev.grammarly-languageserver.override (old: { - meta = old.meta // { - # requires EOL Node.js 16 - # https://github.com/znck/grammarly/issues/334 - broken = true; - }; - }); - graphql-language-service-cli = prev.graphql-language-service-cli.override { nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ]; postInstall = '' @@ -107,6 +95,7 @@ final: prev: { joplin = prev.joplin.override (oldAttrs:{ nativeBuildInputs = [ pkgs.pkg-config + (pkgs.python3.withPackages (ps: [ ps.setuptools ])) ] ++ lib.optionals stdenv.isDarwin [ pkgs.xcbuild ]; @@ -117,7 +106,7 @@ final: prev: { libsecret final.node-gyp-build - final.node-pre-gyp + node-pre-gyp pixman cairo @@ -140,6 +129,11 @@ final: prev: { }; } ] ++ oldAttrs.dependencies; + + meta = oldAttrs.meta // { + # ModuleNotFoundError: No module named 'distutils' + broken = stdenv.isDarwin; # still broken on darwin + }; }); jsonplaceholder = prev.jsonplaceholder.override { @@ -174,18 +168,8 @@ final: prev: { ''; }; - node-gyp = prev.node-gyp.override { - nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ]; - # Teach node-gyp to use nodejs headers locally rather that download them form https://nodejs.org. - # This is important when build nodejs packages in sandbox. - postInstall = '' - wrapProgram "$out/bin/node-gyp" \ - --set npm_config_nodedir ${nodejs} - ''; - }; - node-red = prev.node-red.override { - buildInputs = [ final.node-pre-gyp ]; + buildInputs = [ pkgs.node-pre-gyp ]; }; node2nix = prev.node2nix.override { @@ -210,6 +194,11 @@ final: prev: { url = "https://github.com/svanderburg/node2nix/commit/3b63e735458947ef39aca247923f8775633363e5.patch"; hash = "sha256-pe8Xm4mjPh9oKXugoMY6pRl8YYgtdw0sRXN+TienalU="; }) + # Use top-level cctools in generated files - PR svanderburg/node2nix#334 + (fetchpatch { + url = "https://github.com/svanderburg/node2nix/commit/31c308bba5f39ea0105f66b9f40dbe57fed7a292.patch"; + hash = "sha256-DdNRteonMvyffPh0uo0lUbsohKYnyqv0QcD9vjN6aXE="; + }) ]; in '' ${lib.concatStringsSep "\n" (map (patch: "patch -d $out/lib/node_modules/node2nix -p1 < ${patch}") patches)} @@ -225,7 +214,7 @@ final: prev: { version = esbuild-version; src = fetchurl { url = "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-${esbuild-version}.tgz"; - sha512 = "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw=="; + sha512 = "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ=="; }; }; esbuild-linux-arm64 = { @@ -265,7 +254,7 @@ final: prev: { postInstall = '' wrapProgram "$out/bin/postcss" \ --prefix NODE_PATH : ${final.postcss}/lib/node_modules \ - --prefix NODE_PATH : ${final.autoprefixer}/lib/node_modules + --prefix NODE_PATH : ${pkgs.autoprefixer}/node_modules ln -s '${final.postcss}/lib/node_modules/postcss' "$out/lib/node_modules/postcss" ''; passthru.tests = { @@ -289,7 +278,7 @@ final: prev: { src = fetchurl { url = "https://registry.npmjs.org/prisma/-/prisma-${version}.tgz"; - hash = "sha256-136nEfCJjLLUMO3TZhVrltfqv8nU2fA14+L0JLe6Zfk="; + hash = "sha256-TlwKCuDQRFM6+Hhx9eFCfXbtLZq6RwBTIFCWzE4D8N8="; }; postInstall = with pkgs; '' wrapProgram "$out/bin/prisma" \ @@ -350,15 +339,15 @@ final: prev: { }); thelounge-plugin-closepms = prev.thelounge-plugin-closepms.override { - nativeBuildInputs = [ final.node-pre-gyp ]; + nativeBuildInputs = [ pkgs.node-pre-gyp ]; }; thelounge-plugin-giphy = prev.thelounge-plugin-giphy.override { - nativeBuildInputs = [ final.node-pre-gyp ]; + nativeBuildInputs = [ pkgs.node-pre-gyp ]; }; thelounge-theme-flat-blue = prev.thelounge-theme-flat-blue.override { - nativeBuildInputs = [ final.node-pre-gyp ]; + nativeBuildInputs = [ pkgs.node-pre-gyp ]; # TODO: needed until upstream pins thelounge version 4.3.1+ (which fixes dependency on old sqlite3 and transitively very old node-gyp 3.x) preRebuild = '' rm -r node_modules/node-gyp @@ -366,7 +355,7 @@ final: prev: { }; thelounge-theme-flat-dark = prev.thelounge-theme-flat-dark.override { - nativeBuildInputs = [ final.node-pre-gyp ]; + nativeBuildInputs = [ pkgs.node-pre-gyp ]; # TODO: needed until upstream pins thelounge version 4.3.1+ (which fixes dependency on old sqlite3 and transitively very old node-gyp 3.x) preRebuild = '' rm -r node_modules/node-gyp @@ -389,13 +378,6 @@ final: prev: { ''; }; - typescript-language-server = prev.typescript-language-server.override { - nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ]; - postInstall = '' - ${pkgs.xorg.lndir}/bin/lndir ${pkgs.typescript} $out - ''; - }; - uppy-companion = prev."@uppy/companion".override { name = "uppy-companion"; }; @@ -403,7 +385,7 @@ final: prev: { vega-cli = prev.vega-cli.override { nativeBuildInputs = [ pkgs.pkg-config ]; buildInputs = with pkgs; [ - final.node-pre-gyp + node-pre-gyp pixman cairo pango @@ -430,7 +412,7 @@ final: prev: { }; wavedrom-cli = prev.wavedrom-cli.override { - nativeBuildInputs = [ pkgs.pkg-config final.node-pre-gyp ]; + nativeBuildInputs = [ pkgs.pkg-config pkgs.node-pre-gyp ]; # These dependencies are required by # https://github.com/Automattic/node-canvas. buildInputs = with pkgs; [ @@ -446,63 +428,4 @@ final: prev: { webtorrent-cli = prev.webtorrent-cli.override { buildInputs = [ final.node-gyp-build ]; }; - - wrangler = prev.wrangler.override (oldAttrs: - let - workerdVersion = (lib.findFirst (dep: dep.name == "workerd") null oldAttrs.dependencies).version; - linuxWorkerd = { - name = "_at_cloudflare_slash_workerd-linux-64"; - packageName = "@cloudflare/workerd-linux-64"; - # Should be same version as workerd - version = workerdVersion; - src = fetchurl { - url = "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-${workerdVersion}.tgz"; - sha512 = "sha512-E8mj+HPBryKwaJAiNsYzXtVjKCL0KvUBZbtxJxlWM4mLSQhT+uwGT3nydb/hFY59rZnQgZslw0oqEWht5TEYiQ=="; - }; - }; - linuxWorkerdArm = { - name = "_at_cloudflare_slash_workerd-linux-arm64"; - packageName = "@cloudflare/workerd-linux-arm64"; - # Should be same version as workerd - version = workerdVersion; - src = fetchurl { - url = "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-${workerdVersion}.tgz"; - sha512 = "sha512-/Fr1W671t2triNCDCBWdStxngnbUfZunZ/2e4kaMLzJDJLYDtYdmvOUCBDzUD4ssqmIMbn9RCQQ0U+CLEoqBqw=="; - }; - }; - darwinWorkerd = { - name = "_at_cloudflare_slash_workerd-darwin-64"; - packageName = "@cloudflare/workerd-darwin-64"; - # Should be same version as workerd - version = workerdVersion; - src = fetchurl { - url = "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-${workerdVersion}.tgz"; - sha512 = "sha512-ATaXjefbTsrv4mpn4Fdua114RRDXcX5Ky+Mv+f4JTUllgalmqC4CYMN4jxRz9IpJU/fNMN8IEfvUyuJBAcl9Iw=="; - }; - }; - darwinWorkerdArm = { - name = "_at_cloudflare_slash_workerd-darwin-arm64"; - packageName = "@cloudflare/workerd-darwin-arm64"; - # Should be same version as workerd - version = workerdVersion; - src = fetchurl { - url = "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-${workerdVersion}.tgz"; - sha512 = "sha512-wnbsZI4CS0QPCd+wnBHQ40C28A/2Qo4ESi1YhE2735G3UNcc876MWksZhsubd+XH0XPIra6eNFqyw6wRMpQOXA=="; - }; - }; - - in - { - meta = oldAttrs.meta // { broken = before "16.13"; }; - buildInputs = [ pkgs.llvmPackages.libcxx pkgs.llvmPackages.libunwind ] ++ lib.optional stdenv.isLinux pkgs.autoPatchelfHook; - preFixup = '' - # patch elf is trying to patch binary for sunos - rm -r $out/lib/node_modules/wrangler/node_modules/@esbuild/sunos-x64 - ''; - dependencies = oldAttrs.dependencies - ++ lib.optional (stdenv.isLinux && stdenv.isx86_64) linuxWorkerd - ++ lib.optional (stdenv.isLinux && stdenv.isAarch64) linuxWorkerdArm - ++ lib.optional (stdenv.isDarwin && stdenv.isx86_64) darwinWorkerd - ++ lib.optional (stdenv.isDarwin && stdenv.isAarch64) darwinWorkerdArm; - }); } |