Linux package: bundled terminal in AppImage and minor adjustment (#104)

* AppImage: build Alacritty with from-scratch build environment

* enrich compatible terminal list; fix Linux terminal determination

* Linux: get rid of libicu
This commit is contained in:
Cyano Hao 2023-03-04 18:44:39 +08:00 committed by GitHub
parent 1504e6cb04
commit bdfa4c066b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 228 additions and 100 deletions

View File

@ -31,7 +31,7 @@ apt install gcc g++ make gdb gdbserver
### 2. Install Qt 5 and Other Dependencies ### 2. Install Qt 5 and Other Dependencies
```bash ```bash
apt install qtbase5-dev qttools5-dev-tools libicu-dev libqt5svg5-dev git qterminal apt install qtbase5-dev qttools5-dev-tools libqt5svg5-dev git qterminal
``` ```
### 3. Fetch Source Code ### 3. Fetch Source Code
@ -65,30 +65,34 @@ Note that makepkg checks out HEAD of the repo, so any change should be committed
## AppImage ## AppImage
1. Install dependency: cURL, Docker. 1. Install dependency: Docker or Podman.
Extra requirements for Windows host: Extra requirements for Windows host:
- Docker uses WSL 2 based engine, or enable file sharing on the project folder (Settings > Resources > File sharing); - Docker uses WSL 2 based engine, or enable file sharing on the project folder (Settings > Resources > File sharing);
- PowerShell (previously “PowerShell Core”, not “Windows PowerShell”). - PowerShell (Core) or Windows PowerShell.
2. Prepare build environment. Linux host: 2. Prepare build environment. Linux host:
```bash ```bash
arch=x86_64 # or aarch64 ARCH=x86_64 # or aarch64
curl -L -o packages/appimage/dockerfile-$arch/appimagetool-$arch.AppImage https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-$arch.AppImage DOCKER=docker # or podman
docker build -t redpanda-builder-$arch packages/appimage/dockerfile-$arch $DOCKER build -t redpanda-builder-$ARCH packages/appimage/dockerfile-$ARCH
``` ```
Windows host: Windows host:
```ps1 ```ps1
$arch = "x86_64" # or "aarch64" someday Docker is available on WoA $ARCH = "x86_64" # or "aarch64" someday Docker or Podman is available on WoA
Invoke-WebRequest -OutFile packages/appimage/dockerfile-$arch/appimagetool-$arch.AppImage -Uri https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-$arch.AppImage $DOCKER = "docker" # or "podman"
docker build -t redpanda-builder-$arch packages/appimage/dockerfile-$arch & $DOCKER build -t redpanda-builder-$ARCH packages/appimage/dockerfile-$ARCH
``` ```
3. Build AppImage. Linux host: 3. Build AppImage. Linux host:
```bash ```bash
./packages/appimage/build-x86_64.sh # or *-aarch64.sh 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: Windows host:
```ps1 ```ps1
./packages/appimage/build-x86_64.ps1 # or *-aarch64.ps1 someday Docker is available on WoA $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++. 4. Run Red Panda C++.
```bash ```bash

View File

@ -34,7 +34,7 @@ apt install gcc g++ make gdb gdbserver
### 2.安装QT5和依赖包 ### 2.安装QT5和依赖包
```bash ```bash
apt install qtbase5-dev qttools5-dev-tools libicu-dev libqt5svg5-dev git qterminal apt install qtbase5-dev qttools5-dev-tools libqt5svg5-dev git qterminal
``` ```
### 3.下载源码 ### 3.下载源码
@ -68,30 +68,34 @@ RedPandaIDE
## AppImage ## AppImage
1. 安装依赖包:cURL、Docker。 1. 安装依赖包Docker 或 Podman
Windows 宿主的额外要求: Windows 宿主的额外要求:
- Docker 使用基于 WSL 2 的引擎或者对此项目文件夹启用文件共享Settings > Resources > File sharing - Docker 使用基于 WSL 2 的引擎或者对此项目文件夹启用文件共享Settings > Resources > File sharing
- PowerShell(曾用名 “PowerShell Core”不是 “Windows PowerShell” - PowerShell (Core) 或 Windows PowerShell
2. 准备构建环境。Linux 宿主: 2. 准备构建环境。Linux 宿主:
```bash ```bash
arch=x86_64 # 或 aarch64 ARCH=x86_64 # 或 aarch64
curl -L -o packages/appimage/dockerfile-$arch/appimagetool-$arch.AppImage https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-$arch.AppImage DOCKER=docker # 或 podman
docker build -t redpanda-builder-$arch packages/appimage/dockerfile-$arch $DOCKER build -t redpanda-builder-$ARCH packages/appimage/dockerfile-$ARCH
``` ```
Windows 宿主: Windows 宿主:
```ps1 ```ps1
$arch = "x86_64" # 或 "aarch64"(如果将来 Docker 支持 WoA $ARCH = "x86_64" # 或 "aarch64"(如果将来 Docker 或 Podman 支持 WoA
Invoke-WebRequest -OutFile packages/appimage/dockerfile-$arch/appimagetool-$arch.AppImage -Uri https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-$arch.AppImage $DOCKER = "docker" # 或 "podman"
docker build -t redpanda-builder-$arch packages/appimage/dockerfile-$arch & $DOCKER build -t redpanda-builder-$ARCH packages/appimage/dockerfile-$ARCH
``` ```
3. 构建 AppImage。Linux 宿主: 3. 构建 AppImage。Linux 宿主:
```bash ```bash
./packages/appimage/build-x86_64.sh # 或 *-aarch64.sh 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 宿主: Windows 宿主:
```ps1 ```ps1
./packages/appimage/build-x86_64.ps1 # 或 *-aarch64.ps1如果将来 Docker 支持 WoA $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++. 4. 运行小熊猫 C++.
```bash ```bash

View File

@ -288,7 +288,7 @@ void CompilerManager::run(
newArguments = QString(" -e \"%1\" %2") newArguments = QString(" -e \"%1\" %2")
.arg(localizePath(escapeSpacesInString(filename))).arg(arguments); .arg(localizePath(escapeSpacesInString(filename))).arg(arguments);
} }
execRunner = new ExecutableRunner(pSettings->environment().terminalPath(),newArguments,workDir); execRunner = new ExecutableRunner(pSettings->environment().terminalPathForExec(),newArguments,workDir);
execRunner->setShareMemoryId(sharedMemoryId); execRunner->setShareMemoryId(sharedMemoryId);
#endif #endif
execRunner->setStartConsole(true); execRunner->setStartConsole(true);

View File

@ -2982,7 +2982,7 @@ void DebugTarget::run()
cmd= mGDBServer; cmd= mGDBServer;
arguments = QString(" localhost:%1 \"%2\" %3").arg(mPort).arg(mInferior,mArguments); arguments = QString(" localhost:%1 \"%2\" %3").arg(mPort).arg(mInferior,mArguments);
#else #else
cmd= pSettings->environment().terminalPath(); cmd= pSettings->environment().terminalPathForExec();
arguments = QString(" -e \"%1\" localhost:%2 \"%3\"").arg(mGDBServer).arg(mPort).arg(mInferior); arguments = QString(" -e \"%1\" localhost:%2 \"%3\"").arg(mGDBServer).arg(mPort).arg(mInferior);
#endif #endif
QString workingDir = QFileInfo(mInferior).path(); QString workingDir = QFileInfo(mInferior).path();

View File

@ -4537,7 +4537,7 @@ void MainWindow::onFilesViewOpenInTerminal()
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
openShell(fileInfo.path(),"cmd.exe",getDefaultCompilerSetBinDirs()); openShell(fileInfo.path(),"cmd.exe",getDefaultCompilerSetBinDirs());
#else #else
openShell(fileInfo.path(),pSettings->environment().terminalPath(),getDefaultCompilerSetBinDirs()); openShell(fileInfo.path(),pSettings->environment().terminalPathForExec(),getDefaultCompilerSetBinDirs());
#endif #endif
} }
} }
@ -6679,7 +6679,7 @@ void MainWindow::on_actionOpen_Terminal_triggered()
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
openShell(info.path(),"cmd.exe",getBinDirsForCurrentEditor()); openShell(info.path(),"cmd.exe",getBinDirsForCurrentEditor());
#else #else
openShell(info.path(),pSettings->environment().terminalPath(),getBinDirsForCurrentEditor()); openShell(info.path(),pSettings->environment().terminalPathForExec(),getBinDirsForCurrentEditor());
#endif #endif
} }
} }
@ -7010,7 +7010,7 @@ void MainWindow::on_actionProject_Open_In_Terminal_triggered()
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
openShell(mProject->directory(),"cmd.exe",mProject->binDirs()); openShell(mProject->directory(),"cmd.exe",mProject->binDirs());
#else #else
openShell(mProject->directory(),pSettings->environment().terminalPath(),mProject->binDirs()); openShell(mProject->directory(),pSettings->environment().terminalPathForExec(),mProject->binDirs());
#endif #endif
} }

View File

@ -3326,12 +3326,87 @@ void Settings::Environment::doLoad()
mDefaultOpenFolder = QDir::currentPath(); mDefaultOpenFolder = QDir::currentPath();
} }
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
//use qterminal by default
mTerminalPath = stringValue("terminal_path","/usr/bin/qterminal"); #define SYSTEM_TERMINAL(term) "/usr/bin/" #term, "/usr/local/bin/" #term
if (mTerminalPath.isEmpty()) const static QString terminals[] {
mTerminalPath = stringValue("terminal_path","/usr/bin/konsole"); /* modern, specialized or stylized terminal -- user who installed them are likely to prefer them */
if (mTerminalPath.isEmpty()) SYSTEM_TERMINAL(alacritty), // GPU-accelerated
mTerminalPath = stringValue("terminal_path","/usr/bin/x-terminal-emulator"); SYSTEM_TERMINAL(kitty), // GPU-accelerated
SYSTEM_TERMINAL(wayst), // GPU-accelerated
SYSTEM_TERMINAL(tilix), // tiling
SYSTEM_TERMINAL(cool-retro-term), // old CRT style
/* default terminal for DE */
SYSTEM_TERMINAL(konsole), // KDE
SYSTEM_TERMINAL(deepin-terminal), // DDE
SYSTEM_TERMINAL(qterminal), // LXQt
SYSTEM_TERMINAL(lxterminal), // LXDE
/* bundled terminal in AppImage */
"alacritty",
/* compatible, with minor issue */
SYSTEM_TERMINAL(kgx), // GNOME Console, confirm to quit
SYSTEM_TERMINAL(coreterminal), // not so conforming when parsing args
SYSTEM_TERMINAL(sakura), // not so conforming when parsing args
/* compatible, without out-of-box hidpi support */
SYSTEM_TERMINAL(mlterm),
SYSTEM_TERMINAL(st),
SYSTEM_TERMINAL(terminology), // also not so conforming when parsing args
SYSTEM_TERMINAL(urxvt),
SYSTEM_TERMINAL(xterm),
SYSTEM_TERMINAL(zutty),
/* fallbacks */
SYSTEM_TERMINAL(foot), // Wayland only
SYSTEM_TERMINAL(x-terminal-emulator), // Debian alternatives
/* parameter incompatible */
// "gnome-terminal",
// "guake",
// "hyper",
// "io.elementary.terminal",
// "kermit",
// "liri-terminal",
// "mate-terminal",
// "roxterm",
// "station",
// "terminator",
// "termite",
// "tilda",
// "xfce4-terminal",
// "yakuake",
/* incompatible -- other */
// "aterm", // AUR broken, unable to test
// "eterm", // AUR broken, unable to test
// "rxvt", // no unicode support
// "shellinabox", // AUR broken, unable to test
};
#undef SYSTEM_TERMINAL
auto checkAndSetTerminalPath = [this](QString terminalPath) -> bool {
QDir appDir(pSettings->dirs().appDir());
QString absoluteTerminalPath = appDir.absoluteFilePath(terminalPath);
QFileInfo termPathInfo(absoluteTerminalPath);
if (termPathInfo.isFile() && termPathInfo.isReadable() && termPathInfo.isExecutable()) {
mTerminalPath = terminalPath;
return true;
} else {
return false;
}
};
// check saved terminal path
if (!checkAndSetTerminalPath(stringValue("terminal_path", ""))) {
// if saved terminal path is invalid, try determing terminal from our list
for (auto terminal: terminals) {
if (checkAndSetTerminalPath(terminal))
break;
}
}
mAStylePath = includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"astyle"; mAStylePath = includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"astyle";
#elif defined(Q_OS_MACOS) #elif defined(Q_OS_MACOS)
mTerminalPath = stringValue("terminal_path", mTerminalPath = stringValue("terminal_path",
@ -3397,6 +3472,17 @@ QString Settings::Environment::terminalPath() const
return mTerminalPath; return mTerminalPath;
} }
QString Settings::Environment::terminalPathForExec() const
{
#ifdef Q_OS_LINUX
// `mTerminalPath` can be reletive (bundled terminal in AppImage).
QDir appDir(pSettings->dirs().appDir());
return appDir.absoluteFilePath(mTerminalPath);
#else
return mTerminalPath;
#endif
}
void Settings::Environment::setTerminalPath(const QString &terminalPath) void Settings::Environment::setTerminalPath(const QString &terminalPath)
{ {
mTerminalPath = terminalPath; mTerminalPath = terminalPath;

View File

@ -569,6 +569,7 @@ public:
void setIconSet(const QString &newIconSet); void setIconSet(const QString &newIconSet);
QString terminalPath() const; QString terminalPath() const;
QString terminalPathForExec() const;
void setTerminalPath(const QString &terminalPath); void setTerminalPath(const QString &terminalPath);
QString AStylePath() const; QString AStylePath() const;

View File

@ -25,6 +25,7 @@
#include <memory> #include <memory>
#include <QThread> #include <QThread>
#include <QProcessEnvironment> #include <QProcessEnvironment>
#define SI_NO_CONVERSION
#include "SimpleIni.h" #include "SimpleIni.h"
#include "qt_utils/utils.h" #include "qt_utils/utils.h"

View File

@ -5,7 +5,7 @@ set -xe
# build RedPanda C++ # build RedPanda C++
mkdir -p /build/redpanda-build mkdir -p /build/redpanda-build
cd /build/redpanda-build cd /build/redpanda-build
/opt/qt5/bin/qmake PREFIX='/usr' XDG_ADAPTIVE_ICON=ON QMAKE_RPATHDIR='/_PlaceHolder' /build/RedPanda-CPP/Red_Panda_CPP.pro qmake PREFIX='/usr' XDG_ADAPTIVE_ICON=ON /build/RedPanda-CPP/Red_Panda_CPP.pro
make -j$(nproc) make -j$(nproc)
# install RedPanda C++ to AppDir # install RedPanda C++ to AppDir
@ -19,11 +19,7 @@ ln -s usr/share/icons/hicolor/scalable/apps/redpandaide.svg redpandaide.svg
cp /build/RedPanda-CPP/platform/linux/redpandaide.png .DirIcon cp /build/RedPanda-CPP/platform/linux/redpandaide.png .DirIcon
# copy dependency # copy dependency
mkdir -p usr/lib cp /usr/local/bin/alacritty usr/bin
cp /usr/lib64/libicu{data,i18n,uc}.so.?? usr/lib
patchelf --set-rpath '$ORIGIN' usr/lib/*.so*
patchelf --set-rpath '$ORIGIN/../lib' usr/bin/RedPandaIDE
patchelf --set-rpath '$ORIGIN/../../lib' usr/libexec/RedPandaCPP/*
# create AppImage # create AppImage
cd /build cd /build

View File

@ -1,7 +0,0 @@
#!/usr/bin/env pwsh
Set-PSDebug -Trace 1
$arch = "aarch64"
docker run --rm -v "$(Get-Location):/build/RedPanda-CPP" -e CARCH=$arch redpanda-builder-$arch /build/RedPanda-CPP/packages/appimage/01-in-docker.sh

View File

@ -1,7 +0,0 @@
#!/bin/bash
set -xe
arch=aarch64
docker run --rm -v $PWD:/build/RedPanda-CPP -e CARCH=$arch redpanda-builder-$arch /build/RedPanda-CPP/packages/appimage/01-in-docker.sh

View File

@ -1,7 +0,0 @@
#!/usr/bin/env pwsh
Set-PSDebug -Trace 1
$arch = "x86_64"
docker run --rm -v "$(Get-Location):/build/RedPanda-CPP" -e CARCH=$arch redpanda-builder-$arch /build/RedPanda-CPP/packages/appimage/01-in-docker.sh

View File

@ -1,7 +0,0 @@
#!/bin/bash
set -xe
arch=x86_64
docker run --rm -v $PWD:/build/RedPanda-CPP -e CARCH=$arch redpanda-builder-$arch /build/RedPanda-CPP/packages/appimage/01-in-docker.sh

View File

@ -1,35 +1,61 @@
FROM quay.io/pypa/manylinux_2_28_aarch64 # RHEL would be the best choice, if EL 8 were released on time.
# AppImageKit AArch64 requires Ubuntu 18.04 or later.
FROM docker.io/arm64v8/ubuntu:18.04
COPY appimagetool-aarch64.AppImage /usr/local/bin/appimagetool # System
RUN chmod +x /usr/local/bin/appimagetool && \ RUN sed -i 's|ports.ubuntu.com|mirrors.ustc.edu.cn|g' /etc/apt/sources.list && \
sed -i 's|^mirrorlist=|#mirrorlist=|g ; s|^# baseurl=https://repo.almalinux.org/almalinux|baseurl=https://mirror.sjtu.edu.cn/almalinux|g' /etc/yum.repos.d/almalinux*.repo && \ export DEBIAN_FRONTEND=noninteractive && \
dnf install -y epel-release && \ apt update && \
sed -i 's|^metalink=|#metalink=|g ; s|^#baseurl=https\?://download.fedoraproject.org/pub/epel/|baseurl=https://mirrors.ustc.edu.cn/epel/|g' /etc/yum.repos.d/epel*.repo && \ apt upgrade -y && \
dnf install -y fontconfig-devel freetype-devel libXrender-devel libicu-devel libxcb-devel libxkbcommon-devel libxkbcommon-x11-devel patchelf xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel apt install --no-install-recommends -y ca-certificates cargo curl cmake file gcc g++ make \
libatspi2.0-dev libdbus-1-dev libfontconfig1-dev libfreetype6-dev libgl1-mesa-dev libxkbcommon-x11-dev
# AppImageKit
RUN curl -L -o /usr/local/bin/appimagetool 'https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-aarch64.AppImage' && \
chmod +x /usr/local/bin/appimagetool
# Qt 5
RUN mkdir -p /build/qt5 && \ RUN mkdir -p /build/qt5 && \
cd /build/qt5 && \ cd /build/qt5 && \
curl -O 'https://mirrors.ustc.edu.cn/qtproject/official_releases/qt/5.15/5.15.7/submodules/qt{base,svg,tools}-everywhere-opensource-src-5.15.7.tar.xz' && \ curl -O 'https://mirrors.ustc.edu.cn/qtproject/archive/qt/5.12/5.12.12/submodules/qt{base,svg,tools}-everywhere-src-5.12.12.tar.xz' && \
tar xf qtbase-everywhere-opensource-src-5.15.7.tar.xz && \ tar xf qtbase-everywhere-src-5.12.12.tar.xz && \
cd qtbase-everywhere-src-5.15.7 && \ cd qtbase-everywhere-src-5.12.12 && \
./configure \ ./configure \
-prefix /opt/qt5 \ -prefix /usr/local \
-opensource -confirm-license \ -opensource -confirm-license \
-optimize-size -no-shared -static -platform linux-g++ -no-use-gold-linker \ -optimize-size -no-shared -static -platform linux-g++ -no-use-gold-linker \
-qt-zlib -qt-doubleconversion -qt-pcre -system-freetype -fontconfig -qt-harfbuzz -qt-libjpeg -qt-libpng -xcb -qt-sqlite \ -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 && \ -nomake examples -nomake tests -nomake tools && \
make -j$(nproc) && \ make -j$(nproc) && \
make install && \ make install && \
# svg package
cd /build/qt5 && \ cd /build/qt5 && \
tar xf qtsvg-everywhere-opensource-src-5.15.7.tar.xz && \ tar xf qtsvg-everywhere-src-5.12.12.tar.xz && \
cd qtsvg-everywhere-src-5.15.7 && \ cd qtsvg-everywhere-src-5.12.12 && \
/opt/qt5/bin/qmake . && \ qmake . && \
make -j$(nproc) && \ make -j$(nproc) && \
make install && \ make install && \
# tools package
cd /build/qt5 && \ cd /build/qt5 && \
tar xf qttools-everywhere-opensource-src-5.15.7.tar.xz && \ tar xf qttools-everywhere-src-5.12.12.tar.xz && \
cd qttools-everywhere-src-5.15.7 && \ cd qttools-everywhere-src-5.12.12 && \
/opt/qt5/bin/qmake . && \ qmake . && \
make -j$(nproc) && \ make -j$(nproc) && \
make install && \ make install && \
# cleanup
cd / && \ cd / && \
rm -r /build/qt5 rm -r /build/qt5
# Alacritty
RUN mkdir -p /build/alacritty && \
cd /build/alacritty && \
curl -L -o alacritty-0.11.0.tar.gz 'https://github.com/alacritty/alacritty/archive/refs/tags/v0.11.0.tar.gz' && \
tar xf alacritty-0.11.0.tar.gz && \
cd alacritty-0.11.0 && \
/bin/echo -e '[profile.relminsize]\ninherits="release"\ndebug=false\nstrip=true\nopt-level="s"' >>Cargo.toml && \
cargo build --profile relminsize && \
cp target/relminsize/alacritty /usr/local/bin && \
# cleanup
cd / && \
rm -r /build/alacritty && \
rm -r ~/.cargo/registry

View File

@ -1,34 +1,67 @@
FROM quay.io/pypa/manylinux2014_x86_64 # RHEL devtoolset, which provides new version of GCC targetting old libgcc_s and libstdc++, is the key to compatibility.
# AppImageKit x86-64 requires EL 7 or later.
FROM docker.io/amd64/centos:7
COPY appimagetool-x86_64.AppImage /usr/local/bin/appimagetool # System
RUN chmod +x /usr/local/bin/appimagetool && \ RUN sed -i 's|^mirrorlist=|#mirrorlist=|g; s|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.ustc.edu.cn/centos|g' /etc/yum.repos.d/CentOS-Base.repo && \
sed -i 's|^mirrorlist=|#mirrorlist=|g ; s|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.ustc.edu.cn/centos|g' /etc/yum.repos.d/CentOS-*.repo && \ yum install -y centos-release-scl-rh epel-release && \
sed -i 's|^metalink=|#metalink=|g ; s|^#baseurl=https\?://download.example/pub/epel/|baseurl=https://mirrors.ustc.edu.cn/epel/|g' /etc/yum.repos.d/epel.repo && \ sed -i 's|^mirrorlist=|#mirrorlist=|g; s|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.ustc.edu.cn/centos|g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo && \
yum install -y fontconfig-devel freetype-devel libXrender-devel libicu-devel libxcb-devel libxkbcommon-devel patchelf sed -i 's|^metalink=|#metalink=|g; s|^#baseurl=https\?://download.fedoraproject.org/pub/epel/|baseurl=https://mirrors.ustc.edu.cn/epel/|g' /etc/yum.repos.d/epel.repo && \
yum upgrade -y && \
yum install -y cargo cmake3 file make which \
at-spi2-core-devel dbus-devel fontconfig-devel freetype-devel glib2-devel libXrender-devel libxcb-devel libxkbcommon-devel libxkbcommon-x11-devel mesa-libGL-devel xcb-util-devel \
devtoolset-7-gcc devtoolset-7-gcc-c++
ARG DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-7/root
ENV PATH=${DEVTOOLSET_ROOTPATH}/usr/bin:${PATH}
ENV LD_LIBRARY_PATH=${DEVTOOLSET_ROOTPATH}/usr/lib64
# AppImageKit
RUN curl -L -o /usr/local/bin/appimagetool 'https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage' && \
chmod +x /usr/local/bin/appimagetool
# Qt 5
RUN mkdir -p /build/qt5 && \ RUN mkdir -p /build/qt5 && \
cd /build/qt5 && \ cd /build/qt5 && \
curl -O 'https://mirrors.ustc.edu.cn/qtproject/archive/qt/5.12/5.12.12/submodules/qt{base,svg,tools}-everywhere-src-5.12.12.tar.xz' && \ curl -O 'https://mirrors.ustc.edu.cn/qtproject/archive/qt/5.12/5.12.12/submodules/qt{base,svg,tools}-everywhere-src-5.12.12.tar.xz' && \
tar xf qtbase-everywhere-src-5.12.12.tar.xz && \ tar xf qtbase-everywhere-src-5.12.12.tar.xz && \
cd qtbase-everywhere-src-5.12.12 && \ cd qtbase-everywhere-src-5.12.12 && \
./configure \ ./configure \
-prefix /opt/qt5 \ -prefix /usr/local \
-opensource -confirm-license \ -opensource -confirm-license \
-optimize-size -no-shared -static -platform linux-g++ -no-use-gold-linker \ -optimize-size -no-shared -static -platform linux-g++ -no-use-gold-linker \
-qt-zlib -qt-doubleconversion -qt-pcre -system-freetype -fontconfig -qt-harfbuzz -qt-libjpeg -qt-libpng -qt-xcb -qt-sqlite \ -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 && \ -nomake examples -nomake tests -nomake tools && \
make -j$(nproc) && \ make -j$(nproc) && \
make install && \ make install && \
# svg package
cd /build/qt5 && \ cd /build/qt5 && \
tar xf qtsvg-everywhere-src-5.12.12.tar.xz && \ tar xf qtsvg-everywhere-src-5.12.12.tar.xz && \
cd qtsvg-everywhere-src-5.12.12 && \ cd qtsvg-everywhere-src-5.12.12 && \
/opt/qt5/bin/qmake . && \ qmake . && \
make -j$(nproc) && \ make -j$(nproc) && \
make install && \ make install && \
# tools package
cd /build/qt5 && \ cd /build/qt5 && \
tar xf qttools-everywhere-src-5.12.12.tar.xz && \ tar xf qttools-everywhere-src-5.12.12.tar.xz && \
cd qttools-everywhere-src-5.12.12 && \ cd qttools-everywhere-src-5.12.12 && \
/opt/qt5/bin/qmake . && \ qmake . && \
make -j$(nproc) && \ make -j$(nproc) && \
make install && \ make install && \
# cleanup
cd / && \ cd / && \
rm -r /build/qt5 rm -r /build/qt5
# Alacritty
RUN mkdir -p /build/alacritty && \
cd /build/alacritty && \
curl -L -o alacritty-0.11.0.tar.gz 'https://github.com/alacritty/alacritty/archive/refs/tags/v0.11.0.tar.gz' && \
tar xf alacritty-0.11.0.tar.gz && \
cd alacritty-0.11.0 && \
echo -e '[profile.relminsize]\ninherits="release"\ndebug=false\nstrip=true\nopt-level="s"' >>Cargo.toml && \
cargo build --profile relminsize && \
cp target/relminsize/alacritty /usr/local/bin && \
# cleanup
cd / && \
rm -r /build/alacritty && \
rm -r ~/.cargo/registry

View File

@ -1,6 +1,6 @@
_pkgname=RedPanda-CPP _pkgname=RedPanda-CPP
pkgname=${_pkgname,,}-git pkgname=${_pkgname,,}-git
pkgver=2.7.r10.g0caaad84 pkgver=2.12.r1.g57c4c5bc
pkgrel=1 pkgrel=1
pkgdesc='A fast, lightweight, open source, and cross platform C++ IDE (development version)' pkgdesc='A fast, lightweight, open source, and cross platform C++ IDE (development version)'
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64') arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64')
@ -9,10 +9,16 @@ license=('GPL3')
depends=(qt5-base qt5-svg gcc gdb) depends=(qt5-base qt5-svg gcc gdb)
makedepends=(git qt5-tools) makedepends=(git qt5-tools)
optdepends=( optdepends=(
'clang: alternate C/C++ compiler' 'clang: C/C++ compiler (alternative)'
'qterminal: run in terminal'
'konsole: run in terminal (alternate)'
'git: git integration' 'git: git integration'
'alacritty: run in terminal'
'kitty: run in terminal'
'tilix: run in terminal'
'cool-retro-term: run in terminal'
'konsole: run in terminal'
'deepin-terminal: run in terminal'
'qterminal: run in terminal'
'lxterminal: run in terminal'
) )
conflicts=("${_pkgname,,}") conflicts=("${_pkgname,,}")
provides=("${_pkgname,,}") provides=("${_pkgname,,}")

View File

@ -6,7 +6,6 @@ Build-Depends: debhelper (>= 12~),
qtbase5-dev, qtbase5-dev,
qtbase5-dev-tools, qtbase5-dev-tools,
qttools5-dev-tools, qttools5-dev-tools,
libicu-dev,
libqt5svg5-dev libqt5svg5-dev
Standards-Version: 4.3.0 Standards-Version: 4.3.0
Homepage: https://github.com/royqh1979/RedPanda-CPP Homepage: https://github.com/royqh1979/RedPanda-CPP