aboutsummaryrefslogtreecommitdiff
path: root/tools/buildsteps/win32/download-msys.bat
blob: d62f3e9e7a211641258b87ab22a00d5b9f282162 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@ECHO OFF

SETLOCAL

SET CUR_PATH=%WORKSPACE%\project\BuildDependencies
SET XBMC_PATH=%WORKSPACE%
SET TMP_PATH=%CUR_PATH%\scripts\tmp

SET MSYS_INSTALL_PATH="%CUR_PATH%\msys"
SET MINGW_INSTALL_PATH="%CUR_PATH%\msys\mingw"

cd %CUR_PATH%

rem can't run rmdir and md back to back. access denied error otherwise.
IF EXIST %MSYS_INSTALL_PATH% rmdir %MSYS_INSTALL_PATH% /S /Q
IF EXIST %TMP_PATH% rmdir %TMP_PATH% /S /Q

IF $%1$ == $$ (
  SET DL_PATH="%CD%\downloads2"
) ELSE (
  SET DL_PATH="%1"
)

SET WGET=%CUR_PATH%\bin\wget
SET ZIP=%CUR_PATH%\..\Win32BuildSetup\tools\7z\7za

IF NOT EXIST %DL_PATH% md %DL_PATH%

IF NOT EXIST %MSYS_INSTALL_PATH% md %MSYS_INSTALL_PATH%
IF NOT EXIST %MINGW_INSTALL_PATH% md %MINGW_INSTALL_PATH%
IF NOT EXIST %TMP_PATH% md %TMP_PATH%

cd scripts

CALL get_msys_env.bat
IF EXIST %TMP_PATH% rmdir %TMP_PATH% /S /Q
CALL get_mingw_env.bat

cd %CUR_PATH%

rem update fstab to install path
SET FSTAB=%MINGW_INSTALL_PATH%
SET FSTAB=%FSTAB:\=/%
SET FSTAB=%FSTAB:"=%
ECHO %FSTAB% /mingw>>"%MSYS_INSTALL_PATH%\etc\fstab"
SET FSTAB=%XBMC_PATH%
SET FSTAB=%FSTAB:\=/%
SET FSTAB=%FSTAB:"=%
ECHO %FSTAB% /xbmc>>"%MSYS_INSTALL_PATH%\etc\fstab"

rem patch mingw headers to compile ffmpeg
xcopy mingw_support\postinstall\* "%MSYS_INSTALL_PATH%\postinstall\" /E /Q /I /Y
cd "%MSYS_INSTALL_PATH%\postinstall"
CALL pi_patches.bat

cd %CUR_PATH%

rem insert call to vsvars32.bat in msys.bat
cd %MSYS_INSTALL_PATH%
Move msys.bat msys.bat_dist
ECHO CALL "%VS120COMNTOOLS%vsvars32.bat">>msys.bat
TYPE msys.bat_dist>>msys.bat

cd %CUR_PATH%

IF EXIST %TMP_PATH% rmdir %TMP_PATH% /S /Q