From 644e1ff548d00bc874a718c64c222da3385388fe Mon Sep 17 00:00:00 2001 From: jak1 Date: Wed, 23 Dec 2020 05:46:08 +0000 Subject: added debugger build\ stripped default build\ cleaned up some comments --- .gitlab-ci.yml | 16 ++++------- Dockerfile | 4 ++- build.sh | 62 ------------------------------------------- manaplus.patch | 83 +++++++++++++++++++++++++++------------------------------- manaplus.sh | 23 ++++++++++++++++ mxe.patch | 12 +++++++++ mxe.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 144 insertions(+), 119 deletions(-) delete mode 100755 build.sh create mode 100644 manaplus.sh create mode 100755 mxe.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5904d68..4606887 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,25 +5,19 @@ stages: # - release mxe_gcc5: + image: registry.gitlab.com/jak89_1/docker-testing:v1.0.4 stage: build only: - # change me - branches@jak89_1/docker-testing script: - cd / - # change me - - rm -rf /opt/ + - mkdir -p /builds/jak89_1/docker-testing/logs/ || true + - mkdir -p /builds/jak89_1/docker-testing/build/ || true - git clone https://gitlab.com/jak89_1/docker-testing.git -b $CI_COMMIT_BRANCH /opt || exit 1 - rm -rf /opt/.git/ - mv -f opt/* / - - git clone https://gitlab.com/jak89_1/manaplus.git -b $CI_COMMIT_BRANCH || exit 1 - - chmod +x ./build_manaplus.sh && ./build_manaplus.sh - # copy artifacts - - cp -r /build/ /builds/jak89_1/docker-testing/build - - mkdir -p /builds/jak89_1/docker-testing/logs/ - - cp /manaplus/build/tmp/config.log /builds/jak89_1/docker-testing/build/logs/ || true - - cp /manaplus/build/make2.log /builds/jak89_1/docker-testing/build/logs/ || true - image: registry.gitlab.com/jak89_1/docker-testing:v1.0.3 + - git clone https://gitlab.com/jak89_1/manaplus.git -b master || exit 1 + - chmod +x ./manaplus.sh && ./manaplus.sh variables: CROSS: i686-w64-mingw32.shared artifacts: diff --git a/Dockerfile b/Dockerfile index 29f0144..f19e654 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,11 +43,13 @@ USER root WORKDIR / RUN git clone https://gitlab.com/jak89_1/docker-testing.git opt/ + RUN rm -rf /opt/.git/ RUN mv opt/* / +RUN rm -rf /opt/ RUN mkdir -p /build/ RUN mkdir -p /libs/dll/ -RUN chmod +x build.sh && ./build.sh +RUN chmod +x mxe.sh && ./mxe.sh diff --git a/build.sh b/build.sh deleted file mode 100755 index 59b9fc6..0000000 --- a/build.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash -export CROSS=i686-w64-mingw32.shared -cross_req="cc smpeg ffmpeg sdl sdl_image sdl_ttf sdl_net sdl_gfx libxml2 curl libpng zlib gettext sdl_mixer" -docker_req="gcc g++ python autoconf automake autopoint bash bison bzip2 flex gettext git gperf intltoolize libtool lzip make makensis openssl p7zip patch perl ruby sed unzip wget lzma" - - -req_check() -{ - echo "*** sys-info *** >---------------------------------------------------" - uname -a - req_err="" - for req in $docker_req; do - if ! command -v $req > /dev/null 2>&1; then - req_err="$req_err $req"; - fi - done - if [ "$req_err" != "" ]; then - echo "! missing req: $req_err !"; - exit 1; - fi - echo "*** sys-info *** <---------------------------------------------------" -} - -mxe() -{ - echo "*** mxe-build *** >--------------------------------------------------" - cd / - git clone https://github.com/mxe/mxe.git - cd mxe - - # mxe params to settings.mk - echo "MXE_TARGETS := ${CROSS}" > settings.mk - echo "LOCAL_PKG_LIST := ${cross_req}" >> settings.mk - echo ".DEFAULT_GOAL := local-pkg-list" >> settings.mk - echo 'local-pkg-list: $(LOCAL_PKG_LIST)' >> settings.mk - - # mxe patch - git apply ../mxe.patch || exit 1 - - # make mxe - make || exit 1 - - # sdl patch - sed -i 's|#define GL_GLEXT_VERSION 29|#ifndef GL_GLEXT_VERSION\n#define GL_GLEXT_VERSION 29\n#endif|' /mxe/usr/${CROSS}/include/SDL/SDL_opengl.h - - # cleanup downloads & logs - make clean-junk || exit 1 - echo "*** mxe-build *** <--------------------------------------------------" -} - - -test_mxe() -{ - export PATH=/mxe/usr/bin:/mxe/usr/${CROSS}/bin:$PATH - echo `${CROSS}-gcc --version` - echo `${CROSS}-g++ --version` - echo "${PATH}" -} - -req_check -mxe -test_mxe diff --git a/manaplus.patch b/manaplus.patch index e228cb6..2d4109a 100644 --- a/manaplus.patch +++ b/manaplus.patch @@ -11,8 +11,20 @@ index 4459a5052..01d7fd851 100755 -DUPX=true \ -DBITS=${BITS} \ -DSEHDLL=${SEHDLL} \ +diff --git a/build/win_make b/build/win_make +index 6e7adb83c..dd5a92e41 100755 +--- a/build/win_make ++++ b/build/win_make +@@ -11,6 +11,6 @@ autoreconf -i || exit 1 + cd build/tmp + ../../configure \ + --host=${CROSS} \ +---enable-werror || exit 1 ++--enable-werror $* || exit 1 + + make -j16 2>../make2.log || exit 1 diff --git a/packaging/windows/setup.nsi b/packaging/windows/setup.nsi -index 1c159c7cd..ce3c9f8ff 100644 +index 1c159c7cd..4a22a0155 100644 --- a/packaging/windows/setup.nsi +++ b/packaging/windows/setup.nsi @@ -262,10 +262,11 @@ Section "Core files (required)" SecCore @@ -29,24 +41,25 @@ index 1c159c7cd..ce3c9f8ff 100644 File "${DLLDIR}\libcurl-4.dll" File "${DLLDIR}\libfreetype-6.dll" File "${DLLDIR}\${SEHDLL}" -@@ -370,50 +371,50 @@ Section /o "Portable" SecPortable - File "portable.xml" - SectionEnd - --Section /o "Debugger" SecDebug -- SetOutPath "$INSTDIR" -- File "${DLLDIR}\gdb.exe" +@@ -373,10 +374,10 @@ SectionEnd + Section /o "Debugger" SecDebug + SetOutPath "$INSTDIR" + File "${DLLDIR}\gdb.exe" - File "${DLLDIR}\libdl.dll" - File "${DLLDIR}\libexpat-1.dll" - File "${DLLDIR}\libreadline6.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" -- CreateShortCut "$DESKTOP\ManaPlus (debug).lnk" '"$INSTDIR\gdb.exe"' '"$INSTDIR\manaplusd.exe"' "$INSTDIR\manaplusd.exe" -- ${EndIf} --SectionEnd -- ++; File "${DLLDIR}\libdl.dll" ++; File "${DLLDIR}\libexpat-1.dll" ++; File "${DLLDIR}\libreadline6.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 + -Section /o "Profiler" SecProfiler - SetOutPath "$INSTDIR" - File "${EXEDIR}\manaplusp.exe" @@ -55,20 +68,6 @@ index 1c159c7cd..ce3c9f8ff 100644 - CreateShortCut "$DESKTOP\ManaPlus (profiler).lnk" "$INSTDIR\manaplusp.exe" - ${EndIf} -SectionEnd -+;Section /o "Debugger" SecDebug -+; SetOutPath "$INSTDIR" -+; File "${DLLDIR}\gdb.exe" -+; File "${DLLDIR}\libdl.dll" -+; File "${DLLDIR}\libexpat-1.dll" -+; File "${DLLDIR}\libreadline6.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" -+; CreateShortCut "$DESKTOP\ManaPlus (debug).lnk" '"$INSTDIR\gdb.exe"' '"$INSTDIR\manaplusd.exe"' "$INSTDIR\manaplusd.exe" -+; ${EndIf} -+;SectionEnd -+ +;Section /o "Profiler" SecProfiler +; SetOutPath "$INSTDIR" +; File "${EXEDIR}\manaplusp.exe" @@ -118,20 +117,14 @@ index 1c159c7cd..ce3c9f8ff 100644 Section "Translations" SecTrans SetOutPath "$INSTDIR" -@@ -464,12 +465,12 @@ Section Uninstall +@@ -428,8 +429,8 @@ SectionEnd + !insertmacro MUI_DESCRIPTION_TEXT ${SecEvol} "Create shortcuts for Evol Online." + !insertmacro MUI_DESCRIPTION_TEXT ${SecTrans} "Translations for the user interface. Uncheck this component to leave it in English." + !insertmacro MUI_DESCRIPTION_TEXT ${SecDebug} "Install debugger for try to detect stability issues." +- !insertmacro MUI_DESCRIPTION_TEXT ${SecProfiler} "Install profiler build to detect perfomance issues." +-; !insertmacro MUI_DESCRIPTION_TEXT ${SecTools} "Install tools like dyecmd." ++; !insertmacro MUI_DESCRIPTION_TEXT ${SecProfiler} "Install profiler build to detect perfomance issues." ++; !insertmacro MUI_DESCRIPTION_TEXT ${SecTools} "Install tools like dyecmd." + !insertmacro MUI_FUNCTION_DESCRIPTION_END + - Delete "$SMPROGRAMS\Mana\Uninstall.lnk" - Delete "$DESKTOP\ManaPlus.lnk" -- Delete "$DESKTOP\ManaPlus (debug).lnk" -+; Delete "$DESKTOP\ManaPlus (debug).lnk" - Delete "$DESKTOP\ManaPlus (profiler).lnk" - Delete "$DESKTOP\ManaPlus (tests).lnk" - Delete "$SMPROGRAMS\Mana\ManaPlus.lnk" -- Delete "$SMPROGRAMS\Mana\ManaPlus (debug).lnk" -- Delete "$SMPROGRAMS\Mana\ManaPlus (profiler).lnk" -+; Delete "$SMPROGRAMS\Mana\ManaPlus (debug).lnk" -+; Delete "$SMPROGRAMS\Mana\ManaPlus (profiler).lnk" - Delete "$SMPROGRAMS\Mana\ManaPlus (no opengl).lnk" - Delete "$SMPROGRAMS\Mana\ManaPlus (safemode).lnk" - Delete "$SMPROGRAMS\Mana\ManaPlus (tests).lnk" - diff --git a/manaplus.sh b/manaplus.sh new file mode 100644 index 0000000..8f8e827 --- /dev/null +++ b/manaplus.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +cp /mxe/usr/i686-w64-mingw32.shared/bin/gdb.exe /libs/dll/ || true # can also be moved to docker +cp /manaplus/tools/ci/scripts/winvars.sh manaplus/build/ +cd /manaplus/ + +# v change this in client repo laterâ„¢ +git apply ../manaplus.patch +# ^ change this in client repo laterâ„¢ + +cd /manaplus/build/ +./winmake --enable-commandlinepassword || exit 1 +cp /manaplus/build/tmp/src/manaplus.exe /manaplus/build/tmp/src/manaplusd.exe +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) +./packwin || exit 1 +# artifacts +cp /manaplus/packaging/windows/manaplus-*.exe /builds/jak89_1/docker-testing/build/ || exit 1 +cp /manaplus/build/tmp/config.log /builds/jak89_1/docker-testing/logs/ || true +cp /manaplus/build/make2.log /builds/jak89_1/docker-testing/logs/ || true diff --git a/mxe.patch b/mxe.patch index 35bea09..560494a 100644 --- a/mxe.patch +++ b/mxe.patch @@ -100,3 +100,15 @@ index 3542e13d..8d22635c 100644 $(if $(BUILD_STATIC), \ --disable-music-mod-shared \ --disable-music-ogg-shared \ +diff --git a/src/gdb.mk b/src/gdb.mk +index f4818c9c..ed5976c2 100644 +--- a/src/gdb.mk ++++ b/src/gdb.mk +@@ -23,6 +23,7 @@ define $(PKG)_BUILD + --with-system-readline \ + --disable-gdbtk \ + --disable-tui \ ++ --disable-libctf \ + host_configargs="LIBS=\"`$(TARGET)-pkg-config --libs dlfcn` -lmman\"" \ + CONFIG_SHELL=$(SHELL) \ + LDFLAGS='-Wl,--allow-multiple-definition' diff --git a/mxe.sh b/mxe.sh new file mode 100755 index 0000000..3d52d7c --- /dev/null +++ b/mxe.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +export CROSS=i686-w64-mingw32.shared +cross_req="cc smpeg ffmpeg sdl sdl_image sdl_ttf sdl_net sdl_gfx libxml2 curl libpng zlib gettext sdl_mixer gdb" +docker_req="gcc g++ python autoconf automake autopoint bash bison bzip2 flex gettext git gperf intltoolize libtool lzip make makensis openssl p7zip patch perl ruby sed unzip wget lzma" + + +req_check() +{ + echo "*** sys-info *** >---------------------------------------------------" + uname -a + req_err="" + for req in $docker_req; do + if ! command -v $req > /dev/null 2>&1; then + req_err="$req_err $req"; + fi + done + if [ "$req_err" != "" ]; then + echo "! missing req: $req_err !"; + exit 1; + fi + echo "*** sys-info *** <---------------------------------------------------" +} + +mxe() +{ + echo "*** mxe-build *** >--------------------------------------------------" + cd / + git clone https://github.com/mxe/mxe.git + cd mxe + + # mxe params to settings.mk + echo "MXE_TARGETS := ${CROSS}" > settings.mk + echo "LOCAL_PKG_LIST := ${cross_req}" >> settings.mk + echo ".DEFAULT_GOAL := local-pkg-list" >> settings.mk + echo 'local-pkg-list: $(LOCAL_PKG_LIST)' >> settings.mk + + # mxe patch + git apply ../mxe.patch || exit 1 + + # make mxe + make || exit 1 + + # sdl patch + sed -i 's|#define GL_GLEXT_VERSION 29|#ifndef GL_GLEXT_VERSION\n#define GL_GLEXT_VERSION 29\n#endif|' /mxe/usr/${CROSS}/include/SDL/SDL_opengl.h + + # cleanup downloads & logs + make clean-junk || exit 1 + cp /mxe/usr/${CROSS}/bin/gdb.exe /build/ || exit 1 + echo "*** mxe-build *** <--------------------------------------------------" +} + + +test_mxe() +{ + export PATH=/mxe/usr/bin:/mxe/usr/${CROSS}/bin:$PATH + echo `${CROSS}-gcc --version` + echo `${CROSS}-g++ --version` + echo "${PATH}" +} + +req_check +mxe +test_mxe -- cgit v1.2.3-60-g2f50