Skip to content

Commit

Permalink
cryptpad: verify that we've installed the correct versions of OnlyOff…
Browse files Browse the repository at this point in the history
…ice (#365514)
  • Loading branch information
drupol authored Dec 16, 2024
2 parents afc4425 + ca965ec commit 93f212d
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions pkgs/by-name/cr/cryptpad/package.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
bash,
buildNpmPackage,
fetchFromGitHub,
fetchpatch,
fetchurl,
lib,
makeBinaryWrapper,
Expand Down Expand Up @@ -56,8 +58,8 @@ let
}
{
subdir = "v7";
rev = "9d8b914a";
hash = "sha256-M+rPJ/Xo2olhqB5ViynGRaesMLLfG/1ltUoLnepMPnM=";
rev = "e1267803";
hash = "sha256-iIds0GnCHAyeIEdSD4aCCgDtnnwARh3NE470CywseS0=";
}
];

Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 93f212d

Please sign in to comment.