|
1 | | -@echo on |
2 | | - |
3 | | -rem Full PHP version, eg. 7.1.22 |
4 | | -set PHPVER=%1 |
5 | | -rem cb-specific rebuild number |
6 | | -set BLD_NUM=%2 |
7 | | -rem zts or nts |
8 | | -set TS=%3 |
9 | | -rem Path to work in (will just create "php-sdk" dir here) |
10 | | -set WORKDIR=%4 |
11 | | -rem Path to produce output in (will create full tagged directories) |
12 | | -set INSTALLDIR=%5 |
13 | | - |
14 | | -set PHPUNIT_VER=9.4.3 |
15 | | -set STARTDIR=%CD% |
16 | | - |
17 | | -if "%TS%" == "zts" ( |
18 | | - set tsarg= |
19 | | -) else ( |
20 | | - set tsarg=--disable-zts |
21 | | -) |
22 | | - |
23 | | -set PHPTAG=php-%TS%-default-%PHPVER%-cb%BLD_NUM% |
24 | | -rmdir /s /q %WORKDIR%\%PHPTAG% |
25 | | - |
26 | | -rem Create working directory |
27 | | -mkdir %WORKDIR%\php-sdk |
28 | | -cd %WORKDIR%\php-sdk |
29 | | -call phpsdk_buildtree phpdev || goto :error |
30 | | - |
31 | | -@echo on |
32 | | -rem Clone PHP source |
33 | | -if not exist "php-src.git" ( |
34 | | - git clone --bare git://github.com/php/php-src || goto :error |
35 | | -) |
36 | | -rmdir /s /q %PHPTAG% |
37 | | -git clone php-src -b php-%PHPVER% %PHPTAG% || goto :error |
38 | | -cd %PHPTAG% |
39 | | - |
40 | | -rem Get PHP build dependencies |
41 | | -call phpsdk_deps -u || goto :error |
42 | | - |
43 | | -@echo on |
44 | | -rem Get our extra dependencies |
45 | | -pushd ..\deps |
46 | | -if not exist php-phpunit.phar ( |
47 | | - curl --insecure -L https://phar.phpunit.de/phpunit-%PHPUNIT_VER%.phar -o php-phpunit.phar |
48 | | -) |
49 | | -if not exist php-phpdoc.phar ( |
50 | | - curl --insecure -L https://phpdoc.org/phpDocumentor.phar -o php-phpdoc.phar |
51 | | -) |
52 | | -popd |
53 | | - |
54 | | -rem Configure and build |
55 | | -call buildconf || goto :error |
56 | | -@echo on |
57 | | -call configure --disable-all --enable-sockets ^ |
58 | | - --with-iconv --with-xml --with-libxml --with-xmlwriter ^ |
59 | | - --enable-session --enable-json --enable-cli ^ |
60 | | - --enable-phar=shared ^ |
61 | | - %tsarg% ^ |
62 | | - --with-prefix=%INSTALLDIR%\%PHPTAG% || goto :error |
63 | | -@echo on |
64 | | -nmake && nmake install || goto :error |
65 | | - |
66 | | -rem Copy our extra dependencies |
67 | | -copy ..\deps\php-phpunit.phar %INSTALLDIR%\%PHPTAG% |
68 | | -copy ..\deps\php-phpdoc.phar %INSTALLDIR%\%PHPTAG% |
69 | | -xcopy /c /q /y /s /i %CURDIR%\php-sdk-binary-tools\msys2 %INSTALLDIR%\%PHPTAG%\msys2 |
70 | | - |
71 | | -rem Packaging |
72 | | -pushd %INSTALL_DIR% |
73 | | -cmake -E tar czf php-%TS%-default-windows-amd64-%PHPVER%-cb%BLD_NUM%.tgz %PHPTAG% || goto :error |
74 | | -popd |
75 | | - |
76 | | -:eof |
77 | | -exit /b 0 |
78 | | - |
79 | | -:error |
80 | | -set CODE=%ERRORLEVEL% |
81 | | -cd %STARTDIR% |
82 | | -echo Failed with code %CODE%. |
83 | | -exit /b %CODE% |
| 1 | +@echo on |
| 2 | + |
| 3 | +rem Full PHP version, eg. 7.1.22 |
| 4 | +set PHPVER=%1 |
| 5 | +rem cb-specific rebuild number |
| 6 | +set BLD_NUM=%2 |
| 7 | +rem zts or nts |
| 8 | +set TS=%3 |
| 9 | +rem Path to work in (will just create "php-sdk" dir here) |
| 10 | +set WORKDIR=%4 |
| 11 | +rem Path to produce output in (will create full tagged directories) |
| 12 | +set INSTALLDIR=%5 |
| 13 | + |
| 14 | +set PHPUNIT_VER=9.4.3 |
| 15 | +set STARTDIR=%CD% |
| 16 | + |
| 17 | +if "%TS%" == "zts" ( |
| 18 | + set tsarg= |
| 19 | +) else ( |
| 20 | + set tsarg=--disable-zts |
| 21 | +) |
| 22 | + |
| 23 | +set PHPTAG=php-%TS%-default-%PHPVER%-cb%BLD_NUM% |
| 24 | +rmdir /s /q %WORKDIR%\%PHPTAG% |
| 25 | + |
| 26 | +rem Create working directory |
| 27 | +mkdir %WORKDIR%\php-sdk |
| 28 | +cd %WORKDIR%\php-sdk |
| 29 | +call phpsdk_buildtree phpdev || goto :error |
| 30 | + |
| 31 | +@echo on |
| 32 | +rem Clone PHP source |
| 33 | +if not exist "php-src.git" ( |
| 34 | + git clone --bare git://github.com/php/php-src || goto :error |
| 35 | +) |
| 36 | +rmdir /s /q %PHPTAG% |
| 37 | +git clone php-src -b php-%PHPVER% %PHPTAG% || goto :error |
| 38 | +cd %PHPTAG% |
| 39 | + |
| 40 | +rem Get PHP build dependencies |
| 41 | +call phpsdk_deps -u || goto :error |
| 42 | + |
| 43 | +@echo on |
| 44 | +rem Get our extra dependencies |
| 45 | +pushd ..\deps |
| 46 | +if not exist php-phpunit.phar ( |
| 47 | + curl --insecure -L https://phar.phpunit.de/phpunit-%PHPUNIT_VER%.phar -o php-phpunit.phar |
| 48 | +) |
| 49 | +if not exist php-phpdoc.phar ( |
| 50 | + curl --insecure -L https://phpdoc.org/phpDocumentor.phar -o php-phpdoc.phar |
| 51 | +) |
| 52 | +popd |
| 53 | + |
| 54 | +rem Configure and build |
| 55 | +call buildconf || goto :error |
| 56 | +@echo on |
| 57 | +call configure --disable-all --enable-sockets ^ |
| 58 | + --with-iconv --with-xml --with-libxml --with-xmlwriter ^ |
| 59 | + --enable-session --enable-json --enable-cli ^ |
| 60 | + --enable-phar=shared ^ |
| 61 | + %tsarg% ^ |
| 62 | + --with-prefix=%INSTALLDIR%\%PHPTAG% || goto :error |
| 63 | +@echo on |
| 64 | +nmake && nmake install || goto :error |
| 65 | + |
| 66 | +rem Copy our extra dependencies |
| 67 | +copy ..\deps\php-phpunit.phar %INSTALLDIR%\%PHPTAG% |
| 68 | +copy ..\deps\php-phpdoc.phar %INSTALLDIR%\%PHPTAG% |
| 69 | +xcopy /c /q /y /s /i %CURDIR%\php-sdk-binary-tools\msys2 %INSTALLDIR%\%PHPTAG%\msys2 |
| 70 | + |
| 71 | +rem Packaging |
| 72 | +pushd %INSTALL_DIR% |
| 73 | +cmake -E tar czf php-%TS%-default-windows-amd64-%PHPVER%-cb%BLD_NUM%.tgz %PHPTAG% || goto :error |
| 74 | +popd |
| 75 | + |
| 76 | +:eof |
| 77 | +exit /b 0 |
| 78 | + |
| 79 | +:error |
| 80 | +set CODE=%ERRORLEVEL% |
| 81 | +cd %STARTDIR% |
| 82 | +echo Failed with code %CODE%. |
| 83 | +exit /b %CODE% |
0 commit comments