katex: 0.16.28 -> 0.18.4 (#555719)

This commit is contained in:
Sandro
2026-08-26 23:18:27 +00:00
committed by GitHub
4 changed files with 42 additions and 50 deletions

View File

@@ -127,6 +127,8 @@
- `texlive.combine` is deprecated and scheduled for removal in 27.05. Please migrate to `texliveSmall.withPackages` (see [](#sec-language-texlive-user-guide)).
- `katex` has been updated from 0.16 to 0.18 and has introduced breaking changes. See upstream changelog for details: [0.17.0](https://github.com/KaTeX/KaTeX/releases/tag/v0.17.0), [0.18.0](https://github.com/KaTeX/KaTeX/releases/tag/v0.18.0).
- `keycloak` was updated to >= 26.7.0 and includes some breaking internal (API) changes. See the [upstream migration guide](https://www.keycloak.org/docs/latest/upgrading/#migrating-to-26-7-0) for more information.
- `pdfium` is now built from source instead of packaging prebuilt binaries. `pdfium-binaries` has been renamed to `pdfium`, and `pdfium-binaries-v8` has been removed.

View File

@@ -2,59 +2,52 @@
lib,
stdenv,
fetchFromGitHub,
yarn-berry_4,
pnpm_11,
pnpmBuildHook,
pnpmConfigHook,
fetchPnpmDeps,
nodejs,
nodejs_22,
makeBinaryWrapper,
nix-update-script,
versionCheckHook,
runCommand,
}:
let
# rollup 2.x breaks on nodejs 24.15+ require.extensions regression. https://github.com/nodejs/node/issues/62786
yarn-berry = yarn-berry_4.override { nodejs = nodejs_22; };
pnpm = pnpm_11;
in
stdenv.mkDerivation (finalAttrs: {
pname = "katex";
version = "0.16.28";
version = "0.18.4";
src = fetchFromGitHub {
owner = "katex";
repo = "katex";
rev = "v${finalAttrs.version}";
hash = "sha256-M9PqzSQkMcnfuL2n/eLwxnk3E9gSEVu0t6Tahiw7niI=";
hash = "sha256-Z458Crgd7o68C1pKE9qf5nJhMAs5D+uyK4nbbtJO/lg=";
};
patches = [
# Remove after upstream updates to Yarn 4.14
# https://github.com/KaTeX/KaTeX/blob/main/package.json#L58
./yarn-4.14-support.patch
];
offlineCache = yarn-berry.fetchYarnBerryDeps {
inherit (finalAttrs) src patches;
hash = "sha256-6DxF+TtUOqW14ivBHETUMXzDspP/54k1OzbKeIJqDAQ=";
pnpmDeps = fetchPnpmDeps {
inherit (finalAttrs) pname version src;
inherit pnpm;
fetcherVersion = 4;
hash = "sha256-9AZj9prk8vbt7qNCKo2yiKCvyvRbhfyFjdDU/+jNFiM=";
};
nativeBuildInputs = [
yarn-berry.yarnBerryConfigHook
yarn-berry
nodejs_22
makeBinaryWrapper
nodejs
pnpm
pnpmConfigHook
pnpmBuildHook
];
buildPhase = ''
runHook preBuild
yarn build
runHook postBuild
'';
installPhase = ''
runHook preInstall
yarn config set nodeLinker "node-modules"
yarn install --mode=skip-build --inline-builds
CI=true pnpm --ignore-scripts --prod prune
rm -r test website fonts
mkdir -p $out/lib/node_modules/katex/
mkdir $out/bin
mv * $out/lib/node_modules/katex/
@@ -65,7 +58,25 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstall
'';
passthru.updateScript = nix-update-script { };
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
passthru = {
updateScript = nix-update-script { };
tests = {
mathml =
runCommand "simple-mathml-output-test"
{
nativeBuildInputs = [ finalAttrs.finalPackage ];
}
''
echo "1+2" | katex -F mathml --output test.html
grep -q "<semantics><mrow><mn>1</mn><mo>+</mo><mn>2</mn></mrow>" test.html
touch $out
'';
};
};
meta = {
changelog = "https://github.com/KaTeX/KaTeX/releases/tag/v${finalAttrs.version}";

View File

@@ -1,20 +0,0 @@
diff --git a/.yarnrc.yml b/.yarnrc.yml
--- a/.yarnrc.yml
+++ b/.yarnrc.yml
@@ -1,2 +1,5 @@
compressionLevel: mixed
enableGlobalCache: false
+approvedGitRepositories:
+ - "**"
+enableScripts: true
diff --git a/yarn.lock b/yarn.lock
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,6 +2,6 @@
# Manual changes might be lost - proceed with caution!
__metadata:
- version: 8
+ version: 9
cacheKey: 10

View File

@@ -64,7 +64,6 @@ stdenv.mkDerivation (finalAttrs: {
inherit (pkgs)
prettier
corepack
katex
;
}
else