Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-24.11] element-{web,desktop}: use yarnConfigHook #387585

Open
wants to merge 2 commits into
base: release-24.11
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions pkgs/by-name/el/element-desktop/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
fetchFromGitHub,
makeWrapper,
makeDesktopItem,
fixup-yarn-lock,
yarn,
yarnConfigHook,
nodejs,
fetchYarnDeps,
jq,
Expand Down Expand Up @@ -48,27 +47,14 @@ stdenv.mkDerivation (
};

nativeBuildInputs = [
yarn
fixup-yarn-lock
yarnConfigHook
nodejs
makeWrapper
jq
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ];

inherit seshat;

configurePhase = ''
runHook preConfigure

export HOME=$(mktemp -d)
yarn config --offline set yarn-offline-mirror $offlineCache
fixup-yarn-lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules/

runHook postConfigure
'';

# Only affects unused scripts in $out/share/element/electron/scripts. Also
# breaks because there are some `node`-scripts with a `npx`-shebang and
# this shouldn't be in the closure just for unused scripts.
Expand Down
25 changes: 2 additions & 23 deletions pkgs/by-name/el/element-web-unwrapped/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
fetchFromGitHub,
fetchYarnDeps,
jq,
yarn,
fixup-yarn-lock,
yarnConfigHook,
nodejs,
jitsi-meet,
}:
Expand Down Expand Up @@ -36,8 +35,7 @@ stdenv.mkDerivation (
};

nativeBuildInputs = [
yarn
fixup-yarn-lock
yarnConfigHook
jq
nodejs
];
Expand All @@ -53,25 +51,6 @@ stdenv.mkDerivation (
runHook postBuild
'';

configurePhase = ''
runHook preConfigure

export HOME=$PWD/tmp
# with the update of openssl3, some key ciphers are not supported anymore
# this flag will allow those codecs again as a workaround
# see https://medium.com/the-node-js-collection/node-js-17-is-here-8dba1e14e382#5f07
# and https://github.com/element-hq/element-web/issues/21043
export NODE_OPTIONS=--openssl-legacy-provider
mkdir -p $HOME

fixup-yarn-lock yarn.lock
yarn config --offline set yarn-offline-mirror $offlineCache
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules

runHook postConfigure
'';

installPhase = ''
runHook preInstall

Expand Down