From b18abe34031486381206e71b27209480d23de131 Mon Sep 17 00:00:00 2001 From: Yureka Date: Thu, 11 Aug 2022 19:32:19 +0200 Subject: element-{web,desktop}: use stdenv.mkDerivation --- .../instant-messengers/element/element-web.nix | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'pkgs/applications/networking/instant-messengers/element/element-web.nix') diff --git a/pkgs/applications/networking/instant-messengers/element/element-web.nix b/pkgs/applications/networking/instant-messengers/element/element-web.nix index 3b43946045985..7ba82ca28f601 100644 --- a/pkgs/applications/networking/instant-messengers/element/element-web.nix +++ b/pkgs/applications/networking/instant-messengers/element/element-web.nix @@ -1,5 +1,5 @@ { lib -, mkYarnPackage +, stdenv , runCommand , fetchFromGitHub , fetchYarnDeps @@ -7,6 +7,7 @@ , jq , yarn , fixup_yarn_lock +, nodejs , jitsi-meet , conf ? { } }: @@ -19,8 +20,7 @@ let }; configOverrides = writeText "element-config-overrides.json" (builtins.toJSON (noPhoningHome // conf)); -in -mkYarnPackage rec { +in stdenv.mkDerivation rec { pname = "element-web"; inherit (pinData) version; @@ -31,7 +31,6 @@ mkYarnPackage rec { sha256 = pinData.webSrcHash; }; - packageJSON = ./element-web-package.json; # Remove the matrix-analytics-events dependency from the matrix-react-sdk # dependencies list. It doesn't seem to be necessary since we already are # installing it individually, and it causes issues with the offline mode. @@ -43,11 +42,19 @@ mkYarnPackage rec { sha256 = pinData.webYarnHash; }; - nativeBuildInputs = [ jq ]; + nativeBuildInputs = [ yarn fixup_yarn_lock jq nodejs ]; configurePhase = '' runHook preConfigure - ln -s $node_modules node_modules + + export HOME=$PWD/tmp + 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 ''; @@ -72,9 +79,6 @@ mkYarnPackage rec { runHook postInstall ''; - # Do not attempt generating a tarball for element-web again. - doDist = false; - meta = { description = "A glossy Matrix collaboration client for the web"; homepage = "https://element.io/"; -- cgit 1.4.1