From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7152615803E for ; Wed, 3 Jan 2024 16:54:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7E6FF2BC0A6; Wed, 3 Jan 2024 16:54:08 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5F4702BC0A6 for ; Wed, 3 Jan 2024 16:54:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id DC05234301F for ; Wed, 3 Jan 2024 16:54:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5AEA814C5 for ; Wed, 3 Jan 2024 16:54:04 +0000 (UTC) From: "David Roman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "David Roman" Message-ID: <1704263380.47d6aa9a9b0f1005f4fd592e6d6372c6f18b606d.davidroman@gentoo> Subject: [gentoo-commits] repo/proj/guru:master commit in: app-office/obsidian/ X-VCS-Repository: repo/proj/guru X-VCS-Files: app-office/obsidian/obsidian-1.4.16-r1.ebuild app-office/obsidian/obsidian-1.4.16.ebuild X-VCS-Directories: app-office/obsidian/ X-VCS-Committer: davidroman X-VCS-Committer-Name: David Roman X-VCS-Revision: 47d6aa9a9b0f1005f4fd592e6d6372c6f18b606d X-VCS-Branch: master Date: Wed, 3 Jan 2024 16:54:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 9527b2f6-68a9-48f6-a79c-a80ce3ad7cfa X-Archives-Hash: 14c383751ffd57df0bab0d71b3c07ce4 commit: 47d6aa9a9b0f1005f4fd592e6d6372c6f18b606d Author: Artemis Everfree artemis sh> AuthorDate: Wed Jan 3 06:29:40 2024 +0000 Commit: David Roman gmail com> CommitDate: Wed Jan 3 06:29:40 2024 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=47d6aa9a app-office/obsidian: Provide X11 and Wayland .desktop files together For some users, Obsidian works fine with native wayland. For others, it crashes. See https://bugs.gentoo.org/915899 To make this easier for users to deal with, provide both .desktop files in the installation so they can switch between them to see what works. Warn during install that they should try this if they see crashes. Signed-off-by: Artemis Everfree artemis.sh> ...ian-1.4.16.ebuild => obsidian-1.4.16-r1.ebuild} | 50 +++++++++++++++++++--- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/app-office/obsidian/obsidian-1.4.16.ebuild b/app-office/obsidian/obsidian-1.4.16-r1.ebuild similarity index 67% rename from app-office/obsidian/obsidian-1.4.16.ebuild rename to app-office/obsidian/obsidian-1.4.16-r1.ebuild index b07d924ffa..8baafd637c 100644 --- a/app-office/obsidian/obsidian-1.4.16.ebuild +++ b/app-office/obsidian/obsidian-1.4.16-r1.ebuild @@ -31,7 +31,7 @@ LICENSE="Obsidian-EULA" SLOT="0" KEYWORDS="~amd64 ~arm64" -IUSE="appindicator wayland" +IUSE="appindicator" RDEPEND=" >=app-accessibility/at-spi2-core-2.46.0:2 @@ -97,11 +97,38 @@ src_prepare() { pushd "${S_OBSIDIAN}/locales/" >/dev/null || die "location change for language cleanup failed" chromium_remove_language_paks popd >/dev/null || die "location reset for language cleanup failed" - if use wayland; then - sed -i '/Exec/s/obsidian/obsidian --ozone-platform-hint=auto --enable-features=UseOzonePlatform,WaylandWindowDecorations/' \ - "usr/share/applications/obsidian.desktop" || - die "sed failed for wayland" - fi + + # Create separate .desktop file for launching Obsidian with native wayland + # support. + # + # Obsidian is an Electron app, and Electron can be instructed to run in + # native-wayland mode by turning on the Ozone platform. However, doing this + # causes Obsidian to crash on some users' systems, while it works fine for + # others. (see https://bugs.gentoo.org/915899) + # + # It appears VSCode may have encountered a similar issue, because VSCode + # installs two separate .desktop files, one for launching with wayland + # support and one for launching without. We will do the same here. + + # Create a copy of upstream's .desktop + cp usr/share/applications/obsidian.desktop \ + usr/share/applications/obsidian-wayland.desktop \ + || die "failed to create obsidian-wayland.desktop file" + + # Edit the Exec & Name + sed -i \ + ' + # Add Electron ozone enable flags to obsidian execution + /Exec/s/obsidian /obsidian --ozone-platform-hint=auto --enable-features=UseOzonePlatform,WaylandWindowDecorations / + + # Give this .desktop file a new name/desc of "Obsidian Wayland" + /^Name/s/$/ Wayland/ + + # comment field + /^Comment/s/$/ with Wayland support enabled/ + ' \ + 'usr/share/applications/obsidian-wayland.desktop' || + die "sed failed for obsidian-wayland.desktop file" } src_install() { @@ -133,8 +160,19 @@ src_install() { fi domenu usr/share/applications/obsidian.desktop + domenu usr/share/applications/obsidian-wayland.desktop for size in 16 32 48 64 128 256 512; do doicon --size ${size} usr/share/icons/hicolor/${size}x${size}/apps/${PN}.png done } + +pkg_postinst() { + ewarn "Some users have reported that running Obsidian with native Wayland" + ewarn "support causes the software to crash. Others have it working" + ewarn "without issue. See https://bugs.gentoo.org/915899" + ewarn "" + ewarn "This package now provides application entries for both Obsidian and" + ewarn "Obsidian Wayland. If Obsidian Wayland breaks for you under Wayland," + ewarn "try the other Obsidian entry to launch with XWayland" +}