Bug 485133 - Package xdg-tools 1.2.x requires qtpaths for xdg-mime
Summary: Package xdg-tools 1.2.x requires qtpaths for xdg-mime
Status: CONFIRMED
Alias: None
Product: neon
Classification: KDE Neon
Component: Packages User Edition (other bugs)
Version First Reported In: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Neon Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-06 13:53 UTC by Malte S. Stretz
Modified: 2024-09-06 18:51 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Patch against xdg-mime (642 bytes, text/plain)
2024-04-07 14:15 UTC, Malte S. Stretz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Malte S. Stretz 2024-04-06 13:53:08 UTC
SUMMARY
I just installed some odd 3rd party application and the installation script showed these errors at the end:

Use of uninitialized value $deepLink in substitution (s///) at ./install.pl line 1087, <STDIN> line 5.
/usr/bin/xdg-mime: 856: qtpaths: not found
Use of uninitialized value $deepLink in concatenation (.) or string at ./install.pl line 1001.

I think this is a bug in xdg-mime to require that application but for now it looks like it is the way it is and qtchooser and qt6-base-dev-tools have to be installed for xdg-tools 1.2.1 to work properly on KDE 5 and later.

# sed -n -e '850,860p' $(which xdg-mime)
    #
    # [Removed Associations]
    # text/plain=gnome-gedit.desktop;gnu-emacs.desktop;
    vendor="$1"
    mimetype="$2"
    if [ "${KDE_SESSION_VERSION:-0}" -gt 4 ] ; then
        default_dir="$(qtpaths --writable-path ConfigLocation)"
        default_file="$default_dir/mimeapps.list"
    elif [ x"$KDE_SESSION_VERSION" = x"4" ]; then
        default_dir="$(kde4-config --path xdgdata-apps 2> /dev/null | cut -d ':' -f 1)"
        default_file="$default_dir/mimeapps.list"

STEPS TO REPRODUCE
1. Make sure neither qttools5-dev-tools nor qt6-base-dev-tools are installed
2. Download the installer tarball from https://foto.budni.de/bestellsoftware.html?keyAccount=1773&product=391
3a. Execute the contained install.pl
3b. Or grep for the call to xdg-mime to see how it is called and execute it manually

OBSERVED RESULT
Error message as stated above, properly part of the software is not installed correctly

EXPECTED RESULT
No error

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.0
KDE Plasma Version: 6.0.3
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.3
Kernel Version: 6.5.0-26-generic (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-6300U CPU @ 2.40GHz
Memory: 7,6 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 520
Manufacturer: LENOVO
Product Name: 20F5S1H800
System Version: ThinkPad X260

ADDITIONAL INFORMATION
Package: xdg-utils
Version: 1.2.1-0xneon+22.04+jammy+release+build5
Priority: optional
Section: utils
Maintainer: Neon CI <neon@kde.org>
Installed-Size: 350 kB
Recommends: libfile-mimeinfo-perl, libnet-dbus-perl, libx11-protocol-perl, x11-utils, x11-xserver-utils
Homepage: https://www.freedesktop.org/wiki/Software/xdg-utils/
Download-Size: 69,7 kB
APT-Manual-Installed: no
APT-Sources: http://archive.neon.kde.org/user jammy/main amd64 Packages
Description: desktop integration utilities from freedesktop.org
Comment 1 Malte S. Stretz 2024-04-06 14:54:53 UTC
Looks like the qtpaths dependency was introduced only recently (October last year): https://gitlab.freedesktop.org/xdg/xdg-utils/-/merge_requests/47#note_2108717
Comment 2 Malte S. Stretz 2024-04-06 15:30:17 UTC
Looks like this was introduced with v1.2.0:

# git tag --contains 6f36849cc90f953a80bc4200073ab0c95937208e
v1.2.0
v1.2.1
Comment 3 Malte S. Stretz 2024-04-06 15:40:08 UTC
Should maybe qtpaths moved to qt6-base? Looks like a useful utility and qt6-base already contains qmake which I'd also expect in qt6-base-dev-tools. qt6-base should probably depend on qtchooser then.
Comment 4 Malte S. Stretz 2024-04-07 14:15:42 UTC
Created attachment 168254 [details]
Patch against xdg-mime

I didn't bother yet to create a fdo Gitlab user but looks like the fix was quite overkill and no call to qtpaths is required at all: That call just returns the typical value for XDG_CONFIG_HOME (cf. https://github.com/qt/qtbase/blob/dev/src/corelib/io/qstandardpaths_unix.cpp#L237) ie. according to that change did Plasma 5 and later move to the default generic location of the mimapps.list file.

I might post the attached patch to the project but maybe somebody with an existing account can posu it upstream.