Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 934941

Summary: x11-misc/xdg-utils-1.2.1-r2: wrong name for qtpaths binary on gentoo
Product: Gentoo Linux Reporter: Kris Scott <kris>
Component: Current packagesAssignee: Freedesktop bugs <freedesktop-bugs>
Status: IN_PROGRESS ---    
Severity: minor CC: chiitoo, ionen, kde, kris, qt
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 935416    

Description Kris Scott 2024-06-25 23:32:54 UTC
When using the "xdg-mime default" command, the script looks for the qtpaths binary if you're detected to be on KDE. On gentoo this file is named qtpaths5



Reproducible: Always

Steps to Reproduce:
Use xdg-mime to change default mimetypes

For example, I ran "xdg-mime default firefox-bin.desktop text/html"

Actual Results:  
Output: 

usr/bin/xdg-mime: line 902: qtpaths: command not found

Expected Results:  
the script should run without error.

I was in the air deciding if this should be a bug for qt-dev/qtpaths or for xdg-utils. I decided on xdg-utils because depending on how this is fixed, xdg-utils might need a dependency and USE flag added. 

The binary in question is called qtpaths at /usr/lib64/qt5/bin/qtpaths, but it's symlinked via qt5-build.eclass as /usr/bin/qtpaths5

dev-qt/qtpaths is not installed by the plasma desktop by default, so a dependency might need to be added, as it's not guaranteed to be available on all plasma systems.


This change was added in the following commit upstream, first appearing in the xdg-utils 1.2.1 release:

https://cgit.freedesktop.org/xdg/xdg-utils/commit/scripts/xdg-mime.in?h=v1.2.1&id=6f36849cc90f953a80bc4200073ab0c95937208e



Output of emerge --info:  https://paste.rs/WyRNZ
Comment 1 Kris Scott 2024-06-25 23:35:44 UTC
I just noticed I put the wrong package in the title. The package in question is 

x11-misc/xdg-utils-1.2.1-r2, not xdg-mime which does not exist.
Comment 2 Larry the Git Cow gentoo-dev 2024-07-03 22:35:39 UTC
The bug has been referenced in the following commit(s):

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

commit b779d4b7e4ae652539320473991663dffa366abf
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-07-03 22:34:19 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-07-03 22:35:29 +0000

    x11-misc/xdg-utils: fix qtpaths for KDE Plasma
    
    Pending questions:
    * Should qt6paths instead be in /usr/bin in Gentoo?
    * Why do we have a qtpaths6 as well as a qt6paths?
    
    But add this emergency fix for now given it may manifest in confusing
    and hard-to-diagnose ways.
    
    Bug: https://bugs.gentoo.org/934941
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/arch/hppa/package.use.mask                |   4 +
 profiles/arch/ia64/package.use.mask                |   4 +
 profiles/arch/powerpc/ppc32/package.use.mask       |   4 +
 profiles/arch/s390/package.use.mask                |   4 +
 profiles/arch/sparc/package.use.mask               |   4 +
 .../xdg-utils/files/xdg-utils-1.2.1-qtpaths.patch  |  21 ++++
 x11-misc/xdg-utils/xdg-utils-1.2.1-r3.ebuild       | 106 +++++++++++++++++++++
 7 files changed, 147 insertions(+)
Comment 3 Ionen Wolkens gentoo-dev 2024-07-04 00:49:26 UTC
Note that for Qt6 we haven't been arbitrarily deciding what should be in /usr/bin or not so far and simply following what Qt6 upstream tells us to do in [1]. There is currently 0 manual symlinks and the few like /usr/bin/qmake6 are from user_facing_tool_links.txt

And qt6paths? That sounds like an invention from another distro unless I'm missing something. qtpaths6 is what Qt uses in the private bin dir, albeit they haven't marked it USER_FACING and thus does not appear in user_facing_tool_links.txt (whether it should be or not, is another question).

[1] https://doc.qt.io/qt-6/packaging-recommendations.html
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-04 00:53:31 UTC
Ah, sorry, I think I transposed the two: qt6paths vs qtpaths6.
Comment 5 Ionen Wolkens gentoo-dev 2024-07-04 01:14:04 UTC
If we really needed it, not against doing a manual /usr/bin/qtpaths6 anyhow (but should ideally be changed upstream). Albeit pkg-config doesn't sound too bad if we don't want to invent anything.

<asturm> what I don't get is why we both have /usr/lib64/qt6/bin/qtpaths6 and /usr/lib64/qt6/bin/qtpaths
^ don't really know but it's a hard link and that's just how the build system does it (not from us), they do it for qmake{,6} too -- maybe(?) qtpaths is actually meant to be USER_FACING like qmake6 but it just been an upstream oversight
Comment 6 Ionen Wolkens gentoo-dev 2024-07-04 01:29:38 UTC
(In reply to Ionen Wolkens from comment #5)
> maybe(?) qtpaths6 is actually meant to be USER_FACING like qmake6
> but it just been an upstream oversight
To be more precise, what would need changing in qtbase is:

--- a/src/tools/qtpaths/CMakeLists.txt
+++ b/src/tools/qtpaths/CMakeLists.txt
@@ -12,2 +12,3 @@
     TOOLS_TARGET Core
+    USER_FACING
     INSTALL_VERSIONED_LINK

And then the ebuild would create the /usr/bin/qtpaths6 symlink automatically.
Comment 7 Chiitoo gentoo-dev 2024-07-04 09:06:54 UTC
(In reply to Ionen Wolkens from comment #5)
> maybe(?)
> qtpaths is actually meant to be USER_FACING like qmake6 but it just been an
> upstream oversight

Comment at #qt-labs says "likely yes but would need to look into git history if there is any reason why it wasn't".