diff options
author | Thibault Gagnaux <tgagnaux@gmail.com> | 2022-05-25 17:47:56 +0200 |
---|---|---|
committer | Thibault Gagnaux <tgagnaux@gmail.com> | 2022-05-27 17:28:30 +0200 |
commit | ed52a4493459ee51f9e8d0bf31b707b5a8598693 (patch) | |
tree | c640d56259c1e6c157a4ba65c91c329694d104e3 /pkgs/applications/office | |
parent | 9f80b6d8fe87eccd39e7018512de6998c2765551 (diff) |
libreoffice: general darwin improvements
- throw error if platform is not supported - fix wrong pre/postInstallPhase hook -> pre/postInstall - switch to stdenvNoCC because we don't build anything - run all phases by default - wrap binary using `open -na $out/Applications/${appName} --args "$@"`
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r-- | pkgs/applications/office/libreoffice/darwin/darwin.nix | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/pkgs/applications/office/libreoffice/darwin/darwin.nix b/pkgs/applications/office/libreoffice/darwin/darwin.nix index 9ac615486ab5f..73602d3e317b0 100644 --- a/pkgs/applications/office/libreoffice/darwin/darwin.nix +++ b/pkgs/applications/office/libreoffice/darwin/darwin.nix @@ -1,4 +1,4 @@ -{ stdenv +{ stdenvNoCC , lib , fetchurl , undmg @@ -7,6 +7,7 @@ let appName = "LibreOffice.app"; + scriptName = "soffice"; version = "7.2.5"; baseUrl = "https://download.documentfoundation.org/libreoffice/stable"; dist = { @@ -25,25 +26,27 @@ let }; }; in -stdenv.mkDerivation rec { +stdenvNoCC.mkDerivation { inherit version; pname = "libreoffice"; src = fetchurl { - inherit (dist."${stdenv.hostPlatform.system}") url sha256; + inherit (dist.${stdenvNoCC.hostPlatform.system} or + (throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}")) url sha256; }; nativeBuildInputs = [ undmg ]; sourceRoot = "${appName}"; - dontPatch = true; - dontConfigure = true; - dontBuild = true; installPhase = '' - runHook preInstallPhase + runHook preInstall mkdir -p $out/{Applications/${appName},bin} cp -R . $out/Applications/${appName} - ln -s $out/Applications/${appName}/Contents/MacOS/soffice $out/bin - runHook postInstallPhase + cat > $out/bin/${scriptName} << EOF + #!${stdenvNoCC.shell} + open -na $out/Applications/${appName} --args "$@" + EOF + chmod +x $out/bin/${scriptName} + runHook postInstall ''; passthru.updateScript = @@ -63,7 +66,7 @@ stdenv.mkDerivation rec { set -o errexit set -o nounset set -o pipefail - + # reset version first so that both platforms are always updated and in sync update-source-version libreoffice 0 ${nullHash} --system=aarch64-darwin update-source-version libreoffice ${newVersion} ${newAarch64Sha256} --system=aarch64-darwin |