cryptpad: verify that we've installed the correct versions of OnlyOffice (#365514)

This commit is contained in:
Pol Dellaiera
2024-12-16 10:27:59 +01:00
committed by GitHub
+16 -3
View File
@@ -1,6 +1,8 @@
{
bash,
buildNpmPackage,
fetchFromGitHub,
fetchpatch,
fetchurl,
lib,
makeBinaryWrapper,
@@ -56,8 +58,8 @@ let
}
{
subdir = "v7";
rev = "9d8b914a";
hash = "sha256-M+rPJ/Xo2olhqB5ViynGRaesMLLfG/1ltUoLnepMPnM=";
rev = "e1267803";
hash = "sha256-iIds0GnCHAyeIEdSD4aCCgDtnnwARh3NE470CywseS0=";
}
];
@@ -90,12 +92,19 @@ buildNpmPackage {
makeBinaryWrapper
rdfind
unzip
bash
];
patches = [
# fix httpSafePort setting
# https://github.com/cryptpad/cryptpad/pull/1571
./0001-env.js-fix-httpSafePort-handling.patch
# https://github.com/cryptpad/cryptpad/pull/1740
(fetchpatch {
name = "Add `--check`, `--rdfind`, `--no-rdfind` options to `install-onlyoffice.sh`";
url = "https://github.com/cryptpad/cryptpad/commit/f38668735e777895db2eadd3413cff386fb12c0c.patch";
hash = "sha256-J4AK1XIa3q+/lD74p2c9O7jt0VEtofTmfAaQNU71sp8=";
})
];
# cryptpad build tries to write in cache dir
@@ -121,7 +130,11 @@ buildNpmPackage {
mkdir -p "$out_cryptpad/www/common/onlyoffice/dist"
${lib.concatMapStringsSep "\n" onlyoffice_install onlyoffice_versions}
${x2t_install}
rdfind -makehardlinks true -makeresultsfile false "$out_cryptpad/www/common/onlyoffice/dist"
# Run upstream's `install-onlyoffice.sh` script in `--check` mode to
# verify that we've installed the correct versions of the various
# OnlyOffice components.
patchShebangs --build $out_cryptpad/install-onlyoffice.sh
$out_cryptpad/install-onlyoffice.sh --accept-license --check --rdfind
# cryptpad assumes it runs in the source directory and also outputs
# its state files there, which is not exactly great for us.