diff options
author | Thibaud CANALE <thican@thican.net> | 2024-06-25 08:56:11 +0200 |
---|---|---|
committer | Nick Sarnie <sarnex@gentoo.org> | 2024-06-30 21:03:53 -0400 |
commit | 6368a566a8b05f09e5edfad5d4f7577a83c6334b (patch) | |
tree | db2ae5fbed0068231e774f2e08539c0e30e3f8ec /net-im/discord | |
parent | dev-util/maturin: skip failing test_macosx_deployment_target on sparc (diff) | |
download | gentoo-6368a566a8b05f09e5edfad5d4f7577a83c6334b.tar.gz gentoo-6368a566a8b05f09e5edfad5d4f7577a83c6334b.tar.bz2 gentoo-6368a566a8b05f09e5edfad5d4f7577a83c6334b.zip |
net-im/discord: enable wayland at runtime
Closes: https://bugs.gentoo.org/934886
Signed-off-by: Thibaud CANALE <thican@thican.net>
Closes: https://github.com/gentoo/gentoo/pull/37287
Signed-off-by: Nick Sarnie <sarnex@gentoo.org>
Diffstat (limited to 'net-im/discord')
-rw-r--r-- | net-im/discord/discord-0.0.58-r2.ebuild (renamed from net-im/discord/discord-0.0.58-r1.ebuild) | 28 | ||||
-rw-r--r-- | net-im/discord/files/launcher.sh | 17 |
2 files changed, 31 insertions, 14 deletions
diff --git a/net-im/discord/discord-0.0.58-r1.ebuild b/net-im/discord/discord-0.0.58-r2.ebuild index 1ce7e078123a..2f44019d1175 100644 --- a/net-im/discord/discord-0.0.58-r1.ebuild +++ b/net-im/discord/discord-0.0.58-r2.ebuild @@ -15,7 +15,7 @@ CHROMIUM_LANGS=" inherit chromium-2 desktop linux-info optfeature unpacker xdg DESCRIPTION="All-in-one voice and text chat for gamers" -HOMEPAGE="https://discordapp.com" +HOMEPAGE="https://discord.com/" SRC_URI="https://dl.discordapp.net/apps/linux/${MY_PV}/${MY_PN}-${MY_PV}.tar.gz" S="${WORKDIR}/${MY_PN^}" @@ -81,21 +81,20 @@ src_prepare() { pushd "locales/" >/dev/null || die "location change for language cleanup failed" chromium_remove_language_paks popd >/dev/null || die "location reset for language cleanup failed" + # fix .desktop exec location - sed -i "/Exec/s:/usr/share/discord/Discord:${DESTDIR}/${MY_PN^}:" \ + sed --in-place --expression "/^Exec=/s:/usr/share/discord/Discord:/usr/bin/${MY_PN}:" \ "${MY_PN}.desktop" || die "fixing of exec location on .desktop failed" - # USE wayland - if use wayland; then - sed -i '/Exec/s/Discord/Discord --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime/' \ - "${MY_PN}.desktop" || - die "sed failed for wayland" - fi - # USE seccomp - if ! use seccomp; then - sed -i '/Exec/s/Discord/Discord --disable-seccomp-filter-sandbox/' \ - "${MY_PN}.desktop" || - die "sed failed for seccomp" + + # Update exec location in launcher + sed --expression "s:@@DESTDIR@@:${DESTDIR}:" \ + "${FILESDIR}/launcher.sh" > "${T}/launcher.sh" || die "updating of exec location in launcher failed" + + # USE seccomp in launcher + if use seccomp; then + sed --in-place --expression '/^SECCOMP=/s/false/true/' \ + "${T}/launcher.sh" || die "sed failed for seccomp" fi } @@ -123,7 +122,8 @@ src_install() { # See #903616 and #890595 [[ -x chrome_crashpad_handler ]] && doins chrome_crashpad_handler - dosym "${DESTDIR}/${MY_PN^}" "/usr/bin/${MY_PN}" + exeinto "/usr/bin" + newexe "${T}/launcher.sh" "discord" || die "failing to install launcher" # https://bugs.gentoo.org/898912 if use appindicator; then diff --git a/net-im/discord/files/launcher.sh b/net-im/discord/files/launcher.sh new file mode 100644 index 000000000000..032524ae68e9 --- /dev/null +++ b/net-im/discord/files/launcher.sh @@ -0,0 +1,17 @@ +#!/bin/env bash +# coding: UTF-8 + + +declare -a discord_parameters + +SECCOMP=false + +[[ ! "${SECCOMP}" ]] && discord_parameters+=( --disable-seccomp-filter-sandbox ) + +[[ -n "${WAYLAND_DISPLAY}" ]] && discord_parameters+=( + --enable-features=UseOzonePlatform + --ozone-platform=wayland + --enable-wayland-ime +) + +@@DESTDIR@@/Discord "${discord_parameters[@]}" "$@" |