From 375e990e0b9d7f6f6ff3372717233d48d3733c6b Mon Sep 17 00:00:00 2001 From: Cyano Hao Date: Tue, 3 Jan 2023 12:18:02 +0800 Subject: [PATCH] Add more Linux packaging format (#89) * Arch Linux packaging; make LIBEXECDIR configurable * update docs * resolve libexec and share from relative path * AppImage packaging * allow build AppImage on Windows host --- .gitattributes | 14 +++ .gitignore | 6 +- BUILD.md | 83 +++++++++++++++- BUILD_cn.md | 99 ++++++++++++++----- RedPandaIDE/RedPandaIDE.pro | 4 + RedPandaIDE/settings.cpp | 9 +- Red_Panda_CPP.pro | 3 + packages/appimage/01-in-docker.sh | 34 +++++++ packages/appimage/build-aarch64.ps1 | 7 ++ packages/appimage/build-aarch64.sh | 7 ++ packages/appimage/build-x86_64.ps1 | 7 ++ packages/appimage/build-x86_64.sh | 7 ++ .../appimage/dockerfile-aarch64/Dockerfile | 35 +++++++ .../appimage/dockerfile-x86_64/Dockerfile | 34 +++++++ packages/archlinux/PKGBUILD | 40 ++++++++ platform/linux/redpandaide.desktop.in | 4 +- tools/astyle/astyle.pro | 7 +- tools/consolepauser/consolepauser.pro | 7 +- .../redpanda-git-askpass.pro | 7 +- 19 files changed, 375 insertions(+), 39 deletions(-) create mode 100644 .gitattributes create mode 100755 packages/appimage/01-in-docker.sh create mode 100755 packages/appimage/build-aarch64.ps1 create mode 100755 packages/appimage/build-aarch64.sh create mode 100755 packages/appimage/build-x86_64.ps1 create mode 100755 packages/appimage/build-x86_64.sh create mode 100644 packages/appimage/dockerfile-aarch64/Dockerfile create mode 100644 packages/appimage/dockerfile-x86_64/Dockerfile create mode 100644 packages/archlinux/PKGBUILD diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..aa66f8d5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,14 @@ +########################## +# AppImage on Windows host +########################## + +# script run in docker +/packages/appimage/01-in-docker.sh eol=lf + +# text files to be packed +/platform/linux/install.sh eol=lf +/platform/linux/redpandaide.desktop.in eol=lf +/platform/linux/templates/*/*.txt eol=lf +/platform/linux/templates/*/*.template eol=lf +/platform/linux/templates/*/*.fs eol=lf +/platform/linux/templates/*/*.vs eol=lf diff --git a/.gitignore b/.gitignore index dd6b9e3e..85a64984 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ /.vs +/dist +/packages/appimage/*/*.AppImage +/packages/archlinux/* +!/packages/archlinux/PKGBUILD *.bak -*.pro.user \ No newline at end of file +*.pro.user diff --git a/BUILD.md b/BUILD.md index 408b1bad..81a2f658 100644 --- a/BUILD.md +++ b/BUILD.md @@ -13,4 +13,85 @@ # Linux - Install gcc and qt5 - - Use qtcreator to open Red_Panda_CPP.pro \ No newline at end of file + - Open `Red_Panda_CPP.pro` with Qt Creator + +qmake variables: +- `PREFIX`: default to `/usr/local`. It should be set to `/usr` or `/opt/redpanda-cpp` when packaging. +- `LIBEXECDIR`: directory for auxiliary executables, default to `$PREFIX/libexec`. Arch Linux uses `/usr/lib`. + +## Ubuntu + +### 1. Install Compiler + +```bash +apt install gcc g++ make gdb gdbserver +``` + +### 2. Install Qt 5 and Other Dependencies + +```bash +apt install qtbase5-dev qttools5-dev-tools libicu-dev libqt5svg5-dev git qterminal +``` + +### 3. Fetch Source Code + +```bash +git clone https://github.com/royqh1979/RedPanda-CPP.git +``` + +### 4. Build + +```bash +cd RedPanda-CPP/ +qmake Red_Panda_CPP.pro +make -j$(nproc) +sudo make install +``` + +### 5. Run + +```bash +RedPandaIDE +``` + +## Arch Linux + +A reference PKGBUILD is available at `packages/archlinux`. Build RedPanda C++ with [makepkg](https://wiki.archlinux.org/title/Makepkg) and then install. + +Enter `RedPandaIDE` to launch RedPanda C++. + +Note that makepkg checks out HEAD of the repo, so any change should be committed before building. + +## AppImage + +1. Install dependency: cURL, Docker. + + Extra requirements for Windows host: + - 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”). +2. Prepare build environment. Linux host: + ```bash + 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 build -t redpanda-builder-$arch packages/appimage/dockerfile-$arch + ``` + Windows host: + ```ps1 + $arch = "x86_64" # or "aarch64" someday Docker 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 build -t redpanda-builder-$arch packages/appimage/dockerfile-$arch + ``` +3. Build AppImage. Linux host: + ```bash + ./packages/appimage/build-x86_64.sh # or *-aarch64.sh + ``` + Windows host: + ```ps1 + ./packages/appimage/build-x86_64.ps1 # or *-aarch64.ps1 someday Docker is available on WoA + ``` +4. Run Red Panda C++. + ```bash + ./dist/RedPandaIDE-x86_64.AppImage # or *-aarch64.AppImage + ``` + +Note: AppImage, in which format AppImageKit is shipped, is incompatable with QEMU user space emulator, so you cannot build AArch64 AppImage on x86-64, and vice versa. diff --git a/BUILD_cn.md b/BUILD_cn.md index 48743d96..8ee00298 100644 --- a/BUILD_cn.md +++ b/BUILD_cn.md @@ -1,55 +1,100 @@ -# +# 依赖 - СèC++ҪQt 5(>=5.12) + 小熊猫C++需要Qt 5(>=5.12) # Windows - ʹmsys2°GCCMinGW-w64СèC++VC汾gccһܹ롣 + 我使用msys2打包的最新版的GCC和MinGW-w64工具链来编译小熊猫C++。VC和其他版本的gcc不一定能够正常编译。 - 벽裺 - - װmsys2 (https://www.msys2.org) - - ʹmsys2pacmanװmingw-w64-x86_64-qt5mingw-w64-x86_64-gcc - - װqtcreator - - ʹqtcreatorRed_Panda_CPP.proļ + 编译步骤: + - 安装msys2 (https://www.msys2.org) + - 使用msys2的pacman程序安装mingw-w64-x86_64-qt5和mingw-w64-x86_64-gcc + - 安装qtcreator + - 使用qtcreator打开Red_Panda_CPP.pro文件 # Linux -: - - װ gcc qt5ذ - - ʹqtcreatorRed_Panda_CPP.proļ +步骤: + - 安装 gcc 和 qt5开发相关包 + - 使用qtcreator打开Red_Panda_CPP.pro文件 +qmake 变量: +- `PREFIX`:默认值是 `/usr/local`。打包时应该定义为 `/usr` 或 `/opt/redpanda-cpp`。 +- `LIBEXECDIR`:辅助程序的路径,默认值是 `$PREFIX/libexec`。Arch Linux 使用 `/usr/lib`。 ## Ubuntu -### 1.װ +### 1.安装编译器 -```text -apt install gcc g++ make gdb gdbserver +```bash +apt install gcc g++ make gdb gdbserver ``` -### 2.װQT5 +### 2.安装QT5和依赖包 -```text -apt install qtbase5-dev qttools5-dev-tools libicu-dev libqt5svg5-dev git qterminal +```bash +apt install qtbase5-dev qttools5-dev-tools libicu-dev libqt5svg5-dev git qterminal ``` -### 3.Դ +### 3.下载源码 -``` +```bash git clone https://gitee.com/royqh1979/RedPanda-CPP.git ``` -### 4. +### 4.编译 -``` -cd cd RedPanda-CPP/ -qmake Red_Panda_CPP.pro -make -j8 +```bash +cd RedPanda-CPP/ +qmake Red_Panda_CPP.pro +make -j$(nproc) sudo make install ``` -### 5. +### 5.运行 -``` +```bash RedPandaIDE -``` \ No newline at end of file +``` + +## Arch Linux 及衍生版本 + +`packages/archlinux` 目录下提供了一个参考 PKGBUILD,使用 [makepkg](https://wiki.archlinuxcn.org/wiki/Makepkg) 构建小熊猫 C++ 并安装。 + +小熊猫 C++ 可以通过 `RedPandaIDE` 命令启动。 + +注意:makepkg 签出此存储库的 HEAD,因此构建之前务必提交所有变更。 + +## AppImage + +1. 安装依赖包:cURL、Docker。 + + Windows 宿主的额外要求: + - Docker 使用基于 WSL 2 的引擎,或者对此项目文件夹启用文件共享(Settings > Resources > File sharing); + - PowerShell(曾用名 “PowerShell Core”,不是 “Windows PowerShell”)。 +2. 准备构建环境。Linux 宿主: + ```bash + 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 build -t redpanda-builder-$arch packages/appimage/dockerfile-$arch + ``` + Windows 宿主: + ```ps1 + $arch = "x86_64" # 或 "aarch64"(如果将来 Docker 支持 WoA) + Invoke-WebRequest -OutFile packages/appimage/dockerfile-$arch/appimagetool-$arch.AppImage -Uri https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-$arch.AppImage + docker build -t redpanda-builder-$arch packages/appimage/dockerfile-$arch + ``` +3. 构建 AppImage。Linux 宿主: + ```bash + ./packages/appimage/build-x86_64.sh # 或 *-aarch64.sh + ``` + Windows 宿主: + ```ps1 + ./packages/appimage/build-x86_64.ps1 # 或 *-aarch64.ps1(如果将来 Docker 支持 WoA) + ``` +4. 运行小熊猫 C++. + ```bash + ./dist/RedPandaIDE-x86_64.AppImage # 或 *-aarch64.AppImage + ``` + +注意:AppImage 与 QEMU 用户态模拟不兼容,使用此格式的 AppImageKit 工具自然不能用 QEMU 用户态模拟来运行。因此不能在 x86-64 系统上构建 AArch64 AppImage,反之亦然。 diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index eb6f59b4..cd7bc2ca 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -29,6 +29,9 @@ else: VERSION = $${APP_VERSION} isEmpty(PREFIX) { PREFIX = /usr/local } +isEmpty(LIBEXECDIR) { + LIBEXECDIR = $${PREFIX}/libexec +} # windows 7 is the minimum windows version win32: { @@ -36,6 +39,7 @@ DEFINES += _WIN32_WINNT=0x0601 } DEFINES += PREFIX=\\\"$${PREFIX}\\\" +DEFINES += LIBEXECDIR=\\\"$${LIBEXECDIR}\\\" DEFINES += APP_NAME=\\\"$${APP_NAME}\\\" DEFINES += REDPANDA_CPP_VERSION=\\\"$${APP_VERSION}\\\" diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 4008b938..9d9db9b1 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -184,7 +184,9 @@ QString Settings::Dirs::appResourceDir() const #ifdef Q_OS_WIN return appDir(); #elif defined(Q_OS_LINUX) - return includeTrailingPathDelimiter(PREFIX)+"share/"+APP_NAME; + // in AppImage PREFIX is not true, resolve from relative path + const static QString absoluteResourceDir(QDir(appDir()).absoluteFilePath("../share/" APP_NAME)); + return absoluteResourceDir; #elif defined(Q_OS_MACOS) // return QApplication::instance()->applicationDirPath(); return ""; @@ -197,7 +199,10 @@ QString Settings::Dirs::appLibexecDir() const #ifdef Q_OS_WIN return appDir(); #elif defined(Q_OS_LINUX) - return includeTrailingPathDelimiter(PREFIX)+"libexec/"+APP_NAME; + // in AppImage LIBEXECDIR is not true, resolve from relative path + const static QString relativeLibExecDir(QDir(PREFIX "/bin").relativeFilePath(LIBEXECDIR "/" APP_NAME)); + const static QString absoluteLibExecDir(QDir(appDir()).absoluteFilePath(relativeLibExecDir)); + return absoluteLibExecDir; #elif defined(Q_OS_MACOS) return QApplication::instance()->applicationDirPath(); #endif diff --git a/Red_Panda_CPP.pro b/Red_Panda_CPP.pro index 18cb9b6e..d3138686 100644 --- a/Red_Panda_CPP.pro +++ b/Red_Panda_CPP.pro @@ -39,6 +39,9 @@ linux: { isEmpty(PREFIX) { PREFIX = /usr/local } + isEmpty(LIBEXECDIR) { + LIBEXECDIR = $${PREFIX}/libexec + } QMAKE_SUBSTITUTES += platform/linux/redpandaide.desktop.in diff --git a/packages/appimage/01-in-docker.sh b/packages/appimage/01-in-docker.sh new file mode 100755 index 00000000..55289e8b --- /dev/null +++ b/packages/appimage/01-in-docker.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +set -xe + +# build RedPanda C++ +mkdir -p /build/redpanda-build +cd /build/redpanda-build +/opt/qt5/bin/qmake PREFIX='/usr' QMAKE_RPATHDIR='/_PlaceHolder' /build/RedPanda-CPP/Red_Panda_CPP.pro +make -j$(nproc) + +# install RedPanda C++ to AppDir +make install INSTALL_ROOT=/build/RedPandaIDE.AppDir + +# setup AppImage resource +cd /build/RedPandaIDE.AppDir +ln -s usr/bin/RedPandaIDE AppRun +ln -s usr/share/applications/redpandaide.desktop redpandaide.desktop +ln -s usr/share/pixmaps/redpandaide.png redpandaide.png +ln -s usr/share/pixmaps/redpandaide.png .DirIcon + +# copy dependency +mkdir -p usr/lib +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 +cd /build +appimagetool --appimage-extract-and-run RedPandaIDE.AppDir RedPandaIDE-$CARCH.AppImage + +# copy back to host +mkdir -p /build/RedPanda-CPP/dist +/bin/cp RedPandaIDE-$CARCH.AppImage /build/RedPanda-CPP/dist diff --git a/packages/appimage/build-aarch64.ps1 b/packages/appimage/build-aarch64.ps1 new file mode 100755 index 00000000..5025ff45 --- /dev/null +++ b/packages/appimage/build-aarch64.ps1 @@ -0,0 +1,7 @@ +#!/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 diff --git a/packages/appimage/build-aarch64.sh b/packages/appimage/build-aarch64.sh new file mode 100755 index 00000000..1b1ee03c --- /dev/null +++ b/packages/appimage/build-aarch64.sh @@ -0,0 +1,7 @@ +#!/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 diff --git a/packages/appimage/build-x86_64.ps1 b/packages/appimage/build-x86_64.ps1 new file mode 100755 index 00000000..ae1801e9 --- /dev/null +++ b/packages/appimage/build-x86_64.ps1 @@ -0,0 +1,7 @@ +#!/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 diff --git a/packages/appimage/build-x86_64.sh b/packages/appimage/build-x86_64.sh new file mode 100755 index 00000000..f8c8a360 --- /dev/null +++ b/packages/appimage/build-x86_64.sh @@ -0,0 +1,7 @@ +#!/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 diff --git a/packages/appimage/dockerfile-aarch64/Dockerfile b/packages/appimage/dockerfile-aarch64/Dockerfile new file mode 100644 index 00000000..d1e5318f --- /dev/null +++ b/packages/appimage/dockerfile-aarch64/Dockerfile @@ -0,0 +1,35 @@ +FROM quay.io/pypa/manylinux_2_28_aarch64 + +COPY appimagetool-aarch64.AppImage /usr/local/bin/appimagetool +RUN chmod +x /usr/local/bin/appimagetool && \ + 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 && \ + dnf install -y epel-release && \ + 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 && \ + 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 +RUN mkdir -p /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' && \ + tar xf qtbase-everywhere-opensource-src-5.15.7.tar.xz && \ + cd qtbase-everywhere-src-5.15.7 && \ + ./configure \ + -prefix /opt/qt5 \ + -opensource -confirm-license \ + -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 \ + -nomake examples -nomake tests -nomake tools && \ + make -j$(nproc) && \ + make install && \ + cd /build/qt5 && \ + tar xf qtsvg-everywhere-opensource-src-5.15.7.tar.xz && \ + cd qtsvg-everywhere-src-5.15.7 && \ + /opt/qt5/bin/qmake . && \ + make -j$(nproc) && \ + make install && \ + cd /build/qt5 && \ + tar xf qttools-everywhere-opensource-src-5.15.7.tar.xz && \ + cd qttools-everywhere-src-5.15.7 && \ + /opt/qt5/bin/qmake . && \ + make -j$(nproc) && \ + make install && \ + cd / && \ + rm -r /build/qt5 diff --git a/packages/appimage/dockerfile-x86_64/Dockerfile b/packages/appimage/dockerfile-x86_64/Dockerfile new file mode 100644 index 00000000..f60ce013 --- /dev/null +++ b/packages/appimage/dockerfile-x86_64/Dockerfile @@ -0,0 +1,34 @@ +FROM quay.io/pypa/manylinux2014_x86_64 + +COPY appimagetool-x86_64.AppImage /usr/local/bin/appimagetool +RUN chmod +x /usr/local/bin/appimagetool && \ + 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 && \ + 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 && \ + yum install -y fontconfig-devel freetype-devel libXrender-devel libicu-devel libxcb-devel libxkbcommon-devel patchelf +RUN mkdir -p /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' && \ + tar xf qtbase-everywhere-src-5.12.12.tar.xz && \ + cd qtbase-everywhere-src-5.12.12 && \ + ./configure \ + -prefix /opt/qt5 \ + -opensource -confirm-license \ + -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 \ + -nomake examples -nomake tests -nomake tools && \ + make -j$(nproc) && \ + make install && \ + cd /build/qt5 && \ + tar xf qtsvg-everywhere-src-5.12.12.tar.xz && \ + cd qtsvg-everywhere-src-5.12.12 && \ + /opt/qt5/bin/qmake . && \ + make -j$(nproc) && \ + make install && \ + cd /build/qt5 && \ + tar xf qttools-everywhere-src-5.12.12.tar.xz && \ + cd qttools-everywhere-src-5.12.12 && \ + /opt/qt5/bin/qmake . && \ + make -j$(nproc) && \ + make install && \ + cd / && \ + rm -r /build/qt5 diff --git a/packages/archlinux/PKGBUILD b/packages/archlinux/PKGBUILD new file mode 100644 index 00000000..95b4e7d8 --- /dev/null +++ b/packages/archlinux/PKGBUILD @@ -0,0 +1,40 @@ +_pkgname=RedPanda-CPP +pkgname=${_pkgname,,}-git +pkgver=2.7.r10.g0caaad84 +pkgrel=1 +pkgdesc='A fast, lightweight, open source, and cross platform C++ IDE (development version)' +arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64') +url="https://github.com/royqh1979/$_pkgname" +license=('GPL3') +depends=(qt5-base qt5-svg gcc gdb) +makedepends=(git qt5-tools) +optdepends=( + 'clang: alternate C/C++ compiler' + 'qterminal: run in terminal' + 'konsole: run in terminal (alternate)' + 'git: git integration' +) +conflicts=("${_pkgname,,}") +provides=("${_pkgname,,}") +source=("$_pkgname::git+file://${PWD%packages/archlinux}") +sha256sums=('SKIP') + +pkgver() { + cd "$srcdir/$_pkgname" + git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' +} + +build() { + mkdir redpanda-build + cd redpanda-build + qmake \ + PREFIX='/usr' \ + LIBEXECDIR='/usr/lib' \ + "$srcdir/$_pkgname/Red_Panda_CPP.pro" + make +} + +package() { + cd redpanda-build + make INSTALL_ROOT="$pkgdir" install +} diff --git a/platform/linux/redpandaide.desktop.in b/platform/linux/redpandaide.desktop.in index 4c117353..f1af2bc8 100644 --- a/platform/linux/redpandaide.desktop.in +++ b/platform/linux/redpandaide.desktop.in @@ -4,12 +4,12 @@ Comment[zh_CN]=基于QT的轻量级C/C++集成开发环境 Exec=RedPandaIDE %F GenericName=Red Panda C++ GenericName[zh_CN]=小熊猫C++ -MimeType=application/pdf +MimeType=application/pdf; Name=Red Panda C++ Name[zh_CN]=小熊猫C++ StartupNotify=false Terminal=false Type=Application Categories=Development;Qt; -Icon=$${PREFIX}/share/pixmaps/redpandaide.png +Icon=$${PREFIX}/share/pixmaps/redpandaide Path=$${PREFIX}/bin diff --git a/tools/astyle/astyle.pro b/tools/astyle/astyle.pro index 5f64b506..95619018 100644 --- a/tools/astyle/astyle.pro +++ b/tools/astyle/astyle.pro @@ -26,6 +26,9 @@ SOURCES += \ isEmpty(PREFIX) { PREFIX = /usr/local } +isEmpty(LIBEXECDIR) { + LIBEXECDIR = $${PREFIX}/libexec +} win32: { !isEmpty(PREFIX) { @@ -39,8 +42,8 @@ QMAKE_CXXFLAGS += /source-charset:utf-8 } # Default rules for deployment. -qnx: target.path = $${PREFIX}/libexec/$${APP_NAME} -else: unix:!android: target.path = $${PREFIX}/libexec/$${APP_NAME} +qnx: target.path = $${LIBEXECDIR}/$${APP_NAME} +else: unix:!android: target.path = $${LIBEXECDIR}/$${APP_NAME} !isEmpty(target.path): INSTALLS += target diff --git a/tools/consolepauser/consolepauser.pro b/tools/consolepauser/consolepauser.pro index 737f90e0..dcfd4831 100644 --- a/tools/consolepauser/consolepauser.pro +++ b/tools/consolepauser/consolepauser.pro @@ -41,6 +41,9 @@ CONFIG += embed_translations isEmpty(PREFIX) { PREFIX = /usr/local } +isEmpty(LIBEXECDIR) { + LIBEXECDIR = $${PREFIX}/libexec +} win32: { !isEmpty(PREFIX) { @@ -49,6 +52,6 @@ win32: { } # Default rules for deployment. -qnx: target.path = $${PREFIX}/libexec/$${APP_NAME} -else: unix:!android: target.path = $${PREFIX}/libexec/$${APP_NAME} +qnx: target.path = $${LIBEXECDIR}/$${APP_NAME} +else: unix:!android: target.path = $${LIBEXECDIR}/$${APP_NAME} !isEmpty(target.path): INSTALLS += target diff --git a/tools/redpanda-git-askpass/redpanda-git-askpass.pro b/tools/redpanda-git-askpass/redpanda-git-askpass.pro index a81e9b28..271085d1 100644 --- a/tools/redpanda-git-askpass/redpanda-git-askpass.pro +++ b/tools/redpanda-git-askpass/redpanda-git-askpass.pro @@ -24,8 +24,11 @@ FORMS += \ isEmpty(PREFIX) { PREFIX = /usr/local } +isEmpty(LIBEXECDIR) { + LIBEXECDIR = $${PREFIX}/libexec +} # Default rules for deployment. -qnx: target.path = $${PREFIX}/libexec/$${APP_NAME} -else: unix:!android: target.path = $${PREFIX}/libexec/$${APP_NAME} +qnx: target.path = $${LIBEXECDIR}/$${APP_NAME} +else: unix:!android: target.path = $${LIBEXECDIR}/$${APP_NAME} !isEmpty(target.path): INSTALLS += target