mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-19 02:44:17 +03:00
libreoffice: add darwin to meta platforms and extract to common.nix
As a result, the darwin derivations will show up on https://search.nixos.org/packages.
This commit is contained in:
parent
b9a5485aa5
commit
8315cf274b
10
pkgs/applications/office/libreoffice/common.nix
Normal file
10
pkgs/applications/office/libreoffice/common.nix
Normal file
@ -0,0 +1,10 @@
|
||||
{ lib }:
|
||||
{
|
||||
meta = with lib; {
|
||||
description = "Comprehensive, professional-quality productivity suite, a variant of openoffice.org";
|
||||
homepage = "https://libreoffice.org/";
|
||||
license = licenses.lgpl3;
|
||||
maintainers = with maintainers; [ raskin tricktron ];
|
||||
platforms = platforms.linux ++ [ "x86_64-darwin" "aarch64-darwin" ];
|
||||
};
|
||||
}
|
@ -3,12 +3,15 @@
|
||||
, fetchurl
|
||||
, undmg
|
||||
, writeScript
|
||||
, callPackage
|
||||
}:
|
||||
|
||||
let
|
||||
appName = "LibreOffice.app";
|
||||
scriptName = "soffice";
|
||||
version = "7.3.3";
|
||||
common = import ../common.nix { inherit lib; };
|
||||
|
||||
dist = {
|
||||
aarch64-darwin = rec {
|
||||
arch = "aarch64";
|
||||
@ -27,6 +30,7 @@ let
|
||||
in
|
||||
stdenvNoCC.mkDerivation {
|
||||
inherit version;
|
||||
inherit (import ../common.nix { inherit lib; }) meta;
|
||||
pname = "libreoffice";
|
||||
src = fetchurl {
|
||||
inherit (dist.${stdenvNoCC.hostPlatform.system} or
|
||||
@ -56,6 +60,7 @@ stdenvNoCC.mkDerivation {
|
||||
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;
|
||||
in
|
||||
writeScript "update-libreoffice.sh"
|
||||
''
|
||||
@ -64,17 +69,9 @@ stdenvNoCC.mkDerivation {
|
||||
set -eou pipefail
|
||||
|
||||
# reset version first so that both platforms are always updated and in sync
|
||||
update-source-version libreoffice 0 ${lib.fakeSha256} --system=aarch64-darwin
|
||||
update-source-version libreoffice ${newVersion} ${newAarch64Sha256} --system=aarch64-darwin
|
||||
update-source-version libreoffice 0 ${lib.fakeSha256} --system=x86_64-darwin
|
||||
update-source-version libreoffice ${newVersion} ${newX86_64Sha256} --system=x86_64-darwin
|
||||
update-source-version libreoffice 0 ${lib.fakeSha256} --file ${currentFile} --system=aarch64-darwin
|
||||
update-source-version libreoffice ${newVersion} ${newAarch64Sha256} --file ${currentFile} --system=aarch64-darwin
|
||||
update-source-version libreoffice 0 ${lib.fakeSha256} --file ${currentFile} --system=x86_64-darwin
|
||||
update-source-version libreoffice ${newVersion} ${newX86_64Sha256} --file ${currentFile} --system=x86_64-darwin
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Comprehensive, professional-quality productivity suite, a variant of openoffice.org";
|
||||
homepage = "https://libreoffice.org/";
|
||||
license = licenses.lgpl3;
|
||||
maintainers = with maintainers; [ tricktron ];
|
||||
platforms = [ "aarch64-darwin" "x86_64-darwin" ];
|
||||
};
|
||||
}
|
@ -581,11 +581,5 @@ in
|
||||
|
||||
requiredSystemFeatures = [ "big-parallel" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Comprehensive, professional-quality productivity suite, a variant of openoffice.org";
|
||||
homepage = "https://libreoffice.org/";
|
||||
license = licenses.lgpl3;
|
||||
maintainers = with maintainers; [ raskin ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
inherit (import ../common.nix { inherit lib; }) meta;
|
||||
}).overrideAttrs ((importVariant "override.nix") (args // { inherit kdeIntegration; }))
|
||||
|
@ -27773,7 +27773,7 @@ with pkgs;
|
||||
};
|
||||
|
||||
libreoffice = if stdenv.isDarwin
|
||||
then callPackage ../applications/office/libreoffice/darwin/darwin.nix {}
|
||||
then callPackage ../applications/office/libreoffice/darwin { }
|
||||
else hiPrio libreoffice-still;
|
||||
libreoffice-unwrapped = (hiPrio libreoffice-still).libreoffice;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user