" vim:fenc=utf-8:et:sw=4:ts=4:sts=4 " Vim syntax file " Language: MacPorts Portfiles " Maintainer: Maximilian Nickel " if &compatible || v:version < 603 finish endif if exists("b:current_syntax") finish endif " Disable whitespace error highlight if variable is not set if !exists("g:portfile_highlight_space_errors") let g:portfile_highlight_space_errors=0 endif let is_tcl=1 runtime! syntax/tcl.vim unlet b:current_syntax " Some custom extensions contain a dash (for example, fs-traverse) setlocal iskeyword+=- function AddPortfileOptionPatterns(patterns) execute 'syntax match PortfileOption' \ '"\%(^\|{\|\[\)\s*\zs\%(' . \ join(a:patterns, '\|') . \ '\)\%(-append\|-delete\|-replace\|-strsed\)\?\ze\%(\s\+\|$\)"' endfunction function AddPortfileCommandPatterns(commands) let suffixes = '\.\%(args\|cmd\|dir\|env\|nice\|\%(post\|pre\)_args\|type\)' call AddPortfileOptionPatterns(map(copy(a:commands), '"use_" . v:val')) call AddPortfileOptionPatterns(map(copy(a:commands), 'v:val . suffixes')) endfunction syn match PortfileGroup "{.\+}" contained syn match PortfileYesNo "\<\%(yes\|no\)\>" contained syn keyword PortfileRequired PortSystem syn keyword PortfileOptional PortGroup " Main options (from port1.0/portmain.tcl) call AddPortfileOptionPatterns([ \ 'add_users', 'altprefix', 'categories', 'conflicts', \ 'copy_log_files', 'default_variants', 'depends_skip_archcheck', \ 'description', 'distname', 'distpath', 'epoch', 'filesdir', \ 'homepage', 'installs_libs', 'libpath', 'license', \ 'license_noconflict', 'long_description', \ 'macosx_deployment_target', 'maintainers', 'name', 'notes', \ 'platforms', 'portdbpath', 'prefix', 'provides', 'replaced_by', \ 'revision', 'sources_conf', 'supported_archs', \ 'universal_variant', 'version', 'worksrcdir', \ 'compiler\.\%(cpath\|library_path\)', \ 'install\.\%(group\|user\)', \ 'os\.\%(arch\|endian\|major\|platform\|subplatform\)', \ 'os\.\%(universal_supported\|version\)', \]) syn match PortfilePhases "\<\%(pre-\|post-\)\?\%(fetch\|checksum\|extract\|patch\|configure\|build\|test\|destroot\|archive\|install\|activate\|deactivate\)\>" contains=PortfilePrePost " Fetch phase options (from port1.0/portfetch.tcl) call AddPortfileCommandPatterns(['bzr', 'cvs', 'svn']) call AddPortfileOptionPatterns([ \ 'bzr\.\%(revision\|url\)', \ 'cvs\.\%(date\|method\|module\|password\|root\|tag\)', \ 'dist_subdir', 'distfiles', \ 'extract\.suffix', \ 'fetch\.\%(ignore_sslcert\|password\|use_epsv\|user\)', \ 'git\.\%(branch\|cmd\|url\)', \ 'hg\.\%(cmd\|tag\|url\)', \ '\%(master\|patch\)_sites\%(\.mirror_subdir\)\?', \ 'patchfiles', \ 'svn\.\%(method\|revision\|url\)', \ 'use_\%(7z\|bzip2\|dmg\|lzma\|xz\|zip\)', \ ]) " Checksum phase options (from port1.0/portchecksum.tcl) call AddPortfileOptionPatterns(['checksums\%(\.skip\)\?']) " Extract phase options (from port1.0/portextract.tcl) call AddPortfileCommandPatterns(['extract']) call AddPortfileOptionPatterns(['extract\.\%(asroot\|mkdir\|only\)']) " Patch phase options (from port1.0/portpatch.tcl) call AddPortfileCommandPatterns(['patch']) call AddPortfileOptionPatterns(['patch\.asroot']) " Configure phase options (from port1.0/portconfigure.tcl) call AddPortfileCommandPatterns(['configure', 'auto\%(conf\|reconf\|make\)', 'xmkmf']) call AddPortfileOptionPatterns([ \ 'configure\.asroot', \ 'configure\.\%(m32\|m64\|march\|mtune\)', \ 'configure\.\%(c\|cpp\|cxx\|f\|f90\|fc\|ld\|objc\|objcxx\)flags', \ 'configure\.\%(classpath\|libs\)', \ 'configure\.\%(awk\|bison\|install\|pkg_config\%(_path\)\?\)', \ 'configure\.\%(perl\|python\|ruby\)', \ 'configure\.\%(build_arch\|sdkroot\)', \ 'configure\.\%(cc\|cxx\|f77\|f90\|fc\|ld\|objc\|objcxx\)_archflags', \ 'configure\.universal_\%(archs\|args\)', \ 'configure\.universal_\%(c\|cpp\|cxx\|ld\|objc\|objcxx\)flags', \ 'configure\.\%(ccache\|distcc\|pipe\)', \ 'configure\.\%(cc\|cpp\|cxx\|f77\|f90\|fc\|javac\|objc\|objcxx\)', \ 'configure\.compiler\%(\.add_deps\)\?', \ 'compiler\.\%(blacklist\|fallback\|whitelist\)', \ ]) " Build phase options (from port1.0/portbuild.tcl) call AddPortfileCommandPatterns(['build']) call AddPortfileOptionPatterns([ \ 'build\.\%(asroot\|jobs\|target\)', \ 'use_parallel_build', \]) " Test phase options (from port1.0/porttest.tcl) call AddPortfileCommandPatterns(['test']) call AddPortfileOptionPatterns(['test\.\%(run\|target\)']) " Destroot phase options (from port1.0/portdestroot.tcl) call AddPortfileCommandPatterns(['destroot']) call AddPortfileOptionPatterns([ \ 'destroot\.\%(asroot\|clean\|delete_la_files\|destdir\)', \ 'destroot\.\%(keepdirs\|target\|umask\|violate_mtree\)', \]) " StartupItem options (from port1.0/portdestroot.tcl) call AddPortfileOptionPatterns([ \ 'startupitem\.\%(autostart\|create\|executable\|init\)', \ 'startupitem\.\%(install\|location\|logevents\|logfile\)', \ 'startupitem\.\%(name\|netchange\|pidfile\|plist\|requires\)', \ 'startupitem\.\%(restart\|start\|stop\|type\|uniquename\)', \]) " Variants syn region PortfileVariant matchgroup=Keyword start="^\s*\zsvariant" skip="\\$" end="$" contains=PortfileVariantName,PortfileVariantRequires,PortfileVariantDescription,PortfileVariantConflicts skipwhite syn keyword PortfileVariantRequires requires nextgroup=PortfileVariantName contained syn keyword PortfileVariantConflicts conflicts nextgroup=PortfileVariantName contained syn keyword PortfileVariantDescription description nextgroup=PortfileGroup contained skipwhite syn match PortfileVariantName "\<\w\+\>" contained syn keyword PortfileOptional universal_variant nextgroup=PortfileYesNo skipwhite syn match PortfileOptional "\" nextgroup=PortfileDefaultVariants skipwhite syn match PortfileDefaultVariants "\<[+-]\w\+\%(\s\+[+-]\w\+\)*\>" contained " Platform syn match PortfilePlatform "\" nextgroup=PortfilePlatformName skipwhite syn match PortfilePlatformName "\<\l\w\+\>" nextgroup=PortfilePlatformVersion contained skipwhite syn match PortfilePlatformVersion "\<\d\+\>" nextgroup=PortfilePlatformArch contained skipwhite syn match PortfilePlatformArch "\<\l\w\+\>" contained " Subports syn region PortfileSubport matchgroup=Keyword start="^\s*\zssubport\>" skip="\\$" end="$" contains=PortfileSubportName syn match PortfileSubportName "\<[\w\.-]\+\>" contained " Dependencies syn match PortfileDepends "\" nextgroup=PortfileDependsEntries skipwhite syn region PortfileDependsEntries matchgroup=Normal start="" skip="\\$" end="$" contains=PortfileDependsEntry contained syn match PortfileDependsEntry "\<\%(port\|bin\|path\|lib\):" contained " Livecheck / Distcheck call AddPortfileOptionPatterns([ \ 'distcheck\.check', \ 'livecheck\.\%(distname\|ignore_sslcert\|md5\|name\)', \ 'livecheck\.\%(regex\|type\|url\|version\)', \]) " Port Groups " App syn match PortfileGroups "\" " Archcheck syn match PortfileGroups "\" " CMake " has no keywords " crossbinutils syn match PortfileGroups "\" " crossgcc syn match PortfileGroups "\" " github syn match PortfileGroups "\" " Gnustep syn match PortfileGroups "\" syn keyword PortfileGroups variant_with_docs gnustep_layout syn match PortfileGroups "\" " Haskell syn keyword PortfileGroups haskell.setup " hocbinding syn match PortfileGroups "\" " hunspelldict syn match PortfileGroups "\" " KDE 4, versions 1.0 and 1.1 " have no keywords " muniversal syn match PortfileGroups "\" syn match PortfileGroups "\" syn match PortfileGroups "\" syn match PortfileGroups "\" " obsolete " has no keywords (other than replaced_by, and that should be elsewhere in " this file) " ocml " has no keywords " octave syn match PortfileGroups "\" " PEAR syn match PortfileGroups "\" " Perl5 syn match PortfileGroups "\" " PHP 1.0 syn match PortfileGroups "\" syn match PortfileGroups "\" " PHP 1.1 (only adding those not already present in 1.0) syn match PortfileGroups "\" syn match PortfileGroups "\" " PHP5 extension syn match PortfileGroups "\" " PHP5 PEAR syn match PortfileGroups "\" " Pure syn match PortfileGroups "\" " Python syn match PortfileGroups "\" " I'm not documenting the Python{24,25,26,27,31,32} groups. Don't use them. " Qt4 syn match PortfileGroups "\" syn match PortfileGroups "\" syn match PortfileGroups "\" " Ruby syn match PortfileGroups "\" " Select syn match PortfileGroups "\" " TeX Live syn match PortfileGroups "\" " X11 Font syn match PortfileGroups "\" " Xcode syn match PortfileGroups "\" syn match PortfileGroups "\" syn match PortfileGroups "\" " Xcode version syn match PortfileGroups "\" " Zope syn match PortfileGroups "\" " End of PortGroups " Tcl extensions syn keyword PortfileTcl xinstall fs-traverse readdir md5 vercmp syn keyword PortfileTcl reinplace strsed syn keyword PortfileTcl copy move delete touch ln system syn match PortfileTcl "\" syn match PortfileTcl "\<\%(add\|exists\)\%(user\|group\)\>" syn keyword PortfileTcl nextuid nextgid syn keyword PortfileTcl variant_isset variant_set syn match PortfileTcl "\" syn keyword PortfileTcl lpush lpop lunshift lshift ldindex syn keyword PortfileTcl ui_debug ui_error ui_info ui_msg ui_warn " check whitespace, copied from python.vim if g:portfile_highlight_space_errors == 1 " trailing whitespace syn match PortfileSpaceError display excludenl "\S\s\+$"ms=s+1 " mixed tabs and spaces syn match PortfileSpaceError display " \+\t" syn match PortfileSpaceError display "\t\+ " endif highlight default link PortfileOption Keyword hi def link PortfileGroup String hi def link PortfileYesNo Special hi def link PortfileRequired Keyword hi def link PortfileOptional Keyword hi def link PortfileDescription String hi def link PortfilePhases Keyword hi def link PortfilePhasesAA Keyword hi def link PortfileVariantConflicts Statement hi def link PortfileVariantDescription Statement hi def link PortfileVariantRequires Statement hi def link PortfileVariantName Identifier hi def link PortfileDefaultVariants Identifier hi def link PortfilePlatform Keyword hi def link PortfilePlatformName Identifier hi def link PortfilePlatformVersion tclNumber hi def link PortfilePlatformArch Identifier hi def link PortfileSubportName Identifier hi def link PortfileDepends Keyword hi def link PortfileDependsEntry Special hi def link PortfileGroups Keyword hi def link PortfileTcl Keyword if g:portfile_highlight_space_errors == 1 hi def link PortFileSpaceError Error endif let b:current_syntax = "Portfile"