element-desktop: 1.11.110 -> 1.11.102

Release notes:
- https://github.com/element-hq/element-desktop/releases/tag/v1.11.101
- https://github.com/element-hq/element-desktop/releases/tag/v1.11.102
Changelog: https://github.com/element-hq/element-desktop/compare/v1.11.100...v1.11.102

Updates electron from 35 to 36.

Re-introduces the same mechanism for the yarnOfflineCache as #381196, as
the problem described in there is back again.

authored by transcaffeine and committed by John Titor 84458a3f cb645ca7

+65 -12
+3 -3
pkgs/by-name/el/element-desktop/element-desktop-pin.nix
··· 1 1 { 2 - "version" = "1.11.100"; 2 + "version" = "1.11.102"; 3 3 "hashes" = { 4 - "desktopSrcHash" = "sha256-qlKZkBPWcD1eyEetCrIKsSXmodg6DYCmENfY+UT7Khc="; 5 - "desktopYarnHash" = "sha256-wuRAeb4IpA2Ihr3ohaMPvFsaMod4Bg8o9lm8yzStwmk="; 4 + "desktopSrcHash" = "sha256-wefoN8Nk31lwJFYbBRoKfy+0n69yVg6jskqP6aTHApE="; 5 + "desktopYarnHash" = "sha256-/Gy/sYk8EBWU07zXwPl0zsDW5ADRq1j5PH4lPFe8dxk="; 6 6 }; 7 7 }
+24 -9
pkgs/by-name/el/element-desktop/package.nix
··· 4 4 fetchFromGitHub, 5 5 makeWrapper, 6 6 makeDesktopItem, 7 - yarnConfigHook, 7 + yarn, 8 8 nodejs, 9 - fetchYarnDeps, 10 9 jq, 11 - electron_35, 10 + electron_36, 12 11 element-web, 13 12 sqlcipher, 14 13 callPackage, 15 14 desktopToDarwinBundle, 15 + typescript, 16 16 useKeytar ? true, 17 17 # command line arguments which are always set 18 18 commandLineArgs ? "", ··· 22 22 pinData = import ./element-desktop-pin.nix; 23 23 inherit (pinData.hashes) desktopSrcHash desktopYarnHash; 24 24 executableName = "element-desktop"; 25 - electron = electron_35; 25 + electron = electron_36; 26 26 keytar = callPackage ./keytar { 27 27 inherit electron; 28 28 }; ··· 41 41 hash = desktopSrcHash; 42 42 }; 43 43 44 - offlineCache = fetchYarnDeps { 45 - yarnLock = finalAttrs.src + "/yarn.lock"; 46 - sha256 = desktopYarnHash; 44 + # TODO: fetchYarnDeps currently does not deal properly with a dependency 45 + # declared as a pin to a commit in a specific git repository. 46 + # While it does download everything correctly, `yarn install --offline` 47 + # always wants to `git ls-remote` to the repository, ignoring the local 48 + # cached tarball. 49 + offlineCache = callPackage ./yarn.nix { 50 + inherit (finalAttrs) version src; 51 + hash = desktopYarnHash; 47 52 }; 48 53 49 54 nativeBuildInputs = [ 50 - yarnConfigHook 51 55 nodejs 52 56 makeWrapper 53 57 jq 58 + yarn 59 + typescript 54 60 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; 55 61 56 62 inherit seshat; ··· 60 66 # this shouldn't be in the closure just for unused scripts. 61 67 dontPatchShebangs = true; 62 68 69 + configurePhase = '' 70 + mkdir -p node_modules/ 71 + cp -r $offlineCache/node_modules/* node_modules/ 72 + substituteInPlace package.json --replace-fail "tsx " "node node_modules/tsx/dist/cli.mjs " 73 + ''; 74 + 63 75 buildPhase = '' 64 76 runHook preBuild 65 77 66 78 yarn --offline run build:ts 67 - yarn --offline run i18n 79 + node node_modules/matrix-web-i18n/scripts/gen-i18n.js 80 + yarn --offline run i18n:sort 68 81 yarn --offline run build:res 69 82 83 + chmod -R a+w node_modules/keytar-forked 70 84 rm -rf node_modules/matrix-seshat node_modules/keytar-forked 71 85 ${lib.optionalString useKeytar "ln -s ${keytar} node_modules/keytar-forked"} 72 86 ln -s $seshat node_modules/matrix-seshat ··· 82 96 ln -s '${element-web}' "$out/share/element/webapp" 83 97 cp -r '.' "$out/share/element/electron" 84 98 cp -r './res/img' "$out/share/element" 99 + chmod -R "a+w" "$out/share/element/electron/node_modules" 85 100 rm -rf "$out/share/element/electron/node_modules" 86 101 cp -r './node_modules' "$out/share/element/electron" 87 102 cp $out/share/element/electron/lib/i18n/strings/en_EN.json $out/share/element/electron/lib/i18n/strings/en-us.json
+38
pkgs/by-name/el/element-desktop/yarn.nix
··· 1 + { 2 + stdenvNoCC, 3 + yarn, 4 + cacert, 5 + git, 6 + version, 7 + src, 8 + hash, 9 + }: 10 + stdenvNoCC.mkDerivation { 11 + pname = "element-desktop-yarn-deps"; 12 + inherit version src; 13 + 14 + nativeBuildInputs = [ 15 + cacert 16 + yarn 17 + git 18 + ]; 19 + 20 + dontInstall = true; 21 + 22 + NODE_EXTRA_CA_CERTS = "${cacert}/etc/ssl/certs/ca-bundle.crt"; 23 + 24 + buildPhase = '' 25 + export HOME=$(mktemp -d) 26 + export YARN_ENABLE_TELEMETRY=0 27 + 28 + yarn install --frozen-lockfile --ignore-platform --skip-integrity-check --ignore-scripts --no-progress --non-interactive 29 + 30 + mkdir -p $out/node_modules 31 + cp -r node_modules/* $out/node_modules/ 32 + ''; 33 + 34 + dontPatchShebangs = true; 35 + 36 + outputHash = hash; 37 + outputHashMode = "recursive"; 38 + }