1 @rem Build script
for compiling Perl
for msysGit
3 @rem Perl prefers to be built from a
cmd prompt and requires
'dmake'
4 @rem
when using gcc as the compiler.
6 @rem You need a
copy of sed. Don
't add msysGit/bin to the path though
7 @rem as that breaks the perl build. Grab another from somewhere or
8 @rem manually fixup the patch file and comment out the sed lines here.
11 @rem It would be nice if we could fix the install layout so that it
12 @rem matched the msys-perl layout. But this failed when I tried it.
13 @rem In the meantime - make a perl shell script that runs the perl
14 @rem from mingw/perl/bin/perl so that it gets used instead of /bin/perl
15 @rem then we need to fix git-am, git- and the tests that use perl
16 @rem File::Spec::Functions should be useful.
20 @for /F "delims=" %%I in ("%~dp0.") do @set BASE=%%~fI
21 @for /F "delims=" %%I in ("%~dp0..\..") do @set ROOT=%%~fI
22 @set PATH=%ROOT%\mingw\bin;%PATH%
23 @set ZIP=%ROOT%\share\7-zip\7za.exe >NUL
24 @set URL=http://www.cpan.org/src/5.0
26 @set MD5=af2df531d46b77fdf0d97eecb03eddb2
27 @set DMAKE=dmake-4.12-20090907-SHAY.zip
28 @set DMAKEMD5=6a68a9d456df62808d798bd8710ce091
31 @if exist perl-%VER%.tar.gz @goto CHECKSUMPERL
32 @echo Downloading perl from %URL%
33 @curl -o perl-%VER%.tar.gz %URL%/perl-%VER%.tar.gz
36 @echo %MD5% *perl-%VER%.tar.gz | md5sum >NUL --check -
37 @if ERRORLEVEL 0 @goto DOWNLOADDMAKE
38 @echo error: incorrect checksum for perl file
42 @if exist %DMAKE% @goto CHECKSUMDMAKE
43 @echo Downloading dmake
44 @curl -o %DMAKE% http://search.cpan.org/CPAN/authors/id/S/SH/SHAY/%DMAKE%
47 @echo %DMAKEMD5% *%DMAKE% | md5sum >NUL --check -
48 @if ERRORLEVEL 0 @goto UNPACKDMAKE
49 @echo error: incorrect checksum for dmake file
53 @if exist dmake @goto UNPACK
54 @if not exist dmake %ZIP% x %DMAKE%
57 @if exist perl-%VER% goto CLEAN
58 @if not exist perl-%VER%.tar %ZIP% x perl-%VER%.tar.gz
59 @if not exist perl-%VER% %ZIP% x perl-%VER%.tar
63 @cmd /c git config core.autocrlf true
64 @cmd /c git add . 2>NUL
65 @cmd /c git commit -m "Imported perl-%VER%" 2>NUL
66 @cmd /c git rm -rf . >NUL
67 @cmd /c git reset --hard HEAD
73 @cmd /c git reset --hard HEAD
78 @sed -e "s/@ROOT@/%ROOT:\=\\%/" patches\makefile.patch > fixed.patch
81 @cmd /c git apply ../fixed.patch
85 @pushd perl-%VER%\win32
86 @%BASE%\dmake\dmake install
88 @del %ROOT%\bin\perl.exe
89 @echo #!/bin/sh > %ROOT%\bin\perl
90 @echo /mingw/perl/bin/perl "$@" >> %ROOT%\bin\perl