# $Id: Portfile 119295 2014-04-22 15:35:47Z raimue@macports.org $

PortSystem          1.0

name                vim
set vim_version     7.4
set vim_patchlevel  258
version             ${vim_version}.${vim_patchlevel}
categories          editors
platforms           darwin freebsd
license             Vim GPL-2+
maintainers         raimue
description         Vi \"workalike\" with many additional features
long_description \
    Vim is an advanced text editor that seeks to provide the power of the   \
    de-facto Unix editor 'Vi', with a more complete feature set.

homepage            http://www.vim.org/

master_sites        http://ftp.vim.org/pub/vim/unix/
patch_sites         http://ftp.vim.org/pub/vim/patches/${vim_version}
distname            vim-${vim_version}
use_bzip2           yes
dist_subdir         vim/${vim_version}
worksrcdir          vim[strsed ${vim_version} {g/\.//}]
extract.only        vim-${vim_version}${extract.suffix}

# Generate patchfiles
set low 1
set patchlevel [string trimleft $vim_patchlevel 0]
while {$low <= $patchlevel} {
    patchfiles-append [format "%s.%03d" $vim_version $low]
    incr low 1
}

checksums \
  vim-${vim_version}${extract.suffix} \
    md5     607e135c559be642f210094ad023dc65 \
    sha1    601abf7cc2b5ab186f40d8790e542f86afca86b7 \
    rmd160  f23f62dccdbf84cbf907a0cd38c7077a87e764ee \
    sha256  d0f5a6d2c439f02d97fa21bd9121f4c5abb1f6cd8b5a79d3ca82867495734ade

checksums-append \
    7.4.001 md5 f234692c9ab5265ba6ba6f55c0f81764 \
    7.4.002 md5 a03e1a5ad3722f2011751dda977641af \
    7.4.003 md5 e6d070f592bb6da4d8cf2f7f134425e5 \
    7.4.004 md5 77566c96ea0feb3effd5624e02126b11 \
    7.4.005 md5 c71f2af8c787f6b7f57be9937f925a20 \
    7.4.006 md5 88f99b8f2e2a5eab0b054b839edc3856 \
    7.4.007 md5 59f1c6e00ae3309a3f998e795b998be1 \
    7.4.008 md5 6d17c2f54ed124b03d60121e9a7aa150 \
    7.4.009 md5 e53775eb1a632e68e14d2002b8c220b4 \
    7.4.010 md5 ed08869476205e90af14e0be02cc5cfd \
    7.4.011 md5 b87237dfa835d07a005d3d3a8476fb34 \
    7.4.012 md5 d058bb40d1c670529c19c3c3d3c76421 \
    7.4.013 md5 c5d0ae4f982c57467bc330f03f1f176d \
    7.4.014 md5 914eb6390a5a6b677c2f0ef0edefb60c \
    7.4.015 md5 56c2924732fc886e46569a399864a5cc \
    7.4.016 md5 35a4cf5f64dcb948bb13a2db592c168f \
    7.4.017 md5 67f6ab40bdd3107c0731766278cfdc73 \
    7.4.018 md5 4c8b21a64040356066c5bcc4d056bec5 \
    7.4.019 md5 fbf7aef0eab753fcf4c4d575c76fd4bf \
    7.4.020 md5 c6a5bc4865a5e5e8c16333d5095fd571 \
    7.4.021 md5 a983fabe523f0c91cbeec43a16b599c9 \
    7.4.022 md5 612b6401b7ad5a8859439dc1e257ad05 \
    7.4.023 md5 cdd8466563a0fd4fb538dbc1606d4a42 \
    7.4.024 md5 7720495cecc60252198c1c5056de010a \
    7.4.025 md5 161173463dc95145c48f7691aee73f13 \
    7.4.026 md5 8e0181a33d4cf99f3ff8f359c99af7b5 \
    7.4.027 md5 97f5e46883edf23f873522db86e721a6 \
    7.4.028 md5 163291f22218e69281f8b0a136252bd5 \
    7.4.029 md5 93b6179890ea3f33da2916ef0ae3160e \
    7.4.030 md5 8c1d1829bfce977bbe91df885673b05a \
    7.4.031 md5 83673b79f3e04ea837aeb4f3acdf0350 \
    7.4.032 md5 b98fc58c605dba8d14d566af3da42d15 \
    7.4.033 md5 92a277e660a6968448d9d941df55a308 \
    7.4.034 md5 3510a4181c7719b6c948cde1a9591a5a \
    7.4.035 md5 83476f1ca3fd83ca39681c6315a633bf \
    7.4.036 md5 c52b130beb86f26623fca7b5051ad3e3 \
    7.4.037 md5 469ab2d656828dd1a2c1859ff4498ac7 \
    7.4.038 md5 5d37bfced730ed51b2aa5e77759ddcce \
    7.4.039 md5 0e0d62af9d594237b518bd0795d49103 \
    7.4.040 md5 84dd9c9058de4463c5326dde032f3860 \
    7.4.041 md5 b1c570c620c30879b5bf0b2093696a52 \
    7.4.042 md5 f71fd77d501107cc22d7129d6f7444a4 \
    7.4.043 md5 d86c84c860cc47a1f7dd76f8ac1ecd83 \
    7.4.044 md5 a206223e7ae7e95e948a628e59ad82ce \
    7.4.045 md5 72bf2ace92f8a11a535798e987f444d2 \
    7.4.046 md5 4573290a76d7541bcfb0e051a4fc42f7 \
    7.4.047 md5 7ff734a7afdee370c98e02b966844adb \
    7.4.048 md5 ea675c709cd6011adc30fcf0def31ee4 \
    7.4.049 md5 9664c92bd4c17065a4df9dc24c63ac76 \
    7.4.050 md5 b15ffb4672e82d67cf3ea5d3fdc77ed8 \
    7.4.051 md5 6b2af52b734806187f9e7effc2e43d64 \
    7.4.052 md5 d32a541d7f5224c9fdacb6a81a73d695 \
    7.4.053 md5 9d47ebc404be7fb399031751e1751846 \
    7.4.054 md5 a28c2b89b23233bc8923ed6180647b4e \
    7.4.055 md5 ea670cb50696e36b8619877c2f90bab1 \
    7.4.056 md5 3035ff2de9fea29034fd1babe465c2c5 \
    7.4.057 md5 a181edc322e2240cdab8beda2af69301 \
    7.4.058 md5 5b309b2742a07a0d5909234139456331 \
    7.4.059 md5 05def513b70d2364d64ce1e02589fe8a \
    7.4.060 md5 8fd31eae3d039f665756bd5cf72c6c3d \
    7.4.061 md5 0305c9c20e3dd02331f38505eeb386b7 \
    7.4.062 md5 2aa95bf08e3e29504abe511e6f2e83bf \
    7.4.063 md5 58a8b743a5adaa3e6ed636e52cd7d552 \
    7.4.064 md5 71be80d6479883f9666d58efd4b0d329 \
    7.4.065 md5 5309435b25f35b3f72945e53336cea01 \
    7.4.066 md5 c2d4092358a9ac65278c06ab8f967ae0 \
    7.4.067 md5 95d36725184ad03510323145b4bb4a05 \
    7.4.068 md5 cfd15e5a6a31abd52883697d26ca07ef \
    7.4.069 md5 1c3103031f71afef8d456626cd62cf0c \
    7.4.070 md5 cdce38ccd5248e5827d8269ab141d363 \
    7.4.071 md5 2e8f9ed6c0a1956e1fa2e50bfe0dab5d \
    7.4.072 md5 26b0405c10a1ce5cf6ccf5721c4ad1e3 \
    7.4.073 md5 3d278546ac40f60c8ab9cf81540cff69 \
    7.4.074 md5 b21afbe7575f1f52df7a441c295aff63 \
    7.4.075 md5 d4e190298245ea78831c097f9ae80e07 \
    7.4.076 md5 00134cdf22d4ec8e6f9d8e6fb83dc6ac \
    7.4.077 md5 7901dab17aea76e4aaf810f0d806e286 \
    7.4.078 md5 36112f02dba683f4cff66100c0671364 \
    7.4.079 md5 f4615bba652dd366d6e65c25ae166fde \
    7.4.080 md5 fd2a1a407c5dd7a6764293ab189667df \
    7.4.081 md5 6270d3217b606a845b6cb541f140b7e7 \
    7.4.082 md5 d67c1fde653f381d923825fb03e8082e \
    7.4.083 md5 f56746374b4087dff91ffa99f86e219d \
    7.4.084 md5 c3505655d6d180be21f5d77c68950a2b \
    7.4.085 md5 f35c7e21ba6b3945637e0d8ce4f11e5c \
    7.4.086 md5 fd850b010ca569ea84e461420bf66cb9 \
    7.4.087 md5 b8f239f720256e68a0f89c8bd4186f71 \
    7.4.088 md5 2a95f6de4ba9f9847d735bc94138d5cd \
    7.4.089 md5 a2de53ff09fdf780e1c53351053e8275 \
    7.4.090 md5 34de6b8053e179ac0d80bac2ddd30708 \
    7.4.091 md5 746d0736e19238bafe722eba54311a8e \
    7.4.092 md5 ac3ff0195ecdaacc3ed5f53518598514 \
    7.4.093 md5 25771c5c957afbcab2ccf0b9eec788bd \
    7.4.094 md5 52bb149c0120deaf978688b94cdf8ed7 \
    7.4.095 md5 41abd5c417eb375ed673a0b342403ec9 \
    7.4.096 md5 f5cd9f26ef23923bb88a1cacbfef3c3b \
    7.4.097 md5 ecc8d3762504c8dee0331911049a4965 \
    7.4.098 md5 30f3be5b65a3512a018ff50d0438ddfa \
    7.4.099 md5 f67d7f5942e9561d00e7483f4ee42380 \
    7.4.100 md5 a76c2f081b94e51b4820fb08e66839b5 \
    7.4.101 md5 0caea69290c75b50ef648d116bdd5c79 \
    7.4.102 md5 41e50f33a37e30b53231bb3555ab5725 \
    7.4.103 md5 8800e40a012a3c75b4368cf6a32b2625 \
    7.4.104 md5 f3934e6f9f1c549a0829d0bff021ce05 \
    7.4.105 md5 45fc498daee2f69abeae785cf841b516 \
    7.4.106 md5 9d14772c23637258fcdb45d333082387 \
    7.4.107 md5 533c3d3c69b3dab50ebba3de88508cdd \
    7.4.108 md5 6d34383b901c8b40d4dc1339a66e89f9 \
    7.4.109 md5 2ce1da8a07c25c320caffb05416db428 \
    7.4.110 md5 9890ea1419d17bc0458df4063d6ab717 \
    7.4.111 md5 887c30df358b7ef83ab5cf239fd2af4f \
    7.4.112 md5 7508dd10f72dff553028172f2e79efd3 \
    7.4.113 md5 a5355b5fcd27eb5b56a85603dc2e37e6 \
    7.4.114 md5 d5850be88f63b9337dca9ccaf871b51b \
    7.4.115 md5 d90f517e074a78376c0e9f1b8290485b \
    7.4.116 md5 27bc1ae355d4bdf4099761bd972e2617 \
    7.4.117 md5 aff5b89d042c9b2e2ba8d01cb37124f4 \
    7.4.118 md5 c021088018ea89edbd8926684ab6bc6d \
    7.4.119 md5 d86179fc8d481a61f3a655d1f94c7f28 \
    7.4.120 md5 363551d6c3ec22b6adda01b857618b91 \
    7.4.121 md5 579433be86c5b70c2d709b03a02f6178 \
    7.4.122 md5 2857104ab4b978394add0e0c2c0f8ec3 \
    7.4.123 md5 3d95d356eadaf39c0e010c0bd3607848 \
    7.4.124 md5 8053e8aa3bdcdac81d9cce2d8ad8b1ca \
    7.4.125 md5 3da200dad10f8ac37fc902a25d22fc38 \
    7.4.126 md5 0cb2797bce99ef62d8e8be73205db25e \
    7.4.127 md5 5fb67adaaec1e5f7a504462784106cc8 \
    7.4.128 md5 e5ef188aa15567130d452eabc744b527 \
    7.4.129 md5 ed308944ad0ba75b7e4701f1125f5f05 \
    7.4.130 md5 0970745f265cbc68d5e2895a33372852 \
    7.4.131 md5 06b9896eb8551a9879362f181e956279 \
    7.4.132 md5 153a360d69a97768abcde19419de1f8e \
    7.4.133 md5 db0195ef377d3692305751c266e56963 \
    7.4.134 md5 7277e650a69e5a426f43b4ab7101dfc1 \
    7.4.135 md5 6d78ba444069288673c5bb5d46637fa7 \
    7.4.136 md5 27e599ce323d3ec84318f42befbe046e \
    7.4.137 md5 6670ec5392e8f9451b1f7f7477de9718 \
    7.4.138 md5 87120062d53233da9983e2fdb465aa6b \
    7.4.139 md5 98d1a30530e235f43459dfcf83d70f68 \
    7.4.140 md5 f85499011e6d7d759ec8b8a7087199fc \
    7.4.141 md5 754681af512508f44171e761d51a3048 \
    7.4.142 md5 fbddcd9e452a53085b183a3d9a885e07 \
    7.4.143 md5 72ab636fcee1371ea6e42b3af7eda473 \
    7.4.144 md5 5007e4f14c3f8bcbbdde0e02c964c904 \
    7.4.145 md5 413783063f2de49716ef809e9f227355 \
    7.4.146 md5 d4d29e5c3a4dc7c15075adc3ce6edc0f \
    7.4.147 md5 f179164a5f4c9eea05c400c854fbaf43 \
    7.4.148 md5 d24e10ca3dce85d1d5dc45eddb73f937 \
    7.4.149 md5 55babbe54c308624eb6ff55d9093fbce \
    7.4.150 md5 d5830a1b3fc6ccf80b7a85a662372843 \
    7.4.151 md5 0d8cb61d067a72fff17faf6ae1e63713 \
    7.4.152 md5 624dc1cba478594ae6cd5bc922f58e3a \
    7.4.153 md5 63b729e378f08ecb388a52b2e2d503b3 \
    7.4.154 md5 e4164b531aaa2741a48daf56604a75d6 \
    7.4.155 md5 b1c6d861d4f2df1ebdbd7173d92d3215 \
    7.4.156 md5 aebbb64adc4eb6d7b3f34ef698cfb60f \
    7.4.157 md5 e4369ae117295bc6fb791450ebfdaf65 \
    7.4.158 md5 cb5d7729638278f9c25b148ed5dfcd21 \
    7.4.159 md5 d4edf8a2e715ea496313cfc281b2103e \
    7.4.160 md5 23fcaa3a90563f0b94b4aa5ec5e83383 \
    7.4.161 md5 75e1ff1a9ef3c80d5c6297f026fe7685 \
    7.4.162 md5 ff248c6266915e12e7e6c0402f7f7a42 \
    7.4.163 md5 4ef6ddb9bf63ed48638e7ebc41fdf7dc \
    7.4.164 md5 0ac692ccaf85a6c6f3b81ca91197aaaa \
    7.4.165 md5 04fa4932d8ba79dce6807ea2005068c9 \
    7.4.166 md5 fd9bdb560ba274956edfa19635ae8279 \
    7.4.167 md5 ed55a7b4ec1afa1c2dbfbc89b4a466ef \
    7.4.168 md5 3265557c7d6375cf84f4759a0389fa71 \
    7.4.169 md5 b54447e42f1e66731f9036bcca8b4509 \
    7.4.170 md5 0cf596ed02f6be7080b173a0883bcc7f \
    7.4.171 md5 59820af8f4d9fae312ae2e5288151bcc \
    7.4.172 md5 d5a0ab9f9919aebb91542e48f8fbc027 \
    7.4.173 md5 823b94880865e1049ecfae371b30a415 \
    7.4.174 md5 8a1c1251b0f97e0e3767ae1bc989abec \
    7.4.175 md5 11507012ba1a3c936f668404fa379649 \
    7.4.176 md5 20c1c3cc95b821f252f1c83904b6ba3d \
    7.4.177 md5 9a7d5b714c1a207a5cabfdf9470341f6 \
    7.4.178 md5 7b19d16cb76725280a1ebd55b87f8cb8 \
    7.4.179 md5 41244f46b1ed4f623a725e9b9cb638e9 \
    7.4.180 md5 fd90d1d2e86ee07bad4680f0260d0366 \
    7.4.181 md5 219358ce254fb0c0d353b9a796a100aa \
    7.4.182 md5 fbd89c20781a808d9b9283f10e9d3ae8 \
    7.4.183 md5 d0744cb580446fdd6944d67191cdda3c \
    7.4.184 md5 fc0866feeacfd3e1fb6a0195f0f037f9 \
    7.4.185 md5 2488edc85d82d0c20c66959ffa356365 \
    7.4.186 md5 366792c5d38497c5e7454fb7624f0eaf \
    7.4.187 md5 2a6d42c7d9cfc190d4798de01cb5008f \
    7.4.188 md5 1ecc29e0e066dae607cb04a4ebc295d7 \
    7.4.189 md5 f20e9eee4987f704d20d2cbff4c4ef92 \
    7.4.190 md5 59fe59875d9da34041ede674c185275f \
    7.4.191 md5 b010979da48f27769344506285c87ffd \
    7.4.192 md5 b66f43553771fabff9946c2539233f8b \
    7.4.193 md5 8a54888eff7728c3e1ee8eb3fc271395 \
    7.4.194 md5 a48abd9780d474fc9af9eb1d6cf6a157 \
    7.4.195 md5 371e8d03870cfc8cc80b7af8e2e1e227 \
    7.4.196 md5 f086fef1d8f6b1223cd4c3b3b25ab03a \
    7.4.197 md5 46281579443d7738bd1a9aacf38bf463 \
    7.4.198 md5 166dfc06619cc874ab986e39e6edc3dc \
    7.4.199 md5 20cce084827d4998a87909660c2f62fd \
    7.4.200 md5 910ab3bff3c7af44877736ab8ba8ae92 \
    7.4.201 md5 1de8360283c464dfe37bbd3c22e74fd1 \
    7.4.202 md5 ecdc9aa4facee37c563ee4e16f2447c7 \
    7.4.203 md5 8f29761b3be27a7925e7cfc1b4d2d141 \
    7.4.204 md5 c1fe85c772d4c5e064f2b5cc80223930 \
    7.4.205 md5 fed144f679842969a87ee0aaf70694f0 \
    7.4.206 md5 fa6c00de0e780f1e250d5af476aa95e4 \
    7.4.207 md5 4337d84e53dc942a350d806049bc2588 \
    7.4.208 md5 4f6f05ea3834293e9931f66c3b384368 \
    7.4.209 md5 442df33e3f7825e7224ff0e1a5e18020 \
    7.4.210 md5 afcf5759addbe717d00974cfcdd35226 \
    7.4.211 md5 6418353debd191dba5f9630535d5949c \
    7.4.212 md5 0cb1b3de966db2a84c749aa34db33882 \
    7.4.213 md5 bc6cfa0219398a40d729900e581ba42d \
    7.4.214 md5 fec9b228a6eb6627d2fa82b655d13c70 \
    7.4.215 md5 6d73db3ca196e89d3dcfbd72821f9ca2 \
    7.4.216 md5 d6f74e43a745f4a3758a33488360cecc \
    7.4.217 md5 b7371d17254fe74777d54f1816822c30 \
    7.4.218 md5 2f4acb7e20fa567dc3b0930f018d0d4e \
    7.4.219 md5 b869b0398b0fa08f18e76c2007b80235 \
    7.4.220 md5 884c3649a32bc3690906b470990980c6 \
    7.4.221 md5 e2a95050b3edcfa42ddc31454543e3dd \
    7.4.222 md5 d458a27303fc30be8de30b74389e3466 \
    7.4.223 md5 e19d284753ef5f1eeb9f44fc08785631 \
    7.4.224 md5 dd2ecc1c03f724cad2757f4b45df3115 \
    7.4.225 md5 8bd348cf3c661affa9f441d7cb92366e \
    7.4.226 md5 d175135cfb0a71b1cb7efd8cfec7c083 \
    7.4.227 md5 dd22668741af2e2b6a5fd1b0378fdfd1 \
    7.4.228 md5 f24b3eecf01d97d0b16413a43230aade \
    7.4.229 md5 92b14efda1881ecde71e368fe3f880cf \
    7.4.230 md5 c437f131d4d8e935e0c4122fe14d40bd \
    7.4.231 md5 86513da43dcfe5d341b30e9131ff5c5d \
    7.4.232 md5 c05c12752233b8d98694f740d8e842c1 \
    7.4.233 md5 58619a079ecf449c0603b0ef988c853c \
    7.4.234 md5 e179ee727e1e8978f834aa66c75991d7 \
    7.4.235 md5 e5d37d3e87b9e653de7a9333b670d9ac \
    7.4.236 md5 fb48e0461f7ee5cc560c7a4edfb242d1 \
    7.4.237 md5 48efa9c2116d3a73c1904b258174aa02 \
    7.4.238 md5 1db2c3532ad065b1cb9640d451157b88 \
    7.4.239 md5 649b42a131948ca4ff2fa1a9ca03acb2 \
    7.4.240 md5 1d76171ae8a64020c1226893074b0c32 \
    7.4.241 md5 ead92bdd0c54248db01c9c79e2524912 \
    7.4.242 md5 47a08abd198a0257894c2f0624d10962 \
    7.4.243 md5 abe5ed9fb7b23119815892f98cd94613 \
    7.4.244 md5 6d384e70a3e4b195bc69fe1c2fdd9735 \
    7.4.245 md5 5c3141c1ae60f92f0c17e9814d38f045 \
    7.4.246 md5 8cb28042047ea316a7949c75c94f0997 \
    7.4.247 md5 f37b64c6641c3e462e28d800e5e0dca8 \
    7.4.248 md5 2e1eab93b98dd7460cb3544d31676f6b \
    7.4.249 md5 33033c3f73418900b9fe2b7bef1d980f \
    7.4.250 md5 a9766343778385af47905a456cdfda2a \
    7.4.251 md5 cc43ae910c29aa8f20dc21a8fed6b76c \
    7.4.252 md5 268f1223f0bc09821ab23983dfa07a41 \
    7.4.253 md5 1fcc11b023cf479d640e6e6f1acfe72a \
    7.4.254 md5 1daa1c8dbec782709f9c3b6386e3438f \
    7.4.255 md5 861d7eda0d351234f4559285dab0c7ad \
    7.4.256 md5 deac3b40e58f164a4486a9bd14040c64 \
    7.4.257 md5 674e8a735fd62f2cf058bf98545cab19 \
    7.4.258 md5 b13c892fbf2d29e16cb653558098d028

depends_build       bin:grep:grep
depends_lib         port:ncurses \
                    port:gettext \
                    port:libiconv

patchfiles-append patch-compat-sigaltstack.diff

post-patch {
    set features [open ${worksrcpath}/src/feature.h a+]
    puts $features "#define SYS_VIMRC_FILE \"${prefix}/etc/vimrc\""
    close $features

    # Ensure that auto/config.mk is never older than auto/configure.
    # If the latter was modified by a patch, it would trigger a rebuild of
    # auto/config.mk with the wrong environment resulting in the use of the
    # wrong compiler.
    file mtime ${worksrcpath}/src/auto/config.mk [clock seconds]
}

autoconf.cmd make autoconf
autoconf.pre_args
autoconf.args
autoconf.dir ${worksrcpath}/src

configure.args      --disable-gui \
                    --without-x \
                    --disable-gpm \
                    --mandir=${prefix}/share/man \
                    --with-tlib=ncurses \
                    --enable-multibyte \
                    --with-developer-dir=${developer_dir} \
                    --enable-fail-if-missing

post-destroot {
    ln -s ${prefix}/bin/vim ${destroot}${prefix}/bin/vi
}

test.run            yes

if {![variant_isset tiny] && ![variant_isset small] && ![variant_isset big] && ![variant_isset huge]} {
    default_variants +huge
}

variant x11 description {Build CLI version with X support} {
    configure.args-delete   --without-x
    configure.args-append   --with-x --x-includes=${prefix}/include --x-libraries=${prefix}/lib
    depends_lib-append      port:xorg-libXt
}

variant athena description {Build GUI version using Athena widgets} requires x11 conflicts gtk1 gtk2 motif {
    configure.args-delete   --disable-gui
    configure.args-append   --enable-gui=athena --disable-darwin
    depends_lib-append      port:xorg-libXaw
}
variant gtk1 description {Build GUI version using GTK 1.x widgets} requires x11 conflicts athena gtk2 motif {
    configure.args-delete   --disable-gui
    configure.args-append   --enable-gui=gtk --disable-darwin
    depends_lib-append      port:gtk1
}
variant gtk2 description {Build GUI version using GTK 2.x widgets} requires x11 conflicts athena gtk1 motif {
    configure.args-delete   --disable-gui
    configure.args-append   --enable-gui=gtk2 --disable-darwin
    depends_lib-append      port:gtk2
}
variant motif description {Build GUI version with Motif widgets} requires x11 conflicts athena gtk1 gtk2 {
    configure.args-delete   --disable-gui
    configure.args-append   --enable-gui=motif --disable-darwin
    depends_lib-append      lib:libXm:openmotif
}

variant tiny description {Build tiny feature set} {
    configure.args-append --with-features=tiny
}
variant small description {Build small feature set} conflicts tiny {
    configure.args-append --with-features=small
}
variant big description {Build big feature set} conflicts tiny small	{
    configure.args-append --with-features=big
}
variant huge description {Build huge feature set} conflicts tiny small big {
    configure.args-append --with-features=huge
}
variant xim description {Build with support for X Input Method} {
    configure.args-append --enable-xim
}

# FIXME: Does not work with vim 7.3 yet
# variant shell description {Enables shell windows} {
    # # Patch taken from http://www.wana.at/vimshell/
    # patchfiles-append       patch-vimshell.diff
# }

variant breakindent description {Apply the breakindent patch} {
    # Upstream: https://retracile.net/wiki/VimBreakIndent
    master_sites-append https://retracile.net/raw-attachment/blog/2013/09/12/23.00/:breakindent
    distfiles-append    vim-7.4.16-fc19-breakindent.patch:breakindent
    checksums-append    vim-7.4.16-fc19-breakindent.patch \
                        rmd160  a03d102166b7fa4d699b621c6a9c54dae05017c6 \
                        sha256  8374b1fa505797761fd4480adb1f636d5cdebc1c943c9af70db8f7431b761548

    post-patch {
        system -W ${worksrcpath} "patch -p1 < ${distpath}/vim-7.4.16-fc19-breakindent.patch"
    }
}

variant perl description {Enable Perl scripting} {
    configure.args-append   --enable-perlinterp
    depends_lib-append      path:bin/perl:perl5
}
variant python requires python25 description {Compatibility variant, requires +python25} {}
variant python25 conflicts python26 python27 description {Enable Python scripting} {
    configure.args-append   --enable-pythoninterp --with-python=${prefix}/bin/python2.5
    patchfiles-append       patch-python.diff
    depends_lib-append      port:python25

    use_autoconf yes
    # Overwriting autoconf.cmd above removes dependency, add it again
    depends_build-append port:autoconf
}
variant python26 conflicts python25 python27 description {Enable Python scripting} {
    configure.args-append   --enable-pythoninterp --with-python=${prefix}/bin/python2.6
    patchfiles-append       patch-python.diff
    depends_lib-append      port:python26

    use_autoconf yes
    # Overwriting autoconf.cmd above removes dependency, add it again
    depends_build-append port:autoconf
}
variant python27 conflicts python25 python26 description {Enable Python scripting} {
    configure.args-append   --enable-pythoninterp --with-python=${prefix}/bin/python2.7
    patchfiles-append       patch-python.diff
    depends_lib-append      port:python27

    use_autoconf yes
    # Overwriting autoconf.cmd above removes dependency, add it again
    depends_build-append port:autoconf
}
variant python31 conflicts python32 python33 description {Enable Python scripting} {
    configure.args-append   --enable-python3interp --with-python3=${prefix}/bin/python3.1
    patchfiles-append       patch-python3.diff
    depends_lib-append      port:python31

    use_autoconf yes
    # Overwriting autoconf.cmd above removes dependency, add it again
    depends_build-append port:autoconf
}
variant python32 conflicts python31 python33 description {Enable Python scripting} {
    configure.args-append   --enable-python3interp --with-python3=${prefix}/bin/python3.2
    patchfiles-append       patch-python3.diff
    depends_lib-append      port:python32

    use_autoconf yes
    # Overwriting autoconf.cmd above removes dependency, add it again
    depends_build-append port:autoconf
}
variant python33 conflicts python31 python32 description {Enable Python scripting} {
    configure.args-append   --enable-python3interp --with-python3=${prefix}/bin/python3.3
    patchfiles-append       patch-python3.diff
    depends_lib-append      port:python33

    use_autoconf yes
    # Overwriting autoconf.cmd above removes dependency, add it again
    depends_build-append port:autoconf
}
variant ruby requires ruby18 description {Compatibility variant, requires +ruby18} {}
variant ruby18 conflicts ruby19 ruby20 description {Enable Ruby scripting} {
    configure.args-append   --enable-rubyinterp
    configure.args-append   --with-ruby-command=${prefix}/bin/ruby1.8
    depends_lib-append      port:ruby
}
variant ruby19 conflicts ruby18 ruby20 description {Enable Ruby scripting} {
    configure.args-append   --enable-rubyinterp
    configure.args-append   --with-ruby-command=${prefix}/bin/ruby1.9
    depends_lib-append      port:ruby19
}
variant ruby20 conflicts ruby18 ruby19 description {Enable Ruby scripting} {
    configure.args-append   --enable-rubyinterp
    configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.0
    depends_lib-append      port:ruby20
}
variant tcl description {Enable Tcl scripting} {
    configure.args-append   --enable-tclinterp \
                            --with-tclsh=${prefix}/bin/tclsh
    patchfiles-append       patch-tcl.diff
    depends_lib-append      port:tcl

    use_autoconf yes
    # Overwriting autoconf.cmd above removes dependency, add it again
    depends_build-append port:autoconf
}
variant lua description {Enable Lua scripting} {
    configure.args-append   --enable-luainterp \
                            --with-lua-prefix=${prefix}
    depends_lib-append      port:lua
}

variant cscope description {Enable source code browsing with cscope} {
    configure.args-append   --enable-cscope
}

platform puredarwin {
    configure.args-append --disable-darwin
}

livecheck.type  regex
livecheck.url   http://ftp.vim.org/pub/${name}/patches/${vim_version}/?O=D
livecheck.version [format "%s.%03d" $vim_version $vim_patchlevel]
livecheck.regex (${vim_version}\.\\d+)
