commit: 6dc892886363fad983c305e2ccc1bd84d55ce62a
Author: Petr Vaněk <arkamar <AT> atlas <DOT> cz>
AuthorDate: Wed Jun 8 07:01:26 2022 +0000
Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Thu Jun 9 07:37:55 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6dc89288
www-client/surf: add xdg desktop entry
This commit basically copies changes from live ebuild introduced in
commit f57556a029ef ("www-client/surf: add xdg desktop entry"), however
double quotes around newicon creation are changed to my liking and
Desktop Entry Exec key is extended with %u (a single url) argument as it
was suggested in [1].
[1] https://bugs.gentoo.org/849575#c0
Closes: https://bugs.gentoo.org/849575
Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
.../surf/{surf-2.1.ebuild => surf-2.1-r1.ebuild} | 28 +++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/www-client/surf/surf-2.1.ebuild
b/www-client/surf/surf-2.1-r1.ebuild
similarity index 68%
rename from www-client/surf/surf-2.1.ebuild
rename to www-client/surf/surf-2.1-r1.ebuild
index 7422e29cff76..8b3a6d1ad9fc 100644
--- a/www-client/surf/surf-2.1.ebuild
+++ b/www-client/surf/surf-2.1-r1.ebuild
@@ -1,10 +1,11 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-inherit savedconfig toolchain-funcs
-DESCRIPTION="a simple web browser based on WebKit/GTK+"
+inherit desktop savedconfig toolchain-funcs xdg
+
+DESCRIPTION="A simple web browser based on WebKit/GTK+"
HOMEPAGE="https://surf.suckless.org/"
if [[ ${PV} == "9999" ]] ; then
@@ -73,4 +74,25 @@ src_install() {
fi
save_config config.h
+
+ newicon "${S}/${PN}.png" "${PN}.png"
+
+ local mime_types="text/html;text/xml;application/xhtml+xml;"
+ mime_types+="x-scheme-handler/http;x-scheme-handler/https;"
+ make_desktop_entry \
+ "surf %u" \
+ "Surf" \
+ "surf" \
+ "Network;WebBrowser" \
+ "MimeType=${mime_types}\nStartupWMClass=surf"
+}
+
+pkg_postinst() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
+}
+
+pkg_postrm() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
}