aboutsummaryrefslogblamecommitdiffstats
path: root/main/vim/APKBUILD
blob: 3dd3f6295445147db780e7da4b7d4c8f36ac40a0 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                    
                                                   
                                                              

                                                   
               
        
                                       
                          
          
             
                                          
             
                                                                                 
                                                                                       
                                                                                   

             
 
           
                
                      


                     

                     


                     
           
                                  
                                                                       
                                          
                       
 
 
         



                                 
                                    
                                                
                             
                               
                                    
                                 
                                               

                                                













                                                

 
         


                 
           
                                           

                                               

                                                              

 

                                                







                                                                 
                                   

 

                                        

                               
 
                                       


                                                         










                                                                                








                                                                              


                                                      



                                     

 
            
                                                                                                                                                     

                                                                                                                                       
# Contributor: Sergei Lukin <sergej.lukin@gmail.com>
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=vim
pkgver=8.2.3156
pkgrel=0
pkgdesc="Improved vi-style text editor"
url="https://www.vim.org/"
arch="all"
license="Vim"
options="!check"  # some tests are failing
depends="xxd"
makedepends="ncurses-dev lua5.3-dev python3-dev gtk+3.0-dev libx11-dev libxt-dev"
subpackages="$pkgname-doc ${pkgname}diff::noarch $pkgname-tutor $pkgname-help gvim xxd"
source="$pkgname-$pkgver.tar.gz::https://github.com/vim/vim/archive/v$pkgver.tar.gz
	vimrc
	"

# secfixes:
#   8.1.1365-r0:
#     - CVE-2019-12735
#   8.0.1521-r0:
#     - CVE-2017-6350
#     - CVE-2017-6349
#   8.0.0329-r0:
#     - CVE-2017-5953
#   8.0.0056-r0:
#     - CVE-2016-1248

prepare() {
	# Read vimrc from /etc/vim
	echo '#define SYS_VIMRC_FILE "/etc/vim/vimrc"' >> src/feature.h
	cp -r "$builddir" "$builddir"-gvim
	default_prepare
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-luainterp \
		--enable-python3interp=dynamic \
		--without-x \
		--disable-nls \
		--enable-multibyte \
		--enable-gui=no \
		--with-lua-prefix=/usr/lua5.3 \
		--with-compiledby="Alpine Linux"
	make
	cd "$builddir"-gvim
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-luainterp \
		--enable-python3interp=dynamic \
		--with-x \
		--disable-nls \
		--enable-multibyte \
		--enable-gui=gtk3 \
		--with-lua-prefix=/usr/lua5.3 \
		--with-compiledby="Alpine Linux"
	make
}

check() {
	make test
}

package() {
	make -j1 DESTDIR="$pkgdir/" install

	install -Dm644 runtime/doc/uganda.txt \
		"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	install -Dm644 "$srcdir"/vimrc "$pkgdir"/etc/vim/vimrc
}

gvim() {
	pkgdesc="advanced text editor, with GUI"
	provides="vim"
	cd "$builddir"-gvim
	make -j1 DESTDIR="$subpkgdir/" install

	install -Dm644 runtime/doc/uganda.txt \
		"$subpkgdir/usr/share/licenses/$pkgname/LICENSE"
	install -Dm644 "$srcdir"/vimrc "$subpkgdir"/etc/vim/vimrc
	rm -rf "$subpkgdir"/usr/share/man
	rm "$subpkgdir/usr/bin/xxd"
}

vimdiff() {
	pkgdesc="view file diffs in vim"
	depends="diffutils vim"
	options="!tracedeps"

	install -d "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/vimdiff "$subpkgdir"/usr/bin
}

tutor() {
	pkgdesc="vim tutor and tutor files"
	depends="vim"
	options="!tracedeps"

	install -d "$subpkgdir"/usr/bin
	install -d "$subpkgdir"/usr/share/vim/vim82/tutor
	mv "$pkgdir"/usr/bin/vimtutor "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/share/vim/vim82/tutor "$subpkgdir"/usr/share/vim/vim82/
}

help() {
	pkgdesc="vim help files"
	depends="vim"
	options="!tracedeps"

	install -d "$subpkgdir"/usr/share/vim/vim82/doc
	mv "$pkgdir"/usr/share/vim/vim82/doc "$subpkgdir"/usr/share/vim/vim82/
}

xxd() {
	pkgdesc="tool to make (or reverse) a hex dump"
	depends=""
	echo "$pkgdir" "$subpkgdir"
	mkdir -p "$subpkgdir/usr/bin"
	mv "$pkgdir/usr/bin/xxd" \
	   "$subpkgdir/usr/bin/"
}

sha512sums="
ae76f67d953ac1fe5177c4c449419a88ca85c1004f0e3b07d195ff8089f597d65b8f212e256aecf5ff25bb2ccfadb3e4325351030cb68e53ee5a152cadecbc6c  vim-8.2.3156.tar.gz
d9586b777881973cb5e48e18750336a522ed72c3127b2d6b6991e2b943468ca5b694476e7fa39ab469178c1375fc8f52627484e0fe377aea5811a513e35a7b02  vimrc
"