summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall T. Vasquez <ran.dall@icloud.com>2022-11-02 18:11:59 -0700
committerJoonas Niilola <juippis@gentoo.org>2022-11-07 10:48:01 +0200
commit718503b70a579f26d952ec0262bb4cdd02be907a (patch)
treeb060fb363d8dd74d26dd12fc3ed6c52d27e0556c /net-im/discord-bin
parentwww-client/firefox: drop 106.0.4 (diff)
downloadgentoo-718503b70a579f26d952ec0262bb4cdd02be907a.tar.gz
gentoo-718503b70a579f26d952ec0262bb4cdd02be907a.tar.bz2
gentoo-718503b70a579f26d952ec0262bb4cdd02be907a.zip
net-im/discord-bin: refactor 0.0.21-r1
Signed-off-by: Randall T. Vasquez <ran.dall@icloud.com> Closes: https://github.com/gentoo/gentoo/pull/28117 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'net-im/discord-bin')
-rw-r--r--net-im/discord-bin/discord-bin-0.0.21-r1.ebuild (renamed from net-im/discord-bin/discord-bin-0.0.21.ebuild)67
-rw-r--r--net-im/discord-bin/metadata.xml4
2 files changed, 47 insertions, 24 deletions
diff --git a/net-im/discord-bin/discord-bin-0.0.21.ebuild b/net-im/discord-bin/discord-bin-0.0.21-r1.ebuild
index 58ed3ccea6ef..e006e6ca8030 100644
--- a/net-im/discord-bin/discord-bin-0.0.21.ebuild
+++ b/net-im/discord-bin/discord-bin-0.0.21-r1.ebuild
@@ -3,8 +3,8 @@
EAPI=8
-MY_PN="${PN/-bin}"
-MY_PV="${PV/-r*}"
+MY_PN="${PN/-bin/}"
+MY_PV="${PV/-r*/}"
CHROMIUM_LANGS="
am ar bg bn ca cs da de el en-GB en-US es es-419 et fa fi fil fr gu he hi
@@ -21,23 +21,28 @@ SRC_URI="https://dl.discordapp.net/apps/linux/${MY_PV}/${MY_PN}-${MY_PV}.tar.gz"
LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="amd64"
+RESTRICT="bindist mirror strip test"
+IUSE="+seccomp system-ffmpeg"
-# libXScrnSaver is used through dlopen (bug #825370)
RDEPEND="
- || (
- >=app-accessibility/at-spi2-core-2.46.0:2
- ( app-accessibility/at-spi2-atk dev-libs/atk )
- )
+ || (
+ >=app-accessibility/at-spi2-core-2.46.0:2
+ ( app-accessibility/at-spi2-atk dev-libs/atk )
+ )
+ app-crypt/libsecret
dev-libs/expat
dev-libs/glib:2
dev-libs/nspr
dev-libs/nss
media-libs/alsa-lib
+ media-libs/fontconfig
media-libs/mesa[gbm(+)]
net-print/cups
sys-apps/dbus
+ sys-apps/util-linux
sys-libs/glibc
x11-libs/cairo
+ x11-libs/libdrm
x11-libs/gdk-pixbuf:2
x11-libs/gtk+:3
x11-libs/libX11
@@ -47,15 +52,13 @@ RDEPEND="
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrandr
- x11-libs/libdrm
x11-libs/libxcb
x11-libs/libxkbcommon
x11-libs/libxshmfence
x11-libs/pango
+ system-ffmpeg? ( media-video/ffmpeg[chromium] )
"
-RESTRICT="bindist mirror strip test"
-
DESTDIR="/opt/${MY_PN}"
QA_PREBUILT="
@@ -76,18 +79,13 @@ CONFIG_CHECK="~USER_NS"
S="${WORKDIR}/${MY_PN^}"
-pkg_pretend() {
- chromium_suid_sandbox_check_kernel_config
-}
-
src_unpack() {
unpack ${MY_PN}-${MY_PV}.tar.gz
}
src_configure() {
- chromium_suid_sandbox_check_kernel_config
-
default
+ chromium_suid_sandbox_check_kernel_config
}
src_prepare() {
@@ -95,21 +93,41 @@ src_prepare() {
# remove post-install script
rm postinst.sh || die "the removal of the unneeded post-install script failed"
# cleanup languages
- pushd "locales/" || die "location change for language cleanup failed"
+ pushd "locales/" >/dev/null || die "location change for language cleanup failed"
chromium_remove_language_paks
- popd || die "location reset for language cleanup failed"
+ popd >/dev/null || die "location reset for language cleanup failed"
# fix .desktop exec location
- sed -i -e "s:/usr/share/discord/Discord:${DESTDIR}/${MY_PN^}:" ${MY_PN}.desktop || die "fixing of exec location on .desktop failed"
+ sed -i "/Exec/s:/usr/share/discord/Discord:${DESTDIR}/${MY_PN^}:" \
+ "${MY_PN}.desktop" ||
+ die "fixing of exec location on .desktop failed"
+ # USE seccomp
+ if ! use seccomp; then
+ sed -i '/Exec/s/Discord/Discord --disable-seccomp-filter-sandbox/' \
+ "${MY_PN}.desktop" ||
+ die "sed failed for seccomp"
+ fi
+ # USE system-ffmpeg
+ if use system-ffmpeg; then
+ rm libffmpeg.so || die
+ elog "Using system ffmpeg. This is experimental and may lead to crashes."
+ fi
}
src_install() {
- doicon -s 256 ${MY_PN}.png
+ doicon -s 256 "${MY_PN}.png"
# install .desktop file
- domenu ${MY_PN}.desktop
+ domenu "${MY_PN}.desktop"
exeinto "${DESTDIR}"
- doexe ${MY_PN^} chrome-sandbox libEGL.so libffmpeg.so libGLESv2.so libvk_swiftshader.so
+
+ doexe "${MY_PN^}" chrome-sandbox libEGL.so libGLESv2.so libvk_swiftshader.so
+
+ if use system-ffmpeg; then
+ dosym "../../usr/$(get_libdir)/chromium/libffmpeg.so" "${DESTDIR}/libffmpeg.so" || die
+ else
+ doexe libffmpeg.so
+ fi
insinto "${DESTDIR}"
doins chrome_100_percent.pak chrome_200_percent.pak icudtl.dat resources.pak snapshot_blob.bin v8_context_snapshot.bin
@@ -118,9 +136,10 @@ src_install() {
# Chrome-sandbox requires the setuid bit to be specifically set.
# see https://github.com/electron/electron/issues/17972
- fperms 4755 "${DESTDIR}"/chrome-sandbox
+ fowners root "${DESTDIR}/chrome-sandbox"
+ fperms 4711 "${DESTDIR}/chrome-sandbox"
- dosym "${DESTDIR}"/${MY_PN^} /usr/bin/${MY_PN}
+ dosym "${DESTDIR}/${MY_PN^}" "/usr/bin/${MY_PN}"
}
pkg_postinst() {
diff --git a/net-im/discord-bin/metadata.xml b/net-im/discord-bin/metadata.xml
index f485c452f77f..058ce7688080 100644
--- a/net-im/discord-bin/metadata.xml
+++ b/net-im/discord-bin/metadata.xml
@@ -9,4 +9,8 @@
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
+ <use>
+ <flag name="swiftshader">Install SwiftShader OpenGL libaries</flag>
+ <flag name="system-ffmpeg">Use the system-wide <pkg>media-video/ffmpeg</pkg> instead of bundled</flag>
+ </use>
</pkgmetadata>