From 232281fcfd1b8c6d85e253e811e5cf6f093e4afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Mon, 31 Jan 2022 20:33:45 +0100 Subject: [PATCH] element-desktop: update to 1.10.1. --- ...es-compilation-on-a-bunch-of-targets.patch | 176 ++++++++++-------- srcpkgs/element-desktop/template | 6 +- 2 files changed, 101 insertions(+), 81 deletions(-) diff --git a/srcpkgs/element-desktop/patches/0001-Fixes-compilation-on-a-bunch-of-targets.patch b/srcpkgs/element-desktop/patches/0001-Fixes-compilation-on-a-bunch-of-targets.patch index 869dca38b8a4..8fe48e86a6a2 100644 --- a/srcpkgs/element-desktop/patches/0001-Fixes-compilation-on-a-bunch-of-targets.patch +++ b/srcpkgs/element-desktop/patches/0001-Fixes-compilation-on-a-bunch-of-targets.patch @@ -1,125 +1,149 @@ -From bc552079ad526a8b7da12c091e384d640407c7ea Mon Sep 17 00:00:00 2001 +From 5bba725437953f7f6f4b7b78da1891398bea1c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Tue, 17 Aug 2021 17:33:02 +0200 Subject: [PATCH] Fixes compilation on a bunch of targets -Considering that this changes generated files, I've not submitted this -patch directly. Instead, the original source has received a PR over at -https://github.com/vector-im/element-builder/pull/58. --- package.json | 1 + - scripts/hak/target.js | 82 +++++++++++++++++++++++++++++++++++++------ + scripts/hak/target.ts | 86 +++++++++++++++++++++++++++++++++++++++++-- yarn.lock | 2 +- - 3 files changed, 74 insertions(+), 11 deletions(-) + 3 files changed, 84 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json -index c958137..3b371d2 100644 +index 7bafb02..0814dbd 100644 --- a/package.json +++ b/package.json -@@ -57,6 +57,7 @@ - "allchange": "^1.0.6", +@@ -61,6 +61,7 @@ + "app-builder-lib": "^22.14.10", "asar": "^2.0.1", "chokidar": "^3.5.2", + "detect-libc": "^1.0.3", - "electron": "13.5", + "electron": "^15.3.5", "electron-builder": "22.11.4", "electron-builder-squirrel-windows": "22.11.4", -diff --git a/scripts/hak/target.js b/scripts/hak/target.js -index 0a965fc..07349fc 100644 ---- a/scripts/hak/target.js -+++ b/scripts/hak/target.js -@@ -25,11 +25,26 @@ limitations under the License. +diff --git a/scripts/hak/target.ts b/scripts/hak/target.ts +index 50554fa..3b536c5 100644 +--- a/scripts/hak/target.ts ++++ b/scripts/hak/target.ts +@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and + limitations under the License. + */ - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isHost = exports.isHostId = exports.getHost = exports.ENABLED_TARGETS = exports.TARGETS = void 0; -+const detect_libc_1 = require("detect-libc"); - const aarch64AppleDarwin = { - id: 'aarch64-apple-darwin', - platform: 'darwin', - arch: 'arm64', ++import { GLIBC, MUSL, family as processLibC } from "detect-libc" ++ + // We borrow Rust's target naming scheme as a way of expressing all target + // details in a single string. + // See https://doc.rust-lang.org/rustc/platform-support.html. +@@ -23,18 +25,28 @@ export type TargetId = + 'universal-apple-darwin' | + 'i686-pc-windows-msvc' | + 'x86_64-pc-windows-msvc' | +- 'x86_64-unknown-linux-gnu'; ++ 'i686-unknown-linux-musl' | ++ 'i686-unknown-linux-gnu' | ++ 'x86_64-unknown-linux-musl' | ++ 'x86_64-unknown-linux-gnu' | ++ 'aarch64-unknown-linux-musl' | ++ 'aarch64-unknown-linux-gnu' | ++ 'powerpc64le-unknown-linux-musl' | ++ 'powerpc64le-unknown-linux-gnu'; + + // Values are expected to match those used in `process.platform`. + export type Platform = 'darwin' | 'linux' | 'win32'; + + // Values are expected to match those used in `process.arch`. +-export type Arch = 'arm64' | 'ia32' | 'x64' | 'universal'; ++export type Arch = 'arm64' | 'ia32' | 'x64' | 'ppc64' | 'universal'; + + // Values are expected to match those used by Visual Studio's `vcvarsall.bat`. + // See https://docs.microsoft.com/cpp/build/building-on-the-command-line?view=msvc-160#vcvarsall-syntax + export type VcVarsArch = 'amd64' | 'arm64' | 'x86'; + ++// Values are expected to match those used in `detect-libc`. ++export type LibC = GLIBC | MUSL; ++ + export type Target = { + id: TargetId; + platform: Platform; +@@ -46,6 +58,11 @@ export type WindowsTarget = Target & { + vcVarsArch: VcVarsArch; }; -+const x8664AppleDarwin = { -+ id: 'x86_64-apple-darwin', -+ platform: 'darwin', -+ arch: 'x64', -+}; -+const universalAppleDarwin = { -+ id: 'universal-apple-darwin', -+ platform: 'darwin', -+ arch: 'universal', -+ subtargets: [ -+ aarch64AppleDarwin, -+ x8664AppleDarwin, -+ ], -+}; - const i686PcWindowsMsvc = { - id: 'i686-pc-windows-msvc', - platform: 'win32', -@@ -42,34 +57,81 @@ const x8664PcWindowsMsvc = { - arch: 'x64', + ++export type LinuxTarget = Target & { ++ platform: 'linux'; ++ libC: LibC; ++} ++ + export type UniversalTarget = Target & { + arch: 'universal'; + subtargets: Target[]; +@@ -87,10 +104,60 @@ const x8664PcWindowsMsvc: WindowsTarget = { vcVarsArch: 'amd64', }; --const x8664AppleDarwin = { -- id: 'x86_64-apple-darwin', -- platform: 'darwin', -- arch: 'x64', --}; - const x8664UnknownLinuxGnu = { + +-const x8664UnknownLinuxGnu: Target = { ++const x8664UnknownLinuxGnu: LinuxTarget = { id: 'x86_64-unknown-linux-gnu', platform: 'linux', arch: 'x64', + libC: 'glibc', +}; -+const x8664UnknownLinuxMusl = { ++ ++const x8664UnknownLinuxMusl: LinuxTarget = { + id: 'x86_64-unknown-linux-musl', + platform: 'linux', + arch: 'x64', + libC: 'musl', +}; -+const i686UnknownLinuxGnu = { ++ ++const i686UnknownLinuxGnu: LinuxTarget = { + id: 'i686-unknown-linux-gnu', + platform: 'linux', + arch: 'ia32', + libC: 'glibc', +}; -+const i686UnknownLinuxMusl = { ++ ++const i686UnknownLinuxMusl: LinuxTarget = { + id: 'i686-unknown-linux-musl', + platform: 'linux', + arch: 'ia32', + libC: 'musl', +}; -+const aarch64UnknownLinuxGnu = { ++ ++const aarch64UnknownLinuxGnu: LinuxTarget = { + id: 'aarch64-unknown-linux-gnu', + platform: 'linux', + arch: 'arm64', + libC: 'glibc', +}; -+const aarch64UnknownLinuxMusl = { ++ ++const aarch64UnknownLinuxMusl: LinuxTarget = { + id: 'aarch64-unknown-linux-musl', + platform: 'linux', + arch: 'arm64', + libC: 'musl', +}; -+const powerpc64leUnknownLinuxGnu = { ++ ++const powerpc64leUnknownLinuxGnu: LinuxTarget = { + id: 'powerpc64le-unknown-linux-gnu', + platform: 'linux', + arch: 'ppc64', + libC: 'glibc', +}; -+const powerpc64leUnknownLinuxMusl = { ++ ++const powerpc64leUnknownLinuxMusl: LinuxTarget = { + id: 'powerpc64le-unknown-linux-musl', + platform: 'linux', + arch: 'ppc64', + libC: 'musl', }; - exports.TARGETS = { - 'aarch64-apple-darwin': aarch64AppleDarwin, -+ 'x86_64-apple-darwin': x8664AppleDarwin, -+ 'universal-apple-darwin': universalAppleDarwin, + + export const TARGETS: Record = { +@@ -99,7 +166,14 @@ export const TARGETS: Record = { + 'universal-apple-darwin': universalAppleDarwin, 'i686-pc-windows-msvc': i686PcWindowsMsvc, 'x86_64-pc-windows-msvc': x8664PcWindowsMsvc, -- 'x86_64-apple-darwin': x8664AppleDarwin, + 'i686-unknown-linux-musl': i686UnknownLinuxMusl, + 'i686-unknown-linux-gnu': i686UnknownLinuxGnu, + 'x86_64-unknown-linux-musl': x8664UnknownLinuxMusl, @@ -129,30 +153,26 @@ index 0a965fc..07349fc 100644 + 'powerpc64le-unknown-linux-musl': powerpc64leUnknownLinuxMusl, + 'powerpc64le-unknown-linux-gnu': powerpc64leUnknownLinuxGnu, }; + // The set of targets we build by default, sorted by increasing complexity so - // that we fail fast when the native host target fails. - exports.ENABLED_TARGETS = [ -- exports.TARGETS['x86_64-apple-darwin'], -- exports.TARGETS['aarch64-apple-darwin'], -+ exports.TARGETS['universal-apple-darwin'], - exports.TARGETS['x86_64-unknown-linux-gnu'], -- exports.TARGETS['i686-pc-windows-msvc'], -+ exports.TARGETS['x86_64-pc-windows-msvc'], - ]; - function getHost() { - return Object.values(exports.TARGETS).find(target => (target.platform === process.platform && -- target.arch === process.arch)); +@@ -113,7 +187,11 @@ export const ENABLED_TARGETS: Target[] = [ + export function getHost(): Target { + return Object.values(TARGETS).find(target => ( + target.platform === process.platform && +- target.arch === process.arch + target.arch === process.arch && -+ (process.platform !== 'linux' || -+ target.libC === detect_libc_1.family))); ++ ( ++ process.platform !== 'linux' || ++ (target as LinuxTarget).libC === processLibC ++ ) + )); } - exports.getHost = getHost; - function isHostId(id) { + diff --git a/yarn.lock b/yarn.lock -index ae661ba..782282f 100644 +index 4ef66b4..f1c154e 100644 --- a/yarn.lock +++ b/yarn.lock -@@ -1778,7 +1778,7 @@ deprecation@^2.0.0, deprecation@^2.3.1: +@@ -2019,7 +2019,7 @@ deprecation@^2.0.0, deprecation@^2.3.1: resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== @@ -162,5 +182,5 @@ index ae661ba..782282f 100644 resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= -- -2.34.1 +2.35.0 diff --git a/srcpkgs/element-desktop/template b/srcpkgs/element-desktop/template index a25edc04f31a..2987c251449e 100644 --- a/srcpkgs/element-desktop/template +++ b/srcpkgs/element-desktop/template @@ -1,6 +1,6 @@ # Template file for 'element-desktop' pkgname=element-desktop -version=1.9.7 +version=1.10.1 revision=1 wrksrc="element-web-${version}" conf_files="/etc/${pkgname}/config.json" @@ -18,8 +18,8 @@ _ghpage="https://github.com/vector-im" _archive="archive/v${version}.tar.gz" distfiles="${_ghpage}/element-desktop/${_archive}>element-desktop.tar.gz ${_ghpage}/element-web/${_archive}>element-web.tar.gz" -checksum="1ee24d8c1f894ed66766d67dd5b6a5c2b1e6dcd1f866c9c49a4fd0108fd7a9e2 - b3892acf206f866b571e2eb3dcc01c72c315d737c9d040d72405c066077d9e4c" +checksum="00945a85c58bea82d79af17389b02c2c579fe08b4a3c1239a727c0af4fc07a1f + 03dc51a903c06e9c13b63415f4d393392ed8e0286ae6084eba8134d55dcf55ec" patch_args="-Np1 -d ../${pkgname}-${version}"