[arch-commits] Commit in keybase/repos (6 files)
Caleb Maclennan
alerque at gemini.archlinux.org
Sat Jun 11 09:49:24 UTC 2022
Date: Saturday, June 11, 2022 @ 09:49:24
Author: alerque
Revision: 1232205
archrelease: copy trunk to community-testing-x86_64
Added:
keybase/repos/community-testing-x86_64/
keybase/repos/community-testing-x86_64/0001-Don-t-use-electron-to-build.patch
(from rev 1232204, keybase/trunk/0001-Don-t-use-electron-to-build.patch)
keybase/repos/community-testing-x86_64/0001-Maintain-current-contextIsolation-behavior-across-el.patch
(from rev 1232204, keybase/trunk/0001-Maintain-current-contextIsolation-behavior-across-el.patch)
keybase/repos/community-testing-x86_64/PKGBUILD
(from rev 1232204, keybase/trunk/PKGBUILD)
keybase/repos/community-testing-x86_64/kbfs.install
(from rev 1232204, keybase/trunk/kbfs.install)
keybase/repos/community-testing-x86_64/keybase-gui
(from rev 1232204, keybase/trunk/keybase-gui)
-----------------------------------------------------------------+
0001-Don-t-use-electron-to-build.patch | 52 +++
0001-Maintain-current-contextIsolation-behavior-across-el.patch | 67 ++++
PKGBUILD | 144 ++++++++++
kbfs.install | 15 +
keybase-gui | 18 +
5 files changed, 296 insertions(+)
Copied: keybase/repos/community-testing-x86_64/0001-Don-t-use-electron-to-build.patch (from rev 1232204, keybase/trunk/0001-Don-t-use-electron-to-build.patch)
===================================================================
--- community-testing-x86_64/0001-Don-t-use-electron-to-build.patch (rev 0)
+++ community-testing-x86_64/0001-Don-t-use-electron-to-build.patch 2022-06-11 09:49:24 UTC (rev 1232205)
@@ -0,0 +1,52 @@
+From f13853908947e47a7853125865c98a406cd7772f Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93 at gmail.com>
+Date: Thu, 21 Jun 2018 05:00:37 -0400
+Subject: [PATCH] Don't use electron to build
+
+---
+ shared/desktop/package.desktop.tsx | 4 ++--
+ shared/desktop/yarn-helper/index.tsx | 2 --
+ shared/package.json | 1 -
+ 3 files changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/shared/desktop/package.desktop.tsx b/shared/desktop/package.desktop.tsx
+index b10bb10295..f4b5fc3e6a 100644
+--- a/shared/desktop/package.desktop.tsx
++++ b/shared/desktop/package.desktop.tsx
+@@ -133,7 +133,7 @@
+ // use the same version as the currently-installed electron
+ console.log('Finding electron version')
+ try {
+- packagerOpts.electronVersion = require('../package.json').devDependencies.electron
++ packagerOpts.electronVersion = 'unused string'
+ console.log('Found electron version:', packagerOpts.electronVersion)
+ } catch (err) {
+ console.log("Couldn't parse yarn list to find electron:", err)
+@@ -190,7 +190,7 @@
+ aps.forEach(([arch, plat]) => {
+ pack(plat, arch).then(postPack(plat, arch)).catch(postPackError)
+ })
+- } else {
++ } else if (false) {
+ pack(platform, arch).then(postPack(platform, arch)).catch(postPackError)
+ }
+ }
+diff --git a/shared/desktop/yarn-helper/index.tsx b/shared/desktop/yarn-helper/index.tsx
+index c7b04af258..a752ccd8bc 100644
+--- a/shared/desktop/yarn-helper/index.tsx
++++ b/shared/desktop/yarn-helper/index.tsx
+@@ -1,6 +1,5 @@
+ // Helper for cross platform yarn run script commands
+ import buildCommands from './build'
+-import electronComands from './electron'
+ import fontCommands from './font'
+ import prettierCommands from './prettier'
+ import {execSync} from 'child_process'
+@@ -14,7 +13,6 @@ const [, , command, ...rest] = process.argv
+ const commands = {
+ ...buildCommands,
+ ...fontCommands,
+- ...electronComands,
+ ...prettierCommands,
+ help: {
+ code: () => {
Copied: keybase/repos/community-testing-x86_64/0001-Maintain-current-contextIsolation-behavior-across-el.patch (from rev 1232204, keybase/trunk/0001-Maintain-current-contextIsolation-behavior-across-el.patch)
===================================================================
--- community-testing-x86_64/0001-Maintain-current-contextIsolation-behavior-across-el.patch (rev 0)
+++ community-testing-x86_64/0001-Maintain-current-contextIsolation-behavior-across-el.patch 2022-06-11 09:49:24 UTC (rev 1232205)
@@ -0,0 +1,67 @@
+From c9f8ba2091da223fa703923e36afa4ba5f1731aa Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz at archlinux.org>
+Date: Wed, 23 Jun 2021 19:06:12 -0400
+Subject: [PATCH] Maintain current contextIsolation behavior across electron 11
+ vs. >=12
+
+For what this does, see:
+
+https://www.electronjs.org/docs/breaking-changes#default-changed-contextisolation-defaults-to-true
+https://github.com/electron/electron/blob/main/docs/tutorial/context-isolation.md
+
+In electron 11, this logged:
+
+> The default of contextIsolation is deprecated and will be changing from
+> false to true in a future release of Electron.
+
+In electron 12, Keybase refused to start. Explicitly specifying the old
+behavior makes Keybase run again.
+
+"for the security of your application" Keybase may wish in future to
+restructure and support context isolation, but that would be in the
+future.
+---
+ shared/desktop/app/main-window.desktop.tsx | 1 +
+ shared/desktop/app/menu-bar.desktop.tsx | 1 +
+ shared/desktop/app/node.desktop.tsx | 1 +
+ 3 files changed, 3 insertions(+)
+
+diff --git a/shared/desktop/app/main-window.desktop.tsx b/shared/desktop/app/main-window.desktop.tsx
+index a93ffa11a7..9ef4f6f288 100644
+--- a/shared/desktop/app/main-window.desktop.tsx
++++ b/shared/desktop/app/main-window.desktop.tsx
+@@ -275,6 +275,7 @@ export default () => {
+ minWidth: 740,
+ show: false,
+ webPreferences: {
++ contextIsolation: false,
+ backgroundThrottling: false,
+ devTools: showDevTools,
+ enableRemoteModule: true,
+diff --git a/shared/desktop/app/menu-bar.desktop.tsx b/shared/desktop/app/menu-bar.desktop.tsx
+index 1597c020bd..e1aa62a854 100644
+--- a/shared/desktop/app/menu-bar.desktop.tsx
++++ b/shared/desktop/app/menu-bar.desktop.tsx
+@@ -40,6 +40,7 @@ export default (menubarWindowIDCallback: (id: number) => void) => {
+ resizable: false,
+ transparent: true,
+ webPreferences: {
++ contextIsolation: false,
+ enableRemoteModule: true,
+ nodeIntegration: true,
+ nodeIntegrationInWorker: false,
+diff --git a/shared/desktop/app/node.desktop.tsx b/shared/desktop/app/node.desktop.tsx
+index 6368bc18b9..7c8c4a34d5 100644
+--- a/shared/desktop/app/node.desktop.tsx
++++ b/shared/desktop/app/node.desktop.tsx
+@@ -365,6 +365,7 @@ const plumbEvents = () => {
+ show: false, // Start hidden and show when we actually get props
+ titleBarStyle: 'customButtonsOnHover' as const,
+ webPreferences: {
++ contextIsolation: false,
+ enableRemoteModule: true,
+ nodeIntegration: true,
+ nodeIntegrationInWorker: false,
+--
+2.32.0
+
Copied: keybase/repos/community-testing-x86_64/PKGBUILD (from rev 1232204, keybase/trunk/PKGBUILD)
===================================================================
--- community-testing-x86_64/PKGBUILD (rev 0)
+++ community-testing-x86_64/PKGBUILD 2022-06-11 09:49:24 UTC (rev 1232205)
@@ -0,0 +1,144 @@
+# Maintainer: Caleb Maclennan <caleb at alerque.com>
+# Contributor: Eli Schwartz <eschwartz at archlinux.org>
+# Contributor: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Michael Hansen <zrax0111 gmail com>
+
+pkgbase=keybase
+pkgname=(keybase kbfs keybase-gui)
+pkgdesc='CLI tool for GPG with keybase.io'
+pkgver=6.0.2
+pkgrel=1
+arch=(x86_64)
+url=https://keybase.io
+_url=https://github.com/keybase/client
+license=(BSD)
+# git is needed for yarn...
+makedepends=(git
+ go
+ jq
+ moreutils
+ yarn)
+_archive="$pkgbase-v$pkgver"
+source=("$_url/releases/download/v$pkgver/$_archive.tar.xz"{,.sig}
+ keybase-gui
+ 0001-Don-t-use-electron-to-build.patch)
+sha256sums=('22e5ae4d1f951ea9f3ffc3cb74de9b9f41b828b2c8a4e5cb6401de6fbccf497b'
+ 'SKIP'
+ '1eca47356815ad95437911d9abe80e2d68eb96dabaedf7f95dce7d361501dc9f'
+ '74fd7a777275bdf2128f121e27f722f692302a50d89c6c1d3ec82df1deaffee3')
+validpgpkeys=('222B85B0F90BE2D24CFEB93F47484E50656D16C7') # Keybase.io Code Signing (v1) <code at keybase.io>
+
+prepare() {
+ ln -sf "${_archive/$pkgbase/client}" "$_archive"
+ cd "$_archive"
+
+ export GOPATH="$srcdir/.gopath"
+ mkdir -p "$GOPATH"/src/github.com/keybase
+ ln -sf "$PWD" "$GOPATH"/src/github.com/keybase/client
+
+ # Fix paths to run electron /path/to/app (or our minimal wrapper script).
+ # Also wire up "hideWindow" when running as a service or via XDG autostart.
+ sed -i 's@/opt/keybase/Keybase@/usr/bin/electron17 /usr/share/keybase-app@' \
+ packaging/linux/systemd/keybase.gui.service
+
+ # Don't let desktop launcher automatically start services on boot
+ sed -i 's/run_keybase/keybase-gui/g' \
+ packaging/linux/keybase.desktop
+
+ patch -p1 -i ../0001-Don-t-use-electron-to-build.patch
+ jq 'del(.devDependencies["electron"])' shared/package.json | sponge shared/package.json
+
+ cd go
+ go mod tidy
+}
+
+build() {
+ cd "$_archive/go"
+
+ # None of this should be necessary, but we duplicate the work of
+ # makepkg.conf here since golang CGO can't be bothered to respect
+ # standardized CFLAGS and we don't have native packaging integration for
+ # either this or the go-specific flags. Must be done here to make sure
+ # we're using debug or !buildflags.
+
+ export CGO_CPPFLAGS="$CPPFLAGS"
+ export CGO_CFLAGS="$CFLAGS"
+ export CGO_CXXFLAGS="$CXXFLAGS"
+ export CGO_LDFLAGS="$LDFLAGS"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+
+ export GOPATH="$srcdir/.gopath"
+ go build -a -tags production -o ./bin/keybase github.com/keybase/client/go/keybase
+ go build -a -tags production -o ./bin/kbnm github.com/keybase/client/go/kbnm
+ go build -a -tags production -o ./bin/kbfsfuse github.com/keybase/client/go/kbfs/kbfsfuse
+ go build -a -tags production -o ./bin/git-remote-keybase github.com/keybase/client/go/kbfs/kbfsgit/git-remote-keybase
+
+ cd ../shared
+ yarn install
+ yarn run package --appVersion $pkgver
+}
+
+package_keybase() {
+ depends=(gnupg)
+ optdepends=('kbfs: for the fuse-based fileystem and the encryption subcommand')
+
+ cd "$_archive"
+
+ install -Dm0755 -t "$pkgdir/usr/bin/" go/bin/{keybase,kbnm}
+
+ # native messaging whitelists
+ KBNM_INSTALL_ROOT=1 KBNM_INSTALL_OVERLAY="$pkgdir" "$pkgdir/usr/bin/kbnm" install
+ # systemd activation
+ install -Dm0644 -t "$pkgdir/usr/lib/systemd/user/" packaging/linux/systemd/keybase.service
+ install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
+}
+
+package_kbfs() {
+ pkgdesc='The Keybase filesystem'
+ url='https://keybase.io/docs/kbfs'
+ depends=(fuse keybase)
+ install=kbfs.install
+
+ cd "$_archive"
+
+ install -Dm0755 -t "$pkgdir/usr/bin/" go/bin/{kbfsfuse,git-remote-keybase}
+ install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
+ # more systemd activation
+ install -Dm0644 -t "$pkgdir/usr/lib/systemd/user/" packaging/linux/systemd/kbfs.service
+}
+
+package_keybase-gui() {
+ pkgdesc='GUI frontend for GPG with keybase.io'
+ depends=(electron17 keybase kbfs)
+
+ cd "$_archive"
+
+ install -Dm0644 -t "$pkgdir/usr/share/mime/packages/" packaging/linux/x-saltpack.xml
+ install -Dm0644 -t "$pkgdir/usr/share/applications/" packaging/linux/keybase.desktop
+ # more systemd activation
+ install -Dm0644 -t "$pkgdir/usr/lib/systemd/user/" packaging/linux/systemd/keybase.gui.service
+ # wrapper for electron
+ install -Dm0755 -t "$pkgdir/usr/bin/" "$srcdir/keybase-gui"
+ # Upstream launcher / wrapper / autostart service maker
+ install -Dm0755 -t "$pkgdir/usr/bin/" packaging/linux/run_keybase
+
+ install -Dm0644 -t "$pkgdir/usr/share/licenses/${pkgname}/" LICENSE
+
+ for i in 16 32 128 256 512 ; do
+ install -Dm0644 media/icons/Keybase.iconset/icon_${i}x${i}.png \
+ "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/keybase.png"
+ install -Dm0644 media/icons/Saltpack.iconset/icon_${i}x${i}.png \
+ "$pkgdir/usr/share/icons/hicolor/${i}x${i}/mimetypes/application-x-saltpack.png"
+ done
+ # ???
+ install -Dm0644 media/icons/Keybase.iconset/icon_32x32 at 2x.png \
+ "$pkgdir/usr/share/icons/hicolor/64x64/apps/keybase.png"
+ install -Dm0644 media/icons/Keybase.iconset/icon_512x512 at 2x.png \
+ "$pkgdir/usr/share/icons/hicolor/1024x1024/apps/keybase.png"
+
+ # the app itself
+ cd shared/desktop/build
+ rm -rf desktop/sourcemaps/
+ mkdir -p "$pkgdir/usr/share/keybase-app"
+ cp -r * "$pkgdir/usr/share/keybase-app/"
+}
Copied: keybase/repos/community-testing-x86_64/kbfs.install (from rev 1232204, keybase/trunk/kbfs.install)
===================================================================
--- community-testing-x86_64/kbfs.install (rev 0)
+++ community-testing-x86_64/kbfs.install 2022-06-11 09:49:24 UTC (rev 1232205)
@@ -0,0 +1,15 @@
+post_install() {
+ cat << '__EOF__'
+warning: the keybase-redirector is not included, so you will need to define
+your `keybase config` mountdir to something you like (or install the
+redirector on your own).
+
+See: https://github.com/keybase/client/issues/19840#issuecomment-533842074
+__EOF__
+}
+
+post_upgrade() {
+ if (( $(vercmp 4.7.1-1 $2) > 0 )); then
+ post_install
+ fi
+}
Copied: keybase/repos/community-testing-x86_64/keybase-gui (from rev 1232204, keybase/trunk/keybase-gui)
===================================================================
--- community-testing-x86_64/keybase-gui (rev 0)
+++ community-testing-x86_64/keybase-gui 2022-06-11 09:49:24 UTC (rev 1232205)
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+keybase ctl init
+
+if ! keybase version --assert-matching >/dev/null 2>&1; then
+ echo "restarting outdated services..."
+ systemctl --user daemon-reload
+ systemctl --user restart keybase kbfs
+else
+ systemctl --user start keybase kbfs
+fi
+
+if [ $# -gt 0 ] || systemctl --user is-active --quiet keybase.gui; then
+ exec electron13 /usr/share/keybase-app "$@"
+else
+ systemctl --user import-environment KEYBASE_AUTOSTART
+ exec systemctl start --user --wait keybase.gui
+fi
More information about the arch-commits
mailing list