Makefile 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. # $OpenBSD: Makefile,v 1.160 2017/04/29 21:04:29 sthen Exp $
  2. COMMENT-main= vi clone, many additional features
  3. COMMENT-lang= vi clone, NLS subpackage
  4. # if updating major version, sync editors/vim-spell
  5. V= 8.0.0587
  6. GH_ACCOUNT= vim
  7. GH_PROJECT= vim
  8. GH_TAGNAME= v$V
  9. PKGNAME-main= vim-$V
  10. PKGNAME-lang= vim-lang-$V
  11. P= vim${V:R:S/.//}
  12. CATEGORIES= editors
  13. HOMEPAGE= http://www.vim.org/
  14. # donation-ware
  15. PERMIT_PACKAGE_CDROM= Yes
  16. WANTLIB += c curses
  17. MULTI_PACKAGES= -main -lang
  18. FULLPKGNAME-lang= vim-lang-$V
  19. FULLPKGPATH-lang= ${PKGPATH},-lang
  20. FLAVORS= huge gtk2 athena motif no_x11 lua perl python python3 ruby
  21. FLAVOR?= gtk2
  22. .include <bsd.port.arch.mk>
  23. .if ${FLAVOR:Mno_x11}
  24. BUILD_PACKAGES := ${BUILD_PACKAGES:N-lang}
  25. .endif
  26. CONFIGURE_STYLE=gnu
  27. CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
  28. LDFLAGS="-L${LOCALBASE}/lib"
  29. CONFIGURE_ARGS+= --with-tlib="curses" \
  30. --enable-multibyte \
  31. --enable-cscope
  32. AUTOCONF_VERSION= 2.69
  33. BUILD_DEPENDS= ${MODGNU_AUTOCONF_DEPENDS}
  34. .if ${FLAVOR:Mhuge}
  35. CONFIGURE_ARGS+= --with-features=huge
  36. .endif
  37. .if ${FLAVOR:Mlua}
  38. MODULES+= lang/lua
  39. MODLUA_VERSION= 5.1
  40. CONFIGURE_ENV+= vi_cv_path_plain_lua=${MODLUA_BIN}
  41. CONFIGURE_ARGS+= --enable-luainterp --with-lua-prefix=${LOCALBASE}
  42. LIB_DEPENDS+= ${MODLUA_LIB_DEPENDS}
  43. WANTLIB+= m ${MODLUA_WANTLIB}
  44. .endif
  45. .if ${FLAVOR:Mperl}
  46. CONFIGURE_ARGS+= --enable-perlinterp
  47. WANTLIB+= m perl util
  48. .endif
  49. .if ${FLAVOR:Mpython}
  50. MODULES+= lang/python
  51. CONFIGURE_ENV+= vi_cv_path_python=${MODPY_BIN}
  52. CONFIGURE_ARGS+= --enable-pythoninterp=yes --enable-python3interp=no \
  53. --with-python-config-dir=${MODPY_LIBDIR}/config
  54. LIB_DEPENDS+= ${MODPY_LIB_DEPENDS}
  55. WANTLIB+= m ${MODPY_WANTLIB}
  56. .endif
  57. .if ${FLAVOR:Mpython3}
  58. MODULES+= lang/python
  59. MODPY_MAJOR_VERSION = 3
  60. CONFIGURE_ENV+= vi_cv_path_python3=${MODPY_BIN}
  61. CONFIGURE_ARGS+= --enable-python3interp=yes --enable-pythoninterp=no \
  62. --with-python3-config-dir=${MODPY_LIBDIR}/config-${MODPY_VERSION}m
  63. LIB_DEPENDS+= ${MODPY_LIB_DEPENDS}
  64. WANTLIB+= m ${MODPY_WANTLIB}
  65. .endif
  66. # Some parts of vim (like python autocompletion) require a version of vim
  67. # compiled with "+python" or "+python3". If python2 and python3 are enabled
  68. # in configure, vim is compiled with "+python/dyn" and "+python3/dyn" and that
  69. # breaks some plugins.
  70. .if ${FLAVOR:Mpython} && ${FLAVOR:Mpython3}
  71. ERRORS= "Fatal: You only can select one python flavor"
  72. .endif
  73. .if ${FLAVOR:Mruby}
  74. MODULES+= lang/ruby
  75. MODRUBY_REV= 1.8
  76. CONFIGURE_ARGS+= --enable-rubyinterp --with-ruby-command=${RUBY}
  77. LIB_DEPENDS+= ${MODRUBY_LIB_DEPENDS}
  78. WANTLIB+= m ${MODRUBY_WANTLIB}
  79. .endif
  80. .if ${FLAVOR:Mno_x11} && \
  81. !${FLAVOR:Mmotif} && !${FLAVOR:Mathena} && !${FLAVOR:Mgtk2}
  82. CONFIGURE_ARGS+= --disable-gui \
  83. --without-x
  84. WANTLIB+= m
  85. .elif ${FLAVOR:Mmotif} && \
  86. !${FLAVOR:Mno_x11} && !${FLAVOR:Mathena} && !${FLAVOR:Mgtk2}
  87. CONFIGURE_ARGS+= --enable-gui="motif" \
  88. --enable-fontset \
  89. --enable-xim \
  90. --with-x
  91. CONFIGURE_ENV+= MOTIFHOME=${X11BASE}
  92. LIB_DEPENDS+= x11/motif
  93. WANTLIB += m ICE SM X11 Xmu Xpm Xt Xm
  94. MAKE_ENV+=MOTIFLIB='-L${LOCALBASE}/lib -lXm'
  95. .elif ${FLAVOR:Mathena} && \
  96. !${FLAVOR:Mno_x11} && !${FLAVOR:Mmotif} && !${FLAVOR:Mgtk2}
  97. CONFIGURE_ARGS+= --enable-gui="athena" \
  98. --enable-fontset \
  99. --enable-xim \
  100. --with-x
  101. WANTLIB += m ICE SM X11 Xaw Xmu Xpm Xt
  102. .elif ${FLAVOR:Mgtk2} && \
  103. !${FLAVOR:Mmotif} && !${FLAVOR:Mno_x11} && !${FLAVOR:Mathena}
  104. MAKE_FLAGS+= 'LDFLAGS=-pthread'
  105. MAKE_FLAGS+= 'CFLAGS=-pthread'
  106. LIB_DEPENDS+= x11/gtk+2
  107. CONFIGURE_ARGS+= --enable-gui="gtk2" \
  108. --disable-gtk-check \
  109. --enable-fontset \
  110. --enable-gtk2-check \
  111. --enable-xim \
  112. --with-x
  113. WANTLIB += ICE SM X11 Xcomposite Xcursor Xdamage Xdmcp Xext Xfixes
  114. WANTLIB += Xi Xinerama Xpm Xrandr Xrender Xt atk-1.0 cairo
  115. WANTLIB += fontconfig freetype gdk-x11-2.0 gdk_pixbuf-2.0 gio-2.0
  116. WANTLIB += glib-2.0 gobject-2.0 gtk-x11-2.0 m pango-1.0 pangocairo-1.0
  117. WANTLIB += pangoft2-1.0 pthread z
  118. .else
  119. ERRORS= "Fatal: You must select one GUI interface: no_x11, gtk2, athena or motif"
  120. .endif
  121. RUN_DEPENDS-lang= editors/vim,-main
  122. PKG_ARCH-lang= *
  123. LIB_DEPENDS-lang=
  124. WANTLIB-lang=
  125. MODULES+= devel/gettext
  126. WRKSRC= ${WRKDIST}/src
  127. SUBST_VARS= P
  128. # CONFIGURE_STYLE=autoconf doesn't work
  129. post-patch:
  130. cd ${WRKSRC}; AUTOCONF_VERSION=${AUTOCONF_VERSION} autoconf
  131. post-configure:
  132. touch ${WRKBUILD}/auto/config.mk
  133. post-install:
  134. ${INSTALL_DATA_DIR} ${PREFIX}/share/vim/vimfiles/{doc,syntax}
  135. ${INSTALL_DATA} ${FILESDIR}/openbsd.vim \
  136. ${PREFIX}/share/vim/vimfiles/syntax/
  137. .if ! ${FLAVOR:Mno_x11}
  138. ${INSTALL_DATA_DIR} ${PREFIX}/share/applications
  139. ${SUBST_DATA} ${WRKDIST}/runtime/gvim.desktop \
  140. ${PREFIX}/share/applications/gvim.desktop
  141. ${INSTALL_DATA_DIR} ${PREFIX}/share/pixmaps
  142. ${INSTALL_DATA} ${WRKDIST}/runtime/vim48x48.png ${PREFIX}/share/pixmaps/vim.png
  143. RUN_DEPENDS+= devel/desktop-file-utils
  144. RUN_DEPENDS+= x11/gtk+3,-guic
  145. .endif
  146. .include <bsd.port.mk>