diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94572873..ca56054d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -337,6 +337,52 @@ jobs: name: musl-based Linux (latest Alpine) path: dist/*.apk + appimage: + name: Linux AppImage + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Fetch container image + run: | + podman pull --platform linux/amd64 quay.io/redpanda-cpp/appimage-builder-x86_64:20240304.0 + + - name: Build + run: | + podman run --rm -v $PWD:/mnt -w /mnt -e CARCH=x86_64 quay.io/redpanda-cpp/appimage-builder-x86_64:20240304.0 packages/appimage/01-in-docker.sh + + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: Linux AppImage + path: dist/*.AppImage + + static-deb: + name: Static Deb + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Fetch container image + run: | + podman pull --platform linux/amd64 quay.io/redpanda-cpp/appimage-builder-x86_64:20240304.0 + + - name: Build + run: | + packages/debian-static/builddeb.sh + + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: Static Deb + path: dist/*.deb + macos_x86_64: name: macOS x86_64 runs-on: macos-latest diff --git a/BUILD.md b/BUILD.md index 2c653000..ad1e412c 100644 --- a/BUILD.md +++ b/BUILD.md @@ -1,6 +1,6 @@ # General Development Notes -Red Panda C++ need Qt 5 (≥ 5.12) to build. +Red Panda C++ need Qt 5.15 to build. Recommended development environments: 1. Visual Studio Code. @@ -235,7 +235,7 @@ To build with VS 2017 or later in Command Prompt: General steps: - Install recent version of GCC (≥ 7) or Clang (≥ 6) that supports C++17. -- Install Qt 5 (≥ 5.12) Base, SVG and Tools modules, including both libraries and development files. +- Install Qt 5.15 Base, SVG and Tools modules, including both libraries and development files. - Optionally install fcitx5-qt for building with static Qt library. qmake-based build steps: @@ -376,39 +376,19 @@ Note that these build scripts check out HEAD of the repo, so any changes should ## Linux AppImage -1. Install dependency: Docker or Podman. +Linux host: +```bash +ARCH=x86_64 +podman run --rm -v $PWD:/mnt -w /mnt -e CARCH=$ARCH quay.io/redpanda-cpp/appimage-builder-$ARCH:20240304.0 packages/appimage/01-in-docker.sh +``` - Extra requirements for Windows host: - - Docker uses WSL 2 based engine, or enable file sharing on the project folder (Settings > Resources > File sharing); - - PowerShell (Core) or Windows PowerShell. -2. Prepare build environment. Linux host: - ```bash - ARCH=x86_64 # or aarch64, riscv64 - DOCKER=docker # or podman - $DOCKER build -t redpanda-builder-$ARCH packages/appimage/dockerfile-$ARCH - ``` - Windows host: - ```ps1 - $ARCH = "x86_64" # or "aarch64", "riscv64" - $DOCKER = "docker" # or "podman" - & $DOCKER build -t redpanda-builder-$ARCH packages/appimage/dockerfile-$ARCH - ``` -3. Build AppImage. Linux host: - ```bash - ARCH=x86_64 - DOCKER=docker - $DOCKER run --rm -v $PWD:/build/RedPanda-CPP -e CARCH=$ARCH redpanda-builder-$ARCH /build/RedPanda-CPP/packages/appimage/01-in-docker.sh - ``` - Windows host: - ```ps1 - $ARCH = "x86_64" - $DOCKER = "docker" - & $DOCKER run --rm -v "$(Get-Location):/build/RedPanda-CPP" -e CARCH=$ARCH redpanda-builder-$ARCH /build/RedPanda-CPP/packages/appimage/01-in-docker.sh - ``` -4. Run Red Panda C++. - ```bash - ./dist/RedPandaIDE-x86_64.AppImage # or *-aarch64.AppImage, *-riscv64.AppImage - ``` +Windows host: +```ps1 +$ARCH = "x86_64" +podman run --rm -v "$(Get-Location):/mnt" -w /mnt -e CARCH=$ARCH redpanda-builder-$ARCH packages/appimage/01-in-docker.sh +``` + +Dockerfiles are available in [redpanda-cpp/appimage-builder](https://github.com/redpanda-cpp/appimage-builder). ## Emulated Native Build for Foreign Architectures diff --git a/BUILD_cn.md b/BUILD_cn.md index d8409c56..79c8cb1d 100644 --- a/BUILD_cn.md +++ b/BUILD_cn.md @@ -1,6 +1,6 @@ # 通用开发说明 -小熊猫 C++ 需要 Qt 5(≥ 5.12)。 +小熊猫 C++ 需要 Qt 5.15。 推荐开发环境: 1. Visual Studio Code。 @@ -235,7 +235,7 @@ qmake 变量: 通用步骤: - 安装支持 C++17 的 GCC(≥ 7)或 Clang(≥ 6)。 -- 安装 Qt 5(≥ 5.12)Base、SVG、Tools 模块,包括库和开发文件。 +- 安装 Qt 5.15 Base、SVG、Tools 模块,包括库和开发文件。 - 如果使用静态版本的 Qt 编译,还要安装 fcitx5-qt。 基于 qmake 构建: @@ -376,39 +376,19 @@ Windows 宿主的额外要求: ## Linux AppImage -1. 安装依赖包:Docker 或 Podman。 +Linux 宿主: +```bash +ARCH=x86_64 +podman run --rm -v $PWD:/mnt -w /mnt -e CARCH=$ARCH quay.io/redpanda-cpp/appimage-builder-$ARCH:20240304.0 packages/appimage/01-in-docker.sh +``` - Windows 宿主的额外要求: - - Docker 使用基于 WSL 2 的引擎,或者对此项目文件夹启用文件共享(Settings > Resources > File sharing); - - PowerShell (Core) 或 Windows PowerShell。 -2. 准备构建环境。Linux 宿主: - ```bash - ARCH=x86_64 # 或 aarch64、riscv64 - DOCKER=docker # 或 podman - $DOCKER build -t redpanda-builder-$ARCH packages/appimage/dockerfile-$ARCH - ``` - Windows 宿主: - ```ps1 - $ARCH = "x86_64" # 或 "aarch64"、"riscv64" - $DOCKER = "docker" # 或 "podman" - & $DOCKER build -t redpanda-builder-$ARCH packages/appimage/dockerfile-$ARCH - ``` -3. 构建 AppImage。Linux 宿主: - ```bash - ARCH=x86_64 - DOCKER=docker - $DOCKER run --rm -v $PWD:/build/RedPanda-CPP -e CARCH=$ARCH redpanda-builder-$ARCH /build/RedPanda-CPP/packages/appimage/01-in-docker.sh - ``` - Windows 宿主: - ```ps1 - $ARCH = "x86_64" - $DOCKER = "docker" - & $DOCKER run --rm -v "$(Get-Location):/build/RedPanda-CPP" -e CARCH=$ARCH redpanda-builder-$ARCH /build/RedPanda-CPP/packages/appimage/01-in-docker.sh - ``` -4. 运行小熊猫 C++. - ```bash - ./dist/RedPandaIDE-x86_64.AppImage # 或 *-aarch64.AppImage、*-riscv64.AppImage - ``` +Windows 宿主: +```ps1 +$ARCH = "x86_64" +podman run --rm -v "$(Get-Location):/mnt" -w /mnt -e CARCH=$ARCH redpanda-builder-$ARCH packages/appimage/01-in-docker.sh +``` + +Dockerfile 位于 [redpanda-cpp/appimage-builder](https://github.com/redpanda-cpp/appimage-builder)。 ## 异架构的模拟本机构建(emulated native build) diff --git a/packages/appimage/01-in-docker.sh b/packages/appimage/01-in-docker.sh index c9662674..902d97d1 100755 --- a/packages/appimage/01-in-docker.sh +++ b/packages/appimage/01-in-docker.sh @@ -1,35 +1,46 @@ #!/bin/bash -set -xe +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 -VERSION=$(sed -nr -e '/APP_VERSION\s*=/ s/APP_VERSION\s*=\s*(([0-9]+\.)*[0-9]+)\s*/\1/p' /build/RedPanda-CPP/Red_Panda_CPP.pro) APPIMAGE_FILE=RedPandaIDE-$VERSION-$CARCH.AppImage RUNTIME_FILE=/opt/appimage-runtime RUNTIME_SIZE=$(wc -c <$RUNTIME_FILE) # build RedPanda C++ -mkdir -p /build/redpanda-build -cd /build/redpanda-build -qmake PREFIX='/usr' /build/RedPanda-CPP/Red_Panda_CPP.pro +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 INSTALL_ROOT=/build/RedPandaIDE.AppDir +make INSTALL_ROOT=/RedPandaIDE.AppDir install +# remove unnecessary, huge files +rm /RedPandaIDE.AppDir/usr/libexec/RedPandaCPP/redpanda-git-askpass # setup AppImage resource -cd /build/RedPandaIDE.AppDir +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 /build/RedPanda-CPP/packages/appimage/AppRun.sh AppRun -install -m644 /build/RedPanda-CPP/platform/linux/redpandaide.png .DirIcon +install -m755 "$SRC_DIR/packages/appimage/AppRun.sh" AppRun +install -m644 "$SRC_DIR/platform/linux/redpandaide.png" .DirIcon # create AppImage -cd /build +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 /build/RedPanda-CPP/dist -cp $APPIMAGE_FILE /build/RedPanda-CPP/dist +mkdir -p "$SRC_DIR/dist" +cp $APPIMAGE_FILE "$SRC_DIR/dist" diff --git a/packages/appimage/dockerfile-aarch64/Dockerfile b/packages/appimage/dockerfile-aarch64/Dockerfile deleted file mode 100644 index 9e5534c1..00000000 --- a/packages/appimage/dockerfile-aarch64/Dockerfile +++ /dev/null @@ -1,103 +0,0 @@ -# RHEL devtoolset, which provides new version of GCC targetting old libgcc_s and libstdc++, is the key to compatibility. -# EL 7 is modern enough for apps and libs. -# CentOS 7 aarch64 container image is a mess. Use Oracle instead. -FROM docker.io/arm64v8/oraclelinux:7 - -# System -RUN yum-config-manager --enable ol7_optional_latest && \ - yum install -y oracle-softwarecollection-release-el7 oracle-epel-release-el7 && \ - yum upgrade -y && \ - yum install -y \ - # general devtools - devtoolset-7-gcc devtoolset-7-gcc-c++ make \ - # squashfs-tools libs - libzstd-devel \ - # Qt build tools - file which \ - # Qt libs - at-spi2-core-devel dbus-devel fontconfig-devel freetype-devel glib2-devel libXrender-devel libxcb-devel libxkbcommon-devel libxkbcommon-x11-devel mesa-libGL-devel wayland-devel xcb-util-devel && \ - yum clean all - -ARG DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-7/root -ENV PATH=${DEVTOOLSET_ROOTPATH}/usr/bin:${PATH} -ENV LD_LIBRARY_PATH=${DEVTOOLSET_ROOTPATH}/usr/lib64 - -ARG SQUASHFS_TOOLS_VERSION=4.4 -ARG QT_MAJOR_MINOR=5.12 -ARG QT_PATCH=12 -ARG QT_VERSION=${QT_MAJOR_MINOR}.${QT_PATCH} -ARG FCITX5_QT_VERSION=5.0.17 -ARG ALACRITTY_VERSION=0.12.2 - -# AppImage runtime -RUN curl -L -o /opt/appimage-runtime 'https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-aarch64' - -# squashfs-tools -RUN mkdir -p /build/squashfs-tools && \ - cd /build/squashfs-tools && \ - curl -L -o squashfs-tools-${SQUASHFS_TOOLS_VERSION}.tar.gz "https://github.com/plougher/squashfs-tools/archive/refs/tags/${SQUASHFS_TOOLS_VERSION}.tar.gz" && \ - tar xf squashfs-tools-${SQUASHFS_TOOLS_VERSION}.tar.gz && \ - cd squashfs-tools-${SQUASHFS_TOOLS_VERSION}/squashfs-tools && \ - make ZSTD_SUPPORT=1 -j$(nproc) && \ - make install && \ - # cleanup - cd / && \ - rm -r /build/squashfs-tools - -# Qt 5 -RUN mkdir -p /build/qt5 && \ - cd /build/qt5 && \ - curl -O "https://download.qt.io/archive/qt/${QT_MAJOR_MINOR}/${QT_VERSION}/submodules/qt{base,svg,tools,wayland}-everywhere-src-${QT_VERSION}.tar.xz" && \ - tar xf qtbase-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qtbase-everywhere-src-${QT_VERSION} && \ - ./configure \ - -prefix /usr/local \ - -opensource -confirm-license \ - -optimize-size -no-shared -static -platform linux-g++ -no-use-gold-linker \ - -qt-zlib -qt-doubleconversion -iconv -no-icu -qt-pcre -no-openssl -system-freetype -fontconfig -qt-harfbuzz -qt-libjpeg -qt-libpng -qt-xcb -qt-sqlite \ - -nomake examples -nomake tests -nomake tools && \ - make -j$(nproc) && \ - make install && \ - # svg package - cd /build/qt5 && \ - tar xf qtsvg-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qtsvg-everywhere-src-${QT_VERSION} && \ - qmake . && \ - make -j$(nproc) && \ - make install && \ - # tools package - cd /build/qt5 && \ - tar xf qttools-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qttools-everywhere-src-${QT_VERSION} && \ - qmake . && \ - make -j$(nproc) && \ - make install && \ - # wayland package - cd /build/qt5 && \ - tar xf qtwayland-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qtwayland-everywhere-src-${QT_VERSION} && \ - qmake . && \ - make -j$(nproc) && \ - make install && \ - # cleanup - cd / && \ - rm -r /build/qt5 - -# fcitx5-qt -RUN yum install -y \ - cmake3 extra-cmake-modules && \ - mkdir -p /build/qt5 && \ - cd /build/qt5 && \ - curl -L -o fcitx5-qt-${FCITX5_QT_VERSION}.tar.gz "https://github.com/fcitx/fcitx5-qt/archive/refs/tags/${FCITX5_QT_VERSION}.tar.gz" && \ - tar xf fcitx5-qt-${FCITX5_QT_VERSION}.tar.gz && \ - cd fcitx5-qt-${FCITX5_QT_VERSION} && \ - cmake3 . -Bbuild -DCMAKE_MODULE_PATH=/usr/local/lib/cmake -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_BUILD_TYPE=Release -DENABLE_QT4=Off -DENABLE_QT5=On -DENABLE_QT6=Off -DBUILD_ONLY_PLUGIN=On -DBUILD_STATIC_PLUGIN=On && \ - cmake3 --build build --parallel && \ - # cmake 3.14 is too old to `--install` - cmake3 --build build -- install && \ - # cleanup - yum autoremove -y \ - cmake3 extra-cmake-modules && \ - yum clean all && \ - cd / && \ - rm -r /build/qt5 diff --git a/packages/appimage/dockerfile-riscv64/Dockerfile b/packages/appimage/dockerfile-riscv64/Dockerfile deleted file mode 100644 index adce9c2f..00000000 --- a/packages/appimage/dockerfile-riscv64/Dockerfile +++ /dev/null @@ -1,87 +0,0 @@ -FROM docker.io/riscv64/ubuntu:20.04 - -# System -RUN export DEBIAN_FRONTEND=noninteractive && \ - apt update && \ - apt upgrade -y && \ - apt install --no-install-recommends -y \ - # general utils - ca-certificates curl xz-utils \ - # general devtools - gcc g++ make \ - # Qt build tools - file \ - # Qt libs - libatspi2.0-dev libdbus-1-dev libfontconfig1-dev libfreetype6-dev libgl1-mesa-dev libwayland-dev libxkbcommon-x11-dev \ - # appimage tools - squashfs-tools && \ - apt clean && \ - rm -rf /var/lib/apt/lists/* - -ARG QT_MAJOR_MINOR=5.12 -ARG QT_PATCH=12 -ARG QT_VERSION=${QT_MAJOR_MINOR}.${QT_PATCH} -ARG FCITX5_QT_VERSION=5.0.17 -ARG ALACRITTY_VERSION=0.12.2 - -# AppImage runtime -RUN curl -L -o /opt/appimage-runtime 'https://github.com/cyano-linux/appimage-riscv64/releases/download/20230808.0/runtime-riscv64' - -# Qt 5 -RUN mkdir -p /build/qt5 && \ - cd /build/qt5 && \ - curl -O "https://download.qt.io/archive/qt/${QT_MAJOR_MINOR}/${QT_VERSION}/submodules/qt{base,svg,tools,wayland}-everywhere-src-${QT_VERSION}.tar.xz" && \ - tar xf qtbase-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qtbase-everywhere-src-${QT_VERSION} && \ - ./configure \ - -prefix /usr/local \ - -opensource -confirm-license \ - -optimize-size -no-shared -static -platform linux-g++ -no-use-gold-linker \ - -qt-zlib -qt-doubleconversion -iconv -no-icu -qt-pcre -no-openssl -system-freetype -fontconfig -qt-harfbuzz -qt-libjpeg -qt-libpng -qt-xcb -qt-sqlite \ - -nomake examples -nomake tests -nomake tools && \ - make -j$(nproc) && \ - make install && \ - # svg package - cd /build/qt5 && \ - tar xf qtsvg-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qtsvg-everywhere-src-${QT_VERSION} && \ - qmake . && \ - make -j$(nproc) && \ - make install && \ - # tools package - cd /build/qt5 && \ - tar xf qttools-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qttools-everywhere-src-${QT_VERSION} && \ - qmake . && \ - make -j$(nproc) && \ - make install && \ - # wayland package - cd /build/qt5 && \ - tar xf qtwayland-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qtwayland-everywhere-src-${QT_VERSION} && \ - qmake . && \ - make -j$(nproc) && \ - make install && \ - # cleanup - cd / && \ - rm -r /build/qt5 - -# fcitx5-qt -RUN export DEBIAN_FRONTEND=noninteractive && \ - apt update && \ - apt install --no-install-recommends -y \ - cmake extra-cmake-modules && \ - mkdir -p /build/qt5 && \ - cd /build/qt5 && \ - curl -L -o fcitx5-qt-${FCITX5_QT_VERSION}.tar.gz "https://github.com/fcitx/fcitx5-qt/archive/refs/tags/${FCITX5_QT_VERSION}.tar.gz" && \ - tar xf fcitx5-qt-${FCITX5_QT_VERSION}.tar.gz && \ - cd fcitx5-qt-${FCITX5_QT_VERSION} && \ - cmake . -Bbuild -DCMAKE_MODULE_PATH=/usr/local/lib/cmake -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_BUILD_TYPE=Release -DENABLE_QT4=Off -DENABLE_QT5=On -DENABLE_QT6=Off -DBUILD_ONLY_PLUGIN=On -DBUILD_STATIC_PLUGIN=On && \ - cmake --build build --parallel && \ - cmake --install build && \ - # cleanup - apt autoremove --purge -y \ - cmake extra-cmake-modules && \ - rm -rf /var/lib/apt/lists/* && \ - cd / && \ - rm -r /build/qt5 diff --git a/packages/appimage/dockerfile-x86_64/Dockerfile b/packages/appimage/dockerfile-x86_64/Dockerfile deleted file mode 100644 index 73055843..00000000 --- a/packages/appimage/dockerfile-x86_64/Dockerfile +++ /dev/null @@ -1,100 +0,0 @@ -# RHEL devtoolset, which provides new version of GCC targetting old libgcc_s and libstdc++, is the key to compatibility. -# EL 7 is modern enough for apps and libs. -FROM docker.io/amd64/centos:7 - -# System -RUN yum install -y centos-release-scl-rh epel-release && \ - yum upgrade -y && \ - yum install -y \ - # general devtools - devtoolset-7-gcc devtoolset-7-gcc-c++ make \ - # squashfs-tools libs - libzstd-devel \ - # Qt build tools - file which \ - # Qt libs - at-spi2-core-devel dbus-devel fontconfig-devel freetype-devel glib2-devel libXrender-devel libxcb-devel libxkbcommon-devel libxkbcommon-x11-devel mesa-libGL-devel wayland-devel xcb-util-devel && \ - yum clean all - -ARG DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-7/root -ENV PATH=${DEVTOOLSET_ROOTPATH}/usr/bin:${PATH} -ENV LD_LIBRARY_PATH=${DEVTOOLSET_ROOTPATH}/usr/lib64 - -ARG SQUASHFS_TOOLS_VERSION=4.4 -ARG QT_MAJOR_MINOR=5.12 -ARG QT_PATCH=12 -ARG QT_VERSION=${QT_MAJOR_MINOR}.${QT_PATCH} -ARG FCITX5_QT_VERSION=5.0.17 -ARG ALACRITTY_VERSION=0.12.2 - -# AppImage runtime -RUN curl -L -o /opt/appimage-runtime 'https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-x86_64' - -# squashfs-tools -RUN mkdir -p /build/squashfs-tools && \ - cd /build/squashfs-tools && \ - curl -L -o squashfs-tools-${SQUASHFS_TOOLS_VERSION}.tar.gz "https://github.com/plougher/squashfs-tools/archive/refs/tags/${SQUASHFS_TOOLS_VERSION}.tar.gz" && \ - tar xf squashfs-tools-${SQUASHFS_TOOLS_VERSION}.tar.gz && \ - cd squashfs-tools-${SQUASHFS_TOOLS_VERSION}/squashfs-tools && \ - make ZSTD_SUPPORT=1 -j$(nproc) && \ - make install && \ - # cleanup - cd / && \ - rm -r /build/squashfs-tools - -# Qt 5 -RUN mkdir -p /build/qt5 && \ - cd /build/qt5 && \ - curl -O "https://download.qt.io/archive/qt/${QT_MAJOR_MINOR}/${QT_VERSION}/submodules/qt{base,svg,tools,wayland}-everywhere-src-${QT_VERSION}.tar.xz" && \ - tar xf qtbase-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qtbase-everywhere-src-${QT_VERSION} && \ - ./configure \ - -prefix /usr/local \ - -opensource -confirm-license \ - -optimize-size -no-shared -static -platform linux-g++ -no-use-gold-linker \ - -qt-zlib -qt-doubleconversion -iconv -no-icu -qt-pcre -no-openssl -system-freetype -fontconfig -qt-harfbuzz -qt-libjpeg -qt-libpng -qt-xcb -qt-sqlite \ - -nomake examples -nomake tests -nomake tools && \ - make -j$(nproc) && \ - make install && \ - # svg package - cd /build/qt5 && \ - tar xf qtsvg-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qtsvg-everywhere-src-${QT_VERSION} && \ - qmake . && \ - make -j$(nproc) && \ - make install && \ - # tools package - cd /build/qt5 && \ - tar xf qttools-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qttools-everywhere-src-${QT_VERSION} && \ - qmake . && \ - make -j$(nproc) && \ - make install && \ - # wayland package - cd /build/qt5 && \ - tar xf qtwayland-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qtwayland-everywhere-src-${QT_VERSION} && \ - qmake . && \ - make -j$(nproc) && \ - make install && \ - # cleanup - cd / && \ - rm -r /build/qt5 - -# fcitx5-qt -RUN yum install -y \ - cmake3 extra-cmake-modules && \ - mkdir -p /build/qt5 && \ - cd /build/qt5 && \ - curl -L -o fcitx5-qt-${FCITX5_QT_VERSION}.tar.gz "https://github.com/fcitx/fcitx5-qt/archive/refs/tags/${FCITX5_QT_VERSION}.tar.gz" && \ - tar xf fcitx5-qt-${FCITX5_QT_VERSION}.tar.gz && \ - cd fcitx5-qt-${FCITX5_QT_VERSION} && \ - cmake3 . -Bbuild -DCMAKE_MODULE_PATH=/usr/local/lib/cmake -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_BUILD_TYPE=Release -DENABLE_QT4=Off -DENABLE_QT5=On -DENABLE_QT6=Off -DBUILD_ONLY_PLUGIN=On -DBUILD_STATIC_PLUGIN=On && \ - cmake3 --build build --parallel && \ - cmake3 --install build && \ - # cleanup - yum autoremove -y \ - cmake3 extra-cmake-modules && \ - yum clean all && \ - cd / && \ - rm -r /build/qt5 diff --git a/packages/debian-static/01-in-docker.sh b/packages/debian-static/01-in-docker.sh new file mode 100755 index 00000000..1185ffa7 --- /dev/null +++ b/packages/debian-static/01-in-docker.sh @@ -0,0 +1,16 @@ +#!/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 +# remove unnecessary, huge files +rm /out/usr/libexec/RedPandaCPP/redpanda-git-askpass diff --git a/packages/debian-static/builddeb.sh b/packages/debian-static/builddeb.sh new file mode 100755 index 00000000..1c8a8e65 --- /dev/null +++ b/packages/debian-static/builddeb.sh @@ -0,0 +1,21 @@ +#!/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:20240304.0 packages/debian-static/01-in-docker.sh + +mkdir -p dist +mkdir -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" diff --git a/packages/debian-static/control.in b/packages/debian-static/control.in new file mode 100644 index 00000000..3c475277 --- /dev/null +++ b/packages/debian-static/control.in @@ -0,0 +1,14 @@ +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, + libc6 (>= 2.17), libstdc++6 (>= 4.8), + libdbus-1-3, libfontconfig1, libfreetype6, libwayland-client0, libwayland-cursor0, libwayland-server0, 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, libzstd1 +Recommends: qterminal | deepin-terminal | 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