mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
typst: Update typst packages in typst update script
Co-authored-by: emaryn <emaryn@users.noreply.github.com>
This commit is contained in:
parent
4a065b44a0
commit
55333e69a7
1 changed files with 22 additions and 2 deletions
|
@ -5,7 +5,9 @@
|
|||
installShellFiles,
|
||||
pkg-config,
|
||||
openssl,
|
||||
nix-update-script,
|
||||
writeShellScript,
|
||||
nix-update,
|
||||
gitMinimal,
|
||||
versionCheckHook,
|
||||
callPackage,
|
||||
}:
|
||||
|
@ -60,7 +62,25 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
versionCheckProgramArg = "--version";
|
||||
|
||||
passthru = {
|
||||
updateScript = nix-update-script { };
|
||||
updateScript = {
|
||||
command = [
|
||||
(writeShellScript "update-typst.sh" ''
|
||||
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; typst.version or (lib.getVersion typst)" | tr -d '"')
|
||||
${lib.getExe nix-update} typst > /dev/null
|
||||
latestVersion=$(nix-instantiate --eval -E "with import ./. {}; typst.version or (lib.getVersion typst)" | tr -d '"')
|
||||
changes=()
|
||||
if [[ "$currentVersion" != "$latestVersion" ]]; then
|
||||
changes+=("{\"attrPath\":\"typst\",\"oldVersion\":\"$currentVersion\",\"newVersion\":\"$latestVersion\",\"files\":[\"pkgs/by-name/ty/typst/package.nix\"]}")
|
||||
fi
|
||||
maintainers/scripts/update-typst-packages.py --output pkgs/by-name/ty/typst/typst-packages-from-universe.toml > /dev/null
|
||||
${lib.getExe gitMinimal} diff --quiet HEAD -- pkgs/by-name/ty/typst/typst-packages-from-universe.toml || changes+=("{\"attrPath\":\"typstPackages\",\"oldVersion\":\"0\",\"newVersion\":\"1\",\"files\":[\"pkgs/by-name/ty/typst/typst-packages-from-universe.toml\"]}")
|
||||
echo -n "["
|
||||
IFS=,; echo -n "''${changes[*]}"
|
||||
echo "]"
|
||||
'')
|
||||
];
|
||||
supportedFeatures = [ "commit" ];
|
||||
};
|
||||
packages = callPackage ./typst-packages.nix { };
|
||||
withPackages = callPackage ./with-packages.nix { };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue