summaryrefslogtreecommitdiff
path: root/x11-misc/xdg-utils
diff options
context:
space:
mode:
Diffstat (limited to 'x11-misc/xdg-utils')
-rw-r--r--x11-misc/xdg-utils/Manifest9
-rw-r--r--x11-misc/xdg-utils/files/xdg-utils-1.2.1-qtpaths.patch21
-rw-r--r--x11-misc/xdg-utils/files/xdg-utils-1.2.1-xdg-mime-default.patch143
-rw-r--r--x11-misc/xdg-utils/files/xdg-utils-egrep.patch25
-rw-r--r--x11-misc/xdg-utils/xdg-utils-1.2.1-r1.ebuild2
-rw-r--r--x11-misc/xdg-utils/xdg-utils-1.2.1-r6.ebuild (renamed from x11-misc/xdg-utils/xdg-utils-1.1.3_p20210805-r2.ebuild)67
6 files changed, 213 insertions, 54 deletions
diff --git a/x11-misc/xdg-utils/Manifest b/x11-misc/xdg-utils/Manifest
index c7bd64496e3d..b7cb6d6df628 100644
--- a/x11-misc/xdg-utils/Manifest
+++ b/x11-misc/xdg-utils/Manifest
@@ -1,7 +1,6 @@
-AUX xdg-utils-egrep.patch 760 BLAKE2B 641a75615aa54000acee26ad65e802245c12db388f372b1f7cfe4df29c025a8eb5e4523ef89a6e209e00c7ec0288c799f16a5d4ac04fa25da3375d2d128b1de2 SHA512 80976c70974c670432a48ab467ca68126f699816914b806a65f48b234c631cc470b7399b389a15a6181a0fbbf486692d0583f791c0592bdc70186df319075ac6
-DIST xdg-utils-1.1.3_p20200220-no-which.patch.xz 5576 BLAKE2B cf8c3111689c355add2a0c16a887fd463dc2d00c267cac0561d4598430f043d19fea376859aa4ff521273ff788b4e8afdea5ef6e7b0ba51ffded23be2ad61335 SHA512 c30e512e8caae3f4d2282592722bc24e08cb33f5ec01d5504d2e49833c1598fe27807c095dc2226efca57dcbef4d2883fd9bfa46fb8eeee93c53f9880c050b51
-DIST xdg-utils-1.1.3_p20210805.tar.bz2 287544 BLAKE2B ec3755e5e6f596c5787324ab254ba14938f35dda6df5a4ef88fb582c5df7704e706dee2f4362cc0597164cf2aeab5cf8f5f6db1b9d374355723e3d738e101264 SHA512 ec51e98e4c73ad7cb3c77051617a939c7956c7da6bcbbcda4e54121af247ce6978c8638c80bc644a49cfca14b18f06cb25747719bc20c97f7e60b9b4f3597a71
+AUX xdg-utils-1.2.1-qtpaths.patch 992 BLAKE2B 086d018f214d58cda79011310f382b032e58888e43b9e0ad2619f4aec04c4d5cd8b913c244ca549d1c90b7c57aab225b28a67c5cf6bfed7b8087be4437ff461b SHA512 9a7942e38ecad2bdbebdd558557647648c21bfec132f72bb7c3f2ae737345fb1e552e7fa6a118223da663ae4e3ac4d9776ec3f46f031ad2499141ab83db5c99a
+AUX xdg-utils-1.2.1-xdg-mime-default.patch 5034 BLAKE2B 0eb35b1abd650e442c50cfd52d8801e4fbb36813aeac67b4dcd8d1d39eba08ca02f4bf2189242b848da481ba57ebe96ad849bde8ce52ff73b015fb3be5610d93 SHA512 0e57d5cf9fa9969738c1d836c4c3b644cc6e1e80cd7486ec5ca0fdb2c86f0f5e3988c4790faf1838ad09946803347a96c0fd47373c5971c691c20d4913845ad1
DIST xdg-utils-v1.2.1.tar.bz2 293386 BLAKE2B 9d6ce4be8c27ad5b8d0ae55ad0d8b4457b59cb1bd260884ca5bfd2cb8ed7ed68a2f5a8db6d660ceabab59cbb9880fd4f1a26cb71a8f759ec40c2f9f95bbc8a05 SHA512 d5436449fec2f4db952239ee910bfda203955c8df8cb92379f182dc36f9c82b6ceb092ccbebfd02ed00eb7ef5f6895ef745baca67906ae7490e425db27b1dbfc
-EBUILD xdg-utils-1.1.3_p20210805-r2.ebuild 2424 BLAKE2B 44c105b594dcff348860cfdb915e1b18bfc028a9bc8a0a5c8ae33f7d9e67b6bca2b15360b908a921fc1e9629569152f6adbe81ff335f07d558b8d60b3029c7c6 SHA512 c944a53cc3a5f2c81f8e33bf39aea958ae95398f862f30a21636a1729b8bd196c0d7d4766ea25a501189edbb25fc194c75f4e62913faab8cb5d4862bb77bc865
-EBUILD xdg-utils-1.2.1-r1.ebuild 2291 BLAKE2B b475167f8817c813c3bd844d3fd8d718fcfe96b8728a776e175494850ce42c522bade72c01b18407a594bf1b8698706b14445f8cf2419fb9a0ddea06aaeb67cc SHA512 c60238c0eff9b66984548046d26ef28bbccbdcd88adbce6138021f40b5880f5761fd99e464155e526e1a1e32d2e0057090d59a0db0aaf9597145ce829db5634c
+EBUILD xdg-utils-1.2.1-r1.ebuild 2285 BLAKE2B 6a79cd47dc1f2d7a1691bc28b3b883c6efef384618f012a4f1cacb66104603a61eadac9c24abae10010cfc5ced1b9ba49e062b534c77960355c4d6fd7beeff7c SHA512 fcd8973d05b92ef817a6df662194e1aad96bbdbd3818167628d6db67b8265f22cda161f64f68b1e7c93ef5ff41809240f6ec96613d97d005ec02aeaddcd0cefa
+EBUILD xdg-utils-1.2.1-r6.ebuild 2581 BLAKE2B 4ea0ac32b7fca21676bfca8d736854f0142525c57277a2b492f4b864999439616b6f47f7755583c707d8873f0c0272fa789759f5314b60e6c52cb0eca0d820d4 SHA512 e84ba1e3e68c8fd173cf0e6ba139c856920a1a898940a6d2c2efcf6bd1293b196c8973b899eb784dc8761369f819bad8007199e1c3e4cec36547094567ff3752
MISC metadata.xml 319 BLAKE2B 4910953400fa3f3b0b72b8baba239a1e0c3466c38f84b6a60bc816620b789473179c151b1af68d0629ba7f79a1ea826b536f0f29678007bba025714ceb514061 SHA512 c07b03f20aeedd0ceaf7de137b76578142c703317d98ac7a57ae5143cab7523974a50aafa58e92c541d4a84ec0961b7de180d11d95c7da45f5698e3c19e7182d
diff --git a/x11-misc/xdg-utils/files/xdg-utils-1.2.1-qtpaths.patch b/x11-misc/xdg-utils/files/xdg-utils-1.2.1-qtpaths.patch
new file mode 100644
index 000000000000..67a84e9c4a9b
--- /dev/null
+++ b/x11-misc/xdg-utils/files/xdg-utils-1.2.1-qtpaths.patch
@@ -0,0 +1,21 @@
+Workaround for https://bugs.gentoo.org/934941.
+
+Pending questions:
+* Should qt6paths instead be in /usr/bin in Gentoo?
+* Why do we have a qtpaths6 as well as a qt6paths?
+--- a/scripts/xdg-mime.in
++++ b/scripts/xdg-mime.in
+@@ -166,8 +166,11 @@ make_default_kde()
+ # 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)"
++ if [ "${KDE_SESSION_VERSION:-0}" -gt 5 ] ; then
++ default_dir="$($(pkg-config --variable=bindir Qt6Core)/qtpaths6 --writable-path ConfigLocation)"
++ default_file="$default_dir/mimeapps.list"
++ elif [ x"$KDE_SESSION_VERSION" = x"5" ] ; then
++ default_dir="$(qtpaths5 --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)"
diff --git a/x11-misc/xdg-utils/files/xdg-utils-1.2.1-xdg-mime-default.patch b/x11-misc/xdg-utils/files/xdg-utils-1.2.1-xdg-mime-default.patch
new file mode 100644
index 000000000000..8efcdca1cfef
--- /dev/null
+++ b/x11-misc/xdg-utils/files/xdg-utils-1.2.1-xdg-mime-default.patch
@@ -0,0 +1,143 @@
+https://gitlab.freedesktop.org/xdg/xdg-utils/-/issues/252
+https://gitlab.freedesktop.org/xdg/xdg-utils/-/commit/f113a8b997dcb9527b9694d31bddcfa05096aecf
+
+From f113a8b997dcb9527b9694d31bddcfa05096aecf Mon Sep 17 00:00:00 2001
+From: Slatian <baschdel@disroot.org>
+Date: Tue, 21 May 2024 04:08:23 +0000
+Subject: [PATCH] Make the desktop_file_to_binary function less likely to fall
+ over and do something unexpected.
+
+* Uses a shell implementation ( !24) of `which` in the `desktop_file_to_binary` to avoid tripping over unexpected output from `command -v`
+* In addition it also makes the parsing a bit more standards compliant than it previously was.
+* Adds a developer script to easier test internal functions in the xdg-utils-common.in file
+
+Fixes: #252
+---
+ scripts/test-common-function | 13 ++++++++
+ scripts/xdg-utils-common.in | 64 +++++++++++++++++++++++++++++++-----
+ 2 files changed, 68 insertions(+), 9 deletions(-)
+ create mode 100755 scripts/test-common-function
+
+diff --git a/scripts/test-common-function b/scripts/test-common-function
+new file mode 100755
+index 0000000..c8af98d
+--- /dev/null
++++ b/scripts/test-common-function
+@@ -0,0 +1,13 @@
++#!/bin/sh
++
++# This script is for testing internal functions of the xdg-utils-common.in file
++#
++# Example ./test-common-function xdg_which echo
++
++XDG_UTILS_DEBUG_LEVEL="${XDG_UTILS_DEBUG_LEVEL:-99}"
++
++. ./xdg-utils-common.in
++
++"$@"
++
++exit $?
+diff --git a/scripts/xdg-utils-common.in b/scripts/xdg-utils-common.in
+index f0a1aac..adab368 100644
+--- a/scripts/xdg-utils-common.in
++++ b/scripts/xdg-utils-common.in
+@@ -51,19 +51,24 @@ binary_to_desktop_file()
+ }
+
+ #-------------------------------------------------------------
+-# map a .desktop file to a binary
++# map a .desktop file name to its Exec binary
++# Returns the realpath resolved path to the binary or noting.
++
++# desktop_file_to_binary <desktop-file-name>
+ desktop_file_to_binary()
+ {
++ DEBUG 1 "desktop_file_to_binary '$1'"
+ search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
+ desktop="$(basename "$1")"
+ IFS=:
+ for dir in $search; do
++ DEBUG 2 "Searching in '$dir/{applications,applnk}'"
+ unset IFS
+- [ "$dir" ] && [ -d "$dir/applications" ] || [ -d "$dir/applnk" ] || continue
++ [ -n "$dir" ] && [ -d "$dir/applications" ] || [ -d "$dir/applnk" ] || continue
+ # Check if desktop file contains -
+ if [ "${desktop#*-}" != "$desktop" ]; then
+- vendor=${desktop%-*}
+- app=${desktop#*-}
++ vendor="${desktop%-*}"
++ app="${desktop#*-}"
+ if [ -r "$dir/applications/$vendor/$app" ]; then
+ file_path="$dir/applications/$vendor/$app"
+ elif [ -r "$dir/applnk/$vendor/$app" ]; then
+@@ -72,18 +77,31 @@ desktop_file_to_binary()
+ fi
+ if test -z "$file_path" ; then
+ for indir in "$dir"/applications/ "$dir"/applications/*/ "$dir"/applnk/ "$dir"/applnk/*/; do
++ DEBUG 4 "Does file exist? '$indir/$desktop'"
+ file="$indir/$desktop"
+ if [ -r "$file" ]; then
+- file_path=$file
++ file_path="$file"
+ break
+ fi
+ done
+ fi
+ if [ -r "$file_path" ]; then
+- # Remove any arguments (%F, %f, %U, %u, etc.).
+- command="$(grep -E "^Exec(\[[^]=]*])?=" "$file_path" | cut -d= -f 2- | first_word)"
+- command="$(command -v "$command")"
+- xdg_realpath "$command"
++ DEBUG 2 "Checking desktop file '$file_path'"
++ # Get the command name from the correct Exec
++ # Note: Ignoring quoting and escape sequences here, see #253
++ binary="$(awk -F '=' '
++ /^\[/{ in_entry=0 }
++ $0 == "[Desktop Entry]"{ in_entry=1 }
++ in_entry && /^Exec\s*=/ {
++ sub(/^\s+/,"",$2);
++ match($2,/^[^ ]+/);
++ print substr($2,RSTART,RLENGTH)
++ }' \
++ < "$file_path" )"
++ DEBUG 2 "Found command: $binary"
++ binary="$(xdg_which "$binary")"
++ DEBUG 2 "Resolved to command to file: '$binary'"
++ [ -z "$binary" ] || xdg_realpath "$binary"
+ return
+ fi
+ done
+@@ -461,3 +479,31 @@ xdg_realpath()
+ ;;
+ esac
+ }
++
++#----------------------------------------------------------------------------
++# The `which` command but as a shell implementation.
++# Returns either the path of the resolved binary or nothing
++# because command -v does not always return the path of a command
++# (builtins, aliases, functions, etc.)
++
++# xdg_which <command>
++xdg_which()
++{
++ if [ -z "$1" ] ; then
++ return 1
++ elif [ -x "$1" ] ; then
++ printf "%s\n" "$1"
++ else
++ # this should be faster than the real thing because of shell builtins
++ old_ifs="$IFS"
++ IFS=:
++ for p in $PATH ; do
++ IFS="$old_ifs"
++ if [ -x "$p/$1" ] ; then
++ printf "%s\n" "$p/$1"
++ return
++ fi
++ done
++ return 1
++ fi
++}
+--
+GitLab
diff --git a/x11-misc/xdg-utils/files/xdg-utils-egrep.patch b/x11-misc/xdg-utils/files/xdg-utils-egrep.patch
deleted file mode 100644
index 71608552a08b..000000000000
--- a/x11-misc/xdg-utils/files/xdg-utils-egrep.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 7538458c6c8999296a272c40bd4ec24132a51877 Mon Sep 17 00:00:00 2001
-From: E5ten <ethancsommer@gmail.com>
-Date: Thu, 16 Jan 2020 02:06:09 +0000
-Subject: [PATCH] switch from non-standard "egrep" to POSIX "grep -E"
-
----
- scripts/xdg-open.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in
-index 202f3e3..35b0522 100644
---- a/scripts/xdg-open.in
-+++ b/scripts/xdg-open.in
-@@ -72,7 +72,7 @@ get_key()
- is_file_url_or_path()
- {
- if echo "$1" | grep -q '^file://' \
-- || ! echo "$1" | egrep -q '^[[:alpha:]][[:alpha:][:digit:]+\.\-]*:'; then
-+ || ! echo "$1" | grep -Eq '^[[:alpha:]][[:alpha:][:digit:]+\.\-]*:'; then
- return 0
- else
- return 1
---
-GitLab
-
diff --git a/x11-misc/xdg-utils/xdg-utils-1.2.1-r1.ebuild b/x11-misc/xdg-utils/xdg-utils-1.2.1-r1.ebuild
index 74b50cca06a6..1a7e62b0a6c4 100644
--- a/x11-misc/xdg-utils/xdg-utils-1.2.1-r1.ebuild
+++ b/x11-misc/xdg-utils/xdg-utils-1.2.1-r1.ebuild
@@ -18,7 +18,7 @@ fi
LICENSE="MIT"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
IUSE="dbus doc gnome X"
REQUIRED_USE="gnome? ( dbus )"
diff --git a/x11-misc/xdg-utils/xdg-utils-1.1.3_p20210805-r2.ebuild b/x11-misc/xdg-utils/xdg-utils-1.2.1-r6.ebuild
index 852bfc0c9eea..fc0c96334ecd 100644
--- a/x11-misc/xdg-utils/xdg-utils-1.1.3_p20210805-r2.ebuild
+++ b/x11-misc/xdg-utils/xdg-utils-1.2.1-r6.ebuild
@@ -5,23 +5,27 @@ EAPI=8
inherit autotools
-MY_COMMIT="1a58bc28f6844898532daf9ee1bf6da7764955a9"
DESCRIPTION="Portland utils for cross-platform/cross-toolkit/cross-desktop interoperability"
HOMEPAGE="https://www.freedesktop.org/wiki/Software/xdg-utils/"
-SRC_URI="https://gitlab.freedesktop.org/xdg/xdg-utils/-/archive/${MY_COMMIT}/${P}.tar.bz2"
-# https://gitlab.freedesktop.org/xdg/xdg-utils/-/merge_requests/24
-SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-1.1.3_p20200220-no-which.patch.xz"
-S="${WORKDIR}"/xdg-utils-${MY_COMMIT}
+if [[ ${PV} == *_p* ]] ; then
+ MY_COMMIT="d4f00e1d803038af4f245949d8c747a384117852"
+ SRC_URI="https://gitlab.freedesktop.org/xdg/xdg-utils/-/archive/${MY_COMMIT}/${P}.tar.bz2"
+ S="${WORKDIR}"/xdg-utils-${MY_COMMIT}
+else
+ SRC_URI="https://gitlab.freedesktop.org/xdg/xdg-utils/-/archive/v${PV}/${PN}-v${PV}.tar.bz2"
+ S="${WORKDIR}"/${PN}-v${PV}
+fi
LICENSE="MIT"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
-IUSE="dbus doc gnome X"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
+IUSE="dbus doc gnome plasma X"
REQUIRED_USE="gnome? ( dbus )"
RDEPEND="
- dev-util/desktop-file-utils
dev-perl/File-MimeInfo
+ dev-util/desktop-file-utils
+ x11-misc/shared-mime-info
dbus? (
sys-apps/dbus
gnome? (
@@ -29,36 +33,51 @@ RDEPEND="
dev-perl/X11-Protocol
)
)
- x11-misc/shared-mime-info
+ plasma? (
+ virtual/pkgconfig
+ )
X? (
x11-apps/xprop
x11-apps/xset
)
"
+PDEPEND="
+ plasma? (
+ || (
+ (
+ kde-frameworks/kservice:6
+ dev-qt/qtbase:6
+ )
+ (
+ kde-frameworks/kservice:5
+ dev-qt/qtpaths:5
+ )
+ )
+ )
+"
BDEPEND="
- >=app-text/xmlto-0.0.28-r3[text(+)]
app-alternatives/awk
+ >=app-text/xmlto-0.0.28-r3[text(+)]
"
-DOCS=( ChangeLog README RELEASE_NOTES TODO )
-
# Tests run random system programs, including interactive programs
# that block forever
RESTRICT="test"
PATCHES=(
- "${WORKDIR}"/${PN}-1.1.3_p20200220-no-which.patch
- # https://gitlab.freedesktop.org/xdg/xdg-utils/-/merge_requests/21
- "${FILESDIR}"/${PN}-egrep.patch
+ "${FILESDIR}"/${P}-xdg-mime-default.patch
+ "${FILESDIR}"/${PN}-1.2.1-qtpaths.patch
)
src_prepare() {
default
- # If you choose to do git snapshot instead of patchset, you need to remember
- # to run `autoconf` in ./ and `make scripts-clean` in ./scripts/ to refresh
- # all the files
- eautoreconf
+ if [[ ${PV} == *_p* ]] ; then
+ # If you choose to do git snapshot instead of patchset, you need to remember
+ # to run `autoconf` in ./ and `make scripts-clean` in ./scripts/ to refresh
+ # all the files
+ eautoreconf
+ fi
}
src_configure() {
@@ -70,16 +89,18 @@ src_configure() {
src_install() {
default
+ dodoc RELEASE_NOTES
+
newdoc scripts/xsl/README README.xsl
use doc && dodoc -r scripts/html
# Install default XDG_DATA_DIRS, bug #264647
- echo XDG_DATA_DIRS=\"${EPREFIX}/usr/local/share\" > 30xdg-data-local
- echo 'COLON_SEPARATED="XDG_DATA_DIRS XDG_CONFIG_DIRS"' >> 30xdg-data-local
+ echo XDG_DATA_DIRS=\"${EPREFIX}/usr/local/share\" > 30xdg-data-local || die
+ echo 'COLON_SEPARATED="XDG_DATA_DIRS XDG_CONFIG_DIRS"' >> 30xdg-data-local || die
doenvd 30xdg-data-local
- echo XDG_DATA_DIRS=\"${EPREFIX}/usr/share\" > 90xdg-data-base
- echo XDG_CONFIG_DIRS=\"${EPREFIX}/etc/xdg\" >> 90xdg-data-base
+ echo XDG_DATA_DIRS=\"${EPREFIX}/usr/share\" > 90xdg-data-base || die
+ echo XDG_CONFIG_DIRS=\"${EPREFIX}/etc/xdg\" >> 90xdg-data-base || die
doenvd 90xdg-data-base
}