summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-im/discord-bin/Manifest1
-rw-r--r--net-im/discord-bin/discord-bin-0.0.17-r1.ebuild145
2 files changed, 146 insertions, 0 deletions
diff --git a/net-im/discord-bin/Manifest b/net-im/discord-bin/Manifest
index b0968102aa90..83e85a4eaf0f 100644
--- a/net-im/discord-bin/Manifest
+++ b/net-im/discord-bin/Manifest
@@ -1 +1,2 @@
DIST discord-0.0.17.deb 77105376 BLAKE2B b11d9d6798beb3dbb36892c9c948535fee453c258a91f48b04a686813fb82dc43f7872fcb4e68d17e6fb366a84825aa0e7b4f1ad45ab4efec403a05fb88c4f2a SHA512 b51d8e019b9c8c365aedbc7c77e53febec95d0c0f1b773e008d4d72e3880303b6f2d3381f363eedc8e08492ee2d2e8ef6d65353e852a8db9d708a70caabbb3cb
+DIST discord-0.0.17.tar.gz 77399242 BLAKE2B 0ed763947afd6478becff7c4f81fd805a681b77c48c52a958cc922242ab115b29f05cd2760dcb46d306aa5c1b39ac8ccb54d81e9c1d3b873cd01987d1a02ee2f SHA512 728c760f04770b197635d1fc1a2833c707ab462708cc0bf6fb165691c1375e14e3192f3806d3719325790459b39bd3425f5942d69a53019695f02c965214a5c9
diff --git a/net-im/discord-bin/discord-bin-0.0.17-r1.ebuild b/net-im/discord-bin/discord-bin-0.0.17-r1.ebuild
new file mode 100644
index 000000000000..a818701fa4ed
--- /dev/null
+++ b/net-im/discord-bin/discord-bin-0.0.17-r1.ebuild
@@ -0,0 +1,145 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="${PN/-bin}"
+MY_PV="${PV/-r*}"
+MY_BIN="${MY_PN^}"
+
+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
+ hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv
+ sw ta te th tr uk vi zh-CN zh-TW
+"
+
+inherit chromium-2 desktop linux-info optfeature pax-utils unpacker
+
+DESCRIPTION="All-in-one voice and text chat for gamers"
+HOMEPAGE="https://discordapp.com"
+SRC_URI="https://dl.discordapp.net/apps/linux/${MY_PV}/${MY_PN}-${MY_PV}.tar.gz"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="~amd64"
+
+# libXScrnSaver is used through dlopen (bug #825370)
+RDEPEND="
+ app-accessibility/at-spi2-atk:2
+ app-accessibility/at-spi2-core:2
+ dev-libs/atk
+ dev-libs/expat
+ dev-libs/glib:2
+ dev-libs/nspr
+ dev-libs/nss
+ media-libs/alsa-lib
+ media-libs/mesa[gbm(+)]
+ net-print/cups
+ sys-apps/dbus
+ sys-libs/glibc
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:3
+ x11-libs/libX11
+ x11-libs/libXScrnSaver
+ x11-libs/libXcomposite
+ x11-libs/libXdamage
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXrandr
+ x11-libs/libdrm
+ x11-libs/libxcb
+ x11-libs/libxkbcommon
+ x11-libs/libxshmfence
+ x11-libs/pango
+"
+
+RESTRICT="bindist mirror strip test"
+
+QA_PREBUILT="
+ ${DESTDIR}/${MY_BIN}
+ ${DESTDIR}/chrome-sandbox
+ ${DESTDIR}/libffmpeg.so
+ ${DESTDIR}/libvk_swiftshader.so
+ ${DESTDIR}/libvulkan.so
+ ${DESTDIR}/libEGL.so
+ ${DESTDIR}/libGLESv2.so
+ ${DESTDIR}/libVkICD_mock_icd.so
+ ${DESTDIR}/swiftshader/libEGL.so
+ ${DESTDIR}/swiftshader/libGLESv2.so
+ ${DESTDIR}/swiftshader/libvk_swiftshader.so
+"
+
+CONFIG_CHECK="~USER_NS"
+
+S="${WORKDIR}/${MY_BIN}"
+
+DESTDIR="/opt/${MY_BIN}"
+
+pkg_pretend() {
+ chromium_suid_sandbox_check_kernel_config
+}
+
+src_unpack() {
+ unpack ${MY_PN}-${MY_PV}.tar.gz || die
+}
+
+src_configure() {
+ chromium_suid_sandbox_check_kernel_config
+ default
+}
+
+src_prepare() {
+ default
+
+ rm postinst.sh
+
+ pushd "locales/" || die
+ chromium_remove_language_paks
+ popd
+
+ sed -i \
+ -e "s:/usr/share/discord/Discord:${DESTDIR}/${MY_BIN}:" \
+ ${MY_PN}.desktop || die
+}
+
+src_install() {
+ doicon -s 256 ${MY_PN}.png
+
+ # Install desktop file
+ domenu ${MY_PN}.desktop
+
+ exeinto ${DESTDIR}
+ doexe ${MY_BIN} chrome-sandbox libEGL.so libffmpeg.so libGLESv2.so libvk_swiftshader.so
+
+ insinto ${DESTDIR}
+ doins chrome_100_percent.pak chrome_200_percent.pak icudtl.dat resources.pak snapshot_blob.bin v8_context_snapshot.bin
+ insopts -m0755
+ doins -r locales resources swiftshader
+
+ # chrome-sandbox requires the setuid bit to be specifically set.
+ # See https://github.com/electron/electron/issues/17972
+ fperms 4755 ${DESTDIR}/chrome-sandbox || die
+
+ pax-mark m ${DESTDIR}/${MY_BIN} || die "could not set proper PAX permissions"
+
+ dosym ${DESTDIR}/${MY_BIN} /usr/bin/${MY_PN} || die
+
+ dodir ${DESTDIR}
+}
+
+pkg_postinst() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
+ xdg_mimeinfo_database_update
+
+ optfeature "sound support" \
+ media-sound/pulseaudio media-sound/apulse[sdk] media-video/pipewire
+ optfeature "system tray support" dev-libs/libappindicator
+}
+
+pkg_postrm() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
+ xdg_mimeinfo_database_update
+}