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

Element 1.11.3 #186133

Merged
merged 3 commits into from
Aug 22, 2022
Merged
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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
, fetchFromGitHub
, makeWrapper
, makeDesktopItem
, mkYarnPackage
, fixup_yarn_lock
, yarn
, nodejs
, fetchYarnDeps
, electron
, element-web
Expand All @@ -22,7 +24,7 @@ let
keytar = callPackage ./keytar { inherit Security AppKit; };
seshat = callPackage ./seshat { inherit CoreServices; };
in
mkYarnPackage rec {
stdenv.mkDerivation rec {
pname = "element-desktop";
inherit (pinData) version;
name = "${pname}-${version}";
Expand All @@ -33,27 +35,39 @@ mkYarnPackage rec {
sha256 = pinData.desktopSrcHash;
};

packageJSON = ./element-desktop-package.json;
offlineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
sha256 = pinData.desktopYarnHash;
};

nativeBuildInputs = [ makeWrapper ] ++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ];
nativeBuildInputs = [ yarn fixup_yarn_lock nodejs makeWrapper ]
++ lib.optionals stdenv.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
'';

buildPhase = ''
runHook preBuild
export HOME=$(mktemp -d)
pushd deps/element-desktop/
yarn run build:ts
yarn run i18n
yarn run build:res
popd

yarn --offline run build:ts
yarn --offline run i18n
yarn --offline run build:res

rm -rf node_modules/matrix-seshat node_modules/keytar
${lib.optionalString useKeytar "ln -s ${keytar} node_modules/keytar"}
ln -s $seshat node_modules/matrix-seshat

runHook postBuild
'';

Expand All @@ -63,9 +77,9 @@ mkYarnPackage rec {
# resources
mkdir -p "$out/share/element"
ln -s '${element-web}' "$out/share/element/webapp"
cp -r './deps/element-desktop' "$out/share/element/electron"
cp -r './deps/element-desktop/res/img' "$out/share/element"
rm "$out/share/element/electron/node_modules"
cp -r '.' "$out/share/element/electron"
cp -r './res/img' "$out/share/element"
rm -rf "$out/share/element/electron/node_modules"
cp -r './node_modules' "$out/share/element/electron"
cp $out/share/element/electron/lib/i18n/strings/en_EN.json $out/share/element/electron/lib/i18n/strings/en-us.json
ln -s $out/share/element/electron/lib/i18n/strings/en{-us,}.json
Expand All @@ -90,9 +104,6 @@ mkYarnPackage rec {
runHook postInstall
'';

# Do not attempt generating a tarball for element-desktop again.
doDist = false;

# The desktop item properties should be kept in sync with data from upstream:
# https://github.com/vector-im/element-desktop/blob/develop/package.json
desktopItem = makeDesktopItem {
Expand Down
Loading