Add Linux builds to AppVeyor

Using Qt5.15.2, their 6.x installations are incomplete.
This commit is contained in:
Alejandro Martinez
2025-04-29 20:38:56 -03:00
parent 7e3d0a4350
commit 1694a2b660
4 changed files with 231 additions and 21 deletions

View File

@@ -4,8 +4,10 @@ skip_tags: true
image:
- Visual Studio 2019
- macos-monterey
- Ubuntu2204
environment:
APPVEYOR_SAVE_CACHE_ON_ERROR: true
GC_GOOGLE_CALENDAR_CLIENT_SECRET:
secure: hwjHTrSAMEbKd9PA+5x/zI4x5Uk4KQm1hdfZzkwiu8k=
GC_GOOGLE_DRIVE_CLIENT_ID:
@@ -57,13 +59,23 @@ init:
# Setup NSIS
- cmd: set PATH=%PATH%;C:\"Program Files (x86)"\NSIS
# macOS
# Setup QT 6.5
- sh: export QTDIR=$HOME/Qt/6.5/macos
- sh: export PATH=$HOME/Qt/6.5/macos/bin:$PATH
- sh: qmake --version
# Setup Xcode 14.2
- sh: sudo xcode-select -s /Applications/Xcode-14.2.0.app
# Linux / macOS
- sh: >-
if $CI_LINUX; then
export OS_NAME=linux
# Setup QT 5.15
export QTDIR=$HOME/Qt/5.15/gcc_64
export PATH=$HOME/Qt/5.15/gcc_64/bin:$PATH
qmake --version
else
export OS_NAME=macos
# Setup QT 6.5
export QTDIR=$HOME/Qt/6.5/macos
export PATH=$HOME/Qt/6.5/macos/bin:$PATH
qmake --version
# Setup Xcode 14.2
sudo xcode-select -s /Applications/Xcode-14.2.0.app
fi
cache:
- gc-ci-libs.zip -> appveyor.yml
@@ -137,8 +149,8 @@ install:
- cmd: echo GSL_INCLUDES=c:\tools\vcpkg\installed\x64-windows\include >> src\gcconfig.pri
- cmd: echo GSL_LIBS=-Lc:\tools\vcpkg\installed\x64-windows\lib -lgsl -lgslcblas >> src\gcconfig.pri
# macOS
- sh: appveyor/macos/install.sh
# Linux / macOS
- sh: bash appveyor/$OS_NAME/install.sh
before_build:
@@ -159,10 +171,12 @@ before_build:
# Avoid macro redefinition warnings
- cmd: echo DEFINES+=_MATH_DEFINES_DEFINED >> src\gcconfig.pri
# macOS
- sh: appveyor/macos/before_build.sh
# Linux / macOS
- sh: bash appveyor/$OS_NAME/before_build.sh
# Define GC version string, only for tagged builds
- sh: if $APPVEYOR_REPO_TAG; then echo DEFINES+=GC_VERSION=VERSION_STRING >> src/gcconfig.pri; fi
# Patch Secrets.h (Windows and macOS)
# Patch Secrets.h (Windows / Linux / macOS)
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_GOOGLE_CALENDAR_CLIENT_SECRET__', $env:GC_GOOGLE_CALENDAR_CLIENT_SECRET | Set-Content src\Core\Secrets.h
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_GOOGLE_DRIVE_CLIENT_ID__', $env:GC_GOOGLE_DRIVE_CLIENT_ID | Set-Content src\Core\Secrets.h
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_GOOGLE_DRIVE_CLIENT_SECRET__', $env:GC_GOOGLE_DRIVE_CLIENT_SECRET | Set-Content src\Core\Secrets.h
@@ -192,7 +206,7 @@ build_script:
- cmd: if not exist qwt\lib\qwt.lib jom -j1 sub-qwt
- cmd: jom -j4 sub-src
# macOS
# Linux / macOS
- sh: qmake build.pro -r QMAKE_CXXFLAGS_WARN_ON+="-Wno-unused-private-field -Wno-c++11-narrowing -Wno-deprecated-declarations -Wno-deprecated-register -Wno-nullability-completeness -Wno-sign-compare -Wno-inconsistent-missing-override" QMAKE_CFLAGS_WARN_ON+="-Wno-deprecated-declarations -Wno-sign-compare"
- sh: if test ! -f qwt/lib/libqwt.a; then make sub-qwt; fi
- sh: make -j4 sub-src
@@ -231,8 +245,8 @@ after_build:
- ps: if ($isWindows) { Set-AppveyorBuildVariable -Name 'PUBLISH_BINARIES' -Value false }
- ps: if ($isWindows -And $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED -Match "\[publish binaries\]") { Set-AppveyorBuildVariable -Name 'PUBLISH_BINARIES' -Value true }
# macOS
- sh: appveyor/macos/after_build.sh
# Linux / macOS
- sh: bash appveyor/$OS_NAME/after_build.sh
test_script:
@@ -242,16 +256,24 @@ test_script:
- ps: if ($isWindows) { CertUtil -hashfile GoldenCheetah_v3.7_x64.exe sha256 | Select-Object -First 2 | Add-Content GCversionWindows.txt }
- cmd: type GCversionWindows.txt
# macOS
- sh: src/GoldenCheetah.app/Contents/MacOS/GoldenCheetah --version 2>GCversionMacOS.txt
- sh: git log -1 >> GCversionMacOS.txt
- sh: shasum -a 256 GoldenCheetah_v3.7_x64.dmg | cut -f 1 -d ' ' >> GCversionMacOS.txt
- sh: cat GCversionMacOS.txt
# Linux / macOS
- sh: >-
if $CI_LINUX; then
./GoldenCheetah_v3.7_x64.AppImage --version 2>GCversionLinux.txt
git log -1 >> GCversionLinux.txt
shasum -a 256 GoldenCheetah_v3.7_x64.AppImage | cut -f 1 -d ' ' >> GCversionLinux.txt
cat GCversionLinux.txt
else
src/GoldenCheetah.app/Contents/MacOS/GoldenCheetah --version 2>GCversionMacOS.txt
git log -1 >> GCversionMacOS.txt
shasum -a 256 GoldenCheetah_v3.7_x64.dmg | cut -f 1 -d ' ' >> GCversionMacOS.txt
cat GCversionMacOS.txt
fi
artifacts:
# Windows
- path: GoldenCheetah_v3.7_x64.exe
name: GCinstallerWindows
name: GCwindowsInstaller
- path: GCversionWindows.txt
name: GCversionWindows
# macOS
@@ -259,6 +281,11 @@ artifacts:
name: GCmacOSpackage
- path: GCversionMacOS.txt
name: GCversionMacOS
# Linux
- path: GoldenCheetah_v3.7_x64.AppImage
name: GClinuxAppImage
- path: GCversionLinux.txt
name: GCversionLinux
deploy:
# deploy continuous builds to GitHub release

View File

@@ -0,0 +1,74 @@
#!/bin/bash
set -ev
### This script should be run from GoldenCheetah src directory after build
cd src
if [ ! -x ./GoldenCheetah ]
then echo "Build GoldenCheetah and execute from distribution src"; exit 1
fi
### Create AppDir and start populating
mkdir -p appdir
# Executable
cp GoldenCheetah appdir
# Desktop file
cat >appdir/GoldenCheetah.desktop <<EOF
[Desktop Entry]
Version=1.0
Type=Application
Name=GoldenCheetah
Comment=Cycling Power Analysis Software.
Exec=GoldenCheetah
Icon=gc
Categories=Science;Sports;
EOF
# Icon
cp Resources/images/gc.png appdir/
### Add vlc 3
mkdir appdir/lib
cp -r /usr/lib/x86_64-linux-gnu/vlc appdir/lib/vlc
sudo appdir/lib/vlc/vlc-cache-gen appdir/lib/vlc/plugins
### Download current version of linuxdeployqt
wget --no-verbose -c https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
### Deploy to appdir
./linuxdeployqt-continuous-x86_64.AppImage appdir/GoldenCheetah -verbose=2 -bundle-non-qt-libs -exclude-libs=libqsqlmysql,libqsqlpsql,libnss3,libnssutil3,libxcb-dri3.so.0 -unsupported-allow-new-glibc
# Add Python and core modules
wget --no-verbose https://github.com/niess/python-appimage/releases/download/python3.7/python3.7.17-cp37-cp37m-manylinux1_x86_64.AppImage
chmod +x python3.7.17-cp37-cp37m-manylinux1_x86_64.AppImage
./python3.7.17-cp37-cp37m-manylinux1_x86_64.AppImage --appimage-extract
rm -f python3.7.17-cp37-cp37m-manylinux1_x86_64.AppImage
export PATH="$(pwd)/squashfs-root/usr/bin:$PATH"
pip install --upgrade pip
pip install -q -r Python/requirements.txt
mv squashfs-root/usr appdir/usr
mv squashfs-root/opt appdir/opt
rm -rf squashfs-root
# Generate AppImage
wget --no-verbose "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
# Fix RPATH on QtWebEngineProcess
patchelf --set-rpath '$ORIGIN/../lib' appdir/libexec/QtWebEngineProcess
chmod a+x appimagetool-x86_64.AppImage
./appimagetool-x86_64.AppImage appdir
### Cleanup
rm linuxdeployqt-continuous-x86_64.AppImage
rm appimagetool-x86_64.AppImage
rm -rf appdir
if [ ! -x ./GoldenCheetah*.AppImage ]
then echo "AppImage not generated, check the errors"; exit 1
fi
echo "Renaming AppImage file to version number ready for deploy"
mv GoldenCheetah*.AppImage ../GoldenCheetah_v3.7_x64.AppImage
exit

View File

@@ -0,0 +1,49 @@
#!/bin/bash
set -ev
cp qwt/qwtconfig.pri.in qwt/qwtconfig.pri
cp src/gcconfig.pri.in src/gcconfig.pri
# required to use bison version higher than 3.7
sed -i "s|#\(QMAKE_MOVE = cp.*\)|\1|" src/gcconfig.pri
# make a release build
sed -i "s|#\(CONFIG += release.*\)|\1 static|" src/gcconfig.pri
sed -i "s|^#QMAKE_CXXFLAGS|QMAKE_CXXFLAGS|" src/gcconfig.pri
# Enable -lz
sed -i "s|^#LIBZ_LIBS|LIBZ_LIBS|" src/gcconfig.pri
# ICAL
sed -i "s|#\(ICAL_INSTALL =.*\)|\1 /usr|" src/gcconfig.pri
# LIBUSB
sed -i "s|#\(LIBUSB_INSTALL =\).*|\1 /usr/local|" src/gcconfig.pri
sed -i "s|#\(LIBUSB_LIBS =.*\)|\1 -lusb-1.0 -ldl -ludev|" src/gcconfig.pri
sed -i "s|#\(LIBUSB_USE_V_1 = true.*\)|\1|" src/gcconfig.pri
# VLC & VIDEO
sed -i "s|#\(VLC_INSTALL =.*\)|\1 /usr|" src/gcconfig.pri
sed -i "s|#\(VLC_LIBS =.*\)|\1 -lvlc|" src/gcconfig.pri
sed -i "s|\(DEFINES += GC_VIDEO_NONE.*\)|#\1 |" src/gcconfig.pri
sed -i "s|#\(DEFINES += GC_VIDEO_VLC.*\)|\1|" src/gcconfig.pri
# HTTP Server
sed -i "s|^#HTPATH|HTPATH|" src/gcconfig.pri
# R
sed -i "s|#\(DEFINES += GC_WANT_R.*\)|\1|" src/gcconfig.pri
# Enable CloudDB
sed -i "s|^#CloudDB|CloudDB|" src/gcconfig.pri
# D2XX
sed -i "s|#\(D2XX_INCLUDE =.*\)|\1 ../D2XX/release|" src/gcconfig.pri
# SAMPLERATE
sed -i "s|#\(SAMPLERATE_INSTALL =\).*|\1 /usr|" src/gcconfig.pri
# SRMIO
sed -i "s|#\(SRMIO_INSTALL =.*\)|\1 /usr/local|" src/gcconfig.pri
# Python
echo DEFINES += GC_WANT_PYTHON >> src/gcconfig.pri
echo PYTHONINCLUDES = -I/usr/include/python3.7 >> src/gcconfig.pri
echo PYTHONLIBS = -L/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu -lpython3.7m >> src/gcconfig.pri
# GSL
echo GSL_LIBS = -lgsl -lgslcblas -lm >> src/gcconfig.pri
# TrainerDay Query API
echo DEFINES += GC_WANT_TRAINERDAY_API >> src/gcconfig.pri
echo DEFINES += GC_TRAINERDAY_API_PAGESIZE=25 >> src/gcconfig.pri
cat src/gcconfig.pri
# update translations
lupdate src/src.pro
exit

60
appveyor/linux/install.sh Normal file
View File

@@ -0,0 +1,60 @@
#!/bin/bash
set -ev
sudo apt-get update -qq
sudo apt-get install -qq flex libpulse-dev
sudo apt-get install -qq libglu1-mesa-dev
sudo apt-get install -qq libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt-get install -qq libsamplerate0-dev
sudo apt-get install -qq libical-dev
# Add VLC 3
sudo apt-get install -y vlc libvlc-dev libvlccore-dev
# R 4.0
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository -y "deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/"
sudo apt-get update -qq
sudo apt-get install -qq r-base-dev
R --version
# D2XX - refresh cache if folder is empty
if [ -z "$(ls -A D2XX)" ]; then
mkdir -p D2XX
wget --no-verbose https://ftdichip.com/wp-content/uploads/2022/07/libftd2xx-x86_64-1.4.27.tgz
tar xf libftd2xx-x86_64-1.4.27.tgz -C D2XX
fi
# SRMIO
git clone https://github.com/rclasen/srmio.git
cd srmio
sh genautomake.sh
./configure --disable-shared --enable-static
make --silent -j3
sudo make install
cd ..
# LIBUSB
sudo apt-get install -qq libusb-1.0-0-dev libudev-dev
# Add Python 3.7 and SIP
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update -qq
sudo apt-get install -qq python3.7-dev python3.7-distutils
python3.7 --version
wget --no-verbose https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.8/sip-4.19.8.tar.gz
tar xf sip-4.19.8.tar.gz
cd sip-4.19.8
python3.7 configure.py --incdir=/usr/include/python3.7
make
sudo make install
cd ..
# GSL
sudo apt-get -qq install libgsl-dev
# Install fuse2 required to run older AppImages, and patchelf to fix QtWebEngineProcess
sudo add-apt-repository -y universe
sudo apt install libfuse2 patchelf
exit