From 42a8cabeeb8a8270203a5d831c529f4258632dc5 Mon Sep 17 00:00:00 2001 From: fin444 Date: Fri, 2 Feb 2024 14:54:12 -0500 Subject: onlyoffice-bin_latest: 7.5.1 -> 8.0.0 --- pkgs/applications/office/onlyoffice-bin/7_5.nix | 202 ------------------------ pkgs/applications/office/onlyoffice-bin/8_0.nix | 202 ++++++++++++++++++++++++ 2 files changed, 202 insertions(+), 202 deletions(-) delete mode 100644 pkgs/applications/office/onlyoffice-bin/7_5.nix create mode 100644 pkgs/applications/office/onlyoffice-bin/8_0.nix (limited to 'pkgs/applications/office') diff --git a/pkgs/applications/office/onlyoffice-bin/7_5.nix b/pkgs/applications/office/onlyoffice-bin/7_5.nix deleted file mode 100644 index 33744bb3831e..000000000000 --- a/pkgs/applications/office/onlyoffice-bin/7_5.nix +++ /dev/null @@ -1,202 +0,0 @@ -{ stdenv -, lib -, fetchurl -, buildFHSEnv - # Alphabetic ordering below -, alsa-lib -, at-spi2-atk -, atk -, autoPatchelfHook -, cairo -, curl -, dbus -, dconf -, dpkg -, fontconfig -, gcc-unwrapped -, gdk-pixbuf -, glib -, glibc -, gsettings-desktop-schemas -, gst_all_1 -, gtk2 -, gtk3 -, libpulseaudio -, libudev0-shim -, libdrm -, makeWrapper -, mesa -, noto-fonts-cjk-sans -, nspr -, nss -, pulseaudio -, qt5 -, wrapGAppsHook -, xkeyboard_config -, xorg -}: -let - - # Note on fonts: - # - # OnlyOffice does not distribute unfree fonts, but makes it easy to pick up - # any fonts you install. See: - # - # * https://helpcenter.onlyoffice.com/en/installation/docs-community-install-fonts-linux.aspx - # * https://www.onlyoffice.com/blog/2020/04/how-to-add-new-fonts-to-onlyoffice-desktop-editors/ - # - # As recommended there, you should download - # - # arial.ttf, calibri.ttf, cour.ttf, symbol.ttf, times.ttf, wingding.ttf - # - # into `~/.local/share/fonts/`, otherwise the default template fonts, and - # things like bullet points, will not look as expected. - - # TODO: Find out which of these fonts we'd be allowed to distribute along - # with this package, or how to make this easier for users otherwise. - - runtimeLibs = lib.makeLibraryPath [ - curl - glibc - gcc-unwrapped.lib - libudev0-shim - pulseaudio - ]; - - derivation = stdenv.mkDerivation rec { - pname = "onlyoffice-desktopeditors"; - version = "7.5.1"; - minor = null; - src = fetchurl { - url = "https://github.com/ONLYOFFICE/DesktopEditors/releases/download/v${version}/onlyoffice-desktopeditors_amd64.deb"; - sha256 = "sha256-Hf5CNbUUMuHZHDY3fgD4qpF4UASevscK8DTZlauyHhY="; - }; - - nativeBuildInputs = [ - autoPatchelfHook - dpkg - makeWrapper - wrapGAppsHook - ]; - - buildInputs = [ - alsa-lib - at-spi2-atk - atk - cairo - dbus - dconf - fontconfig - gdk-pixbuf - glib - gsettings-desktop-schemas - gst_all_1.gst-plugins-base - gst_all_1.gstreamer - gtk2 - gtk3 - libpulseaudio - libdrm - nspr - nss - mesa # libgbm - qt5.qtbase - qt5.qtdeclarative - qt5.qtsvg - qt5.qtwayland - xorg.libX11 - xorg.libxcb - xorg.libXcomposite - xorg.libXcursor - xorg.libXdamage - xorg.libXext - xorg.libXfixes - xorg.libXi - xorg.libXrandr - xorg.libXrender - xorg.libXScrnSaver - xorg.libXtst - ]; - - dontWrapQtApps = true; - - unpackPhase = '' - dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner - ''; - - installPhase = '' - runHook preInstall - - mkdir -p $out/{bin,lib,share} - - mv usr/bin/* $out/bin - mv usr/share/* $out/share/ - mv opt/onlyoffice/desktopeditors $out/share - - for f in $out/share/desktopeditors/asc-de-*.png; do - size=$(basename "$f" ".png" | cut -d"-" -f3) - res="''${size}x''${size}" - mkdir -pv "$out/share/icons/hicolor/$res/apps" - ln -s "$f" "$out/share/icons/hicolor/$res/apps/onlyoffice-desktopeditors.png" - done; - - substituteInPlace $out/bin/onlyoffice-desktopeditors \ - --replace "/opt/onlyoffice/" "$out/share/" - - ln -s $out/share/desktopeditors/DesktopEditors $out/bin/DesktopEditors - - runHook postInstall - ''; - - preFixup = '' - gappsWrapperArgs+=( - --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \ - --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" \ - --set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale" \ - --set QT_QPA_PLATFORM "xcb" - # the bundled version of qt does not support wayland - ) - ''; - - passthru.updateScript = ./update.sh; - }; - -in - -# In order to download plugins, OnlyOffice uses /usr/bin/curl so we have to wrap it. -# Curl still needs to be in runtimeLibs because the library is used directly in other parts of the code. -# Fonts are also discovered by looking in /usr/share/fonts, so adding fonts to targetPkgs will include them -buildFHSEnv { - name = derivation.name; - - targetPkgs = pkgs': [ - curl - derivation - noto-fonts-cjk-sans - ]; - - runScript = "/bin/onlyoffice-desktopeditors"; - - extraInstallCommands = '' - mv $out/bin/$name $out/bin/onlyoffice-desktopeditors - mkdir -p $out/share - ln -s ${derivation}/share/icons $out/share - cp -r ${derivation}/share/applications $out/share - substituteInPlace $out/share/applications/onlyoffice-desktopeditors.desktop \ - --replace "/usr/bin/onlyoffice-desktopeditors" "$out/bin/onlyoffice-desktopeditors" - ''; - - meta = with lib; { - description = "Office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents"; - longDescription = '' - This version is broken on wlroots environments (e.g. Hyprland, Sway). - If you are using one of these environments, please use `onlyoffice-bin` instead. - ''; - homepage = "https://www.onlyoffice.com/"; - downloadPage = "https://github.com/ONLYOFFICE/DesktopEditors/releases"; - changelog = "https://github.com/ONLYOFFICE/DesktopEditors/blob/master/CHANGELOG.md"; - platforms = [ "x86_64-linux" ]; - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; - license = licenses.agpl3Plus; - maintainers = with maintainers; [ nh2 gtrunsec ]; - }; -} diff --git a/pkgs/applications/office/onlyoffice-bin/8_0.nix b/pkgs/applications/office/onlyoffice-bin/8_0.nix new file mode 100644 index 000000000000..a0fc5b78aab9 --- /dev/null +++ b/pkgs/applications/office/onlyoffice-bin/8_0.nix @@ -0,0 +1,202 @@ +{ stdenv +, lib +, fetchurl +, buildFHSEnv + # Alphabetic ordering below +, alsa-lib +, at-spi2-atk +, atk +, autoPatchelfHook +, cairo +, curl +, dbus +, dconf +, dpkg +, fontconfig +, gcc-unwrapped +, gdk-pixbuf +, glib +, glibc +, gsettings-desktop-schemas +, gst_all_1 +, gtk2 +, gtk3 +, libpulseaudio +, libudev0-shim +, libdrm +, makeWrapper +, mesa +, noto-fonts-cjk-sans +, nspr +, nss +, pulseaudio +, qt5 +, wrapGAppsHook +, xkeyboard_config +, xorg +}: +let + + # Note on fonts: + # + # OnlyOffice does not distribute unfree fonts, but makes it easy to pick up + # any fonts you install. See: + # + # * https://helpcenter.onlyoffice.com/en/installation/docs-community-install-fonts-linux.aspx + # * https://www.onlyoffice.com/blog/2020/04/how-to-add-new-fonts-to-onlyoffice-desktop-editors/ + # + # As recommended there, you should download + # + # arial.ttf, calibri.ttf, cour.ttf, symbol.ttf, times.ttf, wingding.ttf + # + # into `~/.local/share/fonts/`, otherwise the default template fonts, and + # things like bullet points, will not look as expected. + + # TODO: Find out which of these fonts we'd be allowed to distribute along + # with this package, or how to make this easier for users otherwise. + + runtimeLibs = lib.makeLibraryPath [ + curl + glibc + gcc-unwrapped.lib + libudev0-shim + pulseaudio + ]; + + derivation = stdenv.mkDerivation rec { + pname = "onlyoffice-desktopeditors"; + version = "8.0.0"; + minor = null; + src = fetchurl { + url = "https://github.com/ONLYOFFICE/DesktopEditors/releases/download/v${version}/onlyoffice-desktopeditors_amd64.deb"; + sha256 = "sha256-YtR2fiARMKw8dOgAPXYM+WFwmhKZRsIIBQYTxppu3F0="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + dpkg + makeWrapper + wrapGAppsHook + ]; + + buildInputs = [ + alsa-lib + at-spi2-atk + atk + cairo + dbus + dconf + fontconfig + gdk-pixbuf + glib + gsettings-desktop-schemas + gst_all_1.gst-plugins-base + gst_all_1.gstreamer + gtk2 + gtk3 + libpulseaudio + libdrm + nspr + nss + mesa # libgbm + qt5.qtbase + qt5.qtdeclarative + qt5.qtsvg + qt5.qtwayland + xorg.libX11 + xorg.libxcb + xorg.libXcomposite + xorg.libXcursor + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXi + xorg.libXrandr + xorg.libXrender + xorg.libXScrnSaver + xorg.libXtst + ]; + + dontWrapQtApps = true; + + unpackPhase = '' + dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{bin,lib,share} + + mv usr/bin/* $out/bin + mv usr/share/* $out/share/ + mv opt/onlyoffice/desktopeditors $out/share + + for f in $out/share/desktopeditors/asc-de-*.png; do + size=$(basename "$f" ".png" | cut -d"-" -f3) + res="''${size}x''${size}" + mkdir -pv "$out/share/icons/hicolor/$res/apps" + ln -s "$f" "$out/share/icons/hicolor/$res/apps/onlyoffice-desktopeditors.png" + done; + + substituteInPlace $out/bin/onlyoffice-desktopeditors \ + --replace "/opt/onlyoffice/" "$out/share/" + + ln -s $out/share/desktopeditors/DesktopEditors $out/bin/DesktopEditors + + runHook postInstall + ''; + + preFixup = '' + gappsWrapperArgs+=( + --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \ + --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" \ + --set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale" \ + --set QT_QPA_PLATFORM "xcb" + # the bundled version of qt does not support wayland + ) + ''; + + passthru.updateScript = ./update.sh; + }; + +in + +# In order to download plugins, OnlyOffice uses /usr/bin/curl so we have to wrap it. +# Curl still needs to be in runtimeLibs because the library is used directly in other parts of the code. +# Fonts are also discovered by looking in /usr/share/fonts, so adding fonts to targetPkgs will include them +buildFHSEnv { + name = derivation.name; + + targetPkgs = pkgs': [ + curl + derivation + noto-fonts-cjk-sans + ]; + + runScript = "/bin/onlyoffice-desktopeditors"; + + extraInstallCommands = '' + mv $out/bin/$name $out/bin/onlyoffice-desktopeditors + mkdir -p $out/share + ln -s ${derivation}/share/icons $out/share + cp -r ${derivation}/share/applications $out/share + substituteInPlace $out/share/applications/onlyoffice-desktopeditors.desktop \ + --replace "/usr/bin/onlyoffice-desktopeditors" "$out/bin/onlyoffice-desktopeditors" + ''; + + meta = with lib; { + description = "Office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents"; + longDescription = '' + This version is broken on wlroots environments (e.g. Hyprland, Sway). + If you are using one of these environments, please use `onlyoffice-bin` instead. + ''; + homepage = "https://www.onlyoffice.com/"; + downloadPage = "https://github.com/ONLYOFFICE/DesktopEditors/releases"; + changelog = "https://github.com/ONLYOFFICE/DesktopEditors/blob/master/CHANGELOG.md"; + platforms = [ "x86_64-linux" ]; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + license = licenses.agpl3Plus; + maintainers = with maintainers; [ nh2 gtrunsec ]; + }; +} -- cgit 1.4.1 From 9d551ab298957b0ff3ca2786846d1f5d806a46d3 Mon Sep 17 00:00:00 2001 From: fin444 Date: Fri, 2 Feb 2024 15:25:50 -0500 Subject: onlyoffice-bin, onlyoffice-bin_latest: move to pkgs/by-name --- pkgs/applications/office/onlyoffice-bin/7_2.nix | 192 -------------------- pkgs/applications/office/onlyoffice-bin/8_0.nix | 202 ---------------------- pkgs/applications/office/onlyoffice-bin/update.sh | 5 - pkgs/by-name/on/onlyoffice-bin/package.nix | 192 ++++++++++++++++++++ pkgs/by-name/on/onlyoffice-bin/update.sh | 5 + pkgs/by-name/on/onlyoffice-bin_latest/package.nix | 202 ++++++++++++++++++++++ pkgs/by-name/on/onlyoffice-bin_latest/update.sh | 5 + pkgs/top-level/aliases.nix | 2 + pkgs/top-level/all-packages.nix | 5 - 9 files changed, 406 insertions(+), 404 deletions(-) delete mode 100644 pkgs/applications/office/onlyoffice-bin/7_2.nix delete mode 100644 pkgs/applications/office/onlyoffice-bin/8_0.nix delete mode 100644 pkgs/applications/office/onlyoffice-bin/update.sh create mode 100644 pkgs/by-name/on/onlyoffice-bin/package.nix create mode 100644 pkgs/by-name/on/onlyoffice-bin/update.sh create mode 100644 pkgs/by-name/on/onlyoffice-bin_latest/package.nix create mode 100644 pkgs/by-name/on/onlyoffice-bin_latest/update.sh (limited to 'pkgs/applications/office') diff --git a/pkgs/applications/office/onlyoffice-bin/7_2.nix b/pkgs/applications/office/onlyoffice-bin/7_2.nix deleted file mode 100644 index 8abf0909e6b3..000000000000 --- a/pkgs/applications/office/onlyoffice-bin/7_2.nix +++ /dev/null @@ -1,192 +0,0 @@ -{ stdenv -, lib -, fetchurl - # Alphabetic ordering below -, alsa-lib -, at-spi2-atk -, atk -, autoPatchelfHook -, cairo -, curl -, dbus -, dconf -, dpkg -, fontconfig -, gcc-unwrapped -, gdk-pixbuf -, glib -, glibc -, gsettings-desktop-schemas -, gst_all_1 -, gtk2 -, gtk3 -, libpulseaudio -, libudev0-shim -, libdrm -, makeWrapper -, nspr -, nss -, pulseaudio -, qt5 -, wrapGAppsHook -, xkeyboard_config -, xorg -}: -let - - # Note on fonts: - # - # OnlyOffice does not distribute unfree fonts, but makes it easy to pick up - # any fonts you install. See: - # - # * https://helpcenter.onlyoffice.com/en/installation/docs-community-install-fonts-linux.aspx - # * https://www.onlyoffice.com/blog/2020/04/how-to-add-new-fonts-to-onlyoffice-desktop-editors/ - # - # As recommended there, you should download - # - # arial.ttf, calibri.ttf, cour.ttf, symbol.ttf, times.ttf, wingding.ttf - # - # into `~/.local/share/fonts/`, otherwise the default template fonts, and - # things like bullet points, will not look as expected. - - # TODO: Find out which of these fonts we'd be allowed to distribute along - # with this package, or how to make this easier for users otherwise. - - # Not using the `noto-fonts-cjk` package from nixpkgs, because it was - # reported that its `.ttc` file is not picked up by OnlyOffice, see: - # https://github.com/NixOS/nixpkgs/pull/116343#discussion_r593979816 - noto-fonts-cjk = fetchurl { - url = - let - version = "v20201206-cjk"; - in - "https://github.com/googlefonts/noto-cjk/raw/${version}/NotoSansCJKsc-Regular.otf"; - sha256 = "sha256-aJXSVNJ+p6wMAislXUn4JQilLhimNSedbc9nAuPVxo4="; - }; - - runtimeLibs = lib.makeLibraryPath [ - curl - glibc - gcc-unwrapped.lib - libudev0-shim - pulseaudio - ]; - -in -stdenv.mkDerivation rec { - pname = "onlyoffice-desktopeditors"; - version = "7.2.0"; - minor = null; - src = fetchurl { - url = "https://github.com/ONLYOFFICE/DesktopEditors/releases/download/v${version}/onlyoffice-desktopeditors_amd64.deb"; - sha256 = "sha256-O9gC/b5/eZ1YImuXpEZOJhI1rzCNuFrm5IqablnYo9Y="; - }; - - nativeBuildInputs = [ - autoPatchelfHook - dpkg - makeWrapper - wrapGAppsHook - ]; - - buildInputs = [ - alsa-lib - at-spi2-atk - atk - cairo - dbus - dconf - fontconfig - gdk-pixbuf - glib - gsettings-desktop-schemas - gst_all_1.gst-plugins-base - gst_all_1.gstreamer - gtk2 - gtk3 - libpulseaudio - libdrm - nspr - nss - qt5.qtbase - qt5.qtdeclarative - qt5.qtsvg - qt5.qtwayland - xorg.libX11 - xorg.libxcb - xorg.libXcomposite - xorg.libXcursor - xorg.libXdamage - xorg.libXext - xorg.libXfixes - xorg.libXi - xorg.libXrandr - xorg.libXrender - xorg.libXScrnSaver - xorg.libXtst - ]; - - dontWrapQtApps = true; - - unpackPhase = '' - dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner - ''; - - preConfigure = '' - cp --no-preserve=mode,ownership ${noto-fonts-cjk} opt/onlyoffice/desktopeditors/fonts/ - ''; - - installPhase = '' - runHook preInstall - - mkdir -p $out/{bin,lib,share} - - mv usr/bin/* $out/bin - mv usr/share/* $out/share/ - mv opt/onlyoffice/desktopeditors $out/share - - for f in $out/share/desktopeditors/asc-de-*.png; do - size=$(basename "$f" ".png" | cut -d"-" -f3) - res="''${size}x''${size}" - mkdir -pv "$out/share/icons/hicolor/$res/apps" - ln -s "$f" "$out/share/icons/hicolor/$res/apps/onlyoffice-desktopeditors.png" - done; - - substituteInPlace $out/bin/onlyoffice-desktopeditors \ - --replace "/opt/onlyoffice/" "$out/share/" - - ln -s $out/share/desktopeditors/DesktopEditors $out/bin/DesktopEditors - - substituteInPlace $out/share/applications/onlyoffice-desktopeditors.desktop \ - --replace "/usr/bin/onlyoffice-desktopeditor" "$out/bin/DesktopEditor" - - runHook postInstall - ''; - - preFixup = '' - gappsWrapperArgs+=( - --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \ - --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" \ - --set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale" \ - --set QT_QPA_PLATFORM "xcb" - # the bundled version of qt does not support wayland - ) - ''; - - passthru.updateScript = ./update.sh; - - meta = with lib; { - description = "Office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents"; - longDescription = '' - The latest versions of OnlyOffice are currently broken on wlroots environments (e.g. Hyprland, Sway). - If you are using a different environment, you can get the latest version using `onlyoffice-bin_latest`. - ''; - homepage = "https://www.onlyoffice.com/"; - downloadPage = "https://github.com/ONLYOFFICE/DesktopEditors/releases"; - changelog = "https://github.com/ONLYOFFICE/DesktopEditors/blob/master/CHANGELOG.md"; - platforms = [ "x86_64-linux" ]; - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; - license = licenses.agpl3Plus; - maintainers = with maintainers; [ nh2 gtrunsec ]; - }; -} diff --git a/pkgs/applications/office/onlyoffice-bin/8_0.nix b/pkgs/applications/office/onlyoffice-bin/8_0.nix deleted file mode 100644 index a0fc5b78aab9..000000000000 --- a/pkgs/applications/office/onlyoffice-bin/8_0.nix +++ /dev/null @@ -1,202 +0,0 @@ -{ stdenv -, lib -, fetchurl -, buildFHSEnv - # Alphabetic ordering below -, alsa-lib -, at-spi2-atk -, atk -, autoPatchelfHook -, cairo -, curl -, dbus -, dconf -, dpkg -, fontconfig -, gcc-unwrapped -, gdk-pixbuf -, glib -, glibc -, gsettings-desktop-schemas -, gst_all_1 -, gtk2 -, gtk3 -, libpulseaudio -, libudev0-shim -, libdrm -, makeWrapper -, mesa -, noto-fonts-cjk-sans -, nspr -, nss -, pulseaudio -, qt5 -, wrapGAppsHook -, xkeyboard_config -, xorg -}: -let - - # Note on fonts: - # - # OnlyOffice does not distribute unfree fonts, but makes it easy to pick up - # any fonts you install. See: - # - # * https://helpcenter.onlyoffice.com/en/installation/docs-community-install-fonts-linux.aspx - # * https://www.onlyoffice.com/blog/2020/04/how-to-add-new-fonts-to-onlyoffice-desktop-editors/ - # - # As recommended there, you should download - # - # arial.ttf, calibri.ttf, cour.ttf, symbol.ttf, times.ttf, wingding.ttf - # - # into `~/.local/share/fonts/`, otherwise the default template fonts, and - # things like bullet points, will not look as expected. - - # TODO: Find out which of these fonts we'd be allowed to distribute along - # with this package, or how to make this easier for users otherwise. - - runtimeLibs = lib.makeLibraryPath [ - curl - glibc - gcc-unwrapped.lib - libudev0-shim - pulseaudio - ]; - - derivation = stdenv.mkDerivation rec { - pname = "onlyoffice-desktopeditors"; - version = "8.0.0"; - minor = null; - src = fetchurl { - url = "https://github.com/ONLYOFFICE/DesktopEditors/releases/download/v${version}/onlyoffice-desktopeditors_amd64.deb"; - sha256 = "sha256-YtR2fiARMKw8dOgAPXYM+WFwmhKZRsIIBQYTxppu3F0="; - }; - - nativeBuildInputs = [ - autoPatchelfHook - dpkg - makeWrapper - wrapGAppsHook - ]; - - buildInputs = [ - alsa-lib - at-spi2-atk - atk - cairo - dbus - dconf - fontconfig - gdk-pixbuf - glib - gsettings-desktop-schemas - gst_all_1.gst-plugins-base - gst_all_1.gstreamer - gtk2 - gtk3 - libpulseaudio - libdrm - nspr - nss - mesa # libgbm - qt5.qtbase - qt5.qtdeclarative - qt5.qtsvg - qt5.qtwayland - xorg.libX11 - xorg.libxcb - xorg.libXcomposite - xorg.libXcursor - xorg.libXdamage - xorg.libXext - xorg.libXfixes - xorg.libXi - xorg.libXrandr - xorg.libXrender - xorg.libXScrnSaver - xorg.libXtst - ]; - - dontWrapQtApps = true; - - unpackPhase = '' - dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner - ''; - - installPhase = '' - runHook preInstall - - mkdir -p $out/{bin,lib,share} - - mv usr/bin/* $out/bin - mv usr/share/* $out/share/ - mv opt/onlyoffice/desktopeditors $out/share - - for f in $out/share/desktopeditors/asc-de-*.png; do - size=$(basename "$f" ".png" | cut -d"-" -f3) - res="''${size}x''${size}" - mkdir -pv "$out/share/icons/hicolor/$res/apps" - ln -s "$f" "$out/share/icons/hicolor/$res/apps/onlyoffice-desktopeditors.png" - done; - - substituteInPlace $out/bin/onlyoffice-desktopeditors \ - --replace "/opt/onlyoffice/" "$out/share/" - - ln -s $out/share/desktopeditors/DesktopEditors $out/bin/DesktopEditors - - runHook postInstall - ''; - - preFixup = '' - gappsWrapperArgs+=( - --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \ - --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" \ - --set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale" \ - --set QT_QPA_PLATFORM "xcb" - # the bundled version of qt does not support wayland - ) - ''; - - passthru.updateScript = ./update.sh; - }; - -in - -# In order to download plugins, OnlyOffice uses /usr/bin/curl so we have to wrap it. -# Curl still needs to be in runtimeLibs because the library is used directly in other parts of the code. -# Fonts are also discovered by looking in /usr/share/fonts, so adding fonts to targetPkgs will include them -buildFHSEnv { - name = derivation.name; - - targetPkgs = pkgs': [ - curl - derivation - noto-fonts-cjk-sans - ]; - - runScript = "/bin/onlyoffice-desktopeditors"; - - extraInstallCommands = '' - mv $out/bin/$name $out/bin/onlyoffice-desktopeditors - mkdir -p $out/share - ln -s ${derivation}/share/icons $out/share - cp -r ${derivation}/share/applications $out/share - substituteInPlace $out/share/applications/onlyoffice-desktopeditors.desktop \ - --replace "/usr/bin/onlyoffice-desktopeditors" "$out/bin/onlyoffice-desktopeditors" - ''; - - meta = with lib; { - description = "Office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents"; - longDescription = '' - This version is broken on wlroots environments (e.g. Hyprland, Sway). - If you are using one of these environments, please use `onlyoffice-bin` instead. - ''; - homepage = "https://www.onlyoffice.com/"; - downloadPage = "https://github.com/ONLYOFFICE/DesktopEditors/releases"; - changelog = "https://github.com/ONLYOFFICE/DesktopEditors/blob/master/CHANGELOG.md"; - platforms = [ "x86_64-linux" ]; - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; - license = licenses.agpl3Plus; - maintainers = with maintainers; [ nh2 gtrunsec ]; - }; -} diff --git a/pkgs/applications/office/onlyoffice-bin/update.sh b/pkgs/applications/office/onlyoffice-bin/update.sh deleted file mode 100644 index d7b0bc106fa2..000000000000 --- a/pkgs/applications/office/onlyoffice-bin/update.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p curl jq common-updater-scripts - -version="$(curl -sL "https://api.github.com/repos/ONLYOFFICE/DesktopEditors/releases?per_page=1" | jq -r ".[0].tag_name" | sed 's/^v//')" -update-source-version onlyoffice-bin "$version" diff --git a/pkgs/by-name/on/onlyoffice-bin/package.nix b/pkgs/by-name/on/onlyoffice-bin/package.nix new file mode 100644 index 000000000000..8abf0909e6b3 --- /dev/null +++ b/pkgs/by-name/on/onlyoffice-bin/package.nix @@ -0,0 +1,192 @@ +{ stdenv +, lib +, fetchurl + # Alphabetic ordering below +, alsa-lib +, at-spi2-atk +, atk +, autoPatchelfHook +, cairo +, curl +, dbus +, dconf +, dpkg +, fontconfig +, gcc-unwrapped +, gdk-pixbuf +, glib +, glibc +, gsettings-desktop-schemas +, gst_all_1 +, gtk2 +, gtk3 +, libpulseaudio +, libudev0-shim +, libdrm +, makeWrapper +, nspr +, nss +, pulseaudio +, qt5 +, wrapGAppsHook +, xkeyboard_config +, xorg +}: +let + + # Note on fonts: + # + # OnlyOffice does not distribute unfree fonts, but makes it easy to pick up + # any fonts you install. See: + # + # * https://helpcenter.onlyoffice.com/en/installation/docs-community-install-fonts-linux.aspx + # * https://www.onlyoffice.com/blog/2020/04/how-to-add-new-fonts-to-onlyoffice-desktop-editors/ + # + # As recommended there, you should download + # + # arial.ttf, calibri.ttf, cour.ttf, symbol.ttf, times.ttf, wingding.ttf + # + # into `~/.local/share/fonts/`, otherwise the default template fonts, and + # things like bullet points, will not look as expected. + + # TODO: Find out which of these fonts we'd be allowed to distribute along + # with this package, or how to make this easier for users otherwise. + + # Not using the `noto-fonts-cjk` package from nixpkgs, because it was + # reported that its `.ttc` file is not picked up by OnlyOffice, see: + # https://github.com/NixOS/nixpkgs/pull/116343#discussion_r593979816 + noto-fonts-cjk = fetchurl { + url = + let + version = "v20201206-cjk"; + in + "https://github.com/googlefonts/noto-cjk/raw/${version}/NotoSansCJKsc-Regular.otf"; + sha256 = "sha256-aJXSVNJ+p6wMAislXUn4JQilLhimNSedbc9nAuPVxo4="; + }; + + runtimeLibs = lib.makeLibraryPath [ + curl + glibc + gcc-unwrapped.lib + libudev0-shim + pulseaudio + ]; + +in +stdenv.mkDerivation rec { + pname = "onlyoffice-desktopeditors"; + version = "7.2.0"; + minor = null; + src = fetchurl { + url = "https://github.com/ONLYOFFICE/DesktopEditors/releases/download/v${version}/onlyoffice-desktopeditors_amd64.deb"; + sha256 = "sha256-O9gC/b5/eZ1YImuXpEZOJhI1rzCNuFrm5IqablnYo9Y="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + dpkg + makeWrapper + wrapGAppsHook + ]; + + buildInputs = [ + alsa-lib + at-spi2-atk + atk + cairo + dbus + dconf + fontconfig + gdk-pixbuf + glib + gsettings-desktop-schemas + gst_all_1.gst-plugins-base + gst_all_1.gstreamer + gtk2 + gtk3 + libpulseaudio + libdrm + nspr + nss + qt5.qtbase + qt5.qtdeclarative + qt5.qtsvg + qt5.qtwayland + xorg.libX11 + xorg.libxcb + xorg.libXcomposite + xorg.libXcursor + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXi + xorg.libXrandr + xorg.libXrender + xorg.libXScrnSaver + xorg.libXtst + ]; + + dontWrapQtApps = true; + + unpackPhase = '' + dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner + ''; + + preConfigure = '' + cp --no-preserve=mode,ownership ${noto-fonts-cjk} opt/onlyoffice/desktopeditors/fonts/ + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{bin,lib,share} + + mv usr/bin/* $out/bin + mv usr/share/* $out/share/ + mv opt/onlyoffice/desktopeditors $out/share + + for f in $out/share/desktopeditors/asc-de-*.png; do + size=$(basename "$f" ".png" | cut -d"-" -f3) + res="''${size}x''${size}" + mkdir -pv "$out/share/icons/hicolor/$res/apps" + ln -s "$f" "$out/share/icons/hicolor/$res/apps/onlyoffice-desktopeditors.png" + done; + + substituteInPlace $out/bin/onlyoffice-desktopeditors \ + --replace "/opt/onlyoffice/" "$out/share/" + + ln -s $out/share/desktopeditors/DesktopEditors $out/bin/DesktopEditors + + substituteInPlace $out/share/applications/onlyoffice-desktopeditors.desktop \ + --replace "/usr/bin/onlyoffice-desktopeditor" "$out/bin/DesktopEditor" + + runHook postInstall + ''; + + preFixup = '' + gappsWrapperArgs+=( + --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \ + --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" \ + --set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale" \ + --set QT_QPA_PLATFORM "xcb" + # the bundled version of qt does not support wayland + ) + ''; + + passthru.updateScript = ./update.sh; + + meta = with lib; { + description = "Office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents"; + longDescription = '' + The latest versions of OnlyOffice are currently broken on wlroots environments (e.g. Hyprland, Sway). + If you are using a different environment, you can get the latest version using `onlyoffice-bin_latest`. + ''; + homepage = "https://www.onlyoffice.com/"; + downloadPage = "https://github.com/ONLYOFFICE/DesktopEditors/releases"; + changelog = "https://github.com/ONLYOFFICE/DesktopEditors/blob/master/CHANGELOG.md"; + platforms = [ "x86_64-linux" ]; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + license = licenses.agpl3Plus; + maintainers = with maintainers; [ nh2 gtrunsec ]; + }; +} diff --git a/pkgs/by-name/on/onlyoffice-bin/update.sh b/pkgs/by-name/on/onlyoffice-bin/update.sh new file mode 100644 index 000000000000..d7b0bc106fa2 --- /dev/null +++ b/pkgs/by-name/on/onlyoffice-bin/update.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl jq common-updater-scripts + +version="$(curl -sL "https://api.github.com/repos/ONLYOFFICE/DesktopEditors/releases?per_page=1" | jq -r ".[0].tag_name" | sed 's/^v//')" +update-source-version onlyoffice-bin "$version" diff --git a/pkgs/by-name/on/onlyoffice-bin_latest/package.nix b/pkgs/by-name/on/onlyoffice-bin_latest/package.nix new file mode 100644 index 000000000000..b73d179e341d --- /dev/null +++ b/pkgs/by-name/on/onlyoffice-bin_latest/package.nix @@ -0,0 +1,202 @@ +{ stdenv +, lib +, fetchurl +, buildFHSEnv + # Alphabetic ordering below +, alsa-lib +, at-spi2-atk +, atk +, autoPatchelfHook +, cairo +, curl +, dbus +, dconf +, dpkg +, fontconfig +, gcc-unwrapped +, gdk-pixbuf +, glib +, glibc +, gsettings-desktop-schemas +, gst_all_1 +, gtk2 +, gtk3 +, libpulseaudio +, libudev0-shim +, libdrm +, makeWrapper +, mesa +, noto-fonts-cjk-sans +, nspr +, nss +, pulseaudio +, qt5 +, wrapGAppsHook +, xkeyboard_config +, xorg +}: +let + + # Note on fonts: + # + # OnlyOffice does not distribute unfree fonts, but makes it easy to pick up + # any fonts you install. See: + # + # * https://helpcenter.onlyoffice.com/en/installation/docs-community-install-fonts-linux.aspx + # * https://www.onlyoffice.com/blog/2020/04/how-to-add-new-fonts-to-onlyoffice-desktop-editors/ + # + # As recommended there, you should download + # + # arial.ttf, calibri.ttf, cour.ttf, symbol.ttf, times.ttf, wingding.ttf + # + # into `~/.local/share/fonts/`, otherwise the default template fonts, and + # things like bullet points, will not look as expected. + + # TODO: Find out which of these fonts we'd be allowed to distribute along + # with this package, or how to make this easier for users otherwise. + + runtimeLibs = lib.makeLibraryPath [ + curl + glibc + gcc-unwrapped.lib + libudev0-shim + pulseaudio + ]; + + derivation = stdenv.mkDerivation rec { + pname = "onlyoffice-desktopeditors"; + version = "8.0.0"; + minor = null; + src = fetchurl { + url = "https://github.com/ONLYOFFICE/DesktopEditors/releases/download/v${version}/onlyoffice-desktopeditors_amd64.deb"; + sha256 = "sha256-YtR2fiARMKw8dOgAPXYM+WFwmhKZRsIIBQYTxppu3F0="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + dpkg + makeWrapper + wrapGAppsHook + ]; + + buildInputs = [ + alsa-lib + at-spi2-atk + atk + cairo + dbus + dconf + fontconfig + gdk-pixbuf + glib + gsettings-desktop-schemas + gst_all_1.gst-plugins-base + gst_all_1.gstreamer + gtk2 + gtk3 + libpulseaudio + libdrm + nspr + nss + mesa # libgbm + qt5.qtbase + qt5.qtdeclarative + qt5.qtsvg + qt5.qtwayland + xorg.libX11 + xorg.libxcb + xorg.libXcomposite + xorg.libXcursor + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXi + xorg.libXrandr + xorg.libXrender + xorg.libXScrnSaver + xorg.libXtst + ]; + + dontWrapQtApps = true; + + unpackPhase = '' + dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{bin,lib,share} + + mv usr/bin/* $out/bin + mv usr/share/* $out/share/ + mv opt/onlyoffice/desktopeditors $out/share + + for f in $out/share/desktopeditors/asc-de-*.png; do + size=$(basename "$f" ".png" | cut -d"-" -f3) + res="''${size}x''${size}" + mkdir -pv "$out/share/icons/hicolor/$res/apps" + ln -s "$f" "$out/share/icons/hicolor/$res/apps/onlyoffice-desktopeditors.png" + done; + + substituteInPlace $out/bin/onlyoffice-desktopeditors \ + --replace "/opt/onlyoffice/" "$out/share/" + + ln -s $out/share/desktopeditors/DesktopEditors $out/bin/DesktopEditors + + runHook postInstall + ''; + + preFixup = '' + gappsWrapperArgs+=( + --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \ + --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" \ + --set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale" \ + --set QT_QPA_PLATFORM "xcb" + # the bundled version of qt does not support wayland + ) + ''; + }; + +in + +# In order to download plugins, OnlyOffice uses /usr/bin/curl so we have to wrap it. +# Curl still needs to be in runtimeLibs because the library is used directly in other parts of the code. +# Fonts are also discovered by looking in /usr/share/fonts, so adding fonts to targetPkgs will include them +buildFHSEnv { + name = derivation.name; + + targetPkgs = pkgs': [ + curl + derivation + noto-fonts-cjk-sans + ]; + + runScript = "/bin/onlyoffice-desktopeditors"; + + extraInstallCommands = '' + mv $out/bin/$name $out/bin/onlyoffice-desktopeditors + mkdir -p $out/share + ln -s ${derivation}/share/icons $out/share + cp -r ${derivation}/share/applications $out/share + substituteInPlace $out/share/applications/onlyoffice-desktopeditors.desktop \ + --replace "/usr/bin/onlyoffice-desktopeditors" "$out/bin/onlyoffice-desktopeditors" + ''; + + passthru.updateScript = ./update.sh; + + meta = with lib; { + description = "Office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents"; + longDescription = '' + This version is broken on wlroots environments (e.g. Hyprland, Sway). + If you are using one of these environments, please use `onlyoffice-bin` instead. + ''; + homepage = "https://www.onlyoffice.com/"; + downloadPage = "https://github.com/ONLYOFFICE/DesktopEditors/releases"; + changelog = "https://github.com/ONLYOFFICE/DesktopEditors/blob/master/CHANGELOG.md"; + platforms = [ "x86_64-linux" ]; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + license = licenses.agpl3Plus; + maintainers = with maintainers; [ nh2 gtrunsec ]; + }; +} diff --git a/pkgs/by-name/on/onlyoffice-bin_latest/update.sh b/pkgs/by-name/on/onlyoffice-bin_latest/update.sh new file mode 100644 index 000000000000..d7b0bc106fa2 --- /dev/null +++ b/pkgs/by-name/on/onlyoffice-bin_latest/update.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl jq common-updater-scripts + +version="$(curl -sL "https://api.github.com/repos/ONLYOFFICE/DesktopEditors/releases?per_page=1" | jq -r ".[0].tag_name" | sed 's/^v//')" +update-source-version onlyoffice-bin "$version" diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index b62a6c88843e..af184b11a8b9 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -791,6 +791,8 @@ mapAliases ({ openvpn_24 = throw "openvpn_24 has been removed, because it went EOL. 2.5.x or newer is still available"; # Added 2023-01-23 orchis = orchis-theme; # Added 2021-06-09 oni2 = throw "oni2 was removed, because it is unmaintained and was abandoned years ago."; #Added 2024-01-15 + onlyoffice-bin_7_2 = throw "onlyoffice-bin_7_2 has been renamed to onlyoffice-bin"; # Added 2024-02-05 + onlyoffice-bin_7_5 = throw "onlyoffice-bin_7_5 has been renamed to onlyoffice-bin_latest (and updated from 7.5.x)"; # Added 2024-02-05 oroborus = throw "oroborus was removed, because it was abandoned years ago."; #Added 2023-09-10 osxfuse = macfuse-stubs; # Added 2021-03-20 oxen = throw "'oxen' has been removed, because it was broken, outdated and unmaintained"; # Added 2023-12-09 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 53ae4ccbd3f1..1da9cf3c820f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -33968,11 +33968,6 @@ with pkgs; okteto = callPackage ../development/tools/okteto { }; - onlyoffice-bin_7_2 = callPackage ../applications/office/onlyoffice-bin/7_2.nix { }; - onlyoffice-bin_8_0 = callPackage ../applications/office/onlyoffice-bin/8_0.nix { }; - onlyoffice-bin = onlyoffice-bin_7_2; - onlyoffice-bin_latest = onlyoffice-bin_8_0; - onmetal-image = callPackage ../tools/virtualization/onmetal-image { }; opcr-policy = callPackage ../development/tools/opcr-policy { }; -- cgit 1.4.1