From 97390d648dbfedb28269e6db1255a2b03ad19440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Fri, 30 Aug 2019 17:37:58 +0200 Subject: [PATCH] softmaker-office: init at 970 --- .../office/softmaker/desktop_items.nix | 42 ++++++++ .../applications/office/softmaker/generic.nix | 95 +++++++++++++++++++ .../office/softmaker/softmaker_office.nix | 15 +++ pkgs/top-level/all-packages.nix | 2 + 4 files changed, 154 insertions(+) create mode 100644 pkgs/applications/office/softmaker/desktop_items.nix create mode 100644 pkgs/applications/office/softmaker/generic.nix create mode 100644 pkgs/applications/office/softmaker/softmaker_office.nix diff --git a/pkgs/applications/office/softmaker/desktop_items.nix b/pkgs/applications/office/softmaker/desktop_items.nix new file mode 100644 index 000000000000..6975da064566 --- /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/generic.nix b/pkgs/applications/office/softmaker/generic.nix new file mode 100644 index 000000000000..9505271db14c --- /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 000000000000..26fe420d6a3b --- /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"; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5d6b8037de79..c8fa38358f07 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19686,6 +19686,8 @@ in smtube = libsForQt5.callPackage ../applications/video/smtube {}; + softmaker-office = callPackage ../applications/office/softmaker/softmaker_office.nix {}; + stride = callPackage ../applications/networking/instant-messengers/stride { }; sudolikeaboss = callPackage ../tools/security/sudolikeaboss { };