mio c8e962ddd7 testing/vim-classic: new aport
https://vim-classic.org
Fork of Vim 8.x text editor for long-term maintenance
2026-04-05 03:11:20 +00:00

198 lines
4.7 KiB
Plaintext

# Maintainer: mio <miyopan@e.email>
maintainer="mio <miyopan@e.email>"
pkgname=vim-classic
pkgver=0_git20260403
pkgrel=0
_gitrev=6f8889edd5f64ee4ad073737f9ef870c6b4d9e0b
pkgdesc="Fork of Vim 8.x text editor for long-term maintenance"
url="https://vim-classic.org"
arch="all"
license="Vim"
_luaver=5.5
_makedepends_gvim="
gtk+3.0-dev
libx11-dev
libxt-dev
"
makedepends="
acl-dev
lua$_luaver-dev
ncurses-dev
perl-dev
python3-dev
ruby-dev
tcl-dev
"
checkdepends="
libtool
musl-locales
perl
"
subpackages="
$pkgname-doc
$pkgname-diff::noarch
$pkgname-tutor::noarch
$pkgname-common::noarch
$pkgname-xxd
"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/vim-classic/archive/$_gitrev.tar.gz
configure-as-needed.patch
python-3.14-configure.patch
revert-fix-null-ptr.patch
"
builddir="$srcdir/$pkgname-$_gitrev"
options="!check" # Flaky/env-specific tests
: "${ENABLE_GVIM:=true}"
if $ENABLE_GVIM; then
makedepends="$makedepends $_makedepends_gvim"
subpackages="$subpackages g$pkgname:gvim"
fi
prepare() {
default_prepare
if $ENABLE_GVIM; then
cp -r "$builddir" "$builddir"-gvim
fi
}
_build() {
vi_cv_version_plain_lua=$_luaver \
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--enable-luainterp=dynamic \
--enable-perlinterp=dynamic \
--enable-python3interp=dynamic \
--enable-rubyinterp=dynamic \
--enable-tclinterp=dynamic \
--disable-nls \
--enable-acl \
--enable-multibyte \
--enable-terminal \
--with-compiledby="Alpine Linux" \
--with-features=normal \
--with-local-dir=no \
--with-lua-prefix=/usr/lua$_luaver \
"$@"
make
}
build() {
_build \
--without-x \
--enable-gui=no
if $ENABLE_GVIM; then
cd "$builddir"-gvim
_build \
--with-x \
--enable-gui=gtk3
fi
}
check() {
# As of 6f8889ed: skip tests with errors:
# test87.in: https://lists.sr.ht/~sircmpwn/vim-classic-devel/patches/68689
# test_highlight.vim: Found errors in Test_wincolor_listchars()
# test_lineending.vim: Found errors in Test_lineending()
# test_makeencoding.vim: Found errors in Test_{getfile,grep,make}()
# test_memory_usage.vim: Found errors in Test_memory_func_capture_lvars()
# test_popupwin.vim: Found errors in Test_previewpopup()
# test_swap.vim: Found errors in Test_swapfile_delete()
# test_terminal.vim: Found errors in Test_terminal_composing_unicode()
local testdir="$builddir"/src/testdir
rm -f \
$testdir/test87.in $testdir/test87.ok \
$testdir/test_highlight.vim \
$testdir/test_lineending.vim \
$testdir/test_makeencoding.vim \
$testdir/test_memory_usage.vim \
$testdir/test_popupwin.vim \
$testdir/test_swap.vim \
$testdir/test_terminal.vim
make -j1 test
}
package() {
depends="
$pkgname-common=$pkgver-r$pkgrel
$pkgname-xxd=$pkgver-r$pkgrel
"
provider_priority=10
replaces="gvim-classic gvim"
make -j1 DESTDIR="$pkgdir" install
install -Dm644 runtime/doc/uganda.txt \
"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
# Only used with gvim-classic
rm -r "$pkgdir"/usr/share/icons/
rm -r "$pkgdir"/usr/share/applications/
}
common() {
pkgdesc="$pkgdesc (common files)"
replaces="gvim-classic vim-classic gvim vim"
amove usr/share/vim
}
gvim() {
pkgdesc="$pkgdesc (GTK GUI)"
depends="
$pkgname-common=$pkgver-r$pkgrel
$pkgname-xxd=$pkgver-r$pkgrel
"
provides="vim=$pkgver-r$pkgrel"
provider_priority=1
replaces="vim-classic vim"
make -j1 -C "$builddir"-gvim DESTDIR="$subpkgdir" install
rm "$subpkgdir"/usr/bin/vimdiff
rm "$subpkgdir"/usr/bin/vimtutor
rm -r "$subpkgdir"/usr/share/man
rm -r "$subpkgdir"/usr/share/vim
rm "$subpkgdir"/usr/bin/xxd
}
diff() {
pkgdesc="$pkgdesc (diff view mode)"
depends="
diffutils
$pkgname=$pkgver-r$pkgrel
"
options="$options !tracedeps"
replaces="gvim-classic vim-classic gvim vim"
amove usr/bin/vimdiff
}
tutor() {
pkgdesc="$pkgdesc (interactive tutorial)"
depends="$pkgname=$pkgver-r$pkgrel"
replaces="gvim-classic vim-classic gvim vim"
amove usr/bin/vimtutor
amove usr/share/vim/vim*/tutor
}
xxd() {
pkgdesc="Tool to make and reverse a hex dump"
depends=""
replaces="gvim-classic vim-classic gvim vim"
amove usr/bin/xxd
}
sha512sums="
639ae74730a23c75653d57efc238c42cc12f8f884015fcf58b580d34758218f1a502d235591bba2d54eb7b258fbb594e6c1f546a37722d84335d89adf9b5b604 vim-classic-0_git20260403.tar.gz
ada29cea0bbfeaae0d744fb123d7b34df4cb03bbb2b756cdb33fce4c5c40983cde3787ca4b9c5a0c9c5cf3dc4099b0085316d255e4d6944caac6be9960af12ca configure-as-needed.patch
7ffee30f516052f4ab403ab24b56915743c094504e328839abf39af584ed611d16d754cca03ff0e3431e6f2299d502c4ad9aac05bc1c89f709486938bc34d625 python-3.14-configure.patch
b05e8c1ae53441dc2fca35dd4e04aecbe8027c0740f182fc7afad7720d17bc8ee6d57b59bca26e10f5743ee9a88bd430af825a4344a62735548c45edbd9cefcc revert-fix-null-ptr.patch
"