Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 660870 - net-im/discord-bin-0.0.5: improve src_install
Summary: net-im/discord-bin-0.0.5: improve src_install
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Johannes Huber (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-10 20:22 UTC by Gino McCarty
Modified: 2019-01-19 05:43 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
discord-bin-0.0.5.ebuild rewrite (discord-bin-0.0.5.ebuild,1.72 KB, text/plain)
2018-07-10 20:22 UTC, Gino McCarty
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gino McCarty 2018-07-10 20:22:46 UTC
Created attachment 539084 [details]
discord-bin-0.0.5.ebuild rewrite

Hello,

the way net-im/discord-bin ebuild installs files is weird and different from every other electron packages in the tree,

here is a rewrite of your ebuild to bring it in line and cleanup the /opt/discord directory structure

also fixed /usr/share/lintian for those who care about that..

see below for other apps that use the same electron base
net-im/signal-desktop-bin
net-im/slack-bin



================================================================
--- /usr/portage/net-im/discord-bin/discord-bin-0.0.5.ebuild	2018-05-03 15:47:52.992011193 -0700
+++ /usr/local/portage/net-im/discord-bin/discord-bin-0.0.5.ebuild	2018-07-06 17:50:10.580865051 -0700
@@ -4,6 +4,7 @@
 EAPI=6
 
 MY_PN=${PN/-bin/}
+MY_BIN="D${MY_PN/d/}"
 inherit eutils gnome2-utils unpacker
 
 DESCRIPTION="All-in-one voice and text chat for gamers"
@@ -50,9 +51,9 @@
 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,20 +64,20 @@
 	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/.
-
-	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
+	insinto /usr/share
+	dodoc -r usr/share/doc/${MY_PN}/.
+	doins -r usr/share/lintian
+	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}
+	dosym /opt/${MY_PN}/${MY_PN}.desktop /usr/share/applications/${MY_PN}.desktop
+	dosym /opt/${MY_PN}/${MY_PN}.png /usr/share/pixmaps/${MY_PN}.png
 }
 
 pkg_preinst() {
=========================================================================
Comment 1 Johannes Huber (RETIRED) gentoo-dev 2018-07-10 20:45:04 UTC
Could you please create a pull request for this? (0.0.5-r1)
Comment 2 Gino McCarty 2018-09-09 22:16:16 UTC
Here is the PR
https://github.com/gentoo/gentoo/pull/9815
Comment 3 Larry the Git Cow gentoo-dev 2019-01-19 05:43:05 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0fd290cc81eab1146dfd80f9798a576674d54c2d

commit 0fd290cc81eab1146dfd80f9798a576674d54c2d
Author:     Gino <onigino@protonmail.com>
AuthorDate: 2018-09-09 21:54:17 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2019-01-19 05:08:30 +0000

    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@gentoo.org>

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