From e1527176effe360a1fb3129d735b663783410f90 Mon Sep 17 00:00:00 2001 From: Jony Date: Wed, 18 Aug 2021 22:58:41 -0700 Subject: [PATCH] common/environment/setup/install.sh: add vdesktop Install function for installing `*.desktop` files. --- Manual.md | 6 ++++++ common/environment/setup/install.sh | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Manual.md b/Manual.md index 4316363f66c4..b87b8ea2c484 100644 --- a/Manual.md +++ b/Manual.md @@ -310,6 +310,12 @@ The following functions are defined by `xbps-src` and can be used on any templat - `foo.1.gz` -> `${DESTDIR}/usr/share/man/man1/foo.1` - `foo.1.bz2` -> `${DESTDIR}/usr/share/man/man1/foo.1` +- *vdesktop()* `vdesktop []` + + Installs `file` into `usr/share/applications/` in the pkg + `$DESTDIR`. The optional 2nd argument can be used to change the + `file name`. + - *vdoc()* `vdoc []` Installs `file` into `usr/share/doc/` in the pkg diff --git a/common/environment/setup/install.sh b/common/environment/setup/install.sh index a6b68435eb43..a03f9ce3edce 100644 --- a/common/environment/setup/install.sh +++ b/common/environment/setup/install.sh @@ -13,7 +13,7 @@ _noglob_helper() { } # Apply _noglob to v* commands -for cmd in vinstall vcopy vcompletion vmove vmkdir vbin vman vdoc vconf vsconf vlicense vsv; do +for cmd in vinstall vcopy vcompletion vmove vmkdir vbin vman vdesktop vdoc vconf vsconf vlicense vsv; do alias ${cmd}="set -f; _noglob_helper _${cmd}" done @@ -98,6 +98,17 @@ _vman() { return 1 } +_vdesktop() { + local file="$1" targetfile="$2" + + if [ $# -lt 1 ]; then + msg_red "$pkgver: vdesktop: 1 argument expected: \n" + return 1 + fi + + vinstall "$file" 644 "usr/share/applications/${pkgname}" "$targetfile" +} + _vdoc() { local file="$1" targetfile="$2"