2022-01-16 20:43:39 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-07-07 19:33:25 +08:00
|
|
|
TARGET_DIR="/r/"
|
2022-01-16 20:43:39 +08:00
|
|
|
BUILD_DIR="${TEMP}/redpandacpp-build"
|
|
|
|
PACKAGE_DIR="${TEMP}/RedPanda-CPP"
|
|
|
|
GCC_DIR="/mingw64"
|
|
|
|
PATH="${GCC_DIR}/bin:${PATH}"
|
|
|
|
QMAKE="${GCC_DIR}/qt5-static/bin/qmake"
|
|
|
|
NSIS="/d/Program Files (x86)/NSIS/bin/makensis.exe"
|
|
|
|
SOURCE_DIR=`pwd`
|
|
|
|
MINGW="/e/Workspaces/contributes/MinGW/MinGW64"
|
|
|
|
MINGW_NAME="MinGW64"
|
|
|
|
|
2022-02-28 12:22:28 +08:00
|
|
|
rm -rf "${BUILD_DIR}"
|
2022-01-16 20:43:39 +08:00
|
|
|
test -z "${BUILD_DIR}" | mkdir "${BUILD_DIR}"
|
|
|
|
rm -rf "${PACKAGE_DIR}"
|
|
|
|
mkdir "${PACKAGE_DIR}"
|
|
|
|
|
|
|
|
echo "Building..."
|
|
|
|
pushd .
|
|
|
|
cd "${BUILD_DIR}"
|
|
|
|
make distclean
|
2023-02-14 23:42:11 +08:00
|
|
|
"$QMAKE" PREFIX="${PACKAGE_DIR}" X86_64=ON -o Makefile "${SOURCE_DIR}\Red_Panda_Cpp.pro" -r -spec win32-g++
|
2022-01-16 20:43:39 +08:00
|
|
|
make -j16
|
|
|
|
make install
|
|
|
|
popd
|
|
|
|
|
|
|
|
echo "Making no-compiler installer ..."
|
|
|
|
pushd .
|
|
|
|
cd "${PACKAGE_DIR}"
|
|
|
|
|
2022-09-27 23:44:26 +08:00
|
|
|
cp "${SOURCE_DIR}/platform/windows/installer-scripts/lang.nsh" .
|
|
|
|
cp "${SOURCE_DIR}/platform/windows/installer-scripts/redpanda-nocompiler.nsi" .
|
2022-01-16 20:43:39 +08:00
|
|
|
|
|
|
|
"${NSIS}" redpanda-nocompiler.nsi
|
|
|
|
rm -f lang.nsh
|
|
|
|
rm -f config.nsh
|
2022-01-16 20:50:26 +08:00
|
|
|
rm -f config32.nsh
|
2022-01-16 20:43:39 +08:00
|
|
|
rm -f redpanda-nocompiler.nsi
|
|
|
|
|
|
|
|
SETUP_NAME=`ls *.Setup.exe`
|
|
|
|
PORTABLE_NAME=`echo $SETUP_NAME | sed 's/Setup.exe/Portable.7z/'`
|
2022-07-07 19:33:25 +08:00
|
|
|
mv "$SETUP_NAME" "${TARGET_DIR}"
|
2022-01-16 20:43:39 +08:00
|
|
|
popd
|
|
|
|
|
2022-07-07 19:33:25 +08:00
|
|
|
pushd .
|
|
|
|
cd "${TARGET_DIR}"
|
2022-01-16 20:43:39 +08:00
|
|
|
echo "Making no-compiler Portable Package..."
|
|
|
|
7z a -mmt8 -mx9 "${PORTABLE_NAME}" "${PACKAGE_DIR}"
|
2022-07-07 19:33:25 +08:00
|
|
|
popd
|
2022-01-16 20:43:39 +08:00
|
|
|
|
|
|
|
# we need reinstall config.nsh
|
|
|
|
pushd .
|
|
|
|
cd "${BUILD_DIR}"
|
|
|
|
make install
|
|
|
|
popd
|
|
|
|
|
|
|
|
echo "Making installer..."
|
|
|
|
|
|
|
|
pushd .
|
|
|
|
cd "${PACKAGE_DIR}"
|
2023-03-16 18:11:05 +08:00
|
|
|
cp -a "${MINGW}" .
|
2023-07-14 10:33:26 +08:00
|
|
|
#rm -rf "${MINGW_NAME}/share/gcc-11.2.0"
|
|
|
|
#cp -a "${SOURCE_DIR}/tools/gdb-scripts/gcc-11.2.0" "${MINGW_NAME}/share"
|
2022-01-16 20:43:39 +08:00
|
|
|
|
2022-09-27 23:44:26 +08:00
|
|
|
cp "${SOURCE_DIR}/platform/windows/installer-scripts/lang.nsh" .
|
|
|
|
cp "${SOURCE_DIR}/platform/windows/installer-scripts/redpanda-x64.nsi" .
|
2022-01-16 20:43:39 +08:00
|
|
|
|
|
|
|
"${NSIS}" redpanda-x64.nsi
|
|
|
|
rm -f lang.nsh
|
|
|
|
rm -f config.nsh
|
2022-01-16 20:50:26 +08:00
|
|
|
rm -f config32.nsh
|
2022-01-16 20:43:39 +08:00
|
|
|
rm -f redpanda-x64.nsi
|
|
|
|
|
|
|
|
SETUP_NAME=`ls *.Setup.exe`
|
|
|
|
PORTABLE_NAME=`echo $SETUP_NAME | sed 's/Setup.exe/Portable.7z/'`
|
2022-07-07 19:33:25 +08:00
|
|
|
mv "$SETUP_NAME" "${TARGET_DIR}"
|
2022-01-16 20:43:39 +08:00
|
|
|
|
|
|
|
popd
|
|
|
|
|
2022-07-07 19:33:25 +08:00
|
|
|
pushd .
|
|
|
|
|
|
|
|
cd "${TARGET_DIR}"
|
2022-01-16 20:43:39 +08:00
|
|
|
echo "Making Portable Package..."
|
|
|
|
7z a -mmt8 -mx9 "${PORTABLE_NAME}" "${PACKAGE_DIR}"
|
|
|
|
|
|
|
|
echo "Clean up..."
|
|
|
|
rm -rf "${PACKAGE_DIR}"
|
|
|
|
|
2022-07-07 19:33:25 +08:00
|
|
|
popd
|
|
|
|
|