build: try remove other platforms

This commit is contained in:
FreskyZ 2024-09-30 22:07:26 +08:00
parent 4bf21d5747
commit 6d7cb29c07
35 changed files with 0 additions and 2244 deletions

View File

@ -68,77 +68,6 @@ jobs:
name: Windows MSYS2 - msystem=${{ matrix.msystem }}
path: dist/
windows_legacy_native:
name: Windows NT 5.x native
strategy:
fail-fast: false
matrix:
profile:
- 64-ucrt
- 32-ucrt
- 64-msvcrt
- 32-msvcrt
include:
- isUcrt: 0
- profile: 64-ucrt
isUcrt: 1
- profile: 32-ucrt
isUcrt: 1
runs-on: windows-2022
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
- name: Build
run: |
./packages/msys/build-xp.sh -p ${{ matrix.profile }} \
$( [[ ${{ matrix.isUcrt }} -eq 1 ]] && echo --ucrt 22621 )
./packages/msys/build-xp.sh -p ${{ matrix.profile }} --mingw \
$( [[ ${{ matrix.isUcrt }} -eq 1 ]] && echo --ucrt 22621 )
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Windows NT 5.x native - profile=${{ matrix.profile }}
path: dist/*
windows_legacy_cross:
name: Windows NT 5.x cross
strategy:
fail-fast: false
matrix:
profile:
- 64-msvcrt
- 32-msvcrt
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: |
sudo ./packages/xmingw/build-xp.sh -p ${{ matrix.profile }}
sudo ./packages/xmingw/build-xp.sh -p ${{ matrix.profile }} --mingw
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Windows NT 5.x cross - profile=${{ matrix.profile }}
path: dist/*
windows_msvc_x64:
name: Windows MSVC x64
runs-on: windows-2019
@ -177,264 +106,3 @@ jobs:
with:
name: Windows MSVC x64
path: pkg/
windows_msvc_arm64ec:
name: Windows MSVC ARM64EC
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'
host: windows
target: desktop
arch: win64_msvc2019_64
archives: qtbase qtsvg qttools
tools: tools_qtcreator,qt.tools.qtcreator
- name: Build
run: |
$JOM = "${Env:RUNNER_WORKSPACE}/Qt/Tools/QtCreator/bin/jom/jom.exe"
$VS_INSTALL_PATH = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
Import-Module "$VS_INSTALL_PATH\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath "$VS_INSTALL_PATH" -SkipAutomaticLocation -DevCmdArguments "-arch=arm64 -host_arch=amd64"
mkdir build && pushd build
qmake QMAKE_CFLAGS="/arm64EC" QMAKE_CXXFLAGS="/arm64EC" QMAKE_LFLAGS="/MACHINE:ARM64EC" QMAKE_LIBFLAGS="/MACHINE:ARM64X" PREFIX=${Env:GITHUB_WORKSPACE}/pkg ${Env:GITHUB_WORKSPACE}/Red_Panda_CPP.pro
& $JOM "-j${Env:NUMBER_OF_PROCESSORS}"
& $JOM install
windeployqt ${Env:GITHUB_WORKSPACE}/pkg/RedPandaIDE.exe
rm ${Env:GITHUB_WORKSPACE}/pkg/vc_redist.x64.exe
popd
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Windows MSVC ARM64EC (do not use)
path: pkg/
debian:
name: Debian
strategy:
fail-fast: false
matrix:
arch: [amd64, i386]
version: ["11", "12"]
env:
IMAGE: docker.io/${{ matrix.arch }}/debian:${{ matrix.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: |
podman run --rm -v $PWD:/mnt -w /mnt $IMAGE ./packages/debian/01-in-docker.sh
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Debian ${{ matrix.version }} ${{ matrix.arch }}
path: dist/*.deb
ubuntu:
name: Ubuntu
strategy:
fail-fast: false
matrix:
version: ["22.04", "23.10", "24.04", "devel"]
env:
IMAGE: docker.io/amd64/ubuntu:${{ matrix.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: |
podman run --rm -v $PWD:/mnt -w /mnt $IMAGE ./packages/debian/01-in-docker.sh
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Ubuntu ${{ matrix.version }} amd64
path: dist/*.deb
archlinux:
name: Arch Linux
runs-on: ubuntu-latest
env:
IMAGE: docker.io/amd64/archlinux:latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: |
podman run --security-opt seccomp=unconfined --rm -v $PWD:/mnt -w /mnt $IMAGE ./packages/archlinux/01-in-docker.sh
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Arch Linux
path: dist/*.pkg.tar.zst
fedora:
name: Fedora
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ["latest", "rawhide"]
env:
IMAGE: docker.io/amd64/fedora:${{ matrix.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: |
podman run --security-opt seccomp=unconfined --rm -v $PWD:/mnt -w /mnt $IMAGE ./packages/fedora/01-in-docker.sh
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Fedora ${{ matrix.version }} x86_64
path: dist/*.rpm
opensuse:
name: openSUSE
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
edition: ["leap", "tumbleweed"]
env:
IMAGE: docker.io/opensuse/${{ matrix.edition }}:latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: |
podman run --security-opt seccomp=unconfined --rm -v $PWD:/mnt -w /mnt $IMAGE ./packages/opensuse/01-in-docker.sh
- name: Upload
uses: actions/upload-artifact@v4
with:
name: openSUSE ${{ matrix.edition }} x86_64
path: dist/*.rpm
musl:
name: musl-based Linux (latest Alpine)
runs-on: ubuntu-latest
env:
IMAGE: docker.io/amd64/alpine:latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: |
podman run --security-opt seccomp=unconfined --rm -v $PWD:/mnt -w /mnt $IMAGE ./packages/alpine/01-in-docker.sh
- name: Upload
uses: actions/upload-artifact@v4
with:
name: musl-based Linux (latest Alpine)
path: dist/*.apk
appimage:
name: Linux AppImage
runs-on: ubuntu-latest
env:
IMAGE: quay.io/redpanda-cpp/appimage-builder-x86_64:20240304.0
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: |
podman run --rm -v $PWD:/mnt -w /mnt $IMAGE ./packages/appimage/01-in-docker.sh
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Linux AppImage
path: dist/*.AppImage
static-deb:
name: Static Deb
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: |
packages/debian-static/builddeb.sh
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Static Deb
path: dist/*.deb
macos_x86_64:
name: macOS x86_64
runs-on: macos-12
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'
host: mac
target: desktop
arch: clang_64
archives: qtbase qtsvg qttools
tools: tools_qtcreator,qt.tools.qtcreator
- name: Build
run: |
mkdir build && pushd build
qmake PREFIX=$GITHUB_WORKSPACE/pkg $GITHUB_WORKSPACE/Red_Panda_CPP.pro
make -j$(nproc)
make install
popd
pushd $GITHUB_WORKSPACE/pkg/bin
macdeployqt RedPandaIDE.app
tar -cJf RedPandaIDE.tar.xz RedPandaIDE.app
- name: Upload
uses: actions/upload-artifact@v4
with:
name: macOS x86_64
path: pkg/bin/RedPandaIDE.tar.xz

View File

@ -3,42 +3,6 @@ name: Feature matrix
on: [push, pull_request, workflow_dispatch]
jobs:
ubuntu_2204:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
lua_addon: ["y", "n"]
sdcc: ["y", "n"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: '2.8.6'
- name: Setup Qt
uses: ConorMacBride/install-package@v1
with:
apt: libqt5svg5-dev qtbase5-dev qtbase5-dev-tools qttools5-dev-tools
- name: Build
run: |
name="redpanda-cpp-${{ matrix.lua_addon }}-${{ matrix.sdcc }}"
xmake f --qt=/usr --prefix=/ --lua-addon=${{ matrix.lua_addon }} --sdcc=${{ matrix.sdcc }}
xmake b
xmake i -o "pkg/$name"
tar -cf "pkg/$name.tar" -C pkg "$name"
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Ubuntu 22.04 - lua-addon=${{ matrix.lua_addon }}, sdcc=${{ matrix.sdcc }}
path: pkg/*.tar
windows_msvc_x64:
runs-on: windows-2019
strategy:

View File

@ -3,34 +3,6 @@ name: Unit
on: [push, pull_request, workflow_dispatch]
jobs:
ubuntu_makefile_escape:
name: Unix makefile escape
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: '2.8.6'
- name: Setup Qt
uses: ConorMacBride/install-package@v1
with:
apt: libqt5svg5-dev qtbase5-dev qtbase5-dev-tools qttools5-dev-tools
- name: Build
run: |
xmake f --qt=/usr
xmake b test-escape
- name: Test
run: |
export QT_ASSUME_STDERR_HAS_CONSOLE=1
xmake r test-escape
teal_lua_consistency:
name: TealLua consistency
runs-on: ubuntu-22.04

Binary file not shown.

View File

@ -1,19 +0,0 @@
#!/bin/bash
input_icon="../RedPandaIDE/images/devcpp.png"
output_dir="RedPandaIDE.iconset"
mkdir $output_dir
sips -z 16 16 $input_icon --out "${output_dir}/icon_16x16.png"
sips -z 32 32 $input_icon --out "${output_dir}/icon_16x16@2x.png"
sips -z 32 32 $input_icon --out "${output_dir}/icon_32x32.png"
sips -z 64 64 $input_icon --out "${output_dir}/icon_32x32@2x.png"
sips -z 128 128 $input_icon --out "${output_dir}/icon_128x128.png"
sips -z 256 256 $input_icon --out "${output_dir}/icon_128x128@2x.png"
sips -z 256 256 $input_icon --out "${output_dir}/icon_256x256.png"
sips -z 512 512 $input_icon --out "${output_dir}/icon_256x256@2x.png"
iconutil -c icns $output_dir
rm -R $output_dir

View File

@ -1,17 +0,0 @@
#!/bin/ash
set -xeuo pipefail
if (env | grep '^MIRROR=') && [[ -n $MIRROR ]]
then
sed -i "s|dl-cdn.alpinelinux.org|$MIRROR|" /etc/apk/repositories
fi
apk add alpine-sdk git
abuild-keygen -an
# TODO: use `abuild-keygen --install`
cp ~/.abuild/*.pub /etc/apk/keys/
./packages/alpine/buildapk.sh
mkdir -p dist
cp ~/packages/unsupported/$(uname -m)/redpanda-cpp-git-*.apk dist/

View File

@ -1,29 +0,0 @@
_pkgname=RedPanda-CPP
pkgname=redpanda-cpp-git
pkgver=__VERSION__
pkgrel=1
pkgdesc='A fast, lightweight, open source, and cross platform C++ IDE (development version)'
arch='all'
url="https://github.com/royqh1979/$_pkgname"
license='GPL-3.0'
depends='qt5-qtbase qt5-qtsvg gcc g++ gdb astyle'
makedepends='qt5-qtbase-dev qt5-qtsvg-dev qt5-qttools-dev'
provides='redpanda-cpp'
source="$_pkgname.tar.gz"
options='!check'
build() {
mkdir "$srcdir/redpanda-build"
cd "$srcdir/redpanda-build"
qmake-qt5 \
PREFIX='/usr' \
"$srcdir/$_pkgname/Red_Panda_CPP.pro"
make
}
package() {
cd "$srcdir/redpanda-build"
make INSTALL_ROOT="$pkgdir" install
}
sha512sums="00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 $_pkgname.tar.gz"

View File

@ -1,17 +0,0 @@
#!/bin/ash
set -xeuo pipefail
TMP_FOLDER=/tmp/unsupported/redpanda-cpp-git
[[ -d $TMP_FOLDER ]] && rm -rf $TMP_FOLDER
mkdir -p "$TMP_FOLDER"
COMMIT_DATE=$(git log -1 --format=%cd --date=format:%Y%m%d)
VERSION=$(git describe --long --tags | sed 's/^v//;s/-\([^-]*\)-g\([0-9a-f]*\)/_git'$COMMIT_DATE'/') || VERSION="0.0_git$COMMIT_DATE"
sed "s/__VERSION__/$VERSION/g" packages/alpine/APKBUILD.in >"$TMP_FOLDER/APKBUILD"
git archive --prefix="RedPanda-CPP/" -o "$TMP_FOLDER/RedPanda-CPP.tar.gz" HEAD
cd "$TMP_FOLDER"
abuild -F checksum
abuild -Fr

View File

@ -1,45 +0,0 @@
#!/bin/bash
set -euxo pipefail
. version.inc
SRC_DIR="$PWD"
TEST_VERSION=$(git rev-list HEAD --count)
if [[ -n "$APP_VERSION_SUFFIX" ]]; then
VERSION="$APP_VERSION.$TEST_VERSION.$APP_VERSION_SUFFIX"
else
VERSION="$APP_VERSION.$TEST_VERSION"
fi
CARCH=$(gcc -dumpmachine | cut -d- -f1)
APPIMAGE_FILE=RedPandaIDE-$VERSION-$CARCH.AppImage
RUNTIME_FILE=/opt/appimage-runtime
RUNTIME_SIZE=$(wc -c <$RUNTIME_FILE)
# build RedPanda C++
mkdir -p /build
cd /build
qmake PREFIX=/usr "$SRC_DIR/Red_Panda_CPP.pro"
make LINUX_STATIC_IME_PLUGIN=ON -j$(nproc)
# install RedPanda C++ to AppDir
make INSTALL_ROOT=/RedPandaIDE.AppDir install
# setup AppImage resource
cd /RedPandaIDE.AppDir
ln -s usr/share/applications/RedPandaIDE.desktop RedPandaIDE.desktop
ln -s usr/share/icons/hicolor/scalable/apps/redpandaide.svg redpandaide.svg
# following files may come from Windows filesystem, use `install` to preseve file permission
install -m755 "$SRC_DIR/packages/appimage/AppRun.sh" AppRun
install -m644 "$SRC_DIR/platform/linux/redpandaide.png" .DirIcon
# create AppImage
cd /
mksquashfs RedPandaIDE.AppDir $APPIMAGE_FILE -offset $RUNTIME_SIZE -comp zstd -root-owned -noappend -b 1M -mkfs-time 0
dd if=$RUNTIME_FILE of=$APPIMAGE_FILE conv=notrunc
chmod +x $APPIMAGE_FILE
# copy back to host
mkdir -p "$SRC_DIR/dist"
cp $APPIMAGE_FILE "$SRC_DIR/dist"

View File

@ -1,7 +0,0 @@
#!/bin/sh
# AppImage runtime set `argv[0]` to AppImage file, which is not reliable.
# Qt framework expects reliable `argv[0]` to locate configuration files.
# This wrapper fixes `argv[0]`.
exec "$(dirname "$0")/usr/bin/RedPandaIDE" "$@"

View File

@ -1,20 +0,0 @@
#!/bin/bash
set -xeuo pipefail
if [[ -v MIRROR && -n $MIRROR ]]
then
echo Server = "http://$MIRROR/archlinux/\$repo/os/\$arch" >/etc/pacman.d/mirrorlist
fi
pacman -Syu --noconfirm --needed base-devel git
useradd -m builduser
echo 'builduser ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builduser
echo "MAKEFLAGS=-j$(($(nproc)+1))" >>/etc/makepkg.conf.d/jobs.conf
su builduser -c "git config --global --add safe.directory $PWD"
su builduser -c ./packages/archlinux/buildpkg.sh
mkdir -p dist
cp /tmp/redpanda-cpp-git/redpanda-cpp-git-*.pkg.tar.zst dist/

View File

@ -1,54 +0,0 @@
_pkgname=RedPanda-CPP
pkgname=${_pkgname,,}-git
pkgver=__VERSION__
pkgrel=1
pkgdesc='A fast, lightweight, open source, and cross platform C++ IDE (development version)'
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64' 'riscv64')
url="https://github.com/royqh1979/$_pkgname"
license=('GPL3')
depends=(qt6-base qt6-svg gcc gdb astyle)
makedepends=(qt6-tools imagemagick librsvg)
optdepends=(
'clang: C/C++ compiler (alternative)'
)
conflicts=("${_pkgname,,}")
provides=("${_pkgname,,}")
source=(
"$_pkgname.tar.gz"
'compiler_hint.lua'
)
sha256sums=(
'SKIP'
'SKIP'
)
prepare() {
sed -i '/CONFIG += ENABLE_LUA_ADDON/ { s/^#\s*// }' RedPanda-CPP/RedPandaIDE/RedPandaIDE.pro
}
build() {
mkdir redpanda-build
cd redpanda-build
qmake6 \
PREFIX='/usr' \
LIBEXECDIR='/usr/lib' \
"$srcdir/$_pkgname/Red_Panda_CPP.pro"
make
}
package() {
local _libexecdir="$pkgdir/usr/lib/RedPandaCPP"
install -Dm644 "compiler_hint.lua" "$_libexecdir/compiler_hint.lua"
cd redpanda-build
make INSTALL_ROOT="$pkgdir" install
for size in 16 22 24 32 36 48 64 72 96 128 192 256 512; do
mkdir -p "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps"
magick convert \
-background none \
"$pkgdir/usr/share/icons/hicolor/scalable/apps/redpandaide.svg" \
-resize ${size}x${size} \
"$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/redpandaide.png"
done
}

View File

@ -1,16 +0,0 @@
#!/bin/bash
set -xeuo pipefail
TMP_FOLDER=/tmp/redpanda-cpp-git
[[ -d $TMP_FOLDER ]] && rm -rf $TMP_FOLDER
mkdir -p "$TMP_FOLDER"
VERSION=$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g') || VERSION="0.0.r$(git rev-list HEAD --count).g$(git rev-parse --short HEAD)"
sed "s/__VERSION__/$VERSION/g" packages/archlinux/PKGBUILD.in >"$TMP_FOLDER/PKGBUILD"
git archive --prefix="RedPanda-CPP/" -o "$TMP_FOLDER/RedPanda-CPP.tar.gz" HEAD
cp packages/archlinux/compiler_hint.lua "$TMP_FOLDER/"
cd "$TMP_FOLDER"
makepkg -s --noconfirm

View File

@ -1,309 +0,0 @@
function apiVersion()
return {
kind = "compiler_hint",
major = 0,
minor = 2,
}
end
local compilerNameTemplate = {
system = {
en_US = "System %1, %2",
pt_BR = "%1 sistema, %2",
zh_CN = "系统 %1%2",
zh_TW = "系統 %1%2",
},
multilib = {
en_US = "Multilib %1, %2",
pt_BR = "%1 multilib, %2",
zh_CN = "Multilib %1%2",
zh_TW = "Multilib %1%2",
},
cross = {
en_US = "Cross %1 %3, %2",
pt_BR = "%1 cruzado %3, %2",
zh_CN = "交叉编译 %1 %3%2",
zh_TW = "交叉編譯 %1 %3%2",
},
mingw = {
en_US = "MinGW %1 %3, %2",
pt_BR = "MinGW %1 %3, %2",
zh_CN = "MinGW %1 %3%2",
zh_TW = "MinGW %1 %3%2",
},
}
local profileNameMap = {
release = {
en_US = "release",
pt_BR = "lançamento",
zh_CN = "发布",
zh_TW = "發佈",
},
debug = {
en_US = "debug",
pt_BR = "depuração",
zh_CN = "调试",
zh_TW = "偵錯",
},
debugWithAsan = {
en_US = "debug with ASan",
pt_BR = "depuração com ASan",
zh_CN = "ASan 调试",
zh_TW = "ASan 偵錯",
},
}
local function nameGenerator(lang, name, kind, profile, arch)
local template = compilerNameTemplate[kind][lang] or compilerNameTemplate[kind].en_US
local profileName = profileNameMap[profile][lang] or profileNameMap[profile].en_US
return C_Util.format(template, name, profileName, arch)
end
local function mergeCompilerSet(compilerSet, other)
local c = compilerSet
local o = other
for k, v in pairs(o) do
c[k] = v
end
end
local function generateConfig(
lang, name, kind,
cCompiler, cxxCompiler,
config)
local commonOptions = {
cCompiler = cCompiler,
cxxCompiler = cxxCompiler,
debugger = "/usr/bin/gdb",
debugServer = "/usr/bin/gdbserver",
make = "/usr/bin/make",
compilerType = name:sub(1, 5) == "Clang" and "Clang" or "GCC_UTF8",
preprocessingSuffix = ".i",
compilationProperSuffix = ".s",
assemblingSuffix = ".o",
executableSuffix = kind == "mingw" and ".exe" or "",
compilationStage = 3,
ccCmdOptUsePipe = "on",
ccCmdOptWarningAll = "on",
ccCmdOptWarningExtra = "on",
ccCmdOptCheckIsoConformance = "on",
binDirs = { "/usr/bin" },
}
if kind == "multilib" then
commonOptions.ccCmdOptPointerSize = "32"
end
if kind == "mingw" then
commonOptions.resourceCompiler = "/usr/bin/" .. config.triplet .. "-windres"
end
if config.customCompileParams then
commonOptions.customCompileParams = config.customCompileParams
end
if config.customLinkParams then
commonOptions.customLinkParams = config.customLinkParams
end
local release = {
name = nameGenerator(lang, name, kind, "release", config.arch),
staticLink = true,
linkCmdOptStripExe = "on",
ccCmdOptOptimize = "2",
}
local debug_ = {
name = nameGenerator(lang, name, kind, "debug", config.arch),
ccCmdOptDebugInfo = "on",
}
local debugWithAsan = {
name = nameGenerator(lang, name, kind, "debugWithAsan", config.arch),
ccCmdOptDebugInfo = "on",
ccCmdOptAddressSanitizer = "address",
}
mergeCompilerSet(release, commonOptions)
mergeCompilerSet(debug_, commonOptions)
mergeCompilerSet(debugWithAsan, commonOptions)
return release, debug_, debugWithAsan
end
function main()
local arch = C_System.osArch()
local libexecDir = C_System.appLibexecDir()
local lang = C_Desktop.language()
local compilerList = {}
do
local release, debug_, debugWithAsan = generateConfig(
lang, "GCC", "system", "/usr/bin/gcc", "/usr/bin/g++",
{})
table.insert(compilerList, release)
table.insert(compilerList, debug_)
table.insert(compilerList, debugWithAsan)
end
local versionedGccs = C_FileSystem.matchFiles("/usr/bin", "^gcc-[0-9]+$")
for _, gcc in ipairs(versionedGccs) do
local version = gcc:sub(5)
local name = "GCC " .. version
local release, debug_, debugWithAsan = generateConfig(
lang, name, "system", "/usr/bin/" .. gcc, "/usr/bin/g++-" .. version,
{})
table.insert(compilerList, release)
table.insert(compilerList, debug_)
table.insert(compilerList, debugWithAsan)
end
if C_FileSystem.isExecutable("/usr/bin/clang") then
local release, debug_, debugWithAsan = generateConfig(
lang, "Clang", "system", "/usr/bin/clang", "/usr/bin/clang++",
{})
table.insert(compilerList, release)
table.insert(compilerList, debug_)
table.insert(compilerList, debugWithAsan)
end
if arch == "x86_64" and C_FileSystem.isExecutable("/usr/lib32/libstdc++.so") then
do
local release, debug_, debugWithAsan = generateConfig(
lang, "GCC", "multilib", "/usr/bin/gcc", "/usr/bin/g++",
{})
table.insert(compilerList, release)
table.insert(compilerList, debug_)
table.insert(compilerList, debugWithAsan)
end
if C_FileSystem.isExecutable("/usr/bin/clang") then
local release, debug_, debugWithAsan = generateConfig(
lang, "Clang", "multilib", "/usr/bin/clang", "/usr/bin/clang++",
{})
table.insert(compilerList, release)
table.insert(compilerList, debug_)
table.insert(compilerList, debugWithAsan)
end
end
if (
arch == "x86_64" and
C_FileSystem.exists("/proc/sys/fs/binfmt_misc/qemu-aarch64") and
C_FileSystem.isExecutable("/usr/bin/aarch64-linux-gnu-gcc")) then
local release, _, _ = generateConfig(
lang, "GCC", "cross",
"/usr/bin/aarch64-linux-gnu-gcc", "/usr/bin/aarch64-linux-gnu-g++",
{ arch = "aarch64" })
table.insert(compilerList, release)
end
if (
arch == "x86_64" and (
C_FileSystem.exists("/proc/sys/fs/binfmt_misc/DOSWin") or
C_FileSystem.exists("/proc/sys/fs/binfmt_misc/WSLInterop"))) then
if C_FileSystem.isExecutable("/usr/bin/x86_64-w64-mingw32-gcc") then
do
local release, _, _ = generateConfig(
lang, "GCC", "mingw",
"/usr/bin/x86_64-w64-mingw32-gcc", "/usr/bin/x86_64-w64-mingw32-g++",
{
arch = "x86_64",
triplet = "x86_64-w64-mingw32",
customLinkParams = {},
})
table.insert(compilerList, release)
end
if C_FileSystem.isExecutable("/usr/bin/clang") then
local release, _, _ = generateConfig(
lang, "Clang", "mingw", "/usr/bin/clang", "/usr/bin/clang++",
{
arch = "x86_64",
triplet = "x86_64-w64-mingw32",
customCompileParams = { "-target", "x86_64-w64-mingw32" },
customLinkParams = {
"-target", "x86_64-w64-mingw32",
"-lstdc++", "-lwinpthread",
},
})
table.insert(compilerList, release)
end
end
if C_FileSystem.isExecutable("/usr/bin/i686-w64-mingw32-gcc") then
do
local release, _, _ = generateConfig(
lang, "GCC", "mingw",
"/usr/bin/i686-w64-mingw32-gcc", "/usr/bin/i686-w64-mingw32-g++",
{
arch = "i686",
triplet = "i686-w64-mingw32",
customLinkParams = {},
})
table.insert(compilerList, release)
end
if C_FileSystem.isExecutable("/usr/bin/clang") then
local release, _, _ = generateConfig(
lang, "Clang", "mingw",
"/usr/bin/clang", "/usr/bin/clang++",
{
arch = "i686",
triplet = "i686-w64-mingw32",
customCompileParams = { "-target", "i686-w64-mingw32" },
customLinkParams = {
"-target", "i686-w64-mingw32",
"-lstdc++", "-lwinpthread",
},
})
table.insert(compilerList, release)
end
end
end
local result = {
compilerList = compilerList,
noSearch = {
"/usr/bin",
"/opt/cuda/bin",
"/usr/lib/ccache/bin",
},
preferCompiler = 3,
}
return result
end

View File

@ -1,14 +0,0 @@
#!/bin/bash
set -euxo pipefail
SRC_DIR="$PWD"
# build RedPanda C++
mkdir -p /build
cd /build
qmake PREFIX=/usr "$SRC_DIR/Red_Panda_CPP.pro"
make LINUX_STATIC_IME_PLUGIN=ON -j$(nproc)
# install RedPanda C++ to AppDir
make INSTALL_ROOT=/out install

View File

@ -1,21 +0,0 @@
#!/bin/bash
set -euxo pipefail
. version.inc
TEST_VERSION="$(git rev-list HEAD --count)"
if [[ -n "$APP_VERSION_SUFFIX" ]]; then
VERSION="$APP_VERSION.$TEST_VERSION.$APP_VERSION_SUFFIX"
else
VERSION="$APP_VERSION.$TEST_VERSION"
fi
DEB_FILE="redpanda-cpp-bin_${VERSION}_amd64.deb"
TMP_FOLDER="$(mktemp -d)"
podman run -it --rm -v "$PWD:/mnt" -w /mnt -v "$TMP_FOLDER:/out" quay.io/redpanda-cpp/appimage-builder-x86_64:20240610.0 packages/debian-static/01-in-docker.sh
mkdir -p dist
mkdir -m 755 -p "$TMP_FOLDER/DEBIAN"
sed "s/__VERSION__/$VERSION/" packages/debian-static/control.in >"$TMP_FOLDER/DEBIAN/control"
dpkg-deb --build "$TMP_FOLDER" "dist/$DEB_FILE"

View File

@ -1,14 +0,0 @@
Section: devel
Priority: optional
Maintainer: royqh1979@gmail.com
Standards-Version: 4.3.0
Homepage: https://github.com/royqh1979/RedPanda-CPP
Package: redpanda-cpp-bin
Version: __VERSION__
Architecture: amd64
Depends: gcc, g++, make, gdb, gdbserver, astyle,
libc6 (>= 2.17), libstdc++6 (>= 4.8),
libdbus-1-3, libfontconfig1, libfreetype6, libwayland-client0, libwayland-cursor0, libx11-6, libx11-xcb1, libxcb1, libxcb-icccm4, libxcb-image0, libxcb-keysyms1, libxcb-randr0, libxcb-render-util0, libxcb-render0, libxcb-shape0, libxcb-shm0, libxcb-sync1, libxcb-xfixes0, libxcb-xinerama0, libxcb-xkb1, libxcb1, libxext6, libxkbcommon-x11-0, libxkbcommon0
Recommends: qterminal | konsole | gnome-terminal | terminator | lxterminal | mate-terminal | terminology | xfce4-terminal | alacritty | cool-retro-term | kitty | sakura | termit | tilix
Suggests: clang
Description: A lightweight but powerful C/C++ IDE, built upon static Qt 5.15

View File

@ -1,42 +0,0 @@
#!/bin/bash
set -xeuo pipefail
DISTRO_ID=$(grep ^ID= /etc/os-release | cut -d= -f2- | tr -d '"')
VERSION_ID=$(grep ^VERSION_ID= /etc/os-release | cut -d= -f2- | tr -d '"')
[[ -v JOBS ]] || JOBS=$(nproc)
# install deps
default_repositories=(
deb.debian.org
security.debian.org
archive.ubuntu.com
security.ubuntu.com
ports.ubuntu.com
)
if [[ -v MIRROR ]]
then
for repo in ${default_repositories[@]}
do
[[ -f /etc/apt/sources.list ]] && sed -i "s|$repo|$MIRROR|" /etc/apt/sources.list
for file in $(ls /etc/apt/sources.list.d/)
do
# okay for both *.list and *.sources (since Debian 12)
sed -i "s|$repo|$MIRROR|" /etc/apt/sources.list.d/$file
done
done
fi
export DEBIAN_FRONTEND=noninteractive
apt update
apt install -y --no-install-recommends build-essential debhelper devscripts equivs
./packages/debian/builddeb.sh
file=$(ls /tmp/redpanda-cpp_*.deb)
basename=$(basename $file)
# copy back to host
mkdir -p dist
cp $file dist/${basename/.deb/.$DISTRO_ID$VERSION_ID.deb}

View File

@ -1,25 +0,0 @@
#!/bin/bash
set -xeuo pipefail
TMP_FOLDER=/tmp/redpandaide
[[ -d $TMP_FOLDER ]] && rm -rf $TMP_FOLDER
mkdir -p "$TMP_FOLDER"
cp -r packages/debian $TMP_FOLDER
cp -r tools $TMP_FOLDER
cp -r libs $TMP_FOLDER
cp -r RedPandaIDE $TMP_FOLDER
cp README.md $TMP_FOLDER
cp LICENSE $TMP_FOLDER
cp NEWS.md $TMP_FOLDER
cp version.inc $TMP_FOLDER
cp -r platform $TMP_FOLDER
cp Red_Panda_CPP.pro $TMP_FOLDER
cd $TMP_FOLDER
rm control
cp control.deepin control
command -v mk-build-deps && mk-build-deps -i -t "apt -y --no-install-recommends" debian/control
sed -i '/CONFIG += ENABLE_LUA_ADDON/ { s/^#\s*// }' RedPandaIDE/RedPandaIDE.pro
dpkg-buildpackage -us -uc

View File

@ -1,23 +0,0 @@
#!/bin/bash
set -xeuo pipefail
TMP_FOLDER=/tmp/redpandaide
[[ -d $TMP_FOLDER ]] && rm -rf $TMP_FOLDER
mkdir -p "$TMP_FOLDER"
cp -r packages/debian $TMP_FOLDER
cp -r tools $TMP_FOLDER
cp -r libs $TMP_FOLDER
cp -r RedPandaIDE $TMP_FOLDER
cp README.md $TMP_FOLDER
cp LICENSE $TMP_FOLDER
cp NEWS.md $TMP_FOLDER
cp version.inc $TMP_FOLDER
cp -r platform $TMP_FOLDER
cp Red_Panda_CPP.pro $TMP_FOLDER
cd $TMP_FOLDER
command -v mk-build-deps && mk-build-deps -i -t "apt -y --no-install-recommends" debian/control
sed -i '/CONFIG += ENABLE_LUA_ADDON/ { s/^#\s*// }' RedPandaIDE/RedPandaIDE.pro
dpkg-buildpackage -us -uc

View File

@ -1,276 +0,0 @@
redpanda-cpp (3.1.2871-1) unstable; urgency=medium
* Update to 3.1.2871
-- Roy Qu (瞿华) <royqh1979@gmail.com> Tue, 11 Jun 2024 16:26:11 +0800
redpanda-cpp (3.1.2849-1) unstable; urgency=medium
* Update to 3.1.2849
-- Roy Qu (瞿华) <royqh1979@gmail.com> Tue, 28 May 2024 20:30:05 +0800
redpanda-cpp (3.1.2832-1) unstable; urgency=medium
* Update to 3.1.2832
-- Roy Qu (瞿华) <royqh1979@gmail.com> Mon, 20 May 2024 17:32:04 +0800
redpanda-cpp (3.0.2795-1) unstable; urgency=medium
* Update to 3.0.2795
-- Roy Qu (瞿华) <royqh1979@gmail.com> Tue, 07 May 2024 19:26:03 +0800
redpanda-cpp (3.0.2788-1) unstable; urgency=medium
* Update to 3.0.2788
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sun, 05 May 2024 15:26:20 +0800
redpanda-cpp (3.0.2754-1) unstable; urgency=medium
* Update to 3.0.2754
-- Roy Qu (瞿华) <royqh1979@gmail.com> Thu, 25 Apr 2024 17:09:34 +0800
redpanda-cpp (3.0.2720-1) unstable; urgency=medium
* Update to 3.0.2720
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sun, 14 Apr 2024 18:32:16 +0800
redpanda-cpp (3.0.2707-1) unstable; urgency=medium
* Update to 3.0.2707
-- Roy Qu (瞿华) <royqh1979@gmail.com> Fri, 12 Apr 2024 20:25:23 +0800
redpanda-cpp (3.0.2705-1) unstable; urgency=medium
* Update to 3.0.2705
-- Roy Qu (瞿华) <royqh1979@gmail.com> Fri, 12 Apr 2024 19:01:00 +0800
redpanda-cpp (3.0.2671-1) unstable; urgency=medium
* Update to 3.0.2671
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sun, 07 Apr 2024 18:42:16 +0800
redpanda-cpp (2.27.2540-1) unstable; urgency=medium
* Update to 2.27.2540
-- Roy Qu (瞿华) <royqh1979@gmail.com> Wed, 27 Mar 2024 10:28:44 +0800
redpanda-cpp (2.26-1) unstable; urgency=medium
* Update to 2.26
-- Roy Qu (瞿华) <royqh1979@gmail.com> Wed, 21 Feb 2024 11:42:00 +0800
redpanda-cpp (2.25-1) unstable; urgency=medium
* Update to 2.25
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sat, 21 Oct 2023 11:41:00 +0800
redpanda-cpp (2.24-1) unstable; urgency=medium
* Update to 2.24
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sun, 20 Apr 2023 21:28:00 +0800
redpanda-cpp (2.23-1) unstable; urgency=medium
* Update to 2.23
-- Roy Qu (瞿华) <royqh1979@gmail.com> Fri, 7 Jul 2023 08:06:00 +0800
redpanda-cpp (2.22-1) unstable; urgency=medium
* Update to 2.22
-- Roy Qu (瞿华) <royqh1979@gmail.com> Wed, 5 Jun 2023 19:57:00 +0800
redpanda-cpp (2.21-1) unstable; urgency=medium
* Update to 2.21
-- Roy Qu (瞿华) <royqh1979@gmail.com> Tue, 25 Apr 2023 20:04:00 +0800
redpanda-cpp (2.20-1) unstable; urgency=medium
* Update to 2.20
-- Roy Qu (瞿华) <royqh1979@gmail.com> Tue, 4 Apr 2023 08:57:00 +0800
redpanda-cpp (2.19-1) unstable; urgency=medium
* Update to 2.19
-- Roy Qu (瞿华) <royqh1979@gmail.com> Tue, 28 Mar 2023 16:33:00 +0800
redpanda-cpp (2.18-1) unstable; urgency=medium
* Update to 2.18
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sat, 17 Mar 2023 20:20:00 +0800
redpanda-cpp (2.12-1) unstable; urgency=medium
* Update to 2.12
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sat, 18 Jan 2023 12:57:00 +0800
redpanda-cpp (2.10-1) unstable; urgency=medium
* Update to 2.10
-- Roy Qu (瞿华) <royqh1979@gmail.com> Fri, 27 Jan 2023 16:12:00 +0800
redpanda-cpp (2.9-1) unstable; urgency=medium
* Update to 2.9
-- Roy Qu (瞿华) <royqh1979@gmail.com> Thu, 15 Jan 2023 09:45:00 +0800
redpanda-cpp (2.7-1) unstable; urgency=medium
* Update to 2.7
-- Roy Qu (瞿华) <royqh1979@gmail.com> Thu, 19 Dec 2022 09:33:00 +0800
redpanda-cpp (2.6-1) unstable; urgency=medium
* Update to 2.6
-- Roy Qu (瞿华) <royqh1979@gmail.com> Thu, 15 Dec 2022 11:30:00 +0800
redpanda-cpp (2.5-1) unstable; urgency=medium
* Update to 2.5
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sat, 3 Dec 2022 11:04:00 +0800
redpanda-cpp (2.4-1) unstable; urgency=medium
* Update to 2.4
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sun, 11 Nov 2022 19:58:00 +0800
redpanda-cpp (2.3-1) unstable; urgency=medium
* Update to 2.3
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sun, 6 Nov 2022 23:21:00 +0800
redpanda-cpp (2.2-2) unstable; urgency=medium
* Update to 2.2
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sun, 6 Nov 2022 18:38:00 +0800
redpanda-cpp (2.1-2) unstable; urgency=medium
* Update to 2.1
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sat, 29 Oct 2022 17:38:00 +0800
redpanda-cpp (2.1-1) unstable; urgency=medium
* Update to 2.1
-- Roy Qu (瞿华) <royqh1979@gmail.com> Fri, 28 Oct 2022 16:38:00 +0800
redpanda-cpp (1.5-1) unstable; urgency=medium
* Update to 1.5
-- Roy Qu (瞿华) <royqh1979@gmail.com> Wed, 19 Oct 2022 19:08:00 +0800
redpanda-cpp (1.4-1) unstable; urgency=medium
* Update to 1.4
-- Roy Qu (瞿华) <royqh1979@gmail.com> Thu, 29 Sep 2022 10:42:00 +0800
redpanda-cpp (1.2-1) unstable; urgency=medium
* Update to 1.2
-- Roy Qu (瞿华) <royqh1979@gmail.com> Tue, 16 Aug 2022 10:42:00 +0800
redpanda-cpp (1.1.5-1) unstable; urgency=medium
* Update to 1.1.5
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sat, 23 Jul 2022 22:39:00 +0800
redpanda-cpp (1.1.3-1) unstable; urgency=medium
* Update to 1.1.3
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sat, 1 Jul 2022 22:03:00 +0800
redpanda-cpp (1.0.10-1) unstable; urgency=medium
* Update to 1.1.0
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sun, 13 Jun 2022 19:19:00 +0800
redpanda-cpp (1.0.10-1) unstable; urgency=medium
* Update to 1.0.10
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sun, 4 Jun 2022 09:41:00 +0800
redpanda-cpp (1.0.6-1) unstable; urgency=medium
* Update to 1.0.6
-- Roy Qu (瞿华) <royqh1979@gmail.com> Fri, 29 Apr 2022 09:41:00 +0800
redpanda-cpp (1.0.0-1) unstable; urgency=medium
* Update to 1.0.0
-- Roy Qu (瞿华) <royqh1979@gmail.com> Fri, 18 Mar 2022 11:51:00 +0800
redpanda-cpp (0.14.4-1) unstable; urgency=medium
* Update to 0.14.4
-- Roy Qu (瞿华) <royqh1979@gmail.com> Sat, 26 Feb 2022 18:48:00 +0800
redpanda-cpp (0.14.2-1) unstable; urgency=medium
* Update to 0.14.2
-- Roy Qu (瞿华) <royqh1979@gmail.com> Fri, 11 Feb 2022 15:29:00 +0800
redpanda-cpp (0.14.0-1) unstable; urgency=medium
* Update to 0.14.0
-- Roy Qu (瞿华) <royqh1979@gmail.com> Fri, 28 Jan 2022 10:51:00 +0800
redpanda-cpp (0.13.3-1) unstable; urgency=medium
* Update to 0.13.3
-- Roy Qu (瞿华) <royqh1979@gmail.com> Mon, 24 Jan 2022 21:50:00 +0800
redpanda-cpp (0.13.2-1) unstable; urgency=medium
* Update to 0.13.2
-- Roy Qu (瞿华) <royqh1979@gmail.com> Thu, 6 Jan 2022 14:52:00 +0800
redpanda-cpp (0.12.6-1) unstable; urgency=medium
* Initial release
-- Roy Qu (瞿华) <royqh1979@gmail.com> Thu, 6 Jan 2022 14:52:00 +0800

View File

@ -1 +0,0 @@
12

View File

@ -1,316 +0,0 @@
function apiVersion()
return {
kind = "compiler_hint",
major = 0,
minor = 2,
}
end
local compilerNameTemplate = {
system = {
en_US = "System %1, %2",
pt_BR = "%1 sistema, %2",
zh_CN = "系统 %1%2",
zh_TW = "系統 %1%2",
},
multilib = {
en_US = "Multilib %1, %2",
pt_BR = "%1 multilib, %2",
zh_CN = "Multilib %1%2",
zh_TW = "Multilib %1%2",
},
libx32 = {
en_US = "Libx32 %1, %2",
pt_BR = "%1 libx32, %2",
zh_CN = "Libx32 %1%2",
zh_TW = "Libx32 %1%2",
},
cross = {
en_US = "Cross %1 %3, %2",
pt_BR = "%1 cruzado %3, %2",
zh_CN = "交叉编译 %1 %3%2",
zh_TW = "交叉編譯 %1 %3%2",
},
mingw = {
en_US = "MinGW %1 %3, %2",
pt_BR = "MinGW %1 %3, %2",
zh_CN = "MinGW %1 %3%2",
zh_TW = "MinGW %1 %3%2",
},
}
local profileNameMap = {
release = {
en_US = "release",
pt_BR = "lançamento",
zh_CN = "发布",
zh_TW = "發佈",
},
debug = {
en_US = "debug",
pt_BR = "depuração",
zh_CN = "调试",
zh_TW = "偵錯",
},
debugWithAsan = {
en_US = "debug with ASan",
pt_BR = "depuração com ASan",
zh_CN = "ASan 调试",
zh_TW = "ASan 偵錯",
},
}
local function nameGenerator(lang, name, kind, profile, arch)
local template = compilerNameTemplate[kind][lang] or compilerNameTemplate[kind].en_US
local profileName = profileNameMap[profile][lang] or profileNameMap[profile].en_US
return C_Util.format(template, name, profileName, arch)
end
local function mergeCompilerSet(compilerSet, other)
local c = compilerSet
local o = other
for k, v in pairs(o) do
c[k] = v
end
end
local function generateConfig(
lang, name, kind,
cCompiler, cxxCompiler,
config)
local commonOptions = {
cCompiler = cCompiler,
cxxCompiler = cxxCompiler,
debugger = "/usr/bin/gdb",
debugServer = "/usr/bin/gdbserver",
make = "/usr/bin/make",
compilerType = name:sub(1, 5) == "Clang" and "Clang" or "GCC_UTF8",
preprocessingSuffix = ".i",
compilationProperSuffix = ".s",
assemblingSuffix = ".o",
executableSuffix = kind == "mingw" and ".exe" or "",
compilationStage = 3,
ccCmdOptUsePipe = "on",
ccCmdOptWarningAll = "on",
ccCmdOptWarningExtra = "on",
ccCmdOptCheckIsoConformance = "on",
binDirs = { "/usr/bin" },
}
if kind == "multilib" then
commonOptions.ccCmdOptPointerSize = "32"
end
if kind == "mingw" then
commonOptions.resourceCompiler = "/usr/bin/" .. config.triplet .. "-windres"
end
if config.customCompileParams then
commonOptions.customCompileParams = config.customCompileParams
end
if config.customLinkParams then
commonOptions.customLinkParams = config.customLinkParams
end
local release = {
name = nameGenerator(lang, name, kind, "release", config.arch),
staticLink = true,
linkCmdOptStripExe = "on",
ccCmdOptOptimize = "2",
}
local debug_ = {
name = nameGenerator(lang, name, kind, "debug", config.arch),
ccCmdOptDebugInfo = "on",
}
local debugWithAsan = {
name = nameGenerator(lang, name, kind, "debugWithAsan", config.arch),
ccCmdOptDebugInfo = "on",
ccCmdOptAddressSanitizer = "address",
}
mergeCompilerSet(release, commonOptions)
mergeCompilerSet(debug_, commonOptions)
mergeCompilerSet(debugWithAsan, commonOptions)
return release, debug_, debugWithAsan
end
function main()
local arch = C_System.osArch()
local libexecDir = C_System.appLibexecDir()
local lang = C_Desktop.language()
local compilerList = {}
local gccDumpVersion = C_System.popen("/usr/bin/gcc", { "-dumpfullversion" })
gccDumpVersion = gccDumpVersion:match("^[0-9.]+")
local gccFsVersion = C_System.popen("/usr/bin/gcc", { "-dumpversion" })
gccFsVersion = gccFsVersion:match("^[0-9.]+")
local clangDumpVersion
do
local release, debug_, debugWithAsan = generateConfig(
lang, "GCC (" .. gccDumpVersion .. ")", "system", "/usr/bin/gcc", "/usr/bin/g++",
{})
table.insert(compilerList, release)
table.insert(compilerList, debug_)
table.insert(compilerList, debugWithAsan)
end
local versionedGccs = C_FileSystem.matchFiles("/usr/bin", "^gcc-[0-9]+$")
for _, gcc in ipairs(versionedGccs) do
local version = gcc:sub(5)
local name = "GCC " .. version
local release, debug_, debugWithAsan = generateConfig(
lang, name, "system", "/usr/bin/" .. gcc, "/usr/bin/g++-" .. version,
{})
table.insert(compilerList, release)
table.insert(compilerList, debug_)
table.insert(compilerList, debugWithAsan)
end
if C_FileSystem.isExecutable("/usr/bin/clang") then
clangDumpVersion = C_System.popen("/usr/bin/clang", { "-dumpversion" })
clangDumpVersion = clangDumpVersion:match("^[0-9.]+")
local release, debug_, debugWithAsan = generateConfig(
lang, "Clang (" .. clangDumpVersion .. ")", "system", "/usr/bin/clang", "/usr/bin/clang++",
{})
table.insert(compilerList, release)
table.insert(compilerList, debug_)
table.insert(compilerList, debugWithAsan)
end
local versionedClangs = C_FileSystem.matchFiles("/usr/bin", "^clang-[0-9]+$")
for _, clang in ipairs(versionedClangs) do
local version = clang:sub(7)
local name = "Clang " .. version
local release, debug_, debugWithAsan = generateConfig(
lang, name, "system", "/usr/bin/" .. clang, "/usr/bin/clang++-" .. version,
{})
table.insert(compilerList, release)
table.insert(compilerList, debug_)
table.insert(compilerList, debugWithAsan)
end
if arch == "x86_64" and C_FileSystem.exists("/usr/lib/gcc/x86_64-linux-gnu/" .. gccFsVersion .. "/32/libstdc++.a") then
do
local release, debug_, debugWithAsan = generateConfig(
lang, "GCC (" .. gccDumpVersion .. ")", "multilib", "/usr/bin/gcc", "/usr/bin/g++",
{})
table.insert(compilerList, release)
table.insert(compilerList, debug_)
table.insert(compilerList, debugWithAsan)
end
if C_FileSystem.isExecutable("/usr/bin/clang") then
local release, debug_, debugWithAsan = generateConfig(
lang, "Clang (" .. clangDumpVersion .. ")", "multilib", "/usr/bin/clang", "/usr/bin/clang++",
{})
table.insert(compilerList, release)
table.insert(compilerList, debug_)
table.insert(compilerList, debugWithAsan)
end
end
if arch == "x86_64" and C_FileSystem.exists("/usr/lib/gcc/x86_64-linux-gnu/" .. gccFsVersion .. "/x32/libstdc++.a") then
do
local release, debug_, debugWithAsan = generateConfig(
lang, "GCC (" .. gccDumpVersion .. ")", "libx32", "/usr/bin/gcc", "/usr/bin/g++",
{
customCompileParams = { "-mx32" },
customLinkParams = { "-mx32" },
})
table.insert(compilerList, release)
table.insert(compilerList, debug_)
table.insert(compilerList, debugWithAsan)
end
if C_FileSystem.isExecutable("/usr/bin/clang") then
local release, debug_, debugWithAsan = generateConfig(
lang, "Clang (" .. clangDumpVersion .. ")", "libx32", "/usr/bin/clang", "/usr/bin/clang++",
{
customCompileParams = { "-mx32" },
customLinkParams = { "-mx32" },
})
table.insert(compilerList, release)
table.insert(compilerList, debug_)
table.insert(compilerList, debugWithAsan)
end
end
if (
arch == "x86_64" and (
C_FileSystem.exists("/proc/sys/fs/binfmt_misc/DOSWin") or
C_FileSystem.exists("/proc/sys/fs/binfmt_misc/WSLInterop"))) then
if C_FileSystem.isExecutable("/usr/bin/x86_64-w64-mingw32-gcc") then
do
local release, _, _ = generateConfig(
lang, "GCC", "mingw",
"/usr/bin/x86_64-w64-mingw32-gcc", "/usr/bin/x86_64-w64-mingw32-g++",
{
arch = "x86_64",
triplet = "x86_64-w64-mingw32",
customLinkParams = {},
})
table.insert(compilerList, release)
end
end
if C_FileSystem.isExecutable("/usr/bin/i686-w64-mingw32-gcc") then
do
local release, _, _ = generateConfig(
lang, "GCC", "mingw",
"/usr/bin/i686-w64-mingw32-gcc", "/usr/bin/i686-w64-mingw32-g++",
{
arch = "i686",
triplet = "i686-w64-mingw32",
customLinkParams = {},
})
table.insert(compilerList, release)
end
end
end
local result = {
compilerList = compilerList,
noSearch = {
"/usr/bin",
"/usr/lib/ccache",
},
preferCompiler = 3,
}
return result
end

View File

@ -1,30 +0,0 @@
Source: redpanda-cpp
Section: devel
Priority: optional
Maintainer: royqh1979@gmail.com
Build-Depends: debhelper (>= 12~),
qtbase5-dev,
qtbase5-dev-tools,
qttools5-dev-tools,
libqt5svg5-dev
Standards-Version: 4.3.0
Homepage: https://github.com/royqh1979/RedPanda-CPP
Package: redpanda-cpp
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
gcc,
g++,
make,
gdb,
gdbserver,
astyle
Recommends: qterminal | konsole | gnome-terminal | terminator | lxterminal | mate-terminal | terminology | xfce4-terminal | alacritty | cool-retro-term | kitty | sakura | termit | tilix
Description: A lightweight but powerful C/C++ IDE
Red Panda C++ (Old name Red Panda Dev-C++ 7) is a full featured C/C++ IDE.
It's the succesor of Red Panda Dev-C++ 6, which is developed by Delphi 7 and
can only running under Windows.

View File

@ -1,31 +0,0 @@
Source: redpanda-cpp
Section: devel
Priority: optional
Maintainer: royqh1979@gmail.com
Build-Depends: debhelper (>= 12~),
qtbase5-dev,
qtbase5-dev-tools,
qttools5-dev-tools,
libqt5svg5-dev
Standards-Version: 4.3.0
Homepage: https://github.com/royqh1979/RedPanda-CPP
Package: redpanda-cpp
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
gcc,
g++,
make,
gdb,
gdbserver,
astyle,
qterminal
Recommends: konsole | gnome-terminal | terminator | lxterminal | mate-terminal | terminology | xfce4-terminal | alacritty | cool-retro-term | kitty | sakura | termit | tilix
Description: A lightweight but powerful C/C++ IDE
Red Panda C++ (Old name Red Panda Dev-C++ 7) is a full featured C/C++ IDE.
It's the succesor of Red Panda Dev-C++ 6, which is developed by Delphi 7 and
can only running under Windows.

View File

@ -1,57 +0,0 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: redpanda-cpp
Source: https://github.com/royqh1979/RedPanda-CPP
Files: *
Copyright: 2020-2022 Roy Qu (瞿华) <royqh1979@gmail.com>
License: GPL-3+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
On Debian systems, the complete text of the GNU General Public License
version 3 can be found in `/usr/share/common-licenses/GPL-3'.
Files: RedPanda/SimpleIni.h
Copyright: 2006-2012 Brodie Thiesfield
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Files: asytle/*
Copyright: 2018 Jim Patee <jimp03@email.com>
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,8 +0,0 @@
#!/usr/bin/make -f
#DH_VERBOSE = 1
export QT_SELECT=qt5
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
dh ${@} --buildsystem qmake

View File

@ -1,30 +0,0 @@
#!/bin/bash
DEBIAN_DIR=packages/debian
minorver=`git rev-list HEAD --count`
majorver=`head version.inc -n 1 | sed -r 's/^APP_VERSION=\"(.*)\".*$/\1/g'`
ver="${majorver}.${minorver}"
pushd .
cd $DEBIAN_DIR
pwd
oldver=`head changelog -n 1 | sed -r 's/^redpanda-cpp\s\((.*)-(.*)\)\s.*$/\1/g'`
count=`head changelog -n 1 | sed -r 's/^redpanda-cpp\s\((.*)-(.*)\)\s.*$/\2/g'`
echo "Old version: $oldver"
if [ "$oldver" != "$ver" ]; then
echo "Upgrade to $ver"
tmpfile=$(mktemp)
now=`date -R`
echo "redpanda-cpp ($ver-1) unstable; urgency=medium" >> $tmpfile
echo "" >> $tmpfile
echo " * Update to $ver" >> $tmpfile
echo "" >> $tmpfile
echo " -- Roy Qu (瞿华) <royqh1979@gmail.com> $now" >> $tmpfile
echo "" >> $tmpfile
cat changelog >> $tmpfile
mv $tmpfile changelog
fi

View File

@ -1,11 +0,0 @@
#!/bin/bash
set -xeuo pipefail
dnf install -y dnf-plugins-core git rpm-build rpmdevtools
rpmdev-setuptree
./packages/fedora/buildrpm.sh
mkdir -p dist
cp ~/rpmbuild/RPMS/$(uname -m)/redpanda-cpp-git-*.rpm dist/

View File

@ -1,16 +0,0 @@
#!/bin/bash
set -xeuo pipefail
SPECDIR=$(rpm --eval %{_specdir})
SOURCEDIR=$(rpm --eval %{_sourcedir})
BUILDDIR=$(rpm --eval %{_builddir})/redpanda-cpp-git
[[ -d $BUILDDIR ]] && rm -rf $BUILDDIR
VERSION=$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g') || VERSION="0.0.r$(git rev-list HEAD --count).g$(git rev-parse --short HEAD)"
sed "s/__VERSION__/$VERSION/g" packages/fedora/redpanda-cpp-git.spec.in >$SPECDIR/redpanda-cpp-git.spec
git archive --prefix="RedPanda-CPP/" -o "$SOURCEDIR/RedPanda-CPP.tar.gz" HEAD
sudo dnf builddep -y $SPECDIR/redpanda-cpp-git.spec
rpmbuild --nodebuginfo -bb $SPECDIR/redpanda-cpp-git.spec

View File

@ -1,46 +0,0 @@
Name: redpanda-cpp-git
Version: __VERSION__
Release: 1%{?dist}
Summary: A fast, lightweight, open source, and cross platform C++ IDE
License: GPLv3+
URL: https://github.com/royqh1979/RedPanda-CPP
Source0: RedPanda-CPP.tar.gz
BuildRequires: gcc gcc-c++
BuildRequires: qt5-qtbase-devel qt5-qtsvg-devel qt5-qttools-devel
Requires: gcc gcc-c++ astyle
Requires: glibc-static libstdc++-static libasan
Requires: qt5-qtbase qt5-qtsvg
%description
A lightweight but powerful C/C++ IDE
Red Panda C++ (Old name Red Panda Dev-C++ 7) is a full featured C/C++ IDE.
It's the succesor of Red Panda Dev-C++ 6, which is developed by Delphi 7 and
can only running under Windows.
%prep
%setup -n "RedPanda-CPP"
%build
mkdir -p %{name}
cd %{name}
qmake-qt5 \
PREFIX=/usr \
"%{_builddir}/RedPanda-CPP/Red_Panda_CPP.pro"
make %{_smp_mflags}
%install
cd %{name}
make INSTALL_ROOT="%{buildroot}" install
%files
/usr/bin/RedPandaIDE
/usr/libexec/RedPandaCPP/*
/usr/share/RedPandaCPP/*
/usr/share/doc/RedPandaCPP/*
/usr/share/applications/RedPandaIDE.desktop
/usr/share/icons/hicolor/scalable/apps/redpandaide.svg
/usr/share/mime/packages/redpandaide.xml
%changelog

View File

@ -1,17 +0,0 @@
#!/bin/bash
set -xeuo pipefail
DISTRO_ID=$(grep ^ID= /etc/os-release | cut -d= -f2- | tr -d '"')
VERSION_ID=$(grep ^VERSION_ID= /etc/os-release | cut -d= -f2- | tr -d '"')
zypper in -y git rpm-build rpmdevtools sudo
rpmdev-setuptree
./packages/opensuse/buildrpm.sh
file=$(ls ~/rpmbuild/RPMS/$(uname -m)/redpanda-cpp-git-*.rpm)
basename=$(basename $file)
mkdir -p dist
cp $file dist/${basename/.rpm/.$DISTRO_ID$VERSION_ID.rpm}

View File

@ -1,16 +0,0 @@
#!/bin/bash
set -xeuo pipefail
SPECDIR=$(rpm --eval %{_specdir})
SOURCEDIR=$(rpm --eval %{_sourcedir})
BUILDDIR=$(rpm --eval %{_builddir})/redpanda-cpp-git
[[ -d $BUILDDIR ]] && rm -rf $BUILDDIR
VERSION=$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g') || VERSION="0.0.r$(git rev-list HEAD --count).g$(git rev-parse --short HEAD)"
sed "s/__VERSION__/$VERSION/g" packages/opensuse/redpanda-cpp-git.spec.in >$SPECDIR/redpanda-cpp-git.spec
git archive --prefix="RedPanda-CPP/" -o "$SOURCEDIR/RedPanda-CPP.tar.gz" HEAD
sudo zypper in -y $(rpmspec -q --buildrequires $SPECDIR/redpanda-cpp-git.spec)
rpmbuild --nodebuginfo -bb $SPECDIR/redpanda-cpp-git.spec

View File

@ -1,46 +0,0 @@
Name: redpanda-cpp-git
Version: __VERSION__
Release: 1%{?dist}
Summary: A fast, lightweight, open source, and cross platform C++ IDE
License: GPLv3+
URL: https://github.com/royqh1979/RedPanda-CPP
Source0: RedPanda-CPP.tar.gz
BuildRequires: gcc gcc-c++
BuildRequires: libqt5-qtbase-devel libqt5-qtsvg-devel libqt5-qttools-devel
Requires: gcc gcc-c++ astyle
Requires: glibc-devel-static
Requires: libQt5Core5 libQt5Gui5 libQt5Svg5
%description
A lightweight but powerful C/C++ IDE
Red Panda C++ (Old name Red Panda Dev-C++ 7) is a full featured C/C++ IDE.
It's the succesor of Red Panda Dev-C++ 6, which is developed by Delphi 7 and
can only running under Windows.
%prep
%setup -n "RedPanda-CPP"
%build
mkdir -p %{name}
cd %{name}
qmake-qt5 \
PREFIX=/usr \
"%{_builddir}/RedPanda-CPP/Red_Panda_CPP.pro"
make %{_smp_mflags}
%install
cd %{name}
make INSTALL_ROOT="%{buildroot}" install
%files
/usr/bin/RedPandaIDE
/usr/libexec/RedPandaCPP/*
/usr/share/RedPandaCPP/*
/usr/share/doc/RedPandaCPP/*
/usr/share/applications/RedPandaIDE.desktop
/usr/share/icons/hicolor/scalable/apps/redpandaide.svg
/usr/share/mime/packages/redpandaide.xml
%changelog

View File

@ -1,275 +0,0 @@
#!/bin/bash
set -euxo pipefail
function fn_print_help() {
cat <<EOF
Usage:
packages/msys/build-xp.sh -p|--profile <profile> [-c|--clean] [-nd|--no-deps] [-t|--target-dir <dir>]
Options:
-h, --help Display this information.
-p, --profile <profile> MinGW Lite profile.
MUST be used before other options.
-c, --clean Clean build and package directories.
--mingw Alias for --mingw32 (x86 app) or --mingw64 (x64 app).
--mingw32 Build mingw32 integrated compiler.
--mingw64 Build mingw64 integrated compiler.
EOF
}
source version.inc
if [[ -n "$APP_VERSION_SUFFIX" ]]; then
APP_VERSION="$APP_VERSION$APP_VERSION_SUFFIX"
fi
if [[ $# -lt 2 || ($1 != "-p" && $1 != "--profile") ]]; then
echo "Missing profile argument."
exit 1
fi
PROFILE=$2
shift 2
case "${PROFILE}" in
64-ucrt|64-msvcrt)
NSIS_ARCH=x64
TARGET=x86_64-w64-mingw32
PACKAGE_BASENAME="redpanda-cpp-${APP_VERSION}-ws2003_x64"
;;
32-ucrt)
NSIS_ARCH=x86
TARGET=i686-w64-mingw32
PACKAGE_BASENAME="redpanda-cpp-${APP_VERSION}-winxp_x86"
;;
32-msvcrt)
NSIS_ARCH=x86
TARGET=i686-w64-mingw32
PACKAGE_BASENAME="redpanda-cpp-${APP_VERSION}-win2000_x86"
;;
*)
echo "Invalid profile: ${PROFILE}"
echo "Available profiles: 64-ucrt, 64-msvcrt, 32-ucrt, 32-msvcrt"
exit 1
;;
esac
CLEAN=0
compilers=()
COMPILER_MINGW32=0
COMPILER_MINGW64=0
while [[ "$#" -gt 0 ]]; do
case $1 in
-h|--help)
fn_print_help
exit 0
;;
-c|--clean)
CLEAN=1
shift
;;
--mingw)
case "$PROFILE" in
64-ucrt|64-msvcrt)
compilers+=("mingw64")
COMPILER_MINGW64=1
shift
;;
32-ucrt|32-msvcrt)
compilers+=("mingw32")
COMPILER_MINGW32=1
shift
;;
esac
;;
--mingw32)
compilers+=("mingw32")
COMPILER_MINGW32=1
shift
;;
--mingw64)
compilers+=("mingw64")
COMPILER_MINGW64=1
shift
;;
*)
echo "Unknown argument: $1"
exit 1
;;
esac
done
QT_VERSION=5.15.15+redpanda0
MINGW_LITE_BRANCH=14
ASTYLE_VERSION_TAG="3.6.2"
TARGET_DIR="$PWD/dist"
BUILD_DIR="/tmp/build/redpanda-xp-$PROFILE-build"
ASTYLE_BUILD_DIR="$BUILD_DIR/astyle"
PACKAGE_DIR="/tmp/build/redpanda-xp-$PROFILE-pkg"
SOURCE_DIR="$PWD"
ASSETS_DIR="$PWD/assets"
QT_ARCHIVE="x-qt-$QT_VERSION-$PROFILE.tar.zst"
QT_DIR="/opt/x-mingw$PROFILE-$MINGW_LITE_BRANCH"
REDPANDA_MINGW_RELEASE="11.5.0-r0"
MINGW32_ARCHIVE="mingw32-$REDPANDA_MINGW_RELEASE.7z"
MINGW32_COMPILER_NAME="MinGW-w64 i686 GCC"
MINGW32_PACKAGE_SUFFIX="mingw32"
MINGW64_ARCHIVE="mingw64-$REDPANDA_MINGW_RELEASE.7z"
MINGW64_COMPILER_NAME="MinGW-w64 x86_64 GCC"
MINGW64_PACKAGE_SUFFIX="mingw64"
if [[ ${#compilers[@]} -eq 0 ]]; then
PACKAGE_BASENAME="$PACKAGE_BASENAME-none"
else
[[ "$COMPILER_MINGW32" -eq 1 ]] && PACKAGE_BASENAME="$PACKAGE_BASENAME-$MINGW32_PACKAGE_SUFFIX"
[[ "$COMPILER_MINGW64" -eq 1 ]] && PACKAGE_BASENAME="$PACKAGE_BASENAME-$MINGW64_PACKAGE_SUFFIX"
fi
function fn_print_progress() {
echo -e "\e[1;32;44m$1\e[0m"
}
## prepare dirs
if [[ "$CLEAN" -eq 1 ]]; then
rm -rf "$BUILD_DIR"
rm -rf "$PACKAGE_DIR"
fi
mkdir -p "$BUILD_DIR" "$PACKAGE_DIR" "$TARGET_DIR" "$ASTYLE_BUILD_DIR" "$ASSETS_DIR"
## install deps
if [[ -v MIRROR && -n $MIRROR ]]
then
sed -i "s|archive.ubuntu.com|$MIRROR|; s|security.ubuntu.com|$MIRROR|" /etc/apt/sources.list.d/ubuntu.sources
fi
apt update
env DEBIAN_FRONTEND=noninteractive \
apt install -y --no-install-recommends \
7zip ca-certificates cmake curl git make nsis qttools5-dev-tools zstd
if [[ ! -f "$ASSETS_DIR/$QT_ARCHIVE" ]]; then
fn_print_progress "Downloading Qt"
curl -L "https://github.com/redpanda-cpp/qtbase-xp/releases/download/$QT_VERSION/$QT_ARCHIVE" -o "$ASSETS_DIR/$QT_ARCHIVE"
fi
zstdcat "$ASSETS_DIR/$QT_ARCHIVE" | tar -x -C /
export PATH="$QT_DIR/bin:$PATH"
## prepare assets
fn_print_progress "Updating astyle repo..."
if [[ ! -d "$ASSETS_DIR/astyle" ]]; then
git clone --bare "https://gitlab.com/saalen/astyle" "$ASSETS_DIR/astyle"
fi
pushd "$ASSETS_DIR/astyle"
if [[ -z "$(git tag -l "$ASTYLE_VERSION_TAG")" ]]; then
git fetch --all --tags
fi
popd
if [[ "$COMPILER_MINGW32" -eq 1 && ! -f "$ASSETS_DIR/$MINGW32_ARCHIVE" ]]; then
fn_print_progress "Downloading MinGW32..."
curl -L "https://github.com/redpanda-cpp/toolchain-win32-mingw-xp/releases/download/$REDPANDA_MINGW_RELEASE/$MINGW32_ARCHIVE" -o "$ASSETS_DIR/$MINGW32_ARCHIVE"
fi
if [[ "$COMPILER_MINGW64" -eq 1 && ! -f "$ASSETS_DIR/$MINGW64_ARCHIVE" ]]; then
fn_print_progress "Downloading MinGW64..."
curl -L "https://github.com/redpanda-cpp/toolchain-win32-mingw-xp/releases/download/$REDPANDA_MINGW_RELEASE/$MINGW64_ARCHIVE" -o "$ASSETS_DIR/$MINGW64_ARCHIVE"
fi
## build
fn_print_progress "Building astyle..."
pushd "$ASSETS_DIR/astyle"
git --work-tree="$ASTYLE_BUILD_DIR" checkout -f "$ASTYLE_VERSION_TAG"
popd
pushd "$ASTYLE_BUILD_DIR"
sed -i "s|<Windows.h>|<windows.h>|" AStyle/src/*.cpp
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME="Windows" -DCMAKE_CC_COMPILER="$TARGET-gcc" -DCMAKE_CXX_COMPILER="$TARGET-g++" -DCMAKE_EXE_LINKER_FLAGS="-static"
make -j$(nproc)
cp AStyle/AStyle.exe "$PACKAGE_DIR/astyle.exe"
popd
fn_print_progress "Building..."
pushd "$BUILD_DIR"
qmake_flags=()
if [[ "$NSIS_ARCH" == x64 ]]; then
qmake_flags+=("X86_64=ON")
fi
qmake PREFIX="$PACKAGE_DIR" "${qmake_flags[@]}" -o Makefile "$SOURCE_DIR/Red_Panda_CPP.pro" -r
make -j$(nproc)
make install
popd
## prepare packaging resources
pushd "$PACKAGE_DIR"
cp "$SOURCE_DIR/platform/windows/qt.conf" .
cp "$SOURCE_DIR"/platform/windows/installer-scripts/{lang.nsh,utils.nsh,redpanda.nsi} .
popd
## make package
pushd "$PACKAGE_DIR"
SETUP_NAME="$PACKAGE_BASENAME.exe"
PORTABLE_NAME="$PACKAGE_BASENAME.7z"
fn_print_progress "Making installer..."
nsis_flags=(
-DAPP_VERSION="$APP_VERSION"
-DARCH="$NSIS_ARCH"
-DFINALNAME="$SETUP_NAME"
-DMINGW32_COMPILER_NAME="$MINGW32_COMPILER_NAME"
-DMINGW64_COMPILER_NAME="$MINGW64_COMPILER_NAME"
)
case "$PROFILE" in
64-ucrt|64-msvcrt)
nsis_flags+=(
-DREQUIRED_WINDOWS_BUILD=3790
-DREQUIRED_WINDOWS_NAME="Windows Server 2003"
)
;;
32-ucrt)
nsis_flags+=(
-DREQUIRED_WINDOWS_BUILD=2600
-DREQUIRED_WINDOWS_NAME="Windows XP"
)
;;
32-msvcrt)
nsis_flags+=(
-DREQUIRED_WINDOWS_BUILD=2195
-DREQUIRED_WINDOWS_NAME="Windows 2000"
)
;;
esac
if [[ "$COMPILER_MINGW32" -eq 1 ]]; then
nsis_flags+=(-DHAVE_MINGW32)
if [[ ! -d mingw32 ]]; then
7z x "$ASSETS_DIR/$MINGW32_ARCHIVE" -o"$PACKAGE_DIR"
fi
fi
if [[ "$COMPILER_MINGW64" -eq 1 ]]; then
nsis_flags+=(-DHAVE_MINGW64)
if [[ ! -d mingw64 ]]; then
7z x "$ASSETS_DIR/$MINGW64_ARCHIVE" -o"$PACKAGE_DIR"
fi
fi
makensis "${nsis_flags[@]}" redpanda.nsi
fn_print_progress "Making Portable Package..."
7z x "$SETUP_NAME" -o"RedPanda-CPP" -xr'!$PLUGINSDIR' -x"!uninstall.exe"
7z a -mmt -mx9 -ms=on -mqs=on -mf=BCJ2 "$PORTABLE_NAME" RedPanda-CPP
rm -rf RedPanda-CPP
mv "$SETUP_NAME" "$TARGET_DIR"
mv "$PORTABLE_NAME" "$TARGET_DIR"
popd