fetch_and_patch.bat 1.81 KB
Newer Older
1
set BUILD=%SRC%..\build
atraczyk's avatar
atraczyk committed
2

3
set PJPROJECT_VERSION=5dfa75be7d69047387f9b0436dd9492bbbf03fe4
4
set PJPROJECT_URL=https://github.com/pjsip/pjproject/archive/%PJPROJECT_VERSION%.tar.gz
5

atraczyk's avatar
atraczyk committed
6
mkdir %BUILD%
7 8

if %USE_CACHE%==1 (
9
    copy %CACHE_DIR%\%PJPROJECT_VERSION%.tar.gz %cd%
10
) else (
11
    %WGET_CMD% %PJPROJECT_URL%
12 13
)

14
7z -y x %PJPROJECT_VERSION%.tar.gz && 7z -y x %PJPROJECT_VERSION%.tar -o%BUILD%
15
del %PJPROJECT_VERSION%.tar && del %PJPROJECT_VERSION%.tar.gz && del %BUILD%\pax_global_header
16
rename %BUILD%\pjproject-%PJPROJECT_VERSION% pjproject
atraczyk's avatar
atraczyk committed
17

18
cd %BUILD%\pjproject
atraczyk's avatar
atraczyk committed
19

20 21 22 23 24 25 26 27
for /F "tokens=* usebackq" %%F in (`bash -c "pwd | grep /mnt/c/"`) do (
    set NO_AUTO=%%F
)
if "%NO_AUTO%"=="" (
    set ROOTPATH=/c/
) else (
    set ROOTPATH=/mnt/c/
)
28
set UNIXPATH=%SRC:\=/%
29
set UNIXPATH=%ROOTPATH%%UNIXPATH:C:/=%
30
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_turn_alloc_failure.patch"
31 32 33 34 35 36
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/ipv6.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/multiple_listeners.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/pj_ice_sess.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_turn_fallback.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_ioqueue_ipv6_sendto.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/add_dtls_transport.patch"
37 38
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/rfc6544.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/ice_config.patch"
39
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_first_packet_turn_tcp.patch"
40
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_ebusy_turn.patch"
41
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/ignore_ipv6_on_transport_check.patch"
42

43 44 45
%APPLY_CMD% %SRC%\pjproject\win32_vs_gnutls.patch
%APPLY_CMD% %SRC%\pjproject\win_config.patch
%APPLY_CMD% %SRC%\pjproject\win_vs2017_props.patch
46

47
if "%1"=="uwp" (
48
    %APPLY_CMD% %SRC%\pjproject\uwp_vs.patch
49
)
atraczyk's avatar
atraczyk committed
50 51

cd %SRC%