From b26201d166215861bd362dfade9da1e93fafffbe Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sun, 16 Jan 2022 15:08:54 +0800 Subject: [PATCH] work save: package script for windows --- .gitignore | 1 + RedPandaIDE/RedPandaIDE.pro | 8 +++++-- Red_Panda_CPP.pro | 17 +++++++++++++++ astyle/astyle.pro | 6 ++++++ consolepauser/consolepauser.pro | 6 ++++++ installer/devcpp-x64.nsi | 4 ++-- packages/msys/build.sh | 37 +++++++++++++++++++++++++++++++++ 7 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 packages/msys/build.sh diff --git a/.gitignore b/.gitignore index 36854cc8..69e4889f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /.vs +*.bak diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index ed81d751..b85f6a5a 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -13,8 +13,6 @@ isEmpty(PREFIX) { PREFIX = /usr/local } -APP_VERSION = beta.0.13.2 - DEFINES += PREFIX=\\\"$${PREFIX}\\\" DEFINES += APP_NAME=\\\"$${APP_NAME}\\\" DEFINES += REDPANDA_CPP_VERSION=\\\"$${APP_VERSION}\\\" @@ -352,6 +350,12 @@ linux: { TRANSLATIONS += \ RedPandaIDE_zh_CN.ts +win32: { + !isEmpty(PREFIX) { + target.path = $${PREFIX} + } +} + # Default rules for deployment. qnx: target.path = $${PREFIX}/bin else: unix:!android: target.path = $${PREFIX}/bin diff --git a/Red_Panda_CPP.pro b/Red_Panda_CPP.pro index 1d354145..882a79d9 100644 --- a/Red_Panda_CPP.pro +++ b/Red_Panda_CPP.pro @@ -7,6 +7,8 @@ SUBDIRS += \ APP_NAME = RedPandaCPP +APP_VERSION = 0.14 + linux: { isEmpty(PREFIX) { @@ -34,3 +36,18 @@ linux: { INSTALLS += desktop } + +win32: { + !isEmpty(PREFIX) { + target.path = $${PREFIX} + + resources.path = $${PREFIX} + resources.files += templates + resources.files += README.md + resources.files += NEWS.md + resources.files += LICENSE + resources.files += RedPandaIDE/images/devcpp.ico + + INSTALLS += resources + } +} diff --git a/astyle/astyle.pro b/astyle/astyle.pro index 39b40a45..6049a182 100644 --- a/astyle/astyle.pro +++ b/astyle/astyle.pro @@ -23,6 +23,12 @@ isEmpty(PREFIX) { PREFIX = /usr/local } +win32: { + !isEmpty(BUILD_MSYS) { + target.path = $${PREFIX} + } +} + # Default rules for deployment. qnx: target.path = $${PREFIX}/libexec/$${APP_NAME} else: unix:!android: target.path = $${PREFIX}/libexec/$${APP_NAME} diff --git a/consolepauser/consolepauser.pro b/consolepauser/consolepauser.pro index dcc5fecc..0ab409f6 100644 --- a/consolepauser/consolepauser.pro +++ b/consolepauser/consolepauser.pro @@ -30,6 +30,12 @@ isEmpty(PREFIX) { PREFIX = /usr/local } +win32: { + !isEmpty(PREFIX) { + target.path = $${PREFIX} + } +} + # Default rules for deployment. qnx: target.path = $${PREFIX}/libexec/$${APP_NAME} else: unix:!android: target.path = $${PREFIX}/libexec/$${APP_NAME} diff --git a/installer/devcpp-x64.nsi b/installer/devcpp-x64.nsi index 007f4e49..c6cbfd8f 100644 --- a/installer/devcpp-x64.nsi +++ b/installer/devcpp-x64.nsi @@ -1,9 +1,9 @@ #################################################################### # Startup -!define COMPILERNAME "MinGW-w64 X86_64 GCC 11.2" +!define COMPILERNAME "MinGW-w64 X86_64 GCC 10.3" !define COMPILERFOLDER "MinGW64" -!define DEVCPP_VERSION "beta.0.12.3" +!define DEVCPP_VERSION "0.14" !define FINALNAME "RedPanda-Cpp.7.${DEVCPP_VERSION}.${COMPILERNAME}.Setup.exe" !define DISPLAY_NAME "Red Panda Dev-C++ 7 ${DEVCPP_VERSION}" diff --git a/packages/msys/build.sh b/packages/msys/build.sh new file mode 100644 index 00000000..d8fe8baf --- /dev/null +++ b/packages/msys/build.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +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` +MINGW64="/d/Program Files/RedPanda-CPP/MINGW64" + +test -z "${BUILD_DIR}" | mkdir "${BUILD_DIR}" +test -z "${PACKAGE_DIR}" | mkdir "${PACKAGE_DIR}" +pushd . + +cd "${BUILD_DIR}" + +echo `pwd` + +"$QMAKE" PREFIX="${PACKAGE_DIR}" BUILD_MSYS=1 -o Makefile "${SOURCE_DIR}\Red_Panda_Cpp.pro" -r -spec win32-g++ +make -j16 +make install +popd + +pushd . +cd "${PACKAGE_DIR}" +mklink /j MinGW64 "${MINGW64}" +cp "${SOURCE_DIR}\installer\devcpp-x64.nsi" build.nsi +cp "${SOURCE_DIR}\installer\lang.nsh" . +"${NSIS}" build.nsi +rm -f lang.nsi +rm -f build.nsi + +popd + + +