Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(neovim): More complete update-alternatives #12

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions packages/neovim/.SRCINFO
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ pkgrel = 1
pkgdesc = Neovim is a vim fork maintained by the community
url = https://neovim.io/
source = https://github.com/neovim/neovim/archive/refs/tags/v0.10.0.tar.gz
source = nview
source = nvimdiff
source = ex
source = rview
source = rvim
source = view
source = vimdiff
makedepends = gettext
makedepends = libtool
makedepends = libtool-bin
Expand All @@ -20,5 +23,8 @@ replaces = neovim-runtime
maintainer = Elsie19 <[email protected]>
repology = project: neovim
sha256sums = 372ea2584b0ea2a5a765844d95206bda9e4a57eaa1a2412a9a0726bab750f828
sha256sums = 2333e46dfa12daa43706b101d8f179a5a81ee08c89530a45bba9c91ae6bc7c7c
sha256sums = dfc7caa96d5906bdd334ce85a2edd632f0f3f8b75e3f35d92fb182d8dfe16077
sha256sums = 5d3178628afc39f0318638cad19e9ad06ada89926dfb263e93ab35cc8f60e911
sha256sums = f04c9baa97f49afe7969826b45e283c60e2d52e28aa3ea7fa93a62dab0408a55
sha256sums = 8528f61eaca19285c8220c7d12099743d76abf872a30515698644c91a05c55e0
sha256sums = 3cb963a264b6cf45749627408b5a62c6945e5e426b595bb5e6a388194c2c1990
sha256sums = 1d3123b9d97a4889696ab72db558041b5cca8e26ff51ae557f7842242a7d4ed1
2 changes: 2 additions & 0 deletions packages/neovim/ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/nvim -e "$@"
60 changes: 48 additions & 12 deletions packages/neovim/neovim.pacscript
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ pkgver="0.10.0"
pkgrel="1"
source=(
"https://github.com/neovim/neovim/archive/refs/tags/v${pkgver}.tar.gz"
"nview"
"nvimdiff"
"ex"
"rview"
"rvim"
"view"
"vimdiff"

)
url='https://neovim.io/'
Expand All @@ -13,8 +16,11 @@ replaces=("neovim" "nvim" "neovim-runtime")
pkgdesc="Neovim is a vim fork maintained by the community"
sha256sums=(
"372ea2584b0ea2a5a765844d95206bda9e4a57eaa1a2412a9a0726bab750f828"
"2333e46dfa12daa43706b101d8f179a5a81ee08c89530a45bba9c91ae6bc7c7c"
"dfc7caa96d5906bdd334ce85a2edd632f0f3f8b75e3f35d92fb182d8dfe16077"
"5d3178628afc39f0318638cad19e9ad06ada89926dfb263e93ab35cc8f60e911"
"f04c9baa97f49afe7969826b45e283c60e2d52e28aa3ea7fa93a62dab0408a55"
"8528f61eaca19285c8220c7d12099743d76abf872a30515698644c91a05c55e0"
"3cb963a264b6cf45749627408b5a62c6945e5e426b595bb5e6a388194c2c1990"
"1d3123b9d97a4889696ab72db558041b5cca8e26ff51ae557f7842242a7d4ed1"
)
maintainer=("Elsie19 <[email protected]>")
external_connection=true
Expand All @@ -30,18 +36,48 @@ package() {
make install DESTDIR="${pkgdir}"
install -Dm644 "LICENSE.txt" -t "${pkgdir}/usr/share/licenses/${pkgname}"
install -Dm644 "README.md" -t "${pkgdir}/usr/share/doc/${pkgname}"
install -Dm755 "${srcdir}/nview" -t "${pkgdir}/usr/bin"
install -Dm755 "${srcdir}/nvimdiff" -t "${pkgdir}/usr/bin"
install -Dm755 "${srcdir}/ex" -t "${pkgdir}/usr/libexec/${pkgname}"
install -Dm755 "${srcdir}/rview" -t "${pkgdir}/usr/libexec/${pkgname}"
install -Dm755 "${srcdir}/rvim" -t "${pkgdir}/usr/libexec/${pkgname}"
install -Dm755 "${srcdir}/view" -t "${pkgdir}/usr/libexec/${pkgname}"
install -Dm755 "${srcdir}/vimdiff" -t "${pkgdir}/usr/libexec/${pkgname}"
}

post_install() {
update-alternatives --install /usr/bin/vim vim /usr/bin/nvim 100
update-alternatives --install /usr/bin/view view /usr/bin/nview 100
update-alternatives --install /usr/bin/vimdiff vimdiff /usr/bin/nvimdiff 100
set -e

update-alternatives --install /usr/bin/editor editor /usr/bin/nvim 30 \
--slave /usr/share/man/man1/editor.1.gz editor.1.gz \
/usr/share/man/man1/nvim.1.gz
update-alternatives --install /usr/bin/ex ex "/usr/libexec/${pkgname}/ex" 30
update-alternatives --install /usr/bin/rvim rvim "/usr/libexec/${pkgname}/rvim" 30
update-alternatives --install /usr/bin/rview rview "/usr/libexec/${pkgname}/rview" 30
update-alternatives --install /usr/bin/vi vi /usr/bin/nvim 30
update-alternatives --install /usr/bin/vim vim /usr/bin/nvim 30
update-alternatives --install /usr/bin/view view "/usr/libexec/${pkgname}/view" 30
update-alternatives --install /usr/bin/vimdiff vimdiff "/usr/libexec/${pkgname}/vimdiff" 30
}

pre_remove() {
update-alternatives --remove vimdiff /usr/bin/nvimdiff
update-alternatives --remove view /usr/bin/nview
update-alternatives --remove vim /usr/bin/nvim
set -e

case "$1" in
remove | deconfigure)
update-alternatives --remove editor /usr/bin/nvim
update-alternatives --remove ex "/usr/libexec/${pkgname}/ex"
update-alternatives --remove rvim "/usr/libexec/${pkgname}/rvim"
update-alternatives --remove rview "/usr/libexec/${pkgname}/rview"
update-alternatives --remove vi /usr/bin/nvim
update-alternatives --remove vim /usr/bin/nvim
update-alternatives --remove view "/usr/libexec/${pkgname}/view"
update-alternatives --remove vimdiff "/usr/libexec/${pkgname}/vimdiff"
;;

upgrade | failed-upgrade) ;;

*)
echo "prerm called with unknown argument '$1'" >&2
exit 0
;;
esac
}
3 changes: 0 additions & 3 deletions packages/neovim/nview

This file was deleted.

3 changes: 0 additions & 3 deletions packages/neovim/nvimdiff

This file was deleted.

2 changes: 2 additions & 0 deletions packages/neovim/rview
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/nvim -RZ "$@"
2 changes: 2 additions & 0 deletions packages/neovim/rvim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/nvim -Z "$@"
2 changes: 2 additions & 0 deletions packages/neovim/view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/nvim -R "$@"
2 changes: 2 additions & 0 deletions packages/neovim/vimdiff
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/nvim -d "$@"
Loading