1
0
mirror of https://github.com/vcmi/vcmi.git synced 2026-05-22 09:55:17 +02:00

Merge pull request #7059 from Laserlicht/linux_conan

[1.7.4] appimage with conan
This commit is contained in:
Ivan Savenko
2026-03-14 20:19:59 +02:00
committed by GitHub
6 changed files with 69 additions and 13 deletions
+5 -3
View File
@@ -132,16 +132,18 @@ jobs:
os: ubuntu-24.04
upload: 1
preset: linux-gcc-release-appimage
conan_profile: linux-x64
conan_prebuilts: dependencies-linux-x64
extension: AppImage
before_install: linux_qt6.sh
artifact_platform: x86_64
- platform: linux-appimage-arm64
os: ubuntu-24.04-arm
upload: 1
preset: linux-gcc-release-arm64-appimage
conan_profile: linux-arm64
conan_prebuilts: dependencies-linux-arm64
extension: AppImage
before_install: linux_qt6.sh
artifact_platform: arm64
runs-on: ${{ matrix.os }}
@@ -366,7 +368,7 @@ jobs:
ARCH: ${{ matrix.artifact_platform }}
run: |
chmod +x CI/create_appimage.sh
CI/create_appimage.sh
CI/create_appimage.sh --use-conan
- name: Kill XProtect to work around CPack issue on macOS
if: ${{ startsWith(matrix.platform, 'mac') }}
+52 -4
View File
@@ -1,6 +1,15 @@
#!/bin/bash
set -e
# Parse arguments
USE_CONAN=0
for arg in "$@"; do
case "$arg" in
--use-conan) USE_CONAN=1 ;;
*) echo "Unknown argument: $arg"; exit 1 ;;
esac
done
# Define paths
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
REPO_ROOT=$(dirname "$SCRIPT_DIR")
@@ -82,14 +91,53 @@ fi
export VERSION
export UPD_INFO="gh-releases-zsync|vcmi|vcmi|continuous|VCMI-*$ARCH.AppImage.zsync"
if [ -z "$QMAKE" ]; then
if command -v qmake6 &> /dev/null; then
export QMAKE=qmake6
# Detect qmake
if [[ -z "$QMAKE" ]]; then
if [[ "$USE_CONAN" -eq 1 ]]; then
# --use-conan: require qmake from Conan2 cache, no system fallback
qtPackage='qt'
hexRegex='[[:xdigit:]]+'
qtPackageRevision=$(conan list --format=compact "$qtPackage/*:*" \
| egrep --only-matching "$qtPackage/[[:alnum:]._-]+#$hexRegex:$hexRegex" \
| head -n1)
qmakeDir="$(conan cache path "$qtPackageRevision")/bin"
CONAN_QMAKE="$qmakeDir/qmake"
if [[ -z "$qtPackageRevision" || ! -x "$CONAN_QMAKE" ]]; then
echo "Error: --use-conan set but no qmake found in Conan cache" >&2
exit 1
fi
export QMAKE="$CONAN_QMAKE"
echo "Using Conan Qt qmake: $QMAKE"
else
export QMAKE=qmake
# No Conan: use system Qt
if command -v qmake &>/dev/null; then
export QMAKE=$(command -v qmake)
echo "Using system Qt qmake: $QMAKE"
elif command -v qmake6 &>/dev/null; then
export QMAKE=$(command -v qmake6)
echo "Using system Qt6 qmake: $QMAKE"
else
echo "Error: No qmake found" >&2
exit 1
fi
fi
fi
# Some Conan-built shared libs (e.g. SDL2_mixer) have no RPATH/RUNPATH, so
# linuxdeploy's dependency resolver cannot locate their transitive deps
# (e.g. libopus.so.0). Adding all Conan lib directories to LD_LIBRARY_PATH
# makes them visible to linuxdeploy.
if [[ "$USE_CONAN" -eq 1 ]] && [[ -d "${HOME}/.conan2/p" ]]; then
CONAN_LIB_DIRS=$(find "${HOME}/.conan2/p" \( -name "*.so" -o -name "*.so.*" \) 2>/dev/null \
| xargs -r dirname 2>/dev/null | sort -u | paste -sd:)
export LD_LIBRARY_PATH="${CONAN_LIB_DIRS}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
echo "Added Conan lib dirs to LD_LIBRARY_PATH"
fi
# Run linuxdeploy
echo "Running linuxdeploy..."
download_tools
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
RELEASE_TAG="2026-03-03"
RELEASE_TAG="2026-03-11"
FILENAME="$1.txz"
DOWNLOAD_URL="https://github.com/vcmi/vcmi-dependencies/releases/download/$RELEASE_TAG/$FILENAME"
+6 -4
View File
@@ -109,22 +109,24 @@
"name": "linux-gcc-release-appimage",
"displayName": "GCC x86_64-pc-linux-gnu for appimage",
"description": "VCMI Linux GCC",
"inherits": "linux-release",
"inherits": ["linux-release", "build-with-conan"],
"cacheVariables": {
"CMAKE_C_COMPILER": "/usr/bin/gcc",
"CMAKE_CXX_COMPILER": "/usr/bin/g++",
"ENABLE_STATIC_LIBS": "ON"
"ENABLE_STATIC_LIBS": "ON",
"FORCE_BUNDLED_FL": "ON"
}
},
{
"name": "linux-gcc-release-arm64-appimage",
"displayName": "GCC aarch64-linux-gnu for appimage",
"description": "VCMI Linux GCC ARM64",
"inherits": "linux-release",
"inherits": ["linux-release", "build-with-conan"],
"cacheVariables": {
"CMAKE_C_COMPILER": "/usr/bin/gcc",
"CMAKE_CXX_COMPILER": "/usr/bin/g++",
"ENABLE_STATIC_LIBS": "ON"
"ENABLE_STATIC_LIBS": "ON",
"FORCE_BUNDLED_FL": "ON"
}
},
{
+4
View File
@@ -28,6 +28,10 @@ if(ANDROID)
set_target_properties(vcmiclient PROPERTIES
OUTPUT_NAME "vcmiclient_${ANDROID_ABI}" # required by Qt
)
# ffmpeg requires -Bsymbolic on 64-bit Android for assembler functions to compile
if(ANDROID_ABI STREQUAL "arm64-v8a" OR ANDROID_ABI STREQUAL "x86_64")
target_link_options(vcmiclient PRIVATE -Wl,-Bsymbolic)
endif()
else()
add_executable(vcmiclient ${clientapp_SRCS} ${clientapp_HEADERS})
vcmi_create_exe_shim(vcmiclient)