diff options
author | Thibault Gagnaux <tgagnaux@gmail.com> | 2022-05-27 15:48:59 +0200 |
---|---|---|
committer | Thibault Gagnaux <tgagnaux@gmail.com> | 2022-05-27 17:28:31 +0200 |
commit | 8315cf274bf02124dbdea8106d6cd7ccefbd9484 (patch) | |
tree | 476359d8fe2c6a1f81d239b2e811a4368165bd76 | |
parent | b9a5485aa5ebe0547de52f04603831d74f00e1f8 (diff) | |
download | nixpkgs-8315cf274bf02124dbdea8106d6cd7ccefbd9484.tar nixpkgs-8315cf274bf02124dbdea8106d6cd7ccefbd9484.tar.gz nixpkgs-8315cf274bf02124dbdea8106d6cd7ccefbd9484.tar.bz2 nixpkgs-8315cf274bf02124dbdea8106d6cd7ccefbd9484.tar.lz nixpkgs-8315cf274bf02124dbdea8106d6cd7ccefbd9484.tar.xz nixpkgs-8315cf274bf02124dbdea8106d6cd7ccefbd9484.tar.zst nixpkgs-8315cf274bf02124dbdea8106d6cd7ccefbd9484.zip |
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.
-rw-r--r-- | pkgs/applications/office/libreoffice/common.nix | 10 | ||||
-rw-r--r-- | pkgs/applications/office/libreoffice/darwin/default.nix (renamed from pkgs/applications/office/libreoffice/darwin/darwin.nix) | 21 | ||||
-rw-r--r-- | pkgs/applications/office/libreoffice/default.nix | 8 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
4 files changed, 21 insertions, 20 deletions
diff --git a/pkgs/applications/office/libreoffice/common.nix b/pkgs/applications/office/libreoffice/common.nix new file mode 100644 index 00000000000..b1c547feb36 --- /dev/null +++ b/pkgs/applications/office/libreoffice/common.nix @@ -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" ]; + }; +} diff --git a/pkgs/applications/office/libreoffice/darwin/darwin.nix b/pkgs/applications/office/libreoffice/darwin/default.nix index 2228d6bbfe6..47b702cc29d 100644 --- a/pkgs/applications/office/libreoffice/darwin/darwin.nix +++ b/pkgs/applications/office/libreoffice/darwin/default.nix @@ -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" ]; - }; } diff --git a/pkgs/applications/office/libreoffice/default.nix b/pkgs/applications/office/libreoffice/default.nix index 74a4c156b83..2e781936c7a 100644 --- a/pkgs/applications/office/libreoffice/default.nix +++ b/pkgs/applications/office/libreoffice/default.nix @@ -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; })) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 194229f944c..43e9efa515b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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; |