about summary refs log tree commit diff
path: root/pkgs/applications/office
diff options
context:
space:
mode:
authorThibault Gagnaux <tgagnaux@gmail.com>2022-05-27 15:48:59 +0200
committerThibault Gagnaux <tgagnaux@gmail.com>2022-05-27 17:28:31 +0200
commit8315cf274bf02124dbdea8106d6cd7ccefbd9484 (patch)
tree476359d8fe2c6a1f81d239b2e811a4368165bd76 /pkgs/applications/office
parentb9a5485aa5ebe0547de52f04603831d74f00e1f8 (diff)
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.
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r--pkgs/applications/office/libreoffice/common.nix10
-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.nix8
3 files changed, 20 insertions, 19 deletions
diff --git a/pkgs/applications/office/libreoffice/common.nix b/pkgs/applications/office/libreoffice/common.nix
new file mode 100644
index 0000000000000..b1c547feb3665
--- /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 2228d6bbfe6fd..47b702cc29d4f 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 74a4c156b8307..2e781936c7aca 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; }))