diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index 7a4901daae34..cf97fe8bca9e 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -7,18 +7,19 @@ _electron=electron17 pkgbase=element.io pkgname=(element-web element-desktop) pkgver=1.10.6 -pkgrel=1 +pkgrel=2 pkgdesc="Glossy Matrix collaboration client — " arch=(x86_64) url="https://element.io" license=(Apache) -makedepends=(npm git yarn python rust sqlcipher ${_electron} nodejs-lts-gallium) +makedepends=(npm git yarn python rust tcl ${_electron} nodejs-lts-gallium) _url="https://github.com/vector-im/element" source=(element-web-${pkgver}.tar.gz::${_url}-web/archive/v${pkgver}.tar.gz element-web-${pkgver}.tar.gz.asc::${_url}-web/releases/download/v${pkgver}/v${pkgver}-src.tar.gz.asc element-desktop-${pkgver}.tar.gz::${_url}-desktop/archive/v${pkgver}.tar.gz element-desktop-${pkgver}.tar.gz.asc::${_url}-desktop/releases/download/v${pkgver}/v${pkgver}-src.tar.gz.asc autolaunch.patch + encapsulate-sqlcipher.diff io.element.Element.desktop element-desktop.sh) sha256sums=('0afbddbaf9215b6aa6e566a9456a1186262245d472d457954febb7b4e12d345f' @@ -26,8 +27,9 @@ sha256sums=('0afbddbaf9215b6aa6e566a9456a1186262245d472d457954febb7b4e12d345f' '388931f2de254f66499ac79d047e4402cba9fc7b289de60e27720bfdca012000' 'SKIP' 'aaae4ffa41590361dac0c159aecc1166f69e459e89faa9d5cab1202f0277e06f' + '3b2112d25b258b67d18b9329faeb9e5c5b218732c9c020ee01911347a90a1cb8' '0103f28a32fe31f698836516783c1c70a76a0117b5df7fd0af5c422c224220f9' - '4c931121009985e7d3f73928c9db88508eedd974a7741e635bb290e3a2cd75db') + 'c1bd9ace215e3ec9af14d7f28b163fc8c8b42e23a2cf04ce6f4ce2fcc465feba') validpgpkeys=(712BFBEE92DCA45252DB17D7C7BE97EFA179B100) # Element Releases prepare() { @@ -39,6 +41,7 @@ prepare() { cd ../element-desktop-${pkgver} patch -p1 < ../autolaunch.patch + patch -p1 < ../encapsulate-sqlcipher.diff sed -i 's|"target": "deb"|"target": "dir"|' package.json sed -i 's|"https://packages.element.io/desktop/update/"|null|' element.io/release/config.json yarn install --no-fund @@ -70,7 +73,7 @@ package_element-web() { package_element-desktop() { pkgdesc+="desktop version." replaces=(riot-desktop) - depends=("element-web=${pkgver}" ${_electron} sqlcipher) + depends=("element-web=${pkgver}" ${_electron}) backup=('etc/element/config.json') cd element-desktop-${pkgver} diff --git a/trunk/element-desktop.sh b/trunk/element-desktop.sh index 3ebd631c1be5..d385e8f54c02 100755 --- a/trunk/element-desktop.sh +++ b/trunk/element-desktop.sh @@ -1,3 +1,3 @@ #!/bin/sh -LD_PRELOAD=/usr/lib/libsqlcipher.so exec @ELECTRON@ /usr/lib/element/app.asar --disable-dev-mode "$@" +exec @ELECTRON@ /usr/lib/element/app.asar --disable-dev-mode "$@" diff --git a/trunk/encapsulate-sqlcipher.diff b/trunk/encapsulate-sqlcipher.diff new file mode 100644 index 000000000000..9923eaef7f75 --- /dev/null +++ b/trunk/encapsulate-sqlcipher.diff @@ -0,0 +1,105 @@ +diff --git i/hak/matrix-seshat/build.ts w/hak/matrix-seshat/build.ts +index 8d50bb1..33ad8d5 100644 +--- i/hak/matrix-seshat/build.ts ++++ w/hak/matrix-seshat/build.ts +@@ -26,7 +26,7 @@ export default async function(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promi + if (hakEnv.isWin()) { + await buildOpenSslWin(hakEnv, moduleInfo); + await buildSqlCipherWin(hakEnv, moduleInfo); +- } else if (hakEnv.isMac()) { ++ } else { + await buildSqlCipherUnix(hakEnv, moduleInfo); + } + await buildMatrixSeshat(hakEnv, moduleInfo); +@@ -179,12 +179,17 @@ async function buildSqlCipherUnix(hakEnv, moduleInfo) { + '--prefix=' + moduleInfo.depPrefix + '', + '--enable-tempstore=yes', + '--enable-shared=no', ++ '--enable-tcl=no', + ]; + + if (hakEnv.isMac()) { + args.push('--with-crypto-lib=commoncrypto'); + } + ++ if (hakEnv.isLinux()) { ++ args.push('--with-pic=yes'); ++ } ++ + if (!hakEnv.isHost()) { + // In the nonsense world of `configure`, it is assumed you are building + // a compiler like `gcc`, so the `host` option actually means the target +@@ -265,12 +270,14 @@ async function buildMatrixSeshat(hakEnv, moduleInfo) { + // it for now: we should confirm how much of this it still actually needs. + const env = hakEnv.makeGypEnv(); + +- if (!hakEnv.isLinux()) { +- Object.assign(env, { +- SQLCIPHER_STATIC: 1, +- SQLCIPHER_LIB_DIR: path.join(moduleInfo.depPrefix, 'lib'), +- SQLCIPHER_INCLUDE_DIR: path.join(moduleInfo.depPrefix, 'include'), +- }); ++ Object.assign(env, { ++ SQLCIPHER_STATIC: 1, ++ SQLCIPHER_LIB_DIR: path.join(moduleInfo.depPrefix, 'lib'), ++ SQLCIPHER_INCLUDE_DIR: path.join(moduleInfo.depPrefix, 'include'), ++ }); ++ ++ if (hakEnv.isLinux()) { ++ env.RUSTFLAGS = '-Clink-arg=-Wl,-Bsymbolic -Clink-arg=-Wl,--exclude-libs,ALL' + } + + if (hakEnv.isWin()) { +diff --git i/hak/matrix-seshat/check.ts w/hak/matrix-seshat/check.ts +index d34247f..ad6533a 100644 +--- i/hak/matrix-seshat/check.ts ++++ w/hak/matrix-seshat/check.ts +@@ -22,21 +22,19 @@ import { DependencyInfo } from '../../scripts/hak/dep'; + + export default async function(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise { + // of course tcl doesn't have a --version +- if (!hakEnv.isLinux()) { +- await new Promise((resolve, reject) => { +- const proc = childProcess.spawn('tclsh', [], { +- stdio: ['pipe', 'ignore', 'ignore'], +- }); +- proc.on('exit', (code) => { +- if (code !== 0) { +- reject("Can't find tclsh - have you installed TCL?"); +- } else { +- resolve(); +- } +- }); +- proc.stdin.end(); ++ await new Promise((resolve, reject) => { ++ const proc = childProcess.spawn('tclsh', [], { ++ stdio: ['pipe', 'ignore', 'ignore'], + }); +- } ++ proc.on('exit', (code) => { ++ if (code !== 0) { ++ reject("Can't find tclsh - have you installed TCL?"); ++ } else { ++ resolve(); ++ } ++ }); ++ proc.stdin.end(); ++ }); + + const tools = [ + ['rustc', '--version'], +diff --git i/hak/matrix-seshat/fetchDeps.ts w/hak/matrix-seshat/fetchDeps.ts +index a2fcf34..1ae1286 100644 +--- i/hak/matrix-seshat/fetchDeps.ts ++++ w/hak/matrix-seshat/fetchDeps.ts +@@ -25,9 +25,7 @@ import HakEnv from '../../scripts/hak/hakEnv'; + import { DependencyInfo } from '../../scripts/hak/dep'; + + export default async function(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise { +- if (!hakEnv.isLinux()) { +- await getSqlCipher(hakEnv, moduleInfo); +- } ++ await getSqlCipher(hakEnv, moduleInfo); + + if (hakEnv.isWin()) { + await getOpenSsl(hakEnv, moduleInfo);