aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/applications/office/softmaker/generic.nix
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/applications/office/softmaker/generic.nix')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/applications/office/softmaker/generic.nix45
1 files changed, 34 insertions, 11 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/applications/office/softmaker/generic.nix b/infra/libkookie/nixpkgs/pkgs/applications/office/softmaker/generic.nix
index c1e25ecb00ec..fbde26058e1b 100644
--- a/infra/libkookie/nixpkgs/pkgs/applications/office/softmaker/generic.nix
+++ b/infra/libkookie/nixpkgs/pkgs/applications/office/softmaker/generic.nix
@@ -1,11 +1,14 @@
-{ stdenv, fetchurl, autoPatchelfHook, makeDesktopItem, makeWrapper
+{ stdenv, fetchurl, autoPatchelfHook, makeDesktopItem, makeWrapper, copyDesktopItems
# Dynamic Libraries
, curl, libGL, libX11, libXext, libXmu, libXrandr, libXrender
# For fixing up execution of /bin/ls, which is necessary for
# product unlocking.
-, coreutils
+, coreutils, libredirect
+
+ # Extra utilities used by the SoftMaker applications.
+, gnugrep, util-linux, which
, pname, version, edition, suiteName, src, archive
@@ -24,6 +27,7 @@ in stdenv.mkDerivation {
nativeBuildInputs = [
autoPatchelfHook
+ copyDesktopItems
makeWrapper
];
@@ -52,7 +56,26 @@ in stdenv.mkDerivation {
runHook postUnpack
'';
- installPhase = ''
+ installPhase = let
+ # SoftMaker/FreeOffice collects some system information upon
+ # unlocking the product. But in doing so, it attempts to execute
+ # /bin/ls. If the execve syscall fails, the whole unlock
+ # procedure fails. This works around that by rewriting /bin/ls
+ # to the proper path.
+ #
+ # In addition, it expects some common utilities (which, whereis)
+ # to be in the path.
+ #
+ # SoftMaker Office restarts itself upon some operations, such
+ # changing the theme and unlocking. Unfortunately, we do not
+ # have control over its environment then and it will fail
+ # with an error.
+ extraWrapperArgs = ''
+ --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
+ --set NIX_REDIRECTS "/bin/ls=${coreutils}/bin/ls" \
+ --prefix PATH : "${stdenv.lib.makeBinPath [ coreutils gnugrep util-linux which ]}"
+ '';
+ in ''
runHook preInstall
mkdir -p $out/share
@@ -61,9 +84,12 @@ in stdenv.mkDerivation {
# Wrap rather than symlinking, so that the programs can determine
# their resource path.
mkdir -p $out/bin
- makeWrapper $out/share/${pname}${edition}/planmaker $out/bin/${pname}-planmaker
- makeWrapper $out/share/${pname}${edition}/presentations $out/bin/${pname}-presentations
- makeWrapper $out/share/${pname}${edition}/textmaker $out/bin/${pname}-textmaker
+ makeWrapper $out/share/${pname}${edition}/planmaker $out/bin/${pname}-planmaker \
+ ${extraWrapperArgs}
+ makeWrapper $out/share/${pname}${edition}/presentations $out/bin/${pname}-presentations \
+ ${extraWrapperArgs}
+ makeWrapper $out/share/${pname}${edition}/textmaker $out/bin/${pname}-textmaker \
+ ${extraWrapperArgs}
for size in 16 32 48 64 96 128 256 512 1024; do
mkdir -p $out/share/icons/hicolor/''${size}x''${size}/apps
@@ -85,17 +111,14 @@ in stdenv.mkDerivation {
# remove broken symbolic links
find $out -xtype l -ls -exec rm {} \;
- # Add desktop items
- ${desktopItems.planmaker.buildCommand}
- ${desktopItems.presentations.buildCommand}
- ${desktopItems.textmaker.buildCommand}
-
# Add mime types
install -D -t $out/share/mime/packages ${pname}/mime/softmaker-*office*${shortEdition}.xml
runHook postInstall
'';
+ desktopItems = builtins.attrValues desktopItems;
+
meta = with stdenv.lib; {
description = "An office suite with a word processor, spreadsheet and presentation program";
homepage = "https://www.softmaker.com/";