summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Maunier2021-05-27 11:36:58 +0200
committerFlorian Maunier2021-05-27 11:36:58 +0200
commit28592b1e2fccac4d64369f1824945555d8ff188e (patch)
tree128a06812e9b42a3ba0b7c5c045857fbfd46249d
parent3cce7df7fa3d1c1e0b329b8c9f832da50830996c (diff)
downloadaur-28592b1e2fccac4d64369f1824945555d8ff188e.tar.gz
Add profile.d script, add completions for bash, fish and zsh
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD22
-rw-r--r--dotnet.sh12
-rw-r--r--register-completions.bash16
-rw-r--r--register-completions.fish1
-rw-r--r--register-completions.zsh11
6 files changed, 68 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index afd1dd29ea1d..f417f3ee4586 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,20 @@
pkgbase = dotnet-core-preview
pkgver = 6.0.0.sdk100+preview.3.21202.5
- pkgrel = 1
+ pkgrel = 2
url = https://www.microsoft.com/net/core
arch = x86_64
arch = armv7h
arch = aarch64
license = MIT
options = staticlibs
+ source = dotnet.sh
+ source = register-completions.bash
+ source = register-completions.fish
+ source = register-completions.zsh
+ sha512sums = e61b9e3e5a2305646a616d598378230c9755c5dd5363692cc363f8f4add3807563c324dd86f3a7ae9d358c82d730608e7b293935a2b6c81c0c0f62d752a0a1cf
+ sha512sums = 9f977e0bd12abc0dda4d914f369c58fce502b4030cf91d4248b32242d98fe5a2bbd8446502feeb914561f310dfd3c113bb6da19bfd5dfa6233109e62d22fa966
+ sha512sums = 1de3f09b96c44429b026277bb135a019b7577df2dec5f695ce51d18daefe2c1736b3359ab95f2abc46f7320c445b968e5582df92bb2bcad3ac5cfc5a32d3c5b6
+ sha512sums = f2be62d9cce00357b7b18ae83b976841037830b7b9ed1b67445f76e02550c904be5ab023366441199f9bb3dfd602004b0334395ffdde6c313910c1da5c39c4a3
source_x86_64 = https://download.visualstudio.microsoft.com/download/pr/cd855e4d-b02a-4327-b218-7ab500ecff83/c7649b00ee20e30244b8b84ff9139c71/dotnet-sdk-6.0.100-preview.3.21202.5-linux-x64.tar.gz
sha512sums_x86_64 = f776177c1ca2b672cf05f9ec32f20ef35a039dd8d31beaa139d1e47d71cca4ccf0f2a61bbf006a781e693977ee91cc9e08e12134ffb4c7a03a8e56c163b8661d
source_armv7h = https://download.visualstudio.microsoft.com/download/pr/bd2c0cea-b1b5-4de8-941b-2b53f94df021/51bdc3008f95104c1e5bf1cd7f34cf78/dotnet-sdk-6.0.100-preview.3.21202.5-linux-arm.tar.gz
diff --git a/PKGBUILD b/PKGBUILD
index a641271ba141..45a456f74e63 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -18,14 +18,22 @@ _hostver=6.0.0-preview.3.21201.4
_dotnetruntimever=6.0.0-preview.2.21201.4
_aspnetruntimever=6.0.0-preview.2.21201.13
_sdkver=6.0.100-preview.3.21202.5
-pkgrel=1
+pkgrel=2
arch=(x86_64 armv7h aarch64)
url=https://www.microsoft.com/net/core
license=(MIT)
options=(staticlibs)
+source=(dotnet.sh
+ register-completions.bash
+ register-completions.fish
+ register-completions.zsh)
source_x86_64=(https://download.visualstudio.microsoft.com/download/pr/cd855e4d-b02a-4327-b218-7ab500ecff83/c7649b00ee20e30244b8b84ff9139c71/dotnet-sdk-6.0.100-preview.3.21202.5-linux-x64.tar.gz)
source_armv7h=(https://download.visualstudio.microsoft.com/download/pr/bd2c0cea-b1b5-4de8-941b-2b53f94df021/51bdc3008f95104c1e5bf1cd7f34cf78/dotnet-sdk-6.0.100-preview.3.21202.5-linux-arm.tar.gz)
source_aarch64=(https://download.visualstudio.microsoft.com/download/pr/90d8a5e0-ed8f-430c-a66c-d17a096024a9/95d17428d5b0da3552c502eede9f7f05/dotnet-sdk-6.0.100-preview.3.21202.5-linux-arm64.tar.gz)
+sha512sums=('e61b9e3e5a2305646a616d598378230c9755c5dd5363692cc363f8f4add3807563c324dd86f3a7ae9d358c82d730608e7b293935a2b6c81c0c0f62d752a0a1cf'
+ '9f977e0bd12abc0dda4d914f369c58fce502b4030cf91d4248b32242d98fe5a2bbd8446502feeb914561f310dfd3c113bb6da19bfd5dfa6233109e62d22fa966'
+ '1de3f09b96c44429b026277bb135a019b7577df2dec5f695ce51d18daefe2c1736b3359ab95f2abc46f7320c445b968e5582df92bb2bcad3ac5cfc5a32d3c5b6'
+ 'f2be62d9cce00357b7b18ae83b976841037830b7b9ed1b67445f76e02550c904be5ab023366441199f9bb3dfd602004b0334395ffdde6c313910c1da5c39c4a3')
sha512sums_x86_64=('f776177c1ca2b672cf05f9ec32f20ef35a039dd8d31beaa139d1e47d71cca4ccf0f2a61bbf006a781e693977ee91cc9e08e12134ffb4c7a03a8e56c163b8661d')
sha512sums_armv7h=('feff4ca8600c48482a4a4cf2863d16e36c4a33e46b1b56567e8acf7599d7ea71feb2bb1715a43e989c26148ea2c5024353114e687c290632fa12f18d184a5ca9')
sha512sums_aarch64=('ee658e35f7917c5681d1f71ad3f82f4f2975d66a9b747ec5b5d58629b75c22fb6f31532b5423ad75b2e92ef333179948b52dd5507eadd9f3431e5638d98268d9')
@@ -41,6 +49,10 @@ package_dotnet-host-preview() {
cp -dr --no-preserve='ownership' LICENSE.txt ThirdPartyNotices.txt "${pkgdir}"/usr/share/licenses/dotnet-host-preview
ln -sf /usr/share/dotnet/dotnet "${pkgdir}"/usr/bin/dotnet
ln -sf /usr/share/dotnet/host/fxr/"${_hostver}"/libhostfxr.so "${pkgdir}"/usr/lib/libhostfxr.so
+ install -Dm 644 "${srcdir}"/dotnet.sh -t "${pkgdir}"/etc/profile.d/
+ install -Dm 644 "${srcdir}"/register-completions.bash "${pkgdir}"/usr/share/bash-completion/completions/dotnet
+ install -Dm 644 "${srcdir}"/register-completions.fish "${pkgdir}"/usr/share/fish/vendor_completions.d/dotnet.fish
+ install -Dm 644 "${srcdir}"/register-completions.zsh "${pkgdir}"/usr/share/zsh/site-functions/_dotnet
}
package_dotnet-runtime-preview() {
@@ -89,7 +101,7 @@ package_dotnet-sdk-preview() {
conflicts=(dotnet-sdk=${_sdkver%-*})
install -dm 755 "${pkgdir}"/usr/share/{dotnet,licenses}
- cp -dr --no-preserve='ownership' sdk templates "${pkgdir}"/usr/share/dotnet/
+ cp -dr --no-preserve='ownership' sdk sdk-manifests templates "${pkgdir}"/usr/share/dotnet/
ln -s dotnet-host-preview "${pkgdir}"/usr/share/licenses/dotnet-sdk-preview
}
@@ -109,8 +121,12 @@ package_dotnet-targeting-pack-preview() {
provides=(dotnet-targeting-pack=${_dotnetruntimever%-*} dotnet-targeting-pack-6.0)
conflicts=(dotnet-targeting-pack=${_dotnetruntimever%-*})
+ if [ $CARCH = 'x86_64' ]; then msarch=x64;
+ elif [ $CARCH = 'armv7h' ]; then msarch=arm;
+ elif [ $CARCH = 'aarch64' ]; then msarch=arm64; fi
+
install -dm 755 "${pkgdir}"/usr/share/{dotnet,dotnet/packs,licenses}
- cp -dr --no-preserve='ownership' packs/Microsoft.NETCore.App.{Host.linux-x64,Ref} "${pkgdir}"/usr/share/dotnet/packs/
+ cp -dr --no-preserve='ownership' packs/Microsoft.NETCore.App.{Host.linux-${msarch},Ref} "${pkgdir}"/usr/share/dotnet/packs/
ln -s dotnet-host "${pkgdir}"/usr/share/licenses/dotnet-targeting-pack-preview
}
diff --git a/dotnet.sh b/dotnet.sh
new file mode 100644
index 000000000000..fcc0bfd11dd4
--- /dev/null
+++ b/dotnet.sh
@@ -0,0 +1,12 @@
+# Set location for AppHost lookup
+[ -z "$DOTNET_ROOT" ] && export DOTNET_ROOT=/usr/share/dotnet
+
+# Add dotnet tools directory to PATH
+DOTNET_TOOLS_PATH="$HOME/.dotnet/tools"
+case "$PATH" in
+ *"$DOTNET_TOOLS_PATH"* ) true ;;
+ * ) PATH="$PATH:$DOTNET_TOOLS_PATH" ;;
+esac
+
+# Extract self-contained executables under HOME to avoid multi-user issues from using the default '/var/tmp'
+[ -z "$DOTNET_BUNDLE_EXTRACT_BASE_DIR" ] && export DOTNET_BUNDLE_EXTRACT_BASE_DIR="${XDG_CACHE_HOME:-"$HOME"/.cache}/dotnet_bundle_extract"
diff --git a/register-completions.bash b/register-completions.bash
new file mode 100644
index 000000000000..1dd65095e1cb
--- /dev/null
+++ b/register-completions.bash
@@ -0,0 +1,16 @@
+# bash parameter completion for the dotnet CLI
+
+_dotnet_bash_complete()
+{
+ local word=${COMP_WORDS[COMP_CWORD]}
+
+ local completions
+ completions="$(dotnet complete --position "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null)"
+ if [ $? -ne 0 ]; then
+ completions=""
+ fi
+
+ COMPREPLY=( $(compgen -W "$completions" -- "$word") )
+}
+
+complete -f -F _dotnet_bash_complete dotnet
diff --git a/register-completions.fish b/register-completions.fish
new file mode 100644
index 000000000000..7ca530dd20cc
--- /dev/null
+++ b/register-completions.fish
@@ -0,0 +1 @@
+complete -f -c dotnet -a "(dotnet complete)"
diff --git a/register-completions.zsh b/register-completions.zsh
new file mode 100644
index 000000000000..b6f9127a3a4c
--- /dev/null
+++ b/register-completions.zsh
@@ -0,0 +1,11 @@
+#compdef dotnet
+# zsh parameter completion for the dotnet CLI
+
+_dotnet()
+{
+ local completions=("$(dotnet complete "$words")")
+
+ [[ -n "$completions" ]] && compadd -- "${(ps:\n:)completions}"
+}
+
+_dotnet "$@"