Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
howto add xdg desktop file to an ebuild.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4787
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Sat Sep 16, 2017 2:12 pm    Post subject: howto add xdg desktop file to an ebuild. Reply with quote

I've write this working personal ebuild for OpenBoard, but I'm not able to add desktop files to it.

inside the source code, I find this code in ./release_scripts/linux/package.sh:

Code:

xdg-desktop-menu install --novendor /usr/share/applications/${APPLICATION_CODE}.desktop
xdg-mime install --mode system /$APPLICATION_PATH/$APPLICATION_CODE/etc/openboard-ubz.xml
xdg-mime default /usr/share/applications/${APPLICATION_CODE}.desktop application/ubz


where should I add these instructions in my ebuild?
is there a way to apply some eclass resource to make all the work?
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Sat Sep 16, 2017 2:25 pm    Post subject: Reply with quote

Search for make_desktop_entry in
And for a misplaced one, see this commit.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30822
Location: here

PostPosted: Sat Sep 16, 2017 2:33 pm    Post subject: Reply with quote

Desktop file already exists in package? if yes you can just move the file in correct path
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4787
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Mon Sep 18, 2017 4:41 am    Post subject: Reply with quote

thank you.
at the end I solved to use make_desktop_entry to make the desktop file (it doesn't exist in the original package) and xdg.eclass to update mime database.

I'm not find a way to emulate the command xdg-mime default /usr/share/applications/${APPLICATION_CODE}.desktop application/ubz (suggested in the source code for the ubuntu package).
I think it should be needed to pair the application/ubz mime type to the new desktop file.

however, from man:
man xdg-mime wrote:
The default option is for use inside a desktop session only. It is not recommended to use xdg-mime default as root.

indeed, using strace, you can observe that the xdg-mime default command opens the /root/.config/mimeapps.list, which is unuseful to perfrom any action at system level and does not touch anything in /usr/share/mime/.

is there a way to set a particular desktop file as default for some mimetype on the whole system?
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Mon Sep 18, 2017 5:32 am    Post subject: Reply with quote

cloc3 wrote:
I'm not find a way to emulate the command xdg-mime default /usr/share/applications/${APPLICATION_CODE}.desktop application/ubz (suggested in the source code for the ubuntu package).

You might want to compare with the example in https://wiki.gentoo.org/wiki/Firefox#XDG_integration. See the difference?
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4787
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Mon Sep 18, 2017 11:40 am    Post subject: Reply with quote

charles17 wrote:
cloc3 wrote:
I'm not find a way to emulate the command xdg-mime default /usr/share/applications/${APPLICATION_CODE}.desktop application/ubz (suggested in the source code for the ubuntu package).

You might want to compare with the example in https://wiki.gentoo.org/wiki/Firefox#XDG_integration. See the difference?

yes.
but the command in the wiki is sent by user.
I want to set the same think in the ebuild for all users in my system.

in my opinion (based on man), xdg-mime cannot be used in such a way.
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
ttrindade
n00b
n00b


Joined: 26 Dec 2009
Posts: 16
Location: Brazil

PostPosted: Wed Oct 23, 2019 3:11 am    Post subject: Reply with quote

Hello cloc3,

I want more informatation of OpenBoard.ebuild, do you updated it? A am trying to run a version 1.5, but a I had several issues with qt, for example, QtWebKit does not is in the package dependecy of your ebuild. I started to build a qt enviorment for OpenBoard 1.5, if you alreay had a ebuild for this version, can you upgrade it on github?

thank you, and sorry by my bad english.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum