From 654b19ace381f998167399c4a684f07e098a5cdf Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 19 Dec 2024 10:53:13 +0100 Subject: [PATCH 1/3] softmaker: format --- .../office/softmaker/desktop_items.nix | 6 +- .../office/softmaker/freeoffice.nix | 41 +++-- .../applications/office/softmaker/generic.nix | 162 +++++++++++------- .../office/softmaker/softmaker_office.nix | 41 +++-- 4 files changed, 147 insertions(+), 103 deletions(-) diff --git a/pkgs/applications/office/softmaker/desktop_items.nix b/pkgs/applications/office/softmaker/desktop_items.nix index a97b3f7d37b6..6febd04f0aaf 100644 --- a/pkgs/applications/office/softmaker/desktop_items.nix +++ b/pkgs/applications/office/softmaker/desktop_items.nix @@ -1,4 +1,8 @@ -{ makeDesktopItem, pname, suiteName }: +{ + makeDesktopItem, + pname, + suiteName, +}: { planmaker = makeDesktopItem { diff --git a/pkgs/applications/office/softmaker/freeoffice.nix b/pkgs/applications/office/softmaker/freeoffice.nix index 4e731de72d18..f74d4a71e48d 100644 --- a/pkgs/applications/office/softmaker/freeoffice.nix +++ b/pkgs/applications/office/softmaker/freeoffice.nix @@ -1,27 +1,32 @@ -{ callPackage -, fetchurl +{ + callPackage, + fetchurl, # This is a bit unusual, but makes version and hash easily # overridable. This is useful when the upstream archive was replaced # and nixpkgs is not in sync yet. -, officeVersion ? { - version = "1054"; - edition = "2021"; - hash = "sha256-dqmJUm0Qi1/GzGrI4OCHo1LwQ5KxMwZZw5EsYTMF6XU="; -} + officeVersion ? { + version = "1054"; + edition = "2021"; + hash = "sha256-dqmJUm0Qi1/GzGrI4OCHo1LwQ5KxMwZZw5EsYTMF6XU="; + }, -, ... } @ args: + ... +}@args: -callPackage ./generic.nix (args // rec { - inherit (officeVersion) version edition; +callPackage ./generic.nix ( + args + // rec { + inherit (officeVersion) version edition; - pname = "freeoffice"; - suiteName = "FreeOffice"; + pname = "freeoffice"; + suiteName = "FreeOffice"; - src = fetchurl { - inherit (officeVersion) hash; - url = "https://www.softmaker.net/down/softmaker-freeoffice-${edition}-${version}-amd64.tgz"; - }; + src = fetchurl { + inherit (officeVersion) hash; + url = "https://www.softmaker.net/down/softmaker-freeoffice-${edition}-${version}-amd64.tgz"; + }; - archive = "freeoffice${edition}.tar.lzma"; -}) + archive = "freeoffice${edition}.tar.lzma"; + } +) diff --git a/pkgs/applications/office/softmaker/generic.nix b/pkgs/applications/office/softmaker/generic.nix index ab47d26f9862..f97076af4b02 100644 --- a/pkgs/applications/office/softmaker/generic.nix +++ b/pkgs/applications/office/softmaker/generic.nix @@ -1,18 +1,38 @@ -{ lib, stdenv, autoPatchelfHook, makeDesktopItem, makeWrapper, copyDesktopItems +{ + lib, + stdenv, + autoPatchelfHook, + makeDesktopItem, + makeWrapper, + copyDesktopItems, # Dynamic Libraries -, curl, libGL, libX11, libXext, libXmu, libXrandr, libXrender + curl, + libGL, + libX11, + libXext, + libXmu, + libXrandr, + libXrender, # For fixing up execution of /bin/ls, which is necessary for # product unlocking. -, coreutils, libredirect + coreutils, + libredirect, # Extra utilities used by the SoftMaker applications. -, gnugrep, util-linux, which + gnugrep, + util-linux, + which, -, pname, version, edition, suiteName, src, archive + pname, + version, + edition, + suiteName, + src, + archive, -, ... + ... }: let @@ -20,7 +40,8 @@ let inherit makeDesktopItem pname suiteName; }; shortEdition = builtins.substring 2 2 edition; -in stdenv.mkDerivation { +in +stdenv.mkDerivation { inherit pname src; version = "${edition}.${version}"; @@ -56,66 +77,75 @@ in stdenv.mkDerivation { runHook postUnpack ''; - 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 : "${lib.makeBinPath [ coreutils gnugrep util-linux which ]}" + 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 : "${ + lib.makeBinPath [ + coreutils + gnugrep + util-linux + which + ] + }" + ''; + in + '' + 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 \ + ${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 + + 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 + + # freeoffice 973 misses the 96x96 application icons, giving broken symbolic links + # remove broken symbolic links + find $out -xtype l -ls -exec rm {} \; + + # Add mime types + install -D -t $out/share/mime/packages ${pname}/mime/softmaker-*office*${shortEdition}.xml + + runHook postInstall ''; - in '' - 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 \ - ${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 - - 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 - - # freeoffice 973 misses the 96x96 application icons, giving broken symbolic links - # remove broken symbolic links - find $out -xtype l -ls -exec rm {} \; - - # Add mime types - install -D -t $out/share/mime/packages ${pname}/mime/softmaker-*office*${shortEdition}.xml - - runHook postInstall - ''; desktopItems = builtins.attrValues desktopItems; diff --git a/pkgs/applications/office/softmaker/softmaker_office.nix b/pkgs/applications/office/softmaker/softmaker_office.nix index 68f92c74a87c..85d17341f67e 100644 --- a/pkgs/applications/office/softmaker/softmaker_office.nix +++ b/pkgs/applications/office/softmaker/softmaker_office.nix @@ -1,28 +1,33 @@ -{ callPackage -, fetchurl +{ + callPackage, + fetchurl, # This is a bit unusual, but makes version and hash easily # overridable. This is useful when people have an older version of # Softmaker Office or when the upstream archive was replaced and # nixpkgs is not in sync yet. -, officeVersion ? { - version = "1032"; - edition = "2021"; - hash = "sha256-LchSqLVBdkmWJQ8hCEvtwRPgIUSDE0URKPzCkEexGbc="; -} + officeVersion ? { + version = "1032"; + edition = "2021"; + hash = "sha256-LchSqLVBdkmWJQ8hCEvtwRPgIUSDE0URKPzCkEexGbc="; + }, -, ... } @ args: + ... +}@args: -callPackage ./generic.nix (args // rec { - inherit (officeVersion) version edition; +callPackage ./generic.nix ( + args + // rec { + inherit (officeVersion) version edition; - pname = "softmaker-office"; - suiteName = "SoftMaker Office"; + pname = "softmaker-office"; + suiteName = "SoftMaker Office"; - src = fetchurl { - inherit (officeVersion) hash; - url = "https://www.softmaker.net/down/softmaker-office-${edition}-${version}-amd64.tgz"; - }; + src = fetchurl { + inherit (officeVersion) hash; + url = "https://www.softmaker.net/down/softmaker-office-${edition}-${version}-amd64.tgz"; + }; - archive = "office${edition}.tar.lzma"; -}) + archive = "office${edition}.tar.lzma"; + } +) From a165f0aa38e04afa786ce2856626a0224ed7013b Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 19 Dec 2024 10:54:39 +0100 Subject: [PATCH 2/3] freeoffice: 2021.1054 -> 2024.1220 --- pkgs/applications/office/softmaker/freeoffice.nix | 6 +++--- pkgs/applications/office/softmaker/generic.nix | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/office/softmaker/freeoffice.nix b/pkgs/applications/office/softmaker/freeoffice.nix index f74d4a71e48d..39cf3351dace 100644 --- a/pkgs/applications/office/softmaker/freeoffice.nix +++ b/pkgs/applications/office/softmaker/freeoffice.nix @@ -6,9 +6,9 @@ # overridable. This is useful when the upstream archive was replaced # and nixpkgs is not in sync yet. officeVersion ? { - version = "1054"; - edition = "2021"; - hash = "sha256-dqmJUm0Qi1/GzGrI4OCHo1LwQ5KxMwZZw5EsYTMF6XU="; + version = "1220"; + edition = "2024"; + hash = "sha256-F1Srm3/4UPifYls21MhjbpxSyLaT0gEVzEMQF0gIzi0="; }, ... diff --git a/pkgs/applications/office/softmaker/generic.nix b/pkgs/applications/office/softmaker/generic.nix index f97076af4b02..a3fee9a114de 100644 --- a/pkgs/applications/office/softmaker/generic.nix +++ b/pkgs/applications/office/softmaker/generic.nix @@ -8,6 +8,8 @@ # Dynamic Libraries curl, + glib, + gst_all_1, libGL, libX11, libXext, @@ -54,6 +56,9 @@ stdenv.mkDerivation { buildInputs = [ curl + glib + gst_all_1.gstreamer + gst_all_1.gst-plugins-base libGL libX11 libXext From 53953bbde55d5b8c4a495cf3a6d2de8332024768 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 19 Dec 2024 10:58:30 +0100 Subject: [PATCH 3/3] softmaker-office: 2021.1032 -> 2024.1222 --- pkgs/applications/office/softmaker/softmaker_office.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/office/softmaker/softmaker_office.nix b/pkgs/applications/office/softmaker/softmaker_office.nix index 85d17341f67e..8cc4bfada5c9 100644 --- a/pkgs/applications/office/softmaker/softmaker_office.nix +++ b/pkgs/applications/office/softmaker/softmaker_office.nix @@ -7,9 +7,9 @@ # Softmaker Office or when the upstream archive was replaced and # nixpkgs is not in sync yet. officeVersion ? { - version = "1032"; - edition = "2021"; - hash = "sha256-LchSqLVBdkmWJQ8hCEvtwRPgIUSDE0URKPzCkEexGbc="; + version = "1222"; + edition = "2024"; + hash = "sha256-eyYBK5ZxPcBakOvXUQZIU2aftyH6PXh/rtqC/1BJhg4="; }, ...