Skip to content

Commit

Permalink
net-im/element-desktop: backport
Browse files Browse the repository at this point in the history
  • Loading branch information
PF4Public committed Sep 20, 2023
1 parent b711dfb commit 1ca7c7e
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions net-im/element-desktop/element-desktop-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,18 @@ src_compile() {
node /usr/bin/yarn run build:native || die
fi

# Electron-Builder doesn't support ppc64 due to using precompiled binaries
if ! use ppc64; then
einfo "Editing ElectronFramework.js"
sed -i 's/return unpack(options, createDownloadOpts.*$/return true;/' \
node_modules/app-builder-lib/out/electron/ElectronFramework.js || die
sed -i 's/return beforeCopyExtraFiles(options);$/return true;/' \
node_modules/app-builder-lib/out/electron/ElectronFramework.js || die

#!Error: With electron's node: "Unknown argument" electron/electron#25379
#!Error: With electron's node: "Invalid package app.asar"
/usr/bin/node node_modules/.bin/electron-builder --dir || die
else
# # Electron-Builder doesn't support ppc64 due to using precompiled binaries
# if ! use ppc64; then
# einfo "Editing ElectronFramework.js"
# sed -i 's/return unpack(options, createDownloadOpts.*$/return true;/' \
# node_modules/app-builder-lib/out/electron/ElectronFramework.js || die
# sed -i 's/return beforeCopyExtraFiles(options);$/return true;/' \
# node_modules/app-builder-lib/out/electron/ElectronFramework.js || die

# #!Error: With electron's node: "Unknown argument" electron/electron#25379
# #!Error: With electron's node: "Invalid package app.asar"
# /usr/bin/node node_modules/.bin/electron-builder --dir || die
# else
einfo "Manually preparing app.asar"
local distdir="dist/linux-unpacked/resources"
mkdir -p ${distdir}/node_modules || die
Expand All @@ -170,14 +170,14 @@ src_compile() {
fi

einfo "Creating archive"
/usr/bin/node node_modules/asar/bin/asar.js pack ${distdir} ${distdir}/app.asar \
--unpack-dir '{**/*.node}' || die
/usr/bin/node node_modules/@electron/asar/bin/asar.js pack ${distdir} ${distdir}/app.asar \
--unpack-dir '{**/Release,**/matrix-seshat}' || die
# Remove unarchived copies of files (they are still in app.asar)
rm -r ${distdir}/node_modules || die
rm -r ${distdir}/lib || die

cp -r res/img ${distdir} || die
fi
# fi

#cp -r /usr/share/element-web webapp
#rm -f webapp/config.json
Expand Down

0 comments on commit 1ca7c7e

Please sign in to comment.