Skip to content

Commit

Permalink
bump(x11/xdg-utils): 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
twaik committed May 14, 2024
1 parent 78f0172 commit a220d31
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 83 deletions.
5 changes: 2 additions & 3 deletions x11-packages/xdg-utils/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/xdg-utils/
TERMUX_PKG_DESCRIPTION="A set of simple scripts that provide basic desktop integration functions for any Free Desktop"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.1.3
TERMUX_PKG_REVISION=1
TERMUX_PKG_VERSION="1.2.1"
TERMUX_PKG_SRCURL=https://gitlab.freedesktop.org/xdg/xdg-utils/-/archive/v${TERMUX_PKG_VERSION}/xdg-utils-v${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_SHA256=deac55c48aa2902023c96a4bea2f1778441ce9c59e60ed52c6ce5d8b3e90ba64
TERMUX_PKG_SHA256=93d510dccf328378f012fe195b4574c2fac1cd65a74d0852d6eaa72e5a2065a7
TERMUX_PKG_DEPENDS="desktop-file-utils, file, make, perl, shared-mime-info, which, xorg-xprop"
TERMUX_PKG_BUILD_IN_SRC=true

Expand Down
122 changes: 46 additions & 76 deletions x11-packages/xdg-utils/fix-hardcoded-paths.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
--- a/scripts/xdg-desktop-menu.in
+++ b/scripts/xdg-desktop-menu.in
+++ ./scripts/xdg-desktop-menu.in
@@ -32,7 +32,7 @@
{
# echo Update desktop database: $mode
Expand All @@ -18,7 +17,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 @@
@@ -112,7 +112,7 @@
xdg_user_dir="$xdg_user_dir/$xdg_dir_name"

xdg_system_dirs="$XDG_CONFIG_DIRS"
Expand All @@ -27,43 +26,34 @@
xdg_global_dir=
for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do
if [ -w $x/$xdg_dir_name ] ; then
@@ -158,7 +158,7 @@
@@ -156,7 +156,7 @@
return
fi

- if [ $action = "install" ] && [ -f "/etc/xdg/menus/gnome-applications.menu" ] ; then
+ if [ $action = "install" ] && [ -f "@TERMUX_PREFIX@/etc/xdg/menus/gnome-applications.menu" ] ; then
# Work around for Debian Gnome
gnome_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/gnome-applications-merged^'`
if [ ! -e "$gnome_xdg_dir" ] ; then
@@ -167,7 +167,7 @@
eval 'ln -s "applications-merged" "$gnome_xdg_dir"'$xdg_redirect_output
fi
fi
- if [ $action = "install" ] && [ -f "/etc/mandrake-release" ] ; then
+ if [ $action = "install" ] && [ -f "@TERMUX_PREFIX@/etc/mandrake-release" ] ; then
# Work around for Mandriva 2006
mandrake_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/applications-mdk-merged^'`
if [ ! -e "$mandrake_xdg_dir" ] ; then
@@ -176,7 +176,7 @@
@@ -165,7 +165,7 @@
eval 'ln -s "applications-merged" "$mandrake_xdg_dir"'$xdg_redirect_output
fi
fi
- if [ $action = "install" -a x"$mode" = x"user" ] && [ -d "/etc/xdg/menus/kde-applications-merged" ] ; then
+ if [ $action = "install" -a x"$mode" = x"user" ] && [ -d "@TERMUX_PREFIX@/etc/xdg/menus/kde-applications-merged" ] ; then
- if [ $action = "install" ] && [ x"$mode" = x"user" ] && [ -d "/etc/xdg/menus/kde-applications-merged" ] ; then
+ if [ $action = "install" ] && [ x"$mode" = x"user" ] && [ -d "@TERMUX_PREFIX@/etc/xdg/menus/kde-applications-merged" ] ; then
# Work around for Fedora Core 5 + patched KDE
kde_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/kde-applications-merged^'`
if [ ! -e "$kde_xdg_dir" ] ; then
@@ -185,7 +185,7 @@
@@ -174,7 +174,7 @@
eval 'ln -s "applications-merged" "$kde_xdg_dir"'$xdg_redirect_output
fi
fi
- if [ $action = "install" -a x"$mode" = x"system" ] && [ -d "/etc/xdg/menus/kde-applications-merged" ] && [ ! -d "/etc/xdg/menus/applications-merged" ] ; then
+ if [ $action = "install" -a x"$mode" = x"system" ] && [ -d "@TERMUX_PREFIX@/etc/xdg/menus/kde-applications-merged" ] && [ ! -d "@TERMUX_PREFIX@/etc/xdg/menus/applications-merged" ] ; then
- if [ $action = "install" ] && [ x"$mode" = x"system" ] && [ -d "/etc/xdg/menus/kde-applications-merged" ] && [ ! -d "/etc/xdg/menus/applications-merged" ] ; then
+ if [ $action = "install" ] && [ x"$mode" = x"system" ] && [ -d "@TERMUX_PREFIX@/etc/xdg/menus/kde-applications-merged" ] && [ ! -d "@TERMUX_PREFIX@/etc/xdg/menus/applications-merged" ] ; then
# Work around for Kubuntu 6.06
kde_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/kde-applications-merged^'`
DEBUG 1 "Kubuntu Workaround: Link '$xdg_dir' to 'kde-applications-merged'"
@@ -196,7 +196,7 @@
@@ -185,7 +185,7 @@

DEBUG 1 "Updating $orig_menu_file ($action)"

Expand All @@ -72,7 +62,7 @@
tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX`
orig_desktop_files=
if [ -r "$orig_menu_file" ] ; then
@@ -246,7 +246,7 @@
@@ -235,7 +235,7 @@

if [ -n "$new_desktop_files" ] ; then
# Install/update
Expand All @@ -81,16 +71,16 @@
tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX`
(
echo '<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"'
@@ -292,7 +292,7 @@
@@ -281,7 +281,7 @@

# Uninstall .directory files only if no longer referenced
if [ $action = "uninstall" ] ; then
- test "${TMPDIR+set}" = set || TMPDIR=/tmp
+ test "${TMPDIR+set}" = set || TMPDIR=@TERMUX_PREFIX@/tmp
tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX`
for menu_file in $xdg_dir/*; do
for menu_file in "$xdg_dir"/*; do
if grep 'generated and managed by @NAME@' "$menu_file" > /dev/null 2> /dev/null; then
@@ -475,7 +475,7 @@
@@ -464,7 +464,7 @@
xdg_user_dir="$xdg_user_dir/$xdg_dir_name"

xdg_system_dirs="$XDG_DATA_DIRS"
Expand All @@ -99,7 +89,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 @@
@@ -527,7 +527,7 @@
xdg_user_dir="$xdg_user_dir/$xdg_dir_name"

xdg_system_dirs="$XDG_DATA_DIRS"
Expand All @@ -108,17 +98,7 @@
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 @@
[ -w $kde_global_dir ] || kde_global_dir=

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

DEBUG 3 "Install locations for *.desktop files:"
--- a/scripts/xdg-icon-resource.in
+++ b/scripts/xdg-icon-resource.in
+++ ./scripts/xdg-icon-resource.in
@@ -37,7 +37,7 @@
[ -n "$GTK_UPDATE_ICON_CACHE" ] && return;

Expand All @@ -137,18 +117,17 @@
for x in `echo "$xdg_system_dirs" | sed 's/:/ /g'`; do
if [ -w "$x/$xdg_dir_name" ] ; then
xdg_global_prefix="$x/icons"
--- a/scripts/xdg-mime.in
+++ b/scripts/xdg-mime.in
@@ -39,7 +39,7 @@
eval 'kbuildsycoca${KDE_SESSION_VERSION}'$xdg_redirect_output
fi
+++ ./scripts/xdg-mime.in
@@ -50,7 +50,7 @@
fi
- for x in `echo "$PATH:/opt/gnome/bin" | sed 's/:/ /g'`; do
+ for x in `echo "$PATH:@TERMUX_PREFIX@/opt/gnome/bin" | sed 's/:/ /g'`; do
if [ -x $x/update-mime-database ] ; then
old_ifs="$IFS"
IFS=:
- for x in $PATH /opt/gnome/bin ; do
+ for x in $PATH @TERMUX_PREFIX@/opt/gnome/bin ; do
IFS="$old_ifs"
if [ -x "$x/update-mime-database" ] ; then
DEBUG 1 "Running $x/update-mime-database $1"
eval '$x/update-mime-database $1'$xdg_redirect_output
@@ -100,7 +100,7 @@
@@ -133,7 +133,7 @@
mimetype --brief --dereference "$1"
else
DEBUG 1 "Running file --brief --dereference --mime-type \"$1\""
Expand All @@ -157,7 +136,7 @@
fi

if [ $? -eq 0 ]; then
@@ -318,7 +318,7 @@
@@ -377,7 +377,7 @@
[ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share"

xdg_system_dirs="$XDG_DATA_DIRS"
Expand All @@ -166,21 +145,16 @@

preference=-1
desktop_file=""
@@ -397,11 +397,11 @@
xdg_config_home="$XDG_CONFIG_HOME"
[ -n "$xdg_config_home" ] || xdg_config_home="$HOME/.config"
xdg_config_dirs="$XDG_CONFIG_DIRS"
- [ -n "$xdg_config_dirs" ] || xdg_config_dirs="/etc/xdg"
+ [ -n "$xdg_config_dirs" ] || xdg_config_dirs="@TERMUX_PREFIX@/etc/xdg"
@@ -467,7 +467,7 @@
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=@TERMUX_PREFIX@/local/share/:@TERMUX_PREFIX@/share/

local oldifs="$IFS" dir
local oldifs dir

@@ -584,7 +584,7 @@
@@ -684,7 +684,7 @@
detectDE

if [ x"$DE" = x"" ]; then
Expand All @@ -189,16 +163,16 @@
DE=generic
fi
fi
@@ -702,7 +702,7 @@
@@ -810,7 +810,7 @@
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=@TERMUX_PREFIX@/local/share/:@TERMUX_PREFIX@/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 @@

old_ifs="$IFS"
IFS=:
@@ -849,7 +849,7 @@
# TODO: Gnome legacy support
# See http://forums.fedoraforum.org/showthread.php?t=26875
gnome_user_dir="$HOME/.gnome/apps"
Expand All @@ -207,8 +181,7 @@
[ -w $gnome_global_dir ] || gnome_global_dir=
DEBUG 3 "gnome_user_dir: $gnome_user_dir"
DEBUG 3 "gnome_global_dir: $gnome_global_dir"
--- a/scripts/xdg-open.in
+++ b/scripts/xdg-open.in
+++ ./scripts/xdg-open.in
@@ -89,8 +89,8 @@
file=${file%%#*}
file=$(echo "$file" | sed -r 's/\?.*$//')
Expand All @@ -229,8 +202,7 @@

DEBUG 3 "$xdg_user_dir:$xdg_system_dirs"
for x in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do
--- a/scripts/xdg-screensaver.in
+++ b/scripts/xdg-screensaver.in
+++ ./scripts/xdg-screensaver.in
@@ -31,7 +31,7 @@
# We can securely move files in /tmp with mv -T
DEBUG 1 "mv -T available"
Expand Down Expand Up @@ -276,8 +248,7 @@
tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX`
# Filter stale entries from the xdg-screensaver status file
cat "$screensaver_file" 2> /dev/null | (
--- a/scripts/xdg-settings.in
+++ b/scripts/xdg-settings.in
+++ ./scripts/xdg-settings.in
@@ -374,7 +374,7 @@

get_browser_xfce()
Expand All @@ -296,23 +267,22 @@
IFS=:
for dir in $search; do
unset IFS
--- a/scripts/xdg-utils-common.in
+++ b/scripts/xdg-utils-common.in
@@ -22,7 +22,7 @@
+++ ./scripts/xdg-utils-common.in
@@ -24,7 +24,7 @@
# map a binary to a .desktop file
binary_to_desktop_file()
{
- search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
+ search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-@TERMUX_PREFIX@/local/share:@TERMUX_PREFIX@/share}"
binary="`which "$1"`"
binary="`readlink -f "$binary"`"
base="`basename "$binary"`"
@@ -52,7 +52,7 @@
+ search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-@TERMUX_PREFIX@/share}"
binary="$(command -v "$1")"
binary="$(xdg_realpath "$binary")"
base="$(basename "$binary")"
@@ -54,7 +54,7 @@
# map a .desktop file to a binary
desktop_file_to_binary()
{
- search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
+ search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-@TERMUX_PREFIX@/local/share:@TERMUX_PREFIX@/share}"
desktop="`basename "$1"`"
+ search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-@TERMUX_PREFIX@/share}"
desktop="$(basename "$1")"
IFS=:
for dir in $search; do
8 changes: 4 additions & 4 deletions x11-packages/xdg-utils/scripts-xdg-email.in.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- a/scripts/xdg-email.in
+++ b/scripts/xdg-email.in
@@ -245,7 +245,7 @@ open_generic()
@@ -271,7 +271,7 @@
run_thunderbird "$client" "$1"
fi
esac

- xdg-open "$1"
+ xdg-utils-xdg-open "$1"
local ret=$?
exit $?
}

# 3 means exit_failure_operation_impossible

0 comments on commit a220d31

Please sign in to comment.