Revision | 14f1c3715b6a8c0f99622e9e22171b604df141ea (tree) |
---|---|
Time | 2023-02-04 00:17:20 |
Author | Fs <Fsu0413@vip....> |
Commiter | Fs |
居然忘了! mariadb step 2
@@ -251,6 +251,98 @@ exit 0 | ||
251 | 251 | |
252 | 252 | ]] |
253 | 253 | |
254 | +-- MSVCBATCALL | |
255 | +-- PATHSET | |
256 | +-- ENVSET | |
257 | +-- BUILDDIR | |
258 | +-- WORKSPACE | |
259 | +-- CONFIGURECOMMANDLINE | |
260 | +-- MAKE | |
261 | +-- INSTALLCOMMANDLINE | |
262 | +-- INSTALLROOT | |
263 | +-- INSTALLPATH | |
264 | +gen.win.template4MariaDB = [[ | |
265 | + | |
266 | +rem Unset it for now since it is only used in Jenkins. | |
267 | +rem Building MariaDB doesn't need JDK. | |
268 | + | |
269 | +set JAVA_HOME= | |
270 | + | |
271 | +setlocal enabledelayedexpansion | |
272 | + | |
273 | +set DOWNLOADTOOL= | |
274 | + | |
275 | +for %%i in (aria2c curl wget) do ( | |
276 | + if "!DOWNLOADTOOL!" == "" ( | |
277 | + set p="--help" | |
278 | + if "%%i" == "aria2c" set p="-h" | |
279 | + %%i !p! >NUL 2>NUL | |
280 | + if not ERRORLEVEL 1 set DOWNLOADTOOL=%%i | |
281 | + set p= | |
282 | + ) | |
283 | +) | |
284 | + | |
285 | +rem TODO - set --no-conf parameter to aria2c | |
286 | + | |
287 | +set pd=o | |
288 | +if "!DOWNLOADTOOL!" == "wget" set pd=O | |
289 | + | |
290 | +&DOWNLOADPACKAGE& | |
291 | + | |
292 | +endlocal | |
293 | + | |
294 | +set SEVENZIP=7z | |
295 | + | |
296 | +&UNCOMPRESSPACKAGE& | |
297 | +&DELETEUNCOMPRESSED& | |
298 | + | |
299 | +&PATHSET& | |
300 | + | |
301 | +&MSVCBATCALL& | |
302 | + | |
303 | +&PATHSET& | |
304 | + | |
305 | +&ENVSET& | |
306 | + | |
307 | +rmdir /s /q &BUILDDIR& | |
308 | +mkdir &BUILDDIR& | |
309 | +cd /d &BUILDDIR& | |
310 | + | |
311 | +set PARALLELNUM=0 | |
312 | + | |
313 | +set /a PARALLELNUM=%NUMBER_OF_PROCESSORS%+1 | |
314 | + | |
315 | +cmd /c &CONFIGURECOMMANDLINE& | |
316 | +if errorlevel 1 exit 1 | |
317 | + | |
318 | +set i=0 | |
319 | + | |
320 | +:LOOP | |
321 | +set /a i=%i%+1 | |
322 | +if %i% gtr 3 exit 1 | |
323 | + | |
324 | +cmd /c &MAKE& | |
325 | +if errorlevel 1 goto LOOP | |
326 | + | |
327 | +set j=0 | |
328 | + | |
329 | +:LOOP2 | |
330 | +set /a j=%j%+1 | |
331 | +if %j% gtr 3 exit 1 | |
332 | + | |
333 | +cmd /c &INSTALLCOMMANDLINE& | |
334 | +if errorlevel 1 goto LOOP2 | |
335 | + | |
336 | +cd /d &INSTALLROOT&\.. | |
337 | + | |
338 | +%SEVENZIP% a -t7z -m0=LZMA2:d256m:fb273 -mmt=3 -myx -mqs -ms=on -- &INSTALLPATH&.7z &INSTALLPATH& | |
339 | + | |
340 | +rmdir /s /q &BUILDDIR& | |
341 | + | |
342 | +exit 0 | |
343 | + | |
344 | +]] | |
345 | + | |
254 | 346 | gen.unix = {} |
255 | 347 | |
256 | 348 | gen.unix.pathEnvPre = "PATH=\"" |
@@ -769,6 +861,115 @@ exit 0 | ||
769 | 861 | |
770 | 862 | ]] |
771 | 863 | |
864 | +-- PATHSET | |
865 | +-- ENVSET | |
866 | +-- BUILDDIR | |
867 | +-- WORKSPACE | |
868 | +-- CONFIGURECOMMANDLINE | |
869 | +-- MAKE | |
870 | +-- INSTALLCOMMANDLINE | |
871 | +-- INSTALLROOT | |
872 | +-- INSTALLPATH | |
873 | +gen.unix.template4MariaDB = [[ | |
874 | +set -x | |
875 | + | |
876 | +unset JAVA_HOME | |
877 | + | |
878 | +DOWNLOADTOOL= | |
879 | + | |
880 | +for i in aria2c wget curl; do | |
881 | + p="--help" | |
882 | + if [ x$i = xaria2c ]; then | |
883 | + p="-h" | |
884 | + fi | |
885 | + if $i $p >/dev/null 2>/dev/null; then | |
886 | + DOWNLOADTOOL=$i | |
887 | + break | |
888 | + fi | |
889 | +done | |
890 | + | |
891 | +if [ "x$DOWNLOADTOOL" = "x" ]; then | |
892 | + echo "no download tool" >&2 | |
893 | + exit 1 | |
894 | +fi | |
895 | + | |
896 | +if [ "x$DOWNLOADTOOL" = "xaria2c" ]; then | |
897 | + DOWNLOADTOOL="aria2c --no-conf" | |
898 | +fi | |
899 | + | |
900 | +DOWNLOADP="o" | |
901 | +if [ "x$DOWNLOADTOOL" = "xwget" ]; then | |
902 | + DOWNLOADP="O" | |
903 | +fi | |
904 | + | |
905 | +&DOWNLOADPACKAGE& | |
906 | + | |
907 | +TAR= | |
908 | + | |
909 | +for i in bsdtar tar; do | |
910 | + if $i --help >/dev/null 2>/dev/null; then | |
911 | + TAR=$i | |
912 | + break | |
913 | + fi | |
914 | +done | |
915 | + | |
916 | +if [ "x$TAR" = "x" ]; then | |
917 | + echo "tar not found" >&2 | |
918 | + exit 1 | |
919 | +fi | |
920 | + | |
921 | +SEVENZIP= | |
922 | + | |
923 | +for i in 7zr 7za 7z; do | |
924 | + if $i >/dev/null 2>/dev/null; then | |
925 | + SEVENZIP=$i | |
926 | + break | |
927 | + fi | |
928 | +done | |
929 | + | |
930 | +&UNCOMPRESSPACKAGE& | |
931 | +&DELETEUNCOMPRESSED& | |
932 | + | |
933 | +&PATHSET& | |
934 | + | |
935 | +&ENVSET& | |
936 | + | |
937 | +rm -rf &BUILDDIR& | |
938 | +mkdir &BUILDDIR& | |
939 | +cd &BUILDDIR& | |
940 | + | |
941 | +PARALLELNUM=`nproc 2> /dev/null` | |
942 | +if [ $? -ne 0 ]; then | |
943 | + PARALLELNUM=3 | |
944 | + if [ "$NUMBER_OF_PROCESSORS" ]; then | |
945 | + PARALLELNUM=`expr $NUMBER_OF_PROCESSORS + 1` | |
946 | + elif [ -e /proc/cpuinfo ]; then | |
947 | + PARALLELNUM=$(expr `cat /proc/cpuinfo | grep processor | wc -l` + 1 ) | |
948 | + elif [ x`uname` = xDarwin ]; then | |
949 | + PARALLELNUM=$(expr `sysctl machdep.cpu.thread_count | cut -d " " -f 2` + 1 ) | |
950 | + fi | |
951 | +fi | |
952 | + | |
953 | +&CONFIGURECOMMANDLINE& | |
954 | +[ $? -eq 0 ] || exit 1 | |
955 | + | |
956 | +&MAKE& | |
957 | +[ $? -eq 0 ] || exit 1 | |
958 | + | |
959 | +&INSTALLCOMMANDLINE& | |
960 | +[ $? -eq 0 ] || exit 1 | |
961 | + | |
962 | +cd &INSTALLROOT&/.. | |
963 | + | |
964 | +$TAR -cf - &INSTALLPATH& | $SEVENZIP a -txz -m0=LZMA2:d256m:fb273 -mmt=3 -myx -si -- &INSTALLPATH&.tar.xz | |
965 | +$SEVENZIP a -t7z -m0=LZMA2:d256m:fb273 -mmt=3 -myx -mqs -ms=on -- &INSTALLPATH&.7z &INSTALLPATH& | |
966 | + | |
967 | +rm -rf &BUILDDIR& | |
968 | + | |
969 | +exit 0 | |
970 | + | |
971 | +]] | |
972 | + | |
772 | 973 | local filenameAndToolFromUrl = function(url) |
773 | 974 | -- get filename from URL since we don't use redirections |
774 | 975 | local n, n2 |
@@ -791,7 +992,7 @@ end | ||
791 | 992 | |
792 | 993 | gen.generate = function(self, para) |
793 | 994 | -- para.template should be "unix" or "win" |
794 | - -- para.buildContent should be "Qt", "OpenSSL", "OpenSSLAndroidAll" or "QQtPatcher" | |
995 | + -- para.buildContent should be "Qt", "OpenSSL", "OpenSSLUnify***", "MariaDB" or "QQtPatcher" | |
795 | 996 | -- other contents in para goes to the replacement function |
796 | 997 | -- for buildContent other than QQtPatcher: |
797 | 998 | -- "MAKE" "CONFIGURECOMMANDLINE" "date" must be provided. Fails if either one is missing. |
@@ -813,7 +1014,7 @@ gen.generate = function(self, para) | ||
813 | 1014 | |
814 | 1015 | if string.sub(template, 1, 12) == "OpenSSLUnify" then |
815 | 1016 | if para.template ~= "unix" then |
816 | - print("[Generate.generate] ERROR: Generation of OpenSSL Android All builds is not available in para.template ~= \"unix\"") | |
1017 | + print("[Generate.generate] ERROR: Generation of OpenSSL Unify builds is not available in para.template ~= \"unix\"") | |
817 | 1018 | os.exit(1) |
818 | 1019 | end |
819 | 1020 | end |
@@ -869,12 +1070,12 @@ gen.generate = function(self, para) | ||
869 | 1070 | end |
870 | 1071 | |
871 | 1072 | local ret = string.gsub(template, "%&([%w_]+)%&", function(s) |
872 | - if paraCopy[s] then | |
873 | - return paraCopy[s] | |
874 | - else | |
875 | - return "" | |
876 | - end | |
877 | - end) | |
1073 | + if paraCopy[s] then | |
1074 | + return paraCopy[s] | |
1075 | + else | |
1076 | + return "" | |
1077 | + end | |
1078 | + end) | |
878 | 1079 | |
879 | 1080 | return ret |
880 | 1081 | end |