Skip to content

Commit

Permalink
devel/xdg-utils: Update to 1.2.1
Browse files Browse the repository at this point in the history
Use textproc/xmlto instead of textproc/minixmlto as the latter produces
errors with <uri> tags.

Adopt/adapt patches for xdg-su from OpenMandriva. [1]

Don't apply subsitutions to .orig files in the post-patch target.

Pet portclippy(1).

Obtained from:	https://github.com/OpenMandrivaAssociation/xdg-utils/blob/rolling/xdg-utils-find-kdesu6.patch [1]
		https://github.com/OpenMandrivaAssociation/xdg-utils/blob/rolling/xdg-utils-1.2.1-lxqt-unquote.patch [1]
  • Loading branch information
BSDKaffee committed Jan 24, 2025
1 parent 5e65a79 commit f6ca366
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 220 deletions.
18 changes: 9 additions & 9 deletions devel/xdg-utils/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
PORTNAME= xdg-utils
PORTVERSION= 1.1.3
PORTREVISION= 4
DISTVERSIONPREFIX= v
DISTVERSION= 1.2.1
CATEGORIES= devel
MASTER_SITES= https://portland.freedesktop.org/download/

MAINTAINER= [email protected]
COMMENT= Tools to allow all applications to integrate with the free desktop
Expand All @@ -11,26 +10,27 @@ WWW= https://www.freedesktop.org/wiki/Software/xdg-utils/
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE

BUILD_DEPENDS= minixmlto:textproc/minixmlto
BUILD_DEPENDS= xmlto:textproc/xmlto
RUN_DEPENDS= ${LOCALBASE}/share/icons/hicolor/index.theme:misc/hicolor-icon-theme

USES= cpe gmake

CPE_VENDOR= freedesktop
USE_GITLAB= yes
GL_SITE= https://gitlab.freedesktop.org
GL_ACCOUNT= xdg

CONFIGURE_ENV= XMLTO=${LOCALBASE}/bin/minixmlto
GNU_CONFIGURE= yes
GNU_CONFIGURE_MANPREFIX=${PREFIX}/share

NO_ARCH= yes
MAKE_ENV= PREFER_DOCBOOK2MDOC=1

OPTIONS_DEFINE= X11
OPTIONS_DEFAULT=X11

X11_RUN_DEPENDS=xprop:x11/xprop \
xset:x11/xset

post-patch:
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
${WRKSRC}/scripts/xdg-*
${WRKSRC}/scripts/xdg-*.in

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions devel/xdg-utils/distinfo
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TIMESTAMP = 1546903676
SHA256 (xdg-utils-1.1.3.tar.gz) = d798b08af8a8e2063ddde6c9fa3398ca81484f27dec642c5627ffcaa0d4051d9
SIZE (xdg-utils-1.1.3.tar.gz) = 297170
TIMESTAMP = 1737661873
SHA256 (xdg-utils-v1.2.1.tar.bz2) = 93d510dccf328378f012fe195b4574c2fac1cd65a74d0852d6eaa72e5a2065a7
SIZE (xdg-utils-v1.2.1.tar.bz2) = 293386
139 changes: 0 additions & 139 deletions devel/xdg-utils/files/patch-add-support-for-plasma6

This file was deleted.

17 changes: 4 additions & 13 deletions devel/xdg-utils/files/patch-scripts_xdg-desktop-menu.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--- scripts/xdg-desktop-menu.in.orig 2019-01-08 19:02:17 UTC
--- scripts/xdg-desktop-menu.in.orig 2024-02-06 01:55:07 UTC
+++ scripts/xdg-desktop-menu.in
@@ -67,7 +67,7 @@ make_lazy_default()

Expand All @@ -9,7 +9,7 @@
if [ x"$mode" = x"user" ] ; then
xdg_user_dir="$XDG_DATA_HOME"
[ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share"
@@ -110,7 +110,7 @@ update_submenu()
@@ -112,7 +112,7 @@ update_submenu()
xdg_user_dir="$xdg_user_dir/$xdg_dir_name"

xdg_system_dirs="$XDG_CONFIG_DIRS"
Expand All @@ -18,7 +18,7 @@
xdg_global_dir=
for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do
if [ -w $x/$xdg_dir_name ] ; then
@@ -475,7 +475,7 @@ xdg_user_dir="$XDG_DATA_HOME"
@@ -464,7 +464,7 @@ xdg_system_dirs="$XDG_DATA_DIRS"
xdg_user_dir="$xdg_user_dir/$xdg_dir_name"

xdg_system_dirs="$XDG_DATA_DIRS"
Expand All @@ -27,7 +27,7 @@
xdg_global_dir=
for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do
if [ -w $x/$xdg_dir_name ] ; then
@@ -542,7 +542,7 @@ xdg_user_dir="$XDG_DATA_HOME"
@@ -527,7 +527,7 @@ xdg_system_dirs="$XDG_DATA_DIRS"
xdg_user_dir="$xdg_user_dir/$xdg_dir_name"

xdg_system_dirs="$XDG_DATA_DIRS"
Expand All @@ -36,12 +36,3 @@
xdg_global_dir=
for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do
if [ -w $x/$xdg_dir_name ] ; then
@@ -556,7 +556,7 @@ kde_global_dir=`kde${KDE_SESSION_VERSION}-config --pat
[ -w $kde_global_dir ] || kde_global_dir=

gnome_user_dir="$HOME/.gnome/apps"
-gnome_global_dir="/usr/share/gnome/apps"
+gnome_global_dir="%%LOCALBASE%%/share/gnome/apps"
[ -w $gnome_global_dir ] || gnome_global_dir=

DEBUG 3 "Install locations for *.desktop files:"
29 changes: 10 additions & 19 deletions devel/xdg-utils/files/patch-scripts_xdg-email.in
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
--- scripts/xdg-email.in.orig 2019-01-08 19:02:17 UTC
--- scripts/xdg-email.in.orig 2024-02-06 01:55:07 UTC
+++ scripts/xdg-email.in
@@ -34,7 +34,7 @@ run_thunderbird()
{
local THUNDERBIRD MAILTO NEWMAILTO TO CC BCC SUBJECT BODY ATTACH
THUNDERBIRD="$1"
- MAILTO=$(echo "$2" | sed 's/^mailto://')
+ MAILTO=$(echo "$2" | tr '&' '\n')
- MAILTO="$(echo "$2" | sed 's/^mailto://')"
+ MAILTO="$(echo "$2" | tr '&' '\n')"
echo "$MAILTO" | grep -qs "^?"
if [ "$?" = "0" ] ; then
MAILTO=$(echo "$MAILTO" | sed 's/^?//')
MAILTO="$(echo "$MAILTO" | sed 's/^?//')"
@@ -48,7 +48,7 @@ run_thunderbird()
BCC=$(/bin/echo -e $(echo "$MAILTO" | grep '^bcc=' | sed 's/^bcc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }'))
SUBJECT=$(echo "$MAILTO" | grep '^subject=' | tail -n 1)
BODY=$(echo "$MAILTO" | grep '^body=' | tail -n 1)
- ATTACH=$(/bin/echo -e $(echo "$MAILTO" | grep '^attach=' | sed 's/^attach=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }' | sed 's/,$//'))
+ ATTACH=$(for attachment in $(echo "$MAILTO" | sed -ne 's,^attach=,file://,gp') ; do printf "%s," "$attachment" ; done); ATTACH=${ATTACH%,}
BCC="$(/bin/echo -e "$(echo "$MAILTO" | grep '^bcc=' | sed 's/^bcc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }')")"
SUBJECT="$(echo "$MAILTO" | grep '^subject=' | tail -n 1)"
BODY="$(echo "$MAILTO" | grep '^body=' | tail -n 1)"
- ATTACH="$(/bin/echo -e "$(echo "$MAILTO" | grep '^attach=' | sed 's/^attach=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }' | sed 's/,$//')")"
+ ATTACH="$(for attachment in $(echo "$MAILTO" | sed -ne 's,^attach=,file://,gp') ; do printf "%s," "$attachment" ; done); ATTACH=${ATTACH%,}"

if [ -z "$TO" ] ; then
NEWMAILTO=
@@ -314,7 +314,7 @@ LC_ALL="$ORIG_LC_ALL"
@@ -317,7 +317,7 @@ mailto=

options=
mailto=
Expand All @@ -27,12 +27,3 @@
while [ $# -gt 0 ] ; do
parm="$1"
shift
@@ -455,7 +455,7 @@ fi
if [ x"$BROWSER" = x"" ]; then
BROWSER=www-browser:links2:elinks:links:lynx:w3m
if has_display; then
- BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER
+ BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chrome:chromium-browser:google-chrome:$BROWSER
fi
fi

18 changes: 9 additions & 9 deletions devel/xdg-utils/files/patch-scripts_xdg-mime.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- scripts/xdg-mime.in.orig 2019-01-08 19:02:17 UTC
--- scripts/xdg-mime.in.orig 2024-02-06 01:55:07 UTC
+++ scripts/xdg-mime.in
@@ -318,7 +318,7 @@ defapp_fallback()
@@ -377,7 +377,7 @@ defapp_fallback()
[ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share"

xdg_system_dirs="$XDG_DATA_DIRS"
Expand All @@ -9,25 +9,25 @@

preference=-1
desktop_file=""
@@ -401,7 +401,7 @@ defapp_generic()
@@ -467,7 +467,7 @@ defapp_generic()
xdg_user_dir="$XDG_DATA_HOME"
[ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share"
xdg_system_dirs="$XDG_DATA_DIRS"
- [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/
+ [ -n "$xdg_system_dirs" ] || xdg_system_dirs=%%LOCALBASE%%/share/:/usr/share/

local oldifs="$IFS" dir
local oldifs dir

@@ -702,7 +702,7 @@ xdg_user_dir="$XDG_DATA_HOME"
@@ -810,7 +810,7 @@ xdg_system_dirs="$XDG_DATA_DIRS"
xdg_user_dir="$xdg_user_dir/$xdg_dir_name"

xdg_system_dirs="$XDG_DATA_DIRS"
-[ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/
+[ -n "$xdg_system_dirs" ] || xdg_system_dirs=%%LOCALBASE%%/share/:/usr/share/
for x in `echo $xdg_system_dirs | sed 's/:/ /g'`; do
if [ -w $x/$xdg_dir_name ] ; then
[ x"$mode" = x"system" ] && xdg_base_dir="$x/mime"
@@ -734,7 +734,7 @@ DEBUG 3 "kde_global_dir: $kde_global_dir"

old_ifs="$IFS"
IFS=:
@@ -849,7 +849,7 @@ gnome_user_dir="$HOME/.gnome/apps"
# TODO: Gnome legacy support
# See http://forums.fedoraforum.org/showthread.php?t=26875
gnome_user_dir="$HOME/.gnome/apps"
Expand Down
21 changes: 10 additions & 11 deletions devel/xdg-utils/files/patch-scripts_xdg-open.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--- scripts/xdg-open.in.orig 2019-01-08 19:02:17 UTC
--- scripts/xdg-open.in.orig 2024-02-06 01:55:07 UTC
+++ scripts/xdg-open.in
@@ -15,6 +15,12 @@
#
Expand All @@ -12,8 +12,8 @@
+
manualpage()
{
cat << _MANUALPAGE
@@ -92,7 +98,7 @@ file_url_to_path()
cat << '_MANUALPAGE'
@@ -116,7 +122,7 @@ file_url_to_path()
if [ -x /usr/bin/printf ]; then
printf=/usr/bin/printf
fi
Expand All @@ -22,7 +22,7 @@
fi
echo "$file"
}
@@ -193,6 +199,17 @@ open_gnome()
@@ -220,6 +226,17 @@ open_gnome()
fi
}

Expand All @@ -40,17 +40,16 @@
open_mate()
{
if gio help open 2>/dev/null 1>&2; then
@@ -342,8 +359,7 @@ open_generic_xdg_mime()
@@ -398,7 +415,7 @@ open_generic_xdg_mime()
[ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share"

xdg_system_dirs="$XDG_DATA_DIRS"
- [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/
-
+ [ -n "$xdg_system_dirs" ] || xdg_system_dirs=%%LOCALBASE%%/share/:/usr/share/
DEBUG 3 "$xdg_user_dir:$xdg_system_dirs"
for x in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do
search_desktop_file "$default" "$x/applications/" "$1"
@@ -438,7 +454,7 @@ open_generic()

search_dirs="$xdg_user_dir:$xdg_system_dirs"
DEBUG 3 "$search_dirs"
@@ -516,7 +533,7 @@ open_generic()
if [ x"$BROWSER" = x"" ]; then
BROWSER=www-browser:links2:elinks:links:lynx:w3m
if has_display; then
Expand All @@ -59,7 +58,7 @@
fi
fi

@@ -534,6 +550,10 @@ case "$DE" in
@@ -623,6 +640,10 @@ case "$DE" in

gnome)
open_gnome "$url"
Expand Down
Loading

0 comments on commit f6ca366

Please sign in to comment.