tree-wide: fix the installation of shell completions

This commit is contained in:
Chongyun Lee 2022-09-07 10:24:10 +08:00 committed by Uchiha Kakashi
parent 2c8b5995e9
commit c0b3468385
6 changed files with 29 additions and 60 deletions

View File

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="GitHubs official command line tool"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="Krishna kanhaiya @kcubeterm"
TERMUX_PKG_VERSION="2.15.0"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/cli/cli/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=298dc4f6bcfd96b05f90cb5d6ad07c9fff4e5e26de45be18b525abdb5d69f345
TERMUX_PKG_AUTO_UPDATE=true
@ -28,23 +29,17 @@ termux_step_make() {
termux_step_make_install() {
install -Dm700 -t "$TERMUX_PREFIX"/bin "$GOPATH"/src/github.com/cli/cli/cmd/gh/gh
install -Dm600 -t "$TERMUX_PREFIX"/share/doc/gh/ "$TERMUX_PKG_SRCDIR"/docs/*
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/bash-completion/completions/gh.bash
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/zsh/site-functions/_gh
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/fish/vendor_completions.d/gh.fish
}
termux_step_create_debscripts() {
cat <<-EOF >./postinst
#!${TERMUX_PREFIX}/bin/sh
mkdir -p ${TERMUX_PREFIX}/share/bash-completion/completions
mkdir -p ${TERMUX_PREFIX}/share/zsh/site-functions
mkdir -p ${TERMUX_PREFIX}/share/fish/vendor_completions.d
gh completion -s bash > ${TERMUX_PREFIX}/share/bash-completion/completions/gh.bash
gh completion -s zsh > ${TERMUX_PREFIX}/share/zsh/site-functions/_gh
gh completion -s fish > ${TERMUX_PREFIX}/share/fish/vendor_completions.d/gh.fish
EOF
cat <<-EOF >./prerm
#!${TERMUX_PREFIX}/bin/sh
rm -f ${TERMUX_PREFIX}/share/bash-completion/completions/gh.bash
rm -f ${TERMUX_PREFIX}/share/zsh/site-functions/_gh
rm -f ${TERMUX_PREFIX}/share/fish/vendor_completions.d/gh.fish
EOF
}

View File

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="A GitLab CLI tool bringing GitLab to your command line"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="1.22.0"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/profclems/glab/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=4b700d46cf9ee8fe6268e7654326053f4366aa3e072b5c3f3d243930a6e89edc
TERMUX_PKG_BUILD_IN_SRC=true
@ -15,23 +16,17 @@ termux_step_pre_configure() {
termux_step_make_install() {
install -Dm700 -t "${TERMUX_PREFIX}"/bin bin/glab
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/bash-completion/completions/glab.bash
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/zsh/site-functions/_glab
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/fish/vendor_completions.d/glab.fish
}
termux_step_create_debscripts() {
cat <<- EOF > ./postinst
#!${TERMUX_PREFIX}/bin/sh
mkdir -p ${TERMUX_PREFIX}/share/bash-completion/completions
mkdir -p ${TERMUX_PREFIX}/share/zsh/site-functions
mkdir -p ${TERMUX_PREFIX}/share/fish/vendor_completions.d
glab completion -s bash > ${TERMUX_PREFIX}/share/bash-completion/completions/glab.bash
glab completion -s zsh > ${TERMUX_PREFIX}/share/zsh/site-functions/_glab
glab completion -s fish > ${TERMUX_PREFIX}/share/fish/vendor_completions.d/glab.fish
EOF
cat <<- EOF > ./prerm
#!${TERMUX_PREFIX}/bin/sh
rm -f ${TERMUX_PREFIX}/share/bash-completion/completions/glab.bash
rm -f ${TERMUX_PREFIX}/share/zsh/site-functions/_glab
rm -f ${TERMUX_PREFIX}/share/fish/vendor_completions.d/glab.fish
EOF
}

View File

@ -4,6 +4,7 @@ TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_LICENSE_FILE="LICENSE"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="0.6.0"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL="https://github.com/charmbracelet/gum/archive/refs/tags/v$TERMUX_PKG_VERSION.tar.gz"
TERMUX_PKG_SHA256=53bc02a5aac5659e5c89d9b469dc181b7379e51defb123d1dfe05753fe05184e
TERMUX_PKG_AUTO_UPDATE=true
@ -17,6 +18,11 @@ termux_step_make() {
termux_step_make_install() {
install -Dm755 -t "${TERMUX_PREFIX}/bin" "${TERMUX_PKG_SRCDIR}/gum"
install -Dm644 /dev/null $TERMUX_PREFIX/share/man/man1/gum.1
install -Dm644 /dev/null $TERMUX_PREFIX/share/bash-completion/completions/gum
install -Dm644 /dev/null $TERMUX_PREFIX/share/zsh/site-functions/_gum
install -Dm644 /dev/null $TERMUX_PREFIX/share/fish/vendor_completions.d/gum.fish
}
termux_step_create_debscripts() {
@ -26,16 +32,12 @@ termux_step_create_debscripts() {
# Generating manpages
printf >&2 "%s\n" "Generating manpages for gum"
mkdir -p "$TERMUX_PREFIX/share/man/man1"
if ! gum man > "$TERMUX_PREFIX/share/man/man1/gum.1"; then
printf >&2 "\t%s\n" "manpages for gum: FAILED"
fi
# Generating shell completions
printf >&2 "%s\n" "Generating shell completions for gum"
mkdir -p "$TERMUX_PREFIX/share/bash-completion/completions"
mkdir -p "$TERMUX_PREFIX/share/zsh/site-functions"
mkdir -p "$TERMUX_PREFIX/share/fish/vendor_completions.d"
if ! gum completion bash \
> "$TERMUX_PREFIX/share/bash-completion/completions/gum"; then
printf >&2 "\t%s\n" "bash completions for gum: FAILED"
@ -49,12 +51,4 @@ termux_step_create_debscripts() {
printf >&2 "\t%s\n" "fish completions for gum: FAILED"
fi
EOF
cat <<- EOF > ./postrm
#!$TERMUX_PREFIX/bin/sh
rm -f "$TERMUX_PREFIX/share/man/man1/gum.1"
rm -f "$TERMUX_PREFIX/share/bash-completion/completions/gum"
rm -f "$TERMUX_PREFIX/share/zsh/site-functions/_gum"
rm -f "$TERMUX_PREFIX/share/fish/vendor_completions.d/gum.fish"
EOF
}

View File

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Simple jira command line client written in Go"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="1.0.27"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/go-jira/jira/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=c5bcf7b61300b67a8f4e42ab60e462204130c352050e8551b1c23ab2ecafefc7
TERMUX_PKG_BUILD_IN_SRC=true
@ -14,21 +15,16 @@ termux_step_pre_configure() {
termux_step_make_install() {
install -Dm700 -t "${TERMUX_PREFIX}"/bin jira
install -Dm644 /dev/null $TERMUX_PREFIX/share/bash-completion/completions/jira-go
install -Dm644 /dev/null $TERMUX_PREFIX/share/zsh/site-functions/_jira_go
}
termux_step_create_debscripts() {
cat <<- EOF > postinst
#!$TERMUX_PREFIX/bin/sh
mkdir -p $TERMUX_PREFIX/share/bash-completion/completions
# \`|| true\` is used since jira exits with non-zero code even if request succeedes.
jira --completion-script-bash > $TERMUX_PREFIX/share/bash-completion/completions/jira-go || true
mkdir -p $TERMUX_PREFIX/share/zsh/site-functions
jira --completion-script-zsh > $TERMUX_PREFIX/share/zsh/site-functions/_jira_go || true
EOF
cat <<- EOF > prerm
#!$TERMUX_PREFIX/bin/sh
rm -f $TERMUX_PREFIX/share/bash-completion/completions/jira-go
rm -f $TERMUX_PREFIX/share/zsh/site-functions/_jira_go
EOF
}

View File

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="GNU Parallel is a shell tool for executing jobs in paral
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=20220422
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/parallel/parallel-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_SHA256=96e4b73fff1302fc141a889ae43ab2e93f6c9e86ac60ef62ced02dbe70b73ca7
TERMUX_PKG_DEPENDS="perl"
@ -10,6 +11,9 @@ TERMUX_PKG_PLATFORM_INDEPENDENT=true
termux_step_post_make_install() {
cd "$TERMUX_PKG_SRCDIR"
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/bash-completion/completions/parallel
mkdir -p "$TERMUX_PREFIX"/share/zsh/site-functions
cat <<-EOF >"$TERMUX_PREFIX"/share/zsh/site-functions/_parallel
@ -23,12 +27,6 @@ termux_step_post_make_install() {
termux_step_create_debscripts() {
cat <<-EOF >./postinst
#!${TERMUX_PREFIX}/bin/sh
mkdir -p ${TERMUX_PREFIX}/share/bash-completion/completions
parallel --shell-completion bash > ${TERMUX_PREFIX}/share/bash-completion/completions/parallel
EOF
cat <<-EOF >./prerm
#!${TERMUX_PREFIX}/bin/sh
rm -f ${TERMUX_PREFIX}/share/bash-completion/completions/parallel
EOF
}

View File

@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Download youtube video in Golang"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="Krishna kanhaiya @kcubeterm"
TERMUX_PKG_VERSION=2.7.10
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/kkdai/youtube/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=04a4f0b745094884fb2902945ac3b1c966fbe4fbd67a027cb482d491662900f9
TERMUX_PKG_AUTO_UPDATE=true
@ -23,26 +23,17 @@ termux_step_make() {
termux_step_make_install() {
install -Dm700 -t "$TERMUX_PREFIX"/bin "$GOPATH"/src/github.com/kkdai/youtube/cmd/youtubedr/youtubedr
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/bash-completion/completions/youtubedr
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/zsh/site-functions/_youtubedr
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/fish/vendor_completions.d/youtubedr.fish
}
termux_step_create_debscripts() {
cat <<-EOF >./postinst
#!${TERMUX_PREFIX}/bin/sh
mkdir -p ${TERMUX_PREFIX}/share/bash-completion/completions
mkdir -p ${TERMUX_PREFIX}/share/zsh/site-functions
mkdir -p ${TERMUX_PREFIX}/share/fish/vendor_completions.d
youtubedr completion bash > ${TERMUX_PREFIX}/share/bash-completion/completions/youtubedr
youtubedr completion zsh > ${TERMUX_PREFIX}/share/zsh/site-functions/_youtubedr
youtubedr completion fish > ${TERMUX_PREFIX}/share/fish/vendor_completions.d/youtubedr.fish
EOF
cat <<-EOF >./prerm
#!${TERMUX_PREFIX}/bin/sh
rm -f ${TERMUX_PREFIX}/share/bash-completion/completions/youtubedr
rm -f ${TERMUX_PREFIX}/share/zsh/site-functions/_youtubedr
rm -f ${TERMUX_PREFIX}/share/fish/vendor_completions.d/youtubedr.fish
EOF
}