ham

portage overlay
git clone git://git.seahorse.sh/ham.git
Log | Files | Refs | LICENSE

discord-canary-bin-0.0.136.ebuild (2856B)


      1 # Copyright 1999-2022 Gentoo Authors
      2 # Distributed under the terms of the GNU General Public License v2
      3 
      4 EAPI=8
      5 
      6 MY_PN="${PN/-bin}"
      7 MY_PV="${PV/-r*}"
      8 
      9 CHROMIUM_LANGS="
     10     am ar bg bn ca cs da de el en-GB en-US es es-419 et fa fi fil fr gu he hi
     11     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
     12     sw ta te th tr uk vi zh-CN zh-TW
     13 "
     14 
     15 inherit chromium-2 desktop linux-info unpacker xdg
     16 
     17 DESCRIPTION="All-in-one voice and text chat"
     18 HOMEPAGE="https://discord.com/"
     19 SRC_URI="https://dl-canary.discordapp.net/apps/linux/${PV}/${MY_PN}-${PV}.tar.gz"
     20 
     21 LICENSE="all-rights-reserved"
     22 SLOT="0"
     23 KEYWORDS="~amd64"
     24 
     25 RDEPEND="
     26     app-accessibility/at-spi2-atk:2
     27     app-accessibility/at-spi2-core:2
     28     dev-libs/atk
     29     dev-libs/expat
     30     dev-libs/glib:2
     31     dev-libs/nspr
     32     dev-libs/nss
     33     media-libs/alsa-lib
     34     media-libs/mesa[gbm(+)]
     35     net-print/cups
     36     sys-apps/dbus
     37     sys-libs/glibc
     38     x11-libs/cairo
     39     x11-libs/gdk-pixbuf:2
     40     x11-libs/gtk+:3
     41     x11-libs/libX11
     42     x11-libs/libXScrnSaver
     43     x11-libs/libxkbcommon
     44     x11-libs/libxcb
     45     x11-libs/libXcomposite
     46     x11-libs/libXdamage
     47     x11-libs/libXext
     48     x11-libs/libXfixes
     49     x11-libs/libXrandr
     50     x11-libs/libdrm
     51     x11-libs/libxshmfence
     52     x11-libs/pango
     53 "
     54 
     55 RESTRICT="bindist mirror strip test"
     56 
     57 DESTDIR="/opt/${MY_PN}"
     58 
     59 QA_PREBUILT="
     60     ${DESTDIR#/}/DiscordCanary
     61     ${DESTDIR#/}/chrome-sandbox
     62     ${DESTDIR#/}/libffmpeg.so
     63     ${DESTDIR#/}/libvk_swiftshader.so
     64     ${DESTDIR#/}/libEGL.so
     65     ${DESTDIR#/}/libGLESv2.so
     66     ${DESTDIR#/}/swiftshader/libEGL.so
     67     ${DESTDIR#/}/swiftshader/libGLESv2.so
     68 "
     69 
     70 CONFIG_CHECK="~USER_NS"
     71 
     72 S="${WORKDIR}/DiscordCanary"
     73 
     74 pkg_pretend() {
     75     chromium_suid_sandbox_check_kernel_config
     76 }
     77 
     78 src_unpack() {
     79     unpack ${MY_PN}-${MY_PV}.tar.gz
     80 }
     81 
     82 src_configure() {
     83     chromium_suid_sandbox_check_kernel_config
     84 
     85     default
     86 }
     87 
     88 src_prepare() {
     89     default
     90 
     91     rm postinst.sh || die "the removal of the unneeded post-install script failed"
     92     pushd "locales/" || die "location change for language cleanup failed"
     93     chromium_remove_language_paks
     94     popd || die "location reset for language cleanup failed"
     95     sed -i -e "s:/usr/share/${MY_PN}/DiscordCanary:${DESTDIR}/DiscordCanary:g" ${MY_PN}.desktop || die "fixing of exec location on .desktop failed"
     96 }
     97 
     98 src_install() {
     99     doicon -s 256 ${MY_PN/-canary}.png
    100     domenu ${MY_PN}.desktop
    101 
    102     exeinto "${DESTDIR}"
    103     doexe DiscordCanary chrome-sandbox libEGL.so libffmpeg.so libGLESv2.so libvk_swiftshader.so
    104 
    105     insinto "${DESTDIR}"
    106     doins chrome_100_percent.pak chrome_200_percent.pak icudtl.dat resources.pak snapshot_blob.bin v8_context_snapshot.bin
    107     insopts -m0755
    108     doins -r locales resources swiftshader
    109 
    110     fperms 4755 "${DESTDIR}"/chrome-sandbox
    111 
    112     dosym "${DESTDIR}"/DiscordCanary /usr/bin/${MY_PN}
    113 }
    114 
    115 pkg_postinst() {
    116     xdg_pkg_postinst
    117 }