about summary refs log tree commit diff
path: root/pkgs/applications/office
diff options
context:
space:
mode:
author7c6f434c <7c6f434c@mail.ru>2022-01-31 13:21:33 +0000
committerGitHub <noreply@github.com>2022-01-31 13:21:33 +0000
commit4971c8caa8ecc0d2a69b682d8f16b56c372671a5 (patch)
tree327ca8fabc9a2870c94fb361a22ea9de5cc7ee70 /pkgs/applications/office
parent589235201f2e0717bee4915bffff5330fa00ff41 (diff)
parentf7e43bf1fc6c99750cc4bcd8df2ba4a08166558c (diff)
Merge pull request #157010 from tricktron/f-libreoffice-darwin
libreoffice: Adds Darwin
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r--pkgs/applications/office/libreoffice/darwin.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/pkgs/applications/office/libreoffice/darwin.nix b/pkgs/applications/office/libreoffice/darwin.nix
new file mode 100644
index 0000000000000..765cbcd43024b
--- /dev/null
+++ b/pkgs/applications/office/libreoffice/darwin.nix
@@ -0,0 +1,51 @@
+{ stdenv
+, lib
+, fetchurl
+, undmg
+}:
+
+let
+  appName = "LibreOffice.app";
+  version = "7.2.5";
+  dist = {
+    aarch64-darwin = {
+      arch = "aarch64";
+      sha256 = "bdbcb9a98211f866ca089d440aebcd1d313aa99e8ab4104aae4e65ea3cee74ca";
+    };
+
+    x86_64-darwin = {
+      arch = "x86_64";
+      sha256 = "0b7ef18ed08341ac6c15339fe9a161ad17f6b469009d987cfc7d50c628d12a4e";
+    };
+  }."${stdenv.hostPlatform.system}";
+in
+stdenv.mkDerivation {
+  inherit version;
+  pname = "libreoffice";
+  src = fetchurl {
+    url = "https://download.documentfoundation.org/libreoffice/stable/${version}/mac/${dist.arch}/LibreOffice_${version}_MacOS_${dist.arch}.dmg";
+    inherit (dist) sha256;
+  };
+
+  nativeBuildInputs = [ undmg ];
+  sourceRoot = "${appName}";
+  dontPatch = true;
+  dontConfigure = true;
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstallPhase
+    mkdir -p $out/{Applications/${appName},bin}
+    cp -R . $out/Applications/${appName}
+    ln -s $out/Applications/${appName}/Contents/MacOS/soffice $out/bin
+    runHook postInstallPhase
+  '';
+
+  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" ];
+  };
+}