summary refs log tree commit diff
path: root/pkgs/applications/office/softmaker
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/office/softmaker')
-rw-r--r--pkgs/applications/office/softmaker/desktop_items.nix42
-rw-r--r--pkgs/applications/office/softmaker/freeoffice.nix15
-rw-r--r--pkgs/applications/office/softmaker/generic.nix95
-rw-r--r--pkgs/applications/office/softmaker/softmaker_office.nix15
4 files changed, 167 insertions, 0 deletions
diff --git a/pkgs/applications/office/softmaker/desktop_items.nix b/pkgs/applications/office/softmaker/desktop_items.nix
new file mode 100644
index 00000000000..6975da06456
--- /dev/null
+++ b/pkgs/applications/office/softmaker/desktop_items.nix
@@ -0,0 +1,42 @@
+{ makeDesktopItem, pname, suiteName }:
+
+{
+  planmaker = makeDesktopItem {
+    name = "${pname}-planmaker";
+    desktopName = "${suiteName} PlanMaker";
+    icon = "${pname}-pml.png";
+    categories = "Application;Office;SpreadSheet;";
+    exec = "${pname}-planmaker %F";
+    mimeType = "application/x-pmd;application/x-pmdx;application/x-pmv;application/excel;application/x-excel;application/x-ms-excel;application/x-msexcel;application/x-sylk;application/x-xls;application/xls;application/vnd.ms-excel;application/vnd.stardivision.calc;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.sheet.macroenabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.template.macroEnabled.12;application/x-dif;text/spreadsheet;text/csv;application/x-prn;application/vnd.ms-excel.sheet.binary.macroenabled.12;";
+    extraEntries = ''
+      TryExec=${pname}-planmaker
+      StartupWMClass=pm
+    '';
+  };
+
+  presentations = makeDesktopItem {
+    name = "${pname}-presentations";
+    desktopName = "${suiteName} Presentations";
+    icon = "${pname}-prl.png";
+    categories = "Application;Office;Presentation;";
+    exec = "${pname}-presentations %F";
+    mimeType = "application/x-prdx;application/x-prvx;application/x-prsx;application/x-prd;application/x-prv;application/x-prs;application/ppt;application/mspowerpoint;application/vnd.ms-powerpoint;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.ms-powerpoint.presentation.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.template;application/vnd.ms-powerpoint.template.macroEnabled.12;application/vnd.ms-powerpoint.slideshow.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.slideshow;";
+    extraEntries = ''
+      TryExec=${pname}-presentations
+      StartupWMClass=pr
+    '';
+  };
+
+  textmaker = makeDesktopItem {
+    name = "${pname}-textmaker";
+    desktopName = "${suiteName} TextMaker";
+    icon = "${pname}-tml.png";
+    categories = "Application;Office;WordProcessor;";
+    exec = "${pname}-textmaker %F";
+    mimeType = "application/x-tmdx;application/x-tmvx;application/x-tmd;application/x-tmv;application/msword;application/vnd.ms-word;application/x-doc;text/rtf;application/rtf;application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-template;application/vnd.stardivision.writer;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;application/x-pocket-word;application/x-dbf;application/msword-template;";
+    extraEntries = ''
+      TryExec=${pname}-textmaker
+      StartupWMClass=tm
+    '';
+  };
+}
diff --git a/pkgs/applications/office/softmaker/freeoffice.nix b/pkgs/applications/office/softmaker/freeoffice.nix
new file mode 100644
index 00000000000..f3e37943bb6
--- /dev/null
+++ b/pkgs/applications/office/softmaker/freeoffice.nix
@@ -0,0 +1,15 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  pname = "freeoffice";
+  version = "970";
+  edition = "2018";
+  suiteName = "FreeOffice";
+
+  src = fetchurl {
+    url = "https://www.softmaker.net/down/softmaker-freeoffice-${version}-amd64.tgz";
+    sha256 = "1maibr4x8mksb32ixvyy2rjn4x9f51191p5fcdj5qwz32pf8h2dr";
+  };
+
+  archive = "freeoffice${edition}.tar.lzma";
+})
diff --git a/pkgs/applications/office/softmaker/generic.nix b/pkgs/applications/office/softmaker/generic.nix
new file mode 100644
index 00000000000..9505271db14
--- /dev/null
+++ b/pkgs/applications/office/softmaker/generic.nix
@@ -0,0 +1,95 @@
+{ stdenv, fetchurl, autoPatchelfHook, makeDesktopItem, makeWrapper
+
+  # Dynamic Libraries
+, curl, libGL, libX11, libXext, libXmu, libXrandr, libXrender
+
+, pname, version, edition, suiteName, src, archive
+
+, ...
+}:
+
+let
+  desktopItems = import ./desktop_items.nix {
+    inherit makeDesktopItem pname suiteName;
+  };
+  shortEdition = builtins.substring 2 2 edition;
+in stdenv.mkDerivation rec {
+  inherit pname version edition shortEdition src;
+  nativeBuildInputs = [
+    autoPatchelfHook
+    makeWrapper
+  ];
+
+  buildInputs = [
+    curl
+    libGL
+    libX11
+    libXext
+    libXmu
+    libXrandr
+    libXrender
+    stdenv.cc.cc.lib
+  ];
+
+  dontBuild = true;
+  dontConfigure = true;
+
+  unpackPhase = ''
+    runHook preUnpack
+
+    mkdir installer
+    tar -C installer -xf ${src}
+    mkdir ${pname}
+    tar -C ${pname} -xf installer/${archive}
+
+    runHook postUnpack
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share
+    cp -r ${pname} $out/share/${pname}${edition}
+
+    # 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
+
+    for size in 16 32 48 64 96 128 256 512 1024; do
+      mkdir -p $out/share/icons/hicolor/''${size}x''${size}/apps
+
+      for app in pml prl tml; do
+        ln -s $out/share/${pname}${edition}/icons/''${app}_''${size}.png \
+          $out/share/icons/hicolor/''${size}x''${size}/apps/${pname}-''${app}.png
+      done
+
+      mkdir -p $out/share/icons/hicolor/''${size}x''${size}/mimetypes
+
+      for mimetype in pmd prd tmd; do
+        ln -s $out/share/${pname}${edition}/icons/''${mimetype}_''${size}.png \
+          $out/share/icons/hicolor/''${size}x''${size}/mimetypes/application-x-''${mimetype}.png
+      done
+    done
+
+    # 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
+  '';
+
+  meta = with stdenv.lib; {
+    description = "An office suite with a word processor, spreadsheet and presentation program";
+    homepage = "https://www.softmaker.com/";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ danieldk ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/pkgs/applications/office/softmaker/softmaker_office.nix b/pkgs/applications/office/softmaker/softmaker_office.nix
new file mode 100644
index 00000000000..26fe420d6a3
--- /dev/null
+++ b/pkgs/applications/office/softmaker/softmaker_office.nix
@@ -0,0 +1,15 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  pname = "softmaker-office";
+  version = "970";
+  edition = "2018";
+  suiteName = "SoftMaker Office";
+
+  src = fetchurl {
+    url = "https://www.softmaker.net/down/softmaker-office-${edition}-${version}-amd64.tgz";
+    sha256 = "14f94p1jms41s2iz5sa770rcyfp4mv01r6jjjis9amx37zrc8yid";
+  };
+
+  archive = "office${edition}.tar.lzma";
+})