diff options
-rw-r--r-- | build_manaplus.sh | 17 | ||||
-rw-r--r-- | manaplus.patch | 16 | ||||
-rw-r--r-- | manaplus.sh | 38 |
3 files changed, 40 insertions, 31 deletions
diff --git a/build_manaplus.sh b/build_manaplus.sh deleted file mode 100644 index 1e3b802..0000000 --- a/build_manaplus.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -# NOTE: please change me! - - -# v change this in client repo laterâ„¢ - -cp /manaplus/tools/ci/scripts/winvars.sh manaplus/build/ -cd /manaplus/ -git apply ../manaplus.patch -cd /manaplus/build/ -# ^ change this in client repo laterâ„¢ -./winmake || exit 1 -/mxe/tools/copydlldeps.py -C/manaplus/build/tmp/src -L/mxe/usr/i686-w64-mingw32.shared/bin/ /libs/dll/ || true -./packwin || exit 1 -cp -r /manaplus/packaging/windows/manaplus-*.exe /build/ || exit 1 - diff --git a/manaplus.patch b/manaplus.patch index 2d4109a..733e302 100644 --- a/manaplus.patch +++ b/manaplus.patch @@ -41,21 +41,15 @@ index 1c159c7cd..4a22a0155 100644 File "${DLLDIR}\libcurl-4.dll" File "${DLLDIR}\libfreetype-6.dll" File "${DLLDIR}\${SEHDLL}" -@@ -373,10 +374,10 @@ SectionEnd - Section /o "Debugger" SecDebug - SetOutPath "$INSTDIR" +@@ -375,7 +375,7 @@ Section /o "Debugger" SecDebug File "${DLLDIR}\gdb.exe" -- File "${DLLDIR}\libdl.dll" -- File "${DLLDIR}\libexpat-1.dll" + File "${DLLDIR}\libdl.dll" + File "${DLLDIR}\libexpat-1.dll" - File "${DLLDIR}\libreadline6.dll" -- File "${DLLDIR}\libtermcap.dll" -+; File "${DLLDIR}\libdl.dll" -+; File "${DLLDIR}\libexpat-1.dll" -+; File "${DLLDIR}\libreadline6.dll" -+; File "${DLLDIR}\libtermcap.dll" ++ File "${DLLDIR}\libreadline8.dll" + File "${DLLDIR}\libtermcap.dll" File "${EXEDIR}\manaplusd.exe" ${If} ${SectionIsSelected} ${SecShortcuts} - CreateShortCut "$SMPROGRAMS\Mana\ManaPlus (debug).lnk" '"$INSTDIR\gdb.exe"' '"$INSTDIR\manaplusd.exe"' "$INSTDIR\manaplusd.exe" @@ -384,36 +385,36 @@ Section /o "Debugger" SecDebug ${EndIf} SectionEnd diff --git a/manaplus.sh b/manaplus.sh index 8f8e827..e039b2a 100644 --- a/manaplus.sh +++ b/manaplus.sh @@ -1,6 +1,36 @@ #!/usr/bin/env bash -cp /mxe/usr/i686-w64-mingw32.shared/bin/gdb.exe /libs/dll/ || true # can also be moved to docker +dll_check(){ + # check all but windows own dll's + windlls=("wldap32.dll opengl32.dll gdi32.dll advapi32.dll kernel32.dll msvcrt.dll wsock32.dll shell32.dll crypt32.dll ws2_32.dll user32.dll iphlpapi.dll winmm.dll") + striped=${dlls#"Missing dll files: "}; + dlls=`tr -d ',' <<< $striped` + err="" + for dll in $dlls + do + [[ ! ${windlls[*]} =~ $dll ]] && err="$err $dll"; + done + [[ "$err" != "" ]] && echo "ERR: missing: $err" && exit 1 || return; +} + +get_version_by_tag(){ + IFS='.' read -r -a array <<< "$CI_COMMIT_TAG" # splits commit tag in array + [ "${CI_COMMIT_TAG:0:1}" == "v" ] \ + && V="${array[0]:1}.${array[1]}.${array[2]}.${array[3]}" # add dots to version + [ "${CI_COMMIT_TAG:0:1}" == "s" ] \ + && V="snapshot-${CI_COMMIT_TAG:1}" # just replace 's' with 'snapshot-' + [ "${CI_COMMIT_TAG}" == "" ] \ + && echo "!WARN: no tag set, using test-99.99.99.99!" \ + && V="test-99.99.99.99" # test versions, (not running from tags) + export PRODUCT_VERSION=$V + export VERSION=$V + echo "PRODUCT_VERSION, VERSION = '$V'" +} +# CI_COMMIT_TAG="v2.1.1.1" # <- test version +# CI_COMMIT_TAG="s20210101" # <- test snapshot2 +#get_version_by_tag # [WIP] + +cp /mxe/usr/i686-w64-mingw32.shared/bin/gdb.exe /libs/dll/ cp /manaplus/tools/ci/scripts/winvars.sh manaplus/build/ cd /manaplus/ @@ -11,11 +41,13 @@ git apply ../manaplus.patch cd /manaplus/build/ ./winmake --enable-commandlinepassword || exit 1 cp /manaplus/build/tmp/src/manaplus.exe /manaplus/build/tmp/src/manaplusd.exe +cp /mxe/usr/i686-w64-mingw32.shared/bin/gdb.exe /manaplus/build/tmp/src/ strip /manaplus/build/tmp/src/manaplus.exe # profiler (needs another build) -/mxe/tools/copydlldeps.py -C/manaplus/build/tmp/src -L/mxe/usr/i686-w64-mingw32.shared/bin/ /libs/dll/ || true -# missing .dll's are available in windows by default (may check if its a default dll, exit 1 when otheres are missing) +dlls=`/mxe/tools/copydlldeps.py -C/manaplus/build/tmp/src -L/mxe/usr/i686-w64-mingw32.shared/bin/ /libs/dll/` +dll_check $dlls + ./packwin || exit 1 # artifacts cp /manaplus/packaging/windows/manaplus-*.exe /builds/jak89_1/docker-testing/build/ || exit 1 |