diff --git a/pkgs/by-name/cr/cryptpad/package.nix b/pkgs/by-name/cr/cryptpad/package.nix index 4b0cbdd0dcaf..c93539a5bd67 100644 --- a/pkgs/by-name/cr/cryptpad/package.nix +++ b/pkgs/by-name/cr/cryptpad/package.nix @@ -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.