commit:     0fd290cc81eab1146dfd80f9798a576674d54c2d
Author:     Gino <onigino <AT> protonmail <DOT> com>
AuthorDate: Sun Sep  9 21:54:17 2018 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat Jan 19 05:08:30 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0fd290cc

net-im/discord-bin: rewrite ebuild

This rewrite offers better handling of electron files installed into
/opt

Closes: https://bugs.gentoo.org/660870
Closes: https://github.com/gentoo/gentoo/pull/9815
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 ...in-0.0.5.ebuild => discord-bin-0.0.5-r1.ebuild} | 35 +++++++++++-----------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/net-im/discord-bin/discord-bin-0.0.5.ebuild 
b/net-im/discord-bin/discord-bin-0.0.5-r1.ebuild
similarity index 64%
rename from net-im/discord-bin/discord-bin-0.0.5.ebuild
rename to net-im/discord-bin/discord-bin-0.0.5-r1.ebuild
index aebe7f5fee1..4f5af1205dc 100644
--- a/net-im/discord-bin/discord-bin-0.0.5.ebuild
+++ b/net-im/discord-bin/discord-bin-0.0.5-r1.ebuild
@@ -1,10 +1,11 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
 
 MY_PN=${PN/-bin/}
-inherit eutils gnome2-utils unpacker
+MY_BIN="D${MY_PN/d/}"
+inherit eutils gnome2-utils unpacker desktop xdg-utils
 
 DESCRIPTION="All-in-one voice and text chat for gamers"
 HOMEPAGE="https://discordapp.com";
@@ -50,9 +51,9 @@ S=${WORKDIR}
 RESTRICT="mirror bindist"
 
 QA_PREBUILT="
-       opt/discord/share/discord/Discord
-       opt/discord/share/discord/libnode.so
-       opt/discord/share/discord/libffmpeg.so
+       opt/discord/${MY_BIN}
+       opt/discord/libnode.so
+       opt/discord/libffmpeg.so
 "
 
 src_unpack() {
@@ -63,30 +64,28 @@ src_prepare() {
        default
 
        sed -i \
-               -e "s:/usr/share/discord/Discord:discord:g" \
+               -e "s:/usr/share/discord/Discord:/opt/${MY_PN}/${MY_BIN}:g" \
                usr/share/${MY_PN}/${MY_PN}.desktop || die
 }
 
 src_install() {
-       insinto /opt/${MY_PN}
-       doins -r usr/.
+       domenu opt/${MY_PN}/${MY_PN}.desktop
+       doicon opt/${MY_PN}/${MY_PN}.png
 
-       fperms +x /opt/${MY_PN}/bin/${MY_PN}
-       dosym ../../opt/${MY_PN}/bin/${MY_PN} /usr/bin/${MY_PN}
-       dosym ../../../opt/${MY_PN}/share/applications/${MY_PN}.desktop \
-               /usr/share/applications/${MY_PN}.desktop
-       dosym ../../../opt/${MY_PN}/share/pixmaps/${MY_PN}.png \
-               /usr/share/pixmaps/${MY_PN}.png
-}
-
-pkg_preinst() {
-       gnome2_icon_savelist
+       insinto /opt
+       doins -r usr/share/${MY_PN}
+       fperms +x /opt/${MY_PN}/${MY_BIN}
+       dosym ../../opt/${MY_PN}/${MY_BIN} usr/bin/${MY_PN}
 }
 
 pkg_postinst() {
+       xdg_desktop_database_update
+       xdg_mimeinfo_database_update
        gnome2_icon_cache_update
 }
 
 pkg_postrm() {
+       xdg_desktop_database_update
+       xdg_mimeinfo_database_update
        gnome2_icon_cache_update
 }

Reply via email to