From 5c810bd1c9cc1eba4fc002382c098db68f101323 Mon Sep 17 00:00:00 2001 From: Cyano Hao Date: Sun, 19 Nov 2023 08:48:58 +0800 Subject: [PATCH] Update Linux packaging (#160) * update arch linux deps; make it CI-friendly * fix musl compatibility * alpine linux packaging * add musl-based Linux to CI * update rpm build * update doc --- .gitattributes | 4 ++ .github/workflows/build.yml | 40 +++++++------ .gitignore | 2 - BUILD.md | 59 ++++--------------- BUILD_cn.md | 61 ++++---------------- packages/alpine/01-in-docker.sh | 16 +++++ packages/alpine/APKBUILD.in | 30 ++++++++++ packages/alpine/buildapk.sh | 17 ++++++ packages/archlinux/01-in-docker.sh | 21 +++++++ packages/archlinux/{PKGBUILD => PKGBUILD.in} | 21 +------ packages/archlinux/buildpkg.sh | 15 +++++ packages/fedora/01-in-docker.sh | 5 +- packages/fedora/buildrpm.sh | 13 +++-- packages/fedora/redpanda-cpp-git.spec.in | 4 +- packages/opensuse/01-in-docker.sh | 5 +- packages/opensuse/buildrpm.sh | 13 +++-- packages/opensuse/redpanda-cpp-git.spec.in | 4 +- tools/astyle/astyle_main.cpp | 1 + 18 files changed, 176 insertions(+), 155 deletions(-) create mode 100755 packages/alpine/01-in-docker.sh create mode 100644 packages/alpine/APKBUILD.in create mode 100755 packages/alpine/buildapk.sh create mode 100755 packages/archlinux/01-in-docker.sh rename packages/archlinux/{PKGBUILD => PKGBUILD.in} (54%) create mode 100755 packages/archlinux/buildpkg.sh diff --git a/.gitattributes b/.gitattributes index 5735c8b4..e7898d5a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,9 +3,13 @@ ################################## # script run in docker +/packages/alpine/* eol=lf /packages/appimage/01-in-docker.sh eol=lf +/packages/archlinux/* eol=lf /packages/debian/01-in-docker.sh eol=lf /packages/debian/rules eol=lf +/packages/fedora/* eol=lf +/packages/opensuse/* eol=lf # files to be processed with Unix utils /packages/windows/qtbase-5.6.3-redpanda.patch eol=lf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 052522e5..efc3e5d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -172,24 +172,7 @@ jobs: - name: Build run: | - cat <$GITHUB_WORKSPACE/archlinux-in-docker.sh - #!/bin/bash - set -euxo pipefail - - pacman -Syu --noconfirm --needed base-devel - cd /src/packages/archlinux - bash -c 'source PKGBUILD && pacman -S --noconfirm --needed --asdeps "\${makedepends[@]}" "\${depends[@]}"' # heredoc: escape variable expansion - - useradd -m builduser - chmod o+w . - su builduser -c 'makepkg' - - mkdir -p /src/dist - mv *.pkg.tar.zst /src/dist/ - EOF - - chmod +x $GITHUB_WORKSPACE/archlinux-in-docker.sh - podman run --rm -e SOURCE_DIR=/src -v $GITHUB_WORKSPACE:/src --platform linux/amd64 docker.io/amd64/archlinux:latest /src/archlinux-in-docker.sh + podman run --rm -e SOURCE_DIR=/src -v $GITHUB_WORKSPACE:/src --platform linux/amd64 docker.io/amd64/archlinux:latest /src/packages/archlinux/01-in-docker.sh - name: Upload uses: actions/upload-artifact@v2 @@ -239,6 +222,27 @@ jobs: name: RPM on openSUSE Tumbleweed path: dist/*.rpm + musl: + name: musl-based Linux (latest Alpine) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Fetch container image + run: | + podman pull --platform linux/amd64 docker.io/amd64/alpine:latest + + - name: Build + run: | + podman run --rm -e SOURCE_DIR=/src -v $GITHUB_WORKSPACE:/src --platform linux/amd64 docker.io/amd64/alpine:latest /src/packages/alpine/01-in-docker.sh + + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: musl-based Linux (latest Alpine) + path: dist/*.apk + macos_x86_64: name: macOS x86_64 runs-on: macos-latest diff --git a/.gitignore b/.gitignore index fbc1f33f..848b9448 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,5 @@ /.vscode /dist /packages/appimage/*/*.AppImage -/packages/archlinux/* -!/packages/archlinux/PKGBUILD *.bak *.pro.user diff --git a/BUILD.md b/BUILD.md index 8de523e9..df3f3112 100644 --- a/BUILD.md +++ b/BUILD.md @@ -377,61 +377,24 @@ Extra requirements for Windows host: RedPandaIDE ``` -## Arch Linux +## Alpine Linux, Arch Linux, Fedora, openSUSE -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. - -## Fedora - -1. Install dependency: - ```bash - sudo dnf install \ - gcc gcc-c++ rpm-build rpmdevtools git \ - glibc-static libstdc++-static libasan \ - qt5-qtbase-devel qt5-qtsvg-devel qt5-qttools-devel - - rpmdev-setuptree # first time only - ``` -2. Build the package: - ```bash - ./packages/fedora/buildrpm.sh - ``` +1. Setup build environment (documentation for [Alpine](https://wiki.alpinelinux.org/wiki/Abuild_and_Helpers), [Arch](https://wiki.archlinux.org/title/Makepkg), [RPM](https://rpm-packaging-guide.github.io/#prerequisites)). +2. Call build script: + - Alpine Linux: `./packages/alpine/buildapk.sh` + - Arch Linux: `./packages/archlinux/buildpkg.sh` + - Fedora: `./packages/fedora/buildrpm.sh` + - openSUSE: `./packages/opensuse/buildrpm.sh` 3. Install the package: - ```bash - sudo dnf install ~/rpmbuild/RPMS/$(uname -m)/redpanda-cpp-git-*.rpm - ``` + - Alpine Linux: `~/packages/unsupported/$(uname -m)/redpanda-cpp-git-*.apk` + - Arch Linux: `/tmp/redpanda-cpp-git/redpanda-cpp-git-*.pkg.tar.zst` + - Fedora, openSUSE: `~/rpmbuild/RPMS/$(uname -m)/redpanda-cpp-git-*.rpm` 4. Run Red Panda C++: ```bash RedPandaIDE ``` -## openSUSE - -1. Install dependency: - ```bash - sudo zypper in \ - gcc gcc-c++ rpm-build rpmdevtools git \ - glibc-devel-static \ - libqt5svg5-dev qtbase5-dev qtbase5-dev-tools qttools5-dev-tools - - rpmdev-setuptree # first time only - ``` -2. Build the package: - ```bash - ./packages/opensuse/buildrpm.sh - ``` -3. Install the package: - ```bash - sudo zypper --no-gpg-checks in ~/rpmbuild/RPMS/$(uname -m)/redpanda-cpp-git-*.rpm - ``` -4. Run Red Panda C++: - ```bash - RedPandaIDE - ``` +Note that these build scripts check out HEAD of the repo, so any changes should be committed before building. ## Linux AppImage diff --git a/BUILD_cn.md b/BUILD_cn.md index 5234502b..d5d0fe5d 100644 --- a/BUILD_cn.md +++ b/BUILD_cn.md @@ -377,61 +377,24 @@ Windows 宿主的额外要求: RedPandaIDE ``` -## Arch Linux 及衍生版本 +## Alpine Linux, Arch Linux, Fedora, openSUSE -`packages/archlinux` 目录下提供了一个参考 PKGBUILD,使用 [makepkg](https://wiki.archlinuxcn.org/wiki/Makepkg) 构建小熊猫 C++ 并安装。 - -小熊猫 C++ 可以通过 `RedPandaIDE` 命令启动。 - -注意:makepkg 签出此存储库的 HEAD,因此构建之前务必提交所有变更。 - -## Fedora - -1. 安装依赖包: - ```bash - sudo dnf install \ - gcc gcc-c++ rpm-build rpmdevtools git \ - glibc-static libstdc++-static libasan \ - qt5-qtbase-devel qt5-qtsvg-devel qt5-qttools-devel - - rpmdev-setuptree # 仅第一次 - ``` -2. 构建 rpm 包: - ```bash - ./packages/fedora/buildrpm.sh - ``` -3. 安装 rpm 包: - ```bash - sudo dnf install ~/rpmbuild/RPMS/$(uname -m)/redpanda-cpp-git-*.rpm - ``` +1. 准备构建环境([Alpine](https://wiki.alpinelinux.org/wiki/Abuild_and_Helpers)、[Arch](https://wiki.archlinux.org/title/Makepkg)、[RPM](https://rpm-packaging-guide.github.io/#prerequisites) 文档)。 +2. 调用构建脚本: + - Alpine Linux:`./packages/alpine/buildapk.sh` + - Arch Linux:`./packages/archlinux/buildpkg.sh` + - Fedora:`./packages/fedora/buildrpm.sh` + - openSUSE:`./packages/opensuse/buildrpm.sh` +3. 安装软件包: + - Alpine Linux:`~/packages/unsupported/$(uname -m)/redpanda-cpp-git-*.apk` + - Arch Linux:`/tmp/redpanda-cpp-git/redpanda-cpp-git-*.pkg.tar.zst` + - Fedora、openSUSE:`~/rpmbuild/RPMS/$(uname -m)/redpanda-cpp-git-*.rpm` 4. 运行小熊猫 C++: ```bash RedPandaIDE ``` -## openSUSE - -1. 安装依赖包: - ```bash - sudo zypper in \ - gcc gcc-c++ rpm-build rpmdevtools git \ - glibc-devel-static \ - libqt5svg5-dev qtbase5-dev qtbase5-dev-tools qttools5-dev-tools - - rpmdev-setuptree # 仅第一次 - ``` -2. 构建 rpm 包: - ```bash - ./packages/opensuse/buildrpm.sh - ``` -3. 安装 rpm 包: - ```bash - sudo zypper --no-gpg-checks in ~/rpmbuild/RPMS/$(uname -m)/redpanda-cpp-git-*.rpm - ``` -4. 运行小熊猫 C++: - ```bash - RedPandaIDE - ``` +注意:这些构建脚本签出此存储库的 HEAD,因此构建之前务必提交所有变更。 ## Linux AppImage diff --git a/packages/alpine/01-in-docker.sh b/packages/alpine/01-in-docker.sh new file mode 100755 index 00000000..8d7b3c25 --- /dev/null +++ b/packages/alpine/01-in-docker.sh @@ -0,0 +1,16 @@ +#!/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 + +cd $SOURCE_DIR +./packages/alpine/buildapk.sh + +mkdir -p $SOURCE_DIR/dist +cp ~/packages/unsupported/$(uname -m)/redpanda-cpp-git-*.apk $SOURCE_DIR/dist/ diff --git a/packages/alpine/APKBUILD.in b/packages/alpine/APKBUILD.in new file mode 100644 index 00000000..f1728f61 --- /dev/null +++ b/packages/alpine/APKBUILD.in @@ -0,0 +1,30 @@ +_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' +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' \ + XDG_ADAPTIVE_ICON=ON \ + "$srcdir/$_pkgname/Red_Panda_CPP.pro" + make +} + +package() { + cd "$srcdir/redpanda-build" + make INSTALL_ROOT="$pkgdir" install +} + +sha512sums="00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 $_pkgname.tar.gz" diff --git a/packages/alpine/buildapk.sh b/packages/alpine/buildapk.sh new file mode 100755 index 00000000..739f5ba2 --- /dev/null +++ b/packages/alpine/buildapk.sh @@ -0,0 +1,17 @@ +#!/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 diff --git a/packages/archlinux/01-in-docker.sh b/packages/archlinux/01-in-docker.sh new file mode 100755 index 00000000..1a7886b7 --- /dev/null +++ b/packages/archlinux/01-in-docker.sh @@ -0,0 +1,21 @@ +#!/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 + +cd $SOURCE_DIR +su builduser -c "git config --global --add safe.directory $SOURCE_DIR" +su builduser -c ./packages/archlinux/buildpkg.sh + +mkdir -p $SOURCE_DIR/dist +cp /tmp/redpanda-cpp-git/redpanda-cpp-git-*.pkg.tar.zst $SOURCE_DIR/dist/ diff --git a/packages/archlinux/PKGBUILD b/packages/archlinux/PKGBUILD.in similarity index 54% rename from packages/archlinux/PKGBUILD rename to packages/archlinux/PKGBUILD.in index 4039eb80..9a78096d 100644 --- a/packages/archlinux/PKGBUILD +++ b/packages/archlinux/PKGBUILD.in @@ -1,36 +1,21 @@ _pkgname=RedPanda-CPP pkgname=${_pkgname,,}-git -pkgver=2.23.r14.gd1214e3d +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=(qt5-base qt5-svg gcc gdb) -makedepends=(git qt5-tools) +makedepends=(qt5-tools) optdepends=( 'clang: C/C++ compiler (alternative)' - '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,,}") provides=("${_pkgname,,}") -source=("$_pkgname::git+file://${PWD%packages/archlinux}") +source=("$_pkgname.tar.gz") sha256sums=('SKIP') -pkgver() { - cd "$srcdir/$_pkgname" - # there may be no tag in forked repo, use `--always` to get commit hash as fallback for ci builds - git describe --long --tags --always | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' -} - build() { mkdir redpanda-build cd redpanda-build diff --git a/packages/archlinux/buildpkg.sh b/packages/archlinux/buildpkg.sh new file mode 100755 index 00000000..28af7aba --- /dev/null +++ b/packages/archlinux/buildpkg.sh @@ -0,0 +1,15 @@ +#!/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 + +cd "$TMP_FOLDER" +makepkg -s --noconfirm diff --git a/packages/fedora/01-in-docker.sh b/packages/fedora/01-in-docker.sh index 8f9ca1c4..00f276c5 100755 --- a/packages/fedora/01-in-docker.sh +++ b/packages/fedora/01-in-docker.sh @@ -2,10 +2,7 @@ set -xeuo pipefail -dnf install -y \ - gcc gcc-c++ rpm-build rpmdevtools git \ - glibc-static libstdc++-static libasan \ - qt5-qtbase-devel qt5-qtsvg-devel qt5-qttools-devel +dnf install -y dnf-plugins-core git rpm-build rpmdevtools rpmdev-setuptree cd $SOURCE_DIR diff --git a/packages/fedora/buildrpm.sh b/packages/fedora/buildrpm.sh index d6a6b12d..0f6f19bb 100755 --- a/packages/fedora/buildrpm.sh +++ b/packages/fedora/buildrpm.sh @@ -3,11 +3,14 @@ set -xeuo pipefail SPECDIR=$(rpm --eval %{_specdir}) +SOURCEDIR=$(rpm --eval %{_sourcedir}) BUILDDIR=$(rpm --eval %{_builddir})/redpanda-cpp-git -VERSION=$(git describe --long --tags --always | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g') - -sed -s "s/__VERSION__/$VERSION/g" packages/fedora/redpanda-cpp-git.spec.in >$SPECDIR/redpanda-cpp-git.spec - [[ -d $BUILDDIR ]] && rm -rf $BUILDDIR -rpmbuild --define "_sourcedir $(pwd)" -bb $SPECDIR/redpanda-cpp-git.spec +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 diff --git a/packages/fedora/redpanda-cpp-git.spec.in b/packages/fedora/redpanda-cpp-git.spec.in index 7886accf..992483e8 100644 --- a/packages/fedora/redpanda-cpp-git.spec.in +++ b/packages/fedora/redpanda-cpp-git.spec.in @@ -4,6 +4,7 @@ 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 @@ -19,6 +20,7 @@ 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} @@ -26,7 +28,7 @@ cd %{name} qmake-qt5 \ PREFIX=/usr \ XDG_ADAPTIVE_ICON=ON \ - "%{_sourcedir}/Red_Panda_CPP.pro" + "%{_builddir}/RedPanda-CPP/Red_Panda_CPP.pro" make %{_smp_mflags} %install diff --git a/packages/opensuse/01-in-docker.sh b/packages/opensuse/01-in-docker.sh index 7f5e8eeb..16a41ff4 100755 --- a/packages/opensuse/01-in-docker.sh +++ b/packages/opensuse/01-in-docker.sh @@ -5,10 +5,7 @@ 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 \ - gcc gcc-c++ rpm-build rpmdevtools git \ - glibc-devel-static \ - libqt5-qtbase-devel libqt5-qtsvg-devel libqt5-qttools-devel +zypper in -y git rpm-build rpmdevtools sudo rpmdev-setuptree cd $SOURCE_DIR diff --git a/packages/opensuse/buildrpm.sh b/packages/opensuse/buildrpm.sh index 9c4c339d..693b9875 100755 --- a/packages/opensuse/buildrpm.sh +++ b/packages/opensuse/buildrpm.sh @@ -3,11 +3,14 @@ set -xeuo pipefail SPECDIR=$(rpm --eval %{_specdir}) +SOURCEDIR=$(rpm --eval %{_sourcedir}) BUILDDIR=$(rpm --eval %{_builddir})/redpanda-cpp-git -VERSION=$(git describe --long --tags --always | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g') - -sed -s "s/__VERSION__/$VERSION/g" packages/opensuse/redpanda-cpp-git.spec.in >$SPECDIR/redpanda-cpp-git.spec - [[ -d $BUILDDIR ]] && rm -rf $BUILDDIR -rpmbuild --define "_sourcedir $(pwd)" -bb $SPECDIR/redpanda-cpp-git.spec +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 diff --git a/packages/opensuse/redpanda-cpp-git.spec.in b/packages/opensuse/redpanda-cpp-git.spec.in index 5d8662c9..a0ba9f0b 100644 --- a/packages/opensuse/redpanda-cpp-git.spec.in +++ b/packages/opensuse/redpanda-cpp-git.spec.in @@ -4,6 +4,7 @@ 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 @@ -19,6 +20,7 @@ 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} @@ -26,7 +28,7 @@ cd %{name} qmake-qt5 \ PREFIX=/usr \ XDG_ADAPTIVE_ICON=ON \ - "%{_sourcedir}/Red_Panda_CPP.pro" + "%{_builddir}/RedPanda-CPP/Red_Panda_CPP.pro" make %{_smp_mflags} %install diff --git a/tools/astyle/astyle_main.cpp b/tools/astyle/astyle_main.cpp index 4dcedb34..05f35f54 100644 --- a/tools/astyle/astyle_main.cpp +++ b/tools/astyle/astyle_main.cpp @@ -50,6 +50,7 @@ #include #include #include + #include #ifdef __VMS #include #include