From be74aecf73199fb5ac6904c1f865dc5ff8b24d70 Mon Sep 17 00:00:00 2001 From: Torsten Kurbad Date: Wed, 31 Jul 2024 16:56:09 +0200 Subject: [PATCH] Discord update --- net-im/discord/Manifest | 2 + net-im/discord/discord-0.0.62.ebuild | 147 +++++++++++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 net-im/discord/discord-0.0.62.ebuild diff --git a/net-im/discord/Manifest b/net-im/discord/Manifest index 973f3d6..d5f00b3 100644 --- a/net-im/discord/Manifest +++ b/net-im/discord/Manifest @@ -1,3 +1,5 @@ DIST discord-0.0.61.tar.gz 103547728 BLAKE2B 8b8e37e0a5940a3a2dce93cdcafe4e3866ccb96e22c6f7bf994890704f3e5ee455eefcb647f73e4f4495e8627e8a97e50690fe66b8cd4243ad6d9e39c01b7837 SHA512 2b7955e93f2352a244ab0838c24399b556174179eb3aa7ef8ed32d914f7ab1e49165cf8ab374b15c90bddd8ec8150146d2ebcc94c7e1aa8c914c56d4b6a03d29 +DIST discord-0.0.62.tar.gz 103553356 BLAKE2B cb319ee0ce9a3a1d9d8acf4810ab36f9ed4f93b1a82a15deb6ca05d50ad612a90d94f234eb38183e925444afa4f5035cd6bc0acbf3abaca3dec79f5f757e004c SHA512 6271382410340c0f38c4403af766fe18ea7548279f3bc75ebe748a75281c304d7738e2d857e208b8867a2330b2a9e22d292ad63421578db35b79e4d16267456f EBUILD discord-0.0.61.ebuild 3517 BLAKE2B 376f475de1231064440fa4508621101f2668319cc0d1b91592bfed39e5673994fc2c7a6fbd4e8df88e301d17ca6975e75cb2a5ecc0db591ad608235ad29769c1 SHA512 2e7678d3c65b235ec6d955e13af6b73447a1e32cd79592bcca1948ab232cb5f6f270cc6cc61c8f356f9c32ad539d9920f613d2df749590fd9498a1195532e751 +EBUILD discord-0.0.62.ebuild 3953 BLAKE2B 5108ee5a095f59114ad00d853f9d146ef0919aa802be7a84c3d61f134021e942c8abf699dbd066c82b310992629a80fd2764dc326b37fd0c6ad879ddfe8e5c9d SHA512 7d9a6560cf066d77301a87d83bcf54619f0291eabdd831911a7ead97eb5b4cecbc5db4b5f0adacbdba244c3c7ebdce4fb3fbc319964ca6c7b251e38697f1d92c MISC metadata.xml 506 BLAKE2B ff098a1c9341a94ebb21da57c3028d3d96e884e19e3adf2df8d50b694a1ca3eee61f5dfd90eaa557a0a0eee769fd11dfa7bbf63308386a11faa56d13687e33c3 SHA512 56baf0a5323057b4af83a7b7d760b2b1e071e15ca4eef6546eab4104fbdd026906f68d8023a3155f492d8d93cd7022c5d0017372cbaf2894b94bd253b2ce3665 diff --git a/net-im/discord/discord-0.0.62.ebuild b/net-im/discord/discord-0.0.62.ebuild new file mode 100644 index 0000000..9c133ac --- /dev/null +++ b/net-im/discord/discord-0.0.62.ebuild @@ -0,0 +1,147 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_PN="${PN/-bin/}" +MY_PV="${PV/-r*/}" + +CHROMIUM_LANGS=" + af 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 ur vi zh-CN zh-TW +" + +inherit chromium-2 desktop linux-info optfeature unpacker xdg + +DESCRIPTION="All-in-one voice and text chat for gamers" +HOMEPAGE="https://discord.com/" +SRC_URI="https://dl.discordapp.net/apps/linux/${MY_PV}/${MY_PN}-${MY_PV}.tar.gz" +S="${WORKDIR}/${MY_PN^}" + +LICENSE="all-rights-reserved" +SLOT="0" +KEYWORDS="amd64" + +IUSE="appindicator +seccomp wayland" +RESTRICT="bindist mirror strip test" + +RDEPEND=" + >=app-accessibility/at-spi2-core-2.46.0:2 + 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 + x11-libs/libXScrnSaver + x11-libs/libXcomposite + x11-libs/libXdamage + x11-libs/libXext + x11-libs/libXfixes + x11-libs/libXrandr + x11-libs/libxcb + x11-libs/libxkbcommon + x11-libs/libxshmfence + x11-libs/pango + appindicator? ( dev-libs/libayatana-appindicator ) +" + +DESTDIR="/opt/${MY_PN}" + +QA_PREBUILT="*" + +CONFIG_CHECK="~USER_NS" + +src_unpack() { + unpack ${MY_PN}-${MY_PV}.tar.gz +} + +src_configure() { + default + chromium_suid_sandbox_check_kernel_config +} + +src_prepare() { + default + # remove post-install script + rm postinst.sh || die "the removal of the unneeded post-install script failed" + # cleanup languages + 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 --in-place --expression "/^Exec=/s:/usr/share/discord/Discord:/usr/bin/${MY_PN}:" \ + "${MY_PN}.desktop" || + die "fixing of exec location on .desktop failed" + + # 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 '/^EBUILD_SECCOMP=/s/false/true/' \ + "${T}/launcher.sh" || die "sed failed for seccomp" + fi + + # USE wayland in launcher + if use wayland; then + sed --in-place --expression '/^EBUILD_WAYLAND=/s/false/true/' \ + "${T}/launcher.sh" || die "sed failed for wayland" + fi +} + +src_install() { + doicon -s 256 "${MY_PN}.png" + + # install .desktop file + domenu "${MY_PN}.desktop" + + exeinto "${DESTDIR}" + + doexe "${MY_PN^}" 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 + + # Chrome-sandbox requires the setuid bit to be specifically set. + # see https://github.com/electron/electron/issues/17972 + fowners root "${DESTDIR}/chrome-sandbox" + fperms 4711 "${DESTDIR}/chrome-sandbox" + + # Crashpad is included in the package once in a while and when it does, it must be installed. + # See #903616 and #890595 + [[ -x chrome_crashpad_handler ]] && doins chrome_crashpad_handler + + exeinto "/usr/bin" + newexe "${T}/launcher.sh" "discord" || die "failing to install launcher" + + # https://bugs.gentoo.org/898912 + if use appindicator; then + dosym ../../usr/lib64/libayatana-appindicator3.so /opt/discord/libappindicator3.so + fi +} + +pkg_postinst() { + xdg_pkg_postinst + + optfeature_header "Install the following packages for additional support:" + optfeature "sound support" \ + media-sound/pulseaudio media-sound/apulse[sdk] media-video/pipewire + optfeature "emoji support" media-fonts/noto-emoji +}