mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-21 19:44:09 +00:00
libreoffice: run the update-script's side-effect at runtime instead of eval
time
This commit is contained in:
parent
4c23cbcc15
commit
d7ccd36aa0
@ -52,26 +52,24 @@ stdenvNoCC.mkDerivation {
|
||||
|
||||
passthru.updateScript =
|
||||
let
|
||||
inherit (import ./update-utils.nix { inherit lib; })
|
||||
getLatestStableVersion
|
||||
getSha256;
|
||||
newVersion = getLatestStableVersion;
|
||||
newAarch64Sha256 = getSha256 dist."aarch64-darwin".url version newVersion;
|
||||
newX86_64Sha256 = getSha256 dist."x86_64-darwin".url version newVersion;
|
||||
currentFile = builtins.toString ./default.nix;
|
||||
defaultNixFile = builtins.toString ./default.nix;
|
||||
updateNix = builtins.toString ./update.nix;
|
||||
aarch64Url = dist."aarch64-darwin".url;
|
||||
x86_64Url = dist."x86_64-darwin".url;
|
||||
in
|
||||
writeScript "update-libreoffice.sh"
|
||||
''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p common-updater-scripts
|
||||
#!nix-shell -i bash --argstr aarch64Url ${aarch64Url} --argstr x86_64Url ${x86_64Url} --argstr version ${version} ${updateNix}
|
||||
set -eou pipefail
|
||||
|
||||
# reset version first so that both platforms are always updated and in sync
|
||||
update-source-version libreoffice-bin 0 ${lib.fakeSha256} --file=${currentFile} --system=aarch64-darwin
|
||||
update-source-version libreoffice-bin ${newVersion} ${newAarch64Sha256} --file=${currentFile} --system=aarch64-darwin
|
||||
update-source-version libreoffice-bin 0 ${lib.fakeSha256} --file=${currentFile} --system=x86_64-darwin
|
||||
update-source-version libreoffice-bin ${newVersion} ${newX86_64Sha256} --file=${currentFile} --system=x86_64-darwin
|
||||
update-source-version libreoffice-bin 0 ${lib.fakeSha256} --file=${defaultNixFile} --system=aarch64-darwin
|
||||
update-source-version libreoffice-bin $newVersion $newAarch64Sha256 --file=${defaultNixFile} --system=aarch64-darwin
|
||||
update-source-version libreoffice-bin 0 ${lib.fakeSha256} --file=${defaultNixFile} --system=x86_64-darwin
|
||||
update-source-version libreoffice-bin $newVersion $newX86_64Sha256 --file=${defaultNixFile} --system=x86_64-darwin
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Comprehensive, professional-quality productivity suite, a variant of openoffice.org";
|
||||
homepage = "https://libreoffice.org/";
|
||||
|
@ -1,4 +1,3 @@
|
||||
# Impure functions, for passthru.updateScript only
|
||||
{ lib }:
|
||||
let
|
||||
# extractLatestVersionFromHtml :: String -> String
|
||||
|
18
pkgs/applications/office/libreoffice/darwin/update.nix
Normal file
18
pkgs/applications/office/libreoffice/darwin/update.nix
Normal file
@ -0,0 +1,18 @@
|
||||
# Impure functions, for passthru.updateScript runtime only
|
||||
{ aarch64Url
|
||||
, x86_64Url
|
||||
, version
|
||||
, pkgs ? import ../../../../../default.nix { }
|
||||
,
|
||||
}:
|
||||
let
|
||||
inherit (import ./update-utils.nix { inherit (pkgs) lib; })
|
||||
getLatestStableVersion
|
||||
getSha256;
|
||||
in
|
||||
pkgs.mkShell rec {
|
||||
buildInputs = [ pkgs.common-updater-scripts ];
|
||||
newVersion = getLatestStableVersion;
|
||||
newAarch64Sha256 = getSha256 aarch64Url version newVersion;
|
||||
newX86_64Sha256 = getSha256 x86_64Url version newVersion;
|
||||
}
|
Loading…
Reference in New Issue
Block a user