# A-A-P recipe to bootstrap Vim from CVS or archives + patches # This recipe is for Vim 7.4a. # # Running "aap update" here will obtain the latest version and build it. # NOTE: CVS is not available for Vim 7.3 and later # When you have CVS and want to use it, specify "cvs=yes" on the # command line. Also allow using "CVS=no" or "CVS=yes" @if _no.get("CVS") == "no" or _no.get("CVS") == "yes": cvs = $CVS CVS = cvs ?= no VLong = 7.4a VShort = 74a CVSname = vim7 SUBDIR = # Reset using CVS when archives were already downloaded. @if os.path.exists('bunzip2-' + VShort + '.done') or os.path.exists('gzip-' + VShort + '.done'): cvs = no # FTP server to use, change if you want to use a mirror FTPROOT ?= ftp://ftp.vim.org/pub/vim$(SUBDIR)/unstable # Location to get the A-A-P specific files AAPROOT ?= http://www.a-a-p.org/vim # Location of the CVS server CVSROOT ?= :pserver:anonymous@vim.cvs.sourceforge.net:/cvsroot/vim # Location of this recipe, get a new version when fetching. :recipe {fetch = $AAPROOT/main.aap} # # Fetch: Get the most recent Vim files. # fetch: :progsearch CVSPATH cvs :progsearch PATCHPATH patch @if _no.cvs == "yes" and (CVSPATH or not PATCHPATH): # CVS is available or patch is not available: use CVS. Installing it # should be possible on many systems. # Using CVS is easy. :print Getting the latest version of Vim through CVS... :fetch {fetch = cvs://$CVSROOT} $CVSname # Need to move the files from "vim7" to "vim" :move $CVSname vim$VShort :update {force} moveit @else: @if os.path.exists("vim/CVS"): :error Vim was obtained from CVS, can't update through patches # Get the required archives through ftp and unpack them. :print Getting Vim version $VLong using ftp... :progsearch BUNZIP2 bunzip2 @if BUNZIP2: :update bunzip2-$(VShort).done @else: :update gzip-$(VShort).done # Get the extra files. # :update extra-$(VShort).done # Apply the patches :update patch # # Get or update the A-A-P specific files # Most of them are included in the distribution now. # :mkdir {f}{r} vim/src/testdir :fetch {fetch = $AAPROOT/%file%} vim/main.aap # # Default target: fetch and build Vim. # all: fetch :execute vim/main.aap PREFIX=$?PREFIX # # Other targets: Pass on to Vim recipe. Won't work when Vim wasn't downloaded # yet. # test install uninstall reconfig testclean distclean clean: @if os.path.exists("vim/main.aap"): :execute vim/main.aap $buildtarget PREFIX=$?PREFIX @else: :error "$buildtarget" doesn't work before downloading the build recipe. # bunzip2 target: get one big archive with sources and rt files # Only used when the "bunzip2" command is available. bunzip2-$(VShort).done: file = vim-$(VLong).tar.bz2 :fetch {fetch = $FTPROOT/unix/%file%} {constant} $file :sys bunzip2 -c $file | tar xf - :update {force} moveit :touch {exist} $target # gzip target: get four archives with sources and rt files gzip-$(VShort).done: # First make sure the "gunzip" and "tar" programs are available. :assertpkg gunzip tar :progsearch Gunzip gunzip :progsearch Tar tar @for part in [ "src1", "src2", "rt1", "rt2" ]: file = vim-$VLong-$(part).tar.gz :fetch {fetch = $FTPROOT/unix/%file%} {constant} $file # Use the "-m" flag to avoid an error when the timestamp cannot be set, # we don't use it anyway. :sys $Gunzip -c $file | $Tar xmf - :update {force} moveit :touch {exist} $target # moveit target: Move the files from "vim70" to "vim". moveit {virtual}: @if not os.path.exists("vim"): :move vim$VShort vim @else: :copy {r}{force} vim$VShort/* vim :del {r} vim$VShort :del {force} vim/src/auto/config.cache vim/src/auto/config.status :del {force}{r} patches/*.done # This is no longer used for Vim 7.3 and later. extra-$(VShort).done: # Get the language and extra files. # First make sure the "gunzip" and "tar" programs are available. :assertpkg gunzip tar :progsearch Gunzip gunzip :progsearch Tar tar @for file in [ "vim-" + _no.VLong + "-lang.tar.gz", "vim-" + _no.VLong + "-extra.tar.gz" ]: :fetch {fetch = $FTPROOT/extra/%file%} {constant} $file # Use the "-m" flag to avoid an error when the timestamp cannot be set, # we don't use it anyway. :sys $Gunzip -c $file | $Tar xmf - # Move the files from "vim70" to "vim". :copy {r}{force} vim$VShort/* vim :del {r} vim$VShort :del {force}{r} patches/*.done :touch {exist} $target # List of patches to be applied to the unpacked archive (not for CVS). # LASTPATCH is automatically adjusted by ~/ftp/vim/patches/main.aap. LASTPATCH = 4279 @vlist = '' @for i in range(1, int(LASTPATCH) + 1): @ vlist = vlist + ("%03d " % i) PATCHFILES = $(VLong).$*vlist PATCHES = patches/$*PATCHFILES PATCHDONE = patches/$*(PATCHFILES).done @if PATCHES: :attr {fetch = $FTPROOT/patches/$VLong/%basename%} {constant} $PATCHES # Need to create the "patches" directory for when just fetching. # Should be skipped when using CVS, but here we don't know yet if CVS is going # to be used... :mkdir {force} patches patch {virtual} : patchpkg $PATCHDONE patchpkg {virtual} : # Make sure the "patch" program is available. :assertpkg patch :progsearch _recipe.Patch patch :rule patches/%.done : patches/% :cd vim # On Mac OS "patch" was reported to fail to create a file when # POSIXLY_CORRECT is set. (Darren Bane) :python if os.environ.has_key('POSIXLY_CORRECT'): del os.environ['POSIXLY_CORRECT'] PATCHCMD ?= $Patch -p0 -f :sys $PATCHCMD < ../$source 2>&1 > ../$target # vim: set sw=4 sts=4: