summaryrefslogtreecommitdiff
path: root/vim/Makefile
blob: 56ba8f2e5550fd1470108c769b3ab37dada47dd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package ?= ips
include /usr/share/cibs/rules/$(package).mk
include /usr/share/cibs/rules/hg.mk
bits = 64

license := ViM
license-file := vim.license

hg-url  := https://vim.googlecode.com/hg/
download := $(hg-url)
home    := http://www.vim.org
name    := vim
version := 7.3.905
# hg update $(hg-update)
hg-update := v$(subst .,-,$(version))

build-depends += \
	developer/build/autoconf \
	developer/python \
	library/tinfo


pre-configure-stamp: autoconf-stamp
autoconf-stamp: patch-stamp
	cp $(sourcedir)/src/config.mk.dist $(sourcedir)/src/auto/config.mk
	$(MAKE) -C $(sourcedir)/src autoconf
	$(MAKE) -C $(sourcedir) distclean
	touch $@

$(eval $(call add-variant,basic))
$(eval $(call add-variant,nox))
$(eval $(call add-variant,tiny))

# Clean protodir, because they do not exist, we do not use them,
# and pkg requires them to exist
pkg-protos := -d .

configure-options := \
	--prefix=/usr \
	--mandir='$${prefix}'/share/man \
	--without-local-dir \
	--enable-fail-if-missing \

configure-options.nox := $(configure-options) \
	--without-x --enable-gui=no \
	--enable-pythoninterp \

configure-options.tiny := $(configure-options) \
	--with-features=small \
	--disable-gui \
	--disable-xsmp \
	--disable-xsmp-interact \
	--disable-netbeans \
	--enable-nls \
	--enable-multibyte \
	--enable-acl \

configure-options.basic := $(configure-options.nox) \
	--disable-luainterp \
	--disable-mzschemeinterp \
	--disable-perlinterp \
	--disable-pythoninterp \
	--disable-python3interp \
	--disable-rubyinterp \
	--disable-tclinterp \

d_tmp := work/proto/tmp
d_common := work/proto/vim-common
d_runtime := work/proto/vim-runtime
movefiles := /usr/share/cibs/scripts/movefiles

# We are building in source dir, but within subdirs:
configure-%-stamp: SHADOWDIR=vim-$*
configure-%-stamp:
	$(MAKE) -C $(sourcedir)/src shadow SHADOWDIR=$(SHADOWDIR)
	cd $(sourcedir) && if test -f src/auto/config.cache; then make distclean; fi
	cd $(sourcedir)/src/$(SHADOWDIR) && \
		LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CC="$(CC)"\
		./configure $(configure-options.$*)
	touch $@

build-%-stamp: SHADOWDIR=vim-$*
build-%-stamp:
	$(MAKE) -C $(sourcedir)/src/$(SHADOWDIR)
	touch $@

install-basic-stamp:
	$(MAKE) -C $(sourcedir)/src/vim-basic DESTDIR=$(topdir)/$(d_tmp) \
	    installvimbin \
	    installtutorbin \
	    installgtutorbin \
	    installruntime \
	    installtools \
	    install-icons \
	    install-languages
	rm -f $(protodir)/usr/bin/vim
	touch $@

install-nox-stamp install-tiny-stamp:
	touch $@

post-install-stamp: vim-common-stamp vim-runtime-stamp
vim-common-stamp: install-stamp
	mkdir -p $(d_common)
	$(movefiles) -s $(d_tmp) -d $(d_common) \
		usr/bin/xxd \
		usr/share/man/man1/xxd.1 \
		usr/share/man/man1/vimdiff.1 \
		usr/share/man/man1/vim.1
	mkdir -p $(d_common)/etc/vim
	mkdir -p $(d_common)/usr/share/vim
	mkdir -p $(d_common)/var/lib/vim/addons
	cp vimrc $(d_common)/etc/vim/vimrc
	ln -sf ../../../etc/vim $(d_common)/usr/share/vim/vimfiles
	ln -sf ../../../etc/vim/vimrc $(d_common)/usr/share/vim/vimrc
	ln -sf vim73 $(d_common)/usr/share/vim/vimcurrent
	ln -sf vim.1 $(d_common)/usr/share/man/man1/rvim.1
	ln -sf vim.1 $(d_common)/usr/share/man/man1/rview.1
	touch $@

vim-runtime-stamp: install-stamp
	mkdir -p $(d_runtime)
	$(movefiles) -s $(d_tmp) -d $(d_runtime) \
		usr/bin/vimtutor \
		usr/share/man/man1/vimtutor.1 \
		usr/share/vim
	touch $@