Subject: [alpine-aports] [PATCH] main/vim: add gvim package

From: Drew DeVault <[email-masked]>
Date: Fri, 1 Mar 2019 09:41:16 -0700

---
 main/vim/APKBUILD | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/main/vim/APKBUILD b/main/vim/APKBUILD
index 9a48bf7d41..95a6234a40 100644
--- a/main/vim/APKBUILD
+++ b/main/vim/APKBUILD
@@ -10,8 +10,8 @@ url="https://www.vim.org"
 arch="all"
 license="Vim"
 options="!check"  # some tests are failing
-makedepends="ncurses-dev lua5.3-dev python3-dev"
-subpackages="$pkgname-doc ${pkgname}diff::noarch"
+makedepends="ncurses-dev lua5.3-dev python3-dev gtk+3.0-dev libx11-dev libxt-dev"
+subpackages="$pkgname-doc ${pkgname}diff::noarch gvim"
 source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/v$pkgver.tar.gz
 	vimrc
 	"
@@ -30,6 +30,7 @@ prepare() {
 	cd "$builddir"
 	# Read vimrc from /etc/vim
 	echo '#define SYS_VIMRC_FILE "/etc/vim/vimrc"' >> src/feature.h
+	cp -r "$builddir" "$builddir"-gvim
 }
 
 build() {
@@ -47,6 +48,20 @@ build() {
 		--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() {
@@ -63,6 +78,19 @@ package() {
 	install -Dm644 "$srcdir"/vimrc "$pkgdir"/etc/vim/vimrc
 }
 
+gvim() {
+	pkgdesc="advanced text editor, with GUI"
+	conflicts="vim"
+	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
+}
+
 vimdiff() {
 	pkgdesc="view file diffs in vim"
 	depends="diffutils"
-- 
2.20.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---