From 6a88c7cbaa8fd328ec110dfb7a1c31cf16ca9cf4 Mon Sep 17 00:00:00 2001 From: iTrooz_ Date: Thu, 18 Aug 2022 23:03:31 +0200 Subject: [PATCH] git: Make sure Linux CI doesn't build ImHex twice (#689) * install deb package in a different folder than AppImage * added comment for Ubuntu cmake build * fixed typos * separate cmake build for deb and appimage --- .github/workflows/build.yml | 40 +++++++++++++++++++++---------------- CMakeLists.txt | 2 +- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ec79876a8528..efeddc801cff1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -187,7 +187,7 @@ jobs: with: submodules: recursive - - name: 📜 Restore cache + - name: 📜 Restore ccache uses: actions/cache@v3 with: path: | @@ -200,6 +200,7 @@ jobs: with: path: | build/CMakeCache.txt + build-appimage/CMakeCache.txt .flatpak-builder key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }} @@ -225,13 +226,14 @@ jobs: $HOME/.cargo/bin/rustup target add x86_64-unknown-linux-gnu $HOME/.cargo/bin/rustup default nightly + # Ubuntu cmake build - name: 🛠️ Build run: | mkdir -p build cd build CC=gcc-12 CXX=g++-12 cmake \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ - -DCMAKE_INSTALL_PREFIX="/usr" \ + -DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_FLAGS="-fuse-ld=lld" \ @@ -239,7 +241,7 @@ jobs: -DRUST_PATH="$HOME/.cargo/bin/" \ -DIMHEX_PATTERNS_PULL_MASTER=ON \ .. - make -j 4 install DESTDIR=AppDir + make -j 4 install DESTDIR=DebDir - name: 📜 Set version variable run: | @@ -256,27 +258,31 @@ jobs: - name: 📦 Bundle DEB run: | - cp -r build/DEBIAN build/AppDir - dpkg-deb -Zgzip --build build/AppDir - mv build/AppDir.deb imhex-${{env.IMHEX_VERSION}}.deb - rm -rf build/AppDir/DEBIAN + cp -r build/DEBIAN build/DebDir + dpkg-deb -Zgzip --build build/DebDir + mv build/DebDir.deb imhex-${{env.IMHEX_VERSION}}.deb + # AppImage cmake build - name: 🛠️ Reconfigure build for AppImage run: | - # Reconfigure CMake to include a flag needed for AppImage - # Other flags are kept from old configuration - - cd build - cmake \ - -DIMHEX_PLUGINS_IN_SHARE=ON \ - .. - - rm -rf AppDir + mkdir -p build-appimage + cd build-appimage + CC=gcc-12 CXX=g++-12 cmake \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ + -DCMAKE_INSTALL_PREFIX="/usr" \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_C_FLAGS="-fuse-ld=lld" \ + -DCMAKE_CXX_FLAGS="-fuse-ld=lld" \ + -DRUST_PATH="$HOME/.cargo/bin/" \ + -DIMHEX_PATTERNS_PULL_MASTER=ON \ + -DIMHEX_PLUGINS_IN_SHARE=ON \ + .. make -j 4 install DESTDIR=AppDir - name: 📦 Bundle AppImage run: | - cd build + cd build-appimage appimage-builder --recipe ../dist/AppImageBuilder.yml mv ImHex-AppImage-x86_64.AppImage ../imhex-${{env.IMHEX_VERSION}}.AppImage cd .. diff --git a/CMakeLists.txt b/CMakeLists.txt index 900b1915fd1d6..cc65f12d99ab8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.20) option(IMHEX_PLUGINS_IN_SHARE "Put the plugins in share/imhex/plugins instead of lib[..]/imhex/plugins" OFF) option(IMHEX_STRIP_RELEASE "Strip the release builds" ON) option(IMHEX_OFFLINE_BUILD "Enable offline build" OFF) -option(IMHEX_IGNORE_BAD_CLONE "Disabled the bad clone prevention checks" OFF) +option(IMHEX_IGNORE_BAD_CLONE "Disable the bad clone prevention checks" OFF) option(IMHEX_PATTERNS_PULL_MASTER "Download latest files from master branch of the ImHex-Patterns repo" OFF) option(IMHEX_IGNORE_BAD_COMPILER "Allow compiling with an unsupported compiler" OFF)