summaryrefslogtreecommitdiff
path: root/setup/scripts/make_pkgs.cmd
blob: c0816a3e6295a926bc76dc5fc5047791f20fe0c5 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
@echo off
echo This batch file can help you to create a packages for SMPlayer and MPlayer.
echo.
echo Note: It will temporarily rename the smplayer-build or mplayer directory.
echo Be sure to have a compiled portable smplayer.exe, renamed as
echo `smplayer-portable.exe` in the same directory as this script or an
echo alternate location you specify in this script.
echo.
echo Configure your build environment at the beginning of this script.
echo.
echo 7zip command-line (http://7zip.org) is required by this script.
echo.
echo * Release Packages
echo.
echo 1 - Portable SMPlayer Package
echo 2 - SMPlayer Package w/o MPlayer
echo 3 - MPlayer Package
echo.
echo * Update Packages
echo.
echo 4 - SMPlayer SVN Update Package
echo 5 - Qt DLL Package

echo.

set TOP_LEVEL_DIR=..

set SMPLAYER_DIR=%TOP_LEVEL_DIR%\smplayer-build
set MPLAYER_DIR=%TOP_LEVEL_DIR%\mplayer
set OUTPUT_DIR=%TOP_LEVEL_DIR%\output
set PORTABLE_EXE_DIR=%TOP_LEVEL_DIR%\portable
set QT_DIR=E:\Buildsys\Qt\%QTVER%

:reask
set /P USER_CHOICE="Choose an action: "
echo.

if "%USER_CHOICE%" == "1"     goto portable
if "%USER_CHOICE%" == "2"     goto nomplayer
if "%USER_CHOICE%" == "3"     goto mplayer
if "%USER_CHOICE%" == "4"     goto svn_updpkg
if "%USER_CHOICE%" == "5"     goto qtdlls
if "%USER_CHOICE%" == ""      goto end

:portable
echo --- Creating SMPlayer Portable Package ---
echo.

set /P SMPLAYER_VER="SMPlayer Version: "
if "%SMPLAYER_VER%"=="" exit
echo.

ren %SMPLAYER_DIR% smplayer-portable-%SMPLAYER_VER%
set SMPLAYER_DIR=%TOP_LEVEL_DIR%\smplayer-portable-%SMPLAYER_VER%

echo.
echo ######      Backing up files       #######
echo.

ren %SMPLAYER_DIR%\smplayer.exe smplayer.bak
ren %SMPLAYER_DIR%\mplayer\mplayer\config config.bak

echo.
echo ######   Create screenshots dir.   #######
echo.

mkdir %SMPLAYER_DIR%\screenshots

echo.
echo ######     Create smplayer.ini     #######
echo.

echo [%%General]>> %SMPLAYER_DIR%\smplayer.ini
echo screenshot_directory=.\\screenshots>> %SMPLAYER_DIR%\smplayer.ini
echo.>> %SMPLAYER_DIR%\smplayer.ini
echo [advanced]>> %SMPLAYER_DIR%\smplayer.ini
echo mplayer_additional_options=-nofontconfig>> %SMPLAYER_DIR%\smplayer.ini

echo.
echo ######  Create smplayer_orig.ini   #######
echo.

echo [%%General]>> %SMPLAYER_DIR%\smplayer_orig.ini
echo screenshot_directory=.\\screenshots>> %SMPLAYER_DIR%\smplayer_orig.ini
echo.>> %SMPLAYER_DIR%\smplayer_orig.ini
echo [advanced]>> %SMPLAYER_DIR%\smplayer_orig.ini
echo mplayer_additional_options=-nofontconfig>> %SMPLAYER_DIR%\smplayer_orig.ini

echo.
echo ######    Create mplayer config    #######
echo.

echo ## MPlayer Windows configuration>> %SMPLAYER_DIR%\mplayer\mplayer\config
echo.>> %SMPLAYER_DIR%\mplayer\mplayer\config
echo subfont=c:\windows\fonts\arial.ttf>> %SMPLAYER_DIR%\mplayer\mplayer\config
echo ^<cachedir^>../fontconfig^</cachedir^>> %SMPLAYER_DIR%\mplayer\fonts\local.conf

echo.
echo ######    Copying portable .exe    #######
echo.

copy /y %PORTABLE_EXE_DIR%\smplayer-portable.exe %SMPLAYER_DIR%\smplayer.exe

echo.
echo ######  Creating portable package  #######
echo.
7za a -t7z %OUTPUT_DIR%\smplayer-portable-%SMPLAYER_VER%.7z %SMPLAYER_DIR% -xr!*.bak -xr!qxtcore.dll -mx9

echo.
echo Restoring source folder(s) back to its original state...
echo.
rmdir %SMPLAYER_DIR%\screenshots
del %SMPLAYER_DIR%\smplayer.ini
del %SMPLAYER_DIR%\smplayer_orig.ini
del %SMPLAYER_DIR%\smplayer.exe
del %SMPLAYER_DIR%\mplayer\mplayer\config
del %SMPLAYER_DIR%\mplayer\fonts\local.conf
ren %SMPLAYER_DIR%\smplayer.bak smplayer.exe
ren %SMPLAYER_DIR%\mplayer\mplayer\config.bak config
ren %SMPLAYER_DIR% smplayer-build

goto end

:nomplayer
echo --- Creating SMPlayer w/o MPlayer Package ---
echo.

set /P SMPLAYER_VER="SMPlayer Version: "
if "%SMPLAYER_VER%"=="" exit
echo.

ren %SMPLAYER_DIR% smplayer-%SMPLAYER_VER%
set SMPLAYER_DIR=%TOP_LEVEL_DIR%\smplayer-%SMPLAYER_VER%

7za a -t7z %OUTPUT_DIR%\smplayer-%SMPLAYER_VER%_without_mplayer.7z %SMPLAYER_DIR% -xr!mplayer -mx9

ren %SMPLAYER_DIR% smplayer-build

echo.
echo Restoring source folder(s) back to its original state....

goto end

:mplayer
echo.
echo --- Creating MPlayer Package ---
echo.

set /P MP_REV="MPlayer Revision: "

ren %MPLAYER_DIR% mplayer-svn-%MP_REV%
set MPLAYER_DIR=%TOP_LEVEL_DIR%\mplayer-svn-%MP_REV%

7za a -t7z %OUTPUT_DIR%\mplayer-svn-%MP_REV%.7z %MPLAYER_DIR% -mx9

ren %MPLAYER_DIR% mplayer
set MPLAYER_DIR=%TOP_LEVEL_DIR%\mplayer

echo.
echo Restoring source folder(s) back to its original state...

goto end

:svn_updpkg
echo.
echo ---  Creating SVN Update Package  ---
echo.

set /P SMPLAYER_SVN="SMPlayer SVN Revision: "
if "%SMPLAYER_SVN%"=="" exit

7za a -t7z %OUTPUT_DIR%\smplayer_update_svn_r%SMPLAYER_SVN%.7z %SMPLAYER_DIR%\smplayer.exe %SMPLAYER_DIR%\translations -mx9

goto end

:qtdlls

set /P QTVER="Qt Version: "
if "%QTVER%"=="" exit

echo.
echo ---  Creating Qt DLL Package  ---
echo.

mkdir imageformats
copy %QT_DIR%\%QTVER%\plugins\imageformats\qjpeg4.dll imageformats
7za a -t7z %OUTPUT_DIR%\qt_%QTVER%_dlls.7z %QT_DIR%\%QTVER%\bin\libgcc_s_dw2-1.dll %QT_DIR%\%QTVER%\bin\mingwm10.dll %QT_DIR%\%QTVER%\bin\QtCore4.dll %QT_DIR%\%QTVER%\bin\QtGui4.dll %QT_DIR%\%QTVER%\bin\QtNetwork4.dll %QT_DIR%\%QTVER%\bin\QtXml4.dll imageformats -mx9
rd /s /q imageformats

goto end

:end

pause