Unverified Commit 474b7b36 authored by phanirithvij's avatar phanirithvij
Browse files

collabora-desktop: init at 25.04.9.2-2

parent 7a51481f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -306,6 +306,8 @@

- The `services.nextcloud-spreed-signaling` NixOS module has been added to facilitate declarative management of a standalone Spreed signaling server ("High Performance Backend" for Nextcloud Talk).

- `collabora-desktop` The desktop version of Collabora Office is now available, package version `25.05.9.2-2`.

- `fetchPnpmDeps` and `pnpmConfigHook` were added as top-level attributes, replacing the now deprecated `pnpm.fetchDeps` and `pnpm.configHook` attributes.

- `fetchPnpmDeps`' `fetcherVersion = 1` is deprecated and scheduled for removal
+31 −0
Original line number Diff line number Diff line
From cd69bba3f02278609699ec53c969a3c5bacbd572 Mon Sep 17 00:00:00 2001
From: phanirithvij <phanirithvij2000@gmail.com>
Date: Mon, 9 Feb 2026 01:22:26 +0530
Subject: [PATCH] template copy permissions fix

Signed-off-by: phanirithvij <phanirithvij2000@gmail.com>
---
 qt/WebView.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/qt/WebView.cpp b/qt/WebView.cpp
index f0434e0055..95ef881808 100644
--- a/qt/WebView.cpp
+++ b/qt/WebView.cpp
@@ -656,6 +656,13 @@ WebView* WebView::createNewDocument(QWebEngineProfile* profile, const std::strin
         return nullptr;
     }
 
+    // Fix for nix, give write permissions as files in the store can only be read-only
+    if (!QFile::setPermissions(newFilePath, QFile::ReadOwner | QFile::WriteOwner | QFile::ReadGroup | QFile::ReadOther))
+    {
+        LOG_ERR("Failed to set write permissions on " << newFilePath.toStdString());
+        return nullptr;
+    }
+
     // Open the new document
     Poco::URI newDocumentURI(Poco::Path(newFilePath.toStdString()));
     WebView* webViewInstance = new WebView(profile, false);
-- 
2.52.0
+10873 −0

File added.

Preview size limit exceeded, changes collapsed.

+149 −0
Original line number Diff line number Diff line
{
  autoreconfHook,
  cairo,
  cppunit,
  fetchFromGitHub,
  fetchNpmDeps,
  lib,
  libcap,
  libpng,
  libreoffice-collabora,
  nodejs,
  npmHooks,
  pam,
  pango,
  pixman,
  pkgs,
  pkg-config,
  poco,
  python3,
  rsync,
  stdenv,
  zstd,
  kdePackages,
  perl,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "collabora-desktop";
  version = "25.04.9.2-2";
  src = fetchFromGitHub {
    owner = "CollaboraOnline";
    repo = "online";
    tag = "coda-${finalAttrs.version}";
    hash = "sha256-5SKtZvdtYoAsTlEseGsW+ndnD45bjTga3FPpDEldaRY=";
  };

  __structuredAttrs = true;
  strictDeps = true;

  patches = [
    # permissions fix for templates
    ./0001-template-copy-permissions-fix.patch
  ];

  postPatch = ''
    cp ${./package-lock.json} ${finalAttrs.env.npmRoot}/package-lock.json

    patchShebangs browser/util/*.py coolwsd-systemplate-setup scripts/*
    substituteInPlace configure.ac --replace-fail '/usr/bin/env python3' python3
  '';

  nativeBuildInputs = [
    autoreconfHook
    perl
    nodejs
    npmHooks.npmConfigHook
    pkg-config
    python3
    python3.pkgs.lxml
    python3.pkgs.polib
    rsync

    # from CollaboraOnline/nix-build-support
    (stdenv.mkDerivation {
      name = "qtlibexec";
      src = kdePackages.qtbase;
      buildPhase = ''
        mkdir -p $out
        ln -s ${kdePackages.qtbase}/libexec $out/bin
      '';
    })
    kdePackages.qttools
    kdePackages.wrapQtAppsHook
  ];

  buildInputs = [
    kdePackages.qtbase
    kdePackages.qtwebengine

    cairo
    cppunit
    libcap
    libpng
    pam
    pango
    pixman
    poco
    zstd
  ];

  # handle flags with spaces safely
  preConfigure = ''
    configureFlagsArray+=(
      "--with-vendor=Collabora Productivity Limited"
      "--with-app-name=Collabora Office"
    )
  '';

  configureFlags = [
    "--enable-qtapp"
    "--disable-werror"
    "--enable-silent-rules"
    "--with-lo-path=${finalAttrs.passthru.libreoffice}/lib/collaboraoffice"
    "--with-lokit-path=${finalAttrs.passthru.libreoffice.src}/include"
    "--enable-silent-rules"
    "--disable-ssl"
    "--with-info-url=https://collaboraoffice.com/"
  ];

  enableParallelBuilding = true;

  postInstall = ''
    cp --no-preserve=mode ${finalAttrs.passthru.libreoffice}/lib/collaboraoffice/LICENSE.html $out/LICENSE.html
    python3 scripts/insert-coda-license.py $out/LICENSE.html CODA-THIRDPARTYLICENSES.html
  '';

  env = {
    npmDeps = fetchNpmDeps {
      unpackPhase = "true";
      # TODO: Use upstream `npm-shrinkwrap.json` once it's fixed
      # https://github.com/CollaboraOnline/online/issues/9644
      postPatch = ''
        cp ${./package-lock.json} package-lock.json
      '';
      hash = "sha256-03ycmv27icEASJZCUSz8OqEAOr9MVgEKkfHN4ddbQNg=";
    };

    npmRoot = "browser";
  };

  passthru = {
    libreoffice = libreoffice-collabora.override {
      variant = "collabora-coda";
      withFonts = true;
    };

    updateScript = ./update.sh;
  };

  meta = {
    changelog = "https://www.collaboraonline.com/blog/";
    description = "Collaborative Office for desktop, based on LibreOffice technology";
    homepage = "https://www.collaboraonline.com/collabora-office/";
    license = lib.licenses.mpl20;
    mainProgram = "coda-qt";
    platforms = lib.platforms.linux;
    teams = [ lib.teams.ngi ];
  };
})
+39 −0
Original line number Diff line number Diff line
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p common-updater-scripts prefetch-npm-deps jq sd nodejs
#shellcheck shell=bash

set -xeu -o pipefail

PACKAGE_DIR="$(realpath "$(dirname "$0")")"
cd "$PACKAGE_DIR/.."
while ! test -f default.nix; do cd ..; done
NIXPKGS_DIR="$PWD"

new_version="$(
  list-git-tags --url=https://github.com/CollaboraOnline/online |
    grep --perl-regex --only-matching '^coda-\K[0-9.-]+$' |
    sort --version-sort |
    tail -n1
)"

cd "$NIXPKGS_DIR"
update-source-version collabora-desktop "$new_version"

TMPDIR="$(mktemp -d)"
trap 'rm -rf "$TMPDIR"' EXIT
cd "$TMPDIR"

src="$(nix-build --no-link "$NIXPKGS_DIR" -A collabora-desktop.src)"
cp "$src"/browser/package.json .
npm install --package-lock-only
cp ./package-lock.json "$PACKAGE_DIR"

prev_npm_hash="$(
  nix-instantiate "$NIXPKGS_DIR" \
    --eval --json \
    -A collabora-desktop.npmDeps.hash |
    jq -r .
)"
new_npm_hash="$(prefetch-npm-deps ./package-lock.json)"

sd --fixed-strings "$prev_npm_hash" "$new_npm_hash" "$PACKAGE_DIR/package.nix"