Skip to content

Commit

Permalink
failing macos build in [travis]
Browse files Browse the repository at this point in the history
  • Loading branch information
oxy86 committed Nov 28, 2024
1 parent 1c632a8 commit ff49c7a
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 85 deletions.
17 changes: 9 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ jobs:
env: FAILURES=true
osx_image: xcode14.2
if: tag IS present OR commit_message =~ /\[travis\]|\[ci\]/ AND commit_message !~ /\[skip osx\]/
addons:
homebrew:
packages:
- qt
- p7zip
- wget
- create-dmg
update: true
# addons:
# homebrew:
# packages:
# - qt
# - cmake
# - p7zip
# - wget
# - create-dmg
# update: true
exclude:
- os: osx
compiler: gcc
Expand Down
5 changes: 3 additions & 2 deletions scripts/travis_install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ elif [ "${TRAVIS_OS_NAME}" == "osx" ]; then
# Install Qt for macOS via brew and configure host environment
#
# echo "Installing Qt6 for macOS via brew..."
# brew install qt@6
# brew install qt
# echo "installing p7zip"
# brew install p7zip
# echo "installing create-dmg"
# brew install create-dmg
brew install qt cmake ninja brotli c-ares icu4c@76 pkgconf libnghttp2 autoconf automake libtool ca-certificates mpdecimal openssl@3 p7zip create-dmg
## Install npm appdmg if you want to create custom dmg files with it
# # npm install -g appdmg
## npm install -g appdmg
# echo "Running brew link to symlink various Qt binaries into /usr/local/bin etc so..."
# brew link --force qt@6
# Add Qt binaries to path
Expand Down
124 changes: 49 additions & 75 deletions scripts/travis_make_build_linux.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/bin/bash

set -e # Exit on any error
set -o pipefail # Ensure errors in pipelines are caught

echo "************************************************"
echo "* STAGE 'script': Building SocNetV for Linux *"
echo "************************************************"

# Check current directory
project_dir=$(pwd)
echo "Project dir is: ${project_dir}"
echo ""
echo "TRAVIS_OS_NAME = $TRAVIS_OS_NAME"
echo "TRAVIS_TAG = $TRAVIS_TAG"
echo "TRAVIS_COMMIT = $TRAVIS_COMMIT"
Expand All @@ -28,112 +30,84 @@ echo ""
echo "Checking TRAVIS_TAG to fix the VERSION..."
echo "If this is a tag, then version will be the tag, i.e. 3.1 or 3.1-dev"
echo "If this is not a tag, the version will include the LAST_COMMIT_SHORT, i.e. 3.1-beta-a0be9cd"
if [ ! -z "$TRAVIS_TAG" ] ; then
# If this is a tag, then version will be the tag, i.e. 2.6 or 2.6-beta
export VERSION=${TRAVIS_TAG}
else
# If this is not a tag, the we want version to be like "2.6-beta-a0be9cd"
export VERSION=${SOCNETV_VERSION}-${LAST_COMMIT_SHORT}
if [ ! -z "$TRAVIS_TAG" ]; then
export VERSION=${TRAVIS_TAG} # Use tag if available
else
export VERSION=${SOCNETV_VERSION}-${LAST_COMMIT_SHORT} # Use commit short hash if no tag
fi

echo "exported VERSION = ${VERSION}";

echo "This VERSION will be used by linuxdeployqt and macdeployqt"
echo "exported VERSION = ${VERSION}";

echo ""

if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
# source /opt/qt512/bin/qt512-env.sh

echo ""
echo "I will build a SocNetV AppImage for linux distributions..."
echo ""

echo "Building SocNetV AppImage for Linux..."

# System Information
lsb_release -a
echo "OpenSSL version: $(openssl version)"

echo ""
echo "openssl version: "
echo `openssl version`
echo ""

echo "Check output of 'which qmake6':"
echo "Checking qmake version..."
which qmake6

echo ""
echo "Check qmake6 -v:"
qmake6 -v

echo ""
echo "Running qmake6 now: "
qmake6 # default: all go to /usr

echo "Start building with 'make -j4'. Please wait..."
make -j4
# Running qmake and build with make
echo "Running qmake6 to configure project..."
qmake6 # default configuration for all targets
echo "Building with 'make -j$(nproc)' (using all available cores)..."
make -j$(nproc)

echo ""
echo "Building finished! "

echo ""
echo "Files in current directory: "
# Output build results
echo "Build finished! Files in current directory:"
find .

echo ""
echo "Attempting make install in appdir: "
make INSTALL_ROOT=appdir install;

echo ""
echo "SocNetV files installed in appdir: "
# Install to appdir
echo "Attempting make install in appdir..."
make INSTALL_ROOT=appdir install
echo "SocNetV files installed in appdir:"
find appdir/

echo ""
echo "Check SocNetV executable libraries:"
# Verify dependencies
echo "Checking SocNetV executable libraries:"
ldd appdir/usr/bin/socnetv

echo ""
echo "Copying .desktop file to ./appdir: "
# Copy application assets
echo "Copying .desktop and icon files..."
cp appdir/usr/share/applications/socnetv.desktop ./appdir
cp appdir/usr/share/pixmaps/socnetv.png .

echo ""
echo "Copying socnetv.png in current dir: "
cp appdir/usr/share/pixmaps/socnetv.png .

#echo ""
#echo "copying custom openssl libs to ./appdir/usr/bin..."
#cp /opt/openssl-1.1.1/lib/libssl.so.1.1 ./appdir/usr/bin/
#cp /opt/openssl-1.1.1/lib/libcrypto.so.1.1 ./appdir/usr/bin/

echo ""
echo "SocNetV files installed in appdir -- final: "
find appdir/


# Check contents of appdir
echo "SocNetV files installed in appdir -- final:"
find appdir/

echo ""
echo "Checking contents of /opt/qtXX/plugins: "
# Check Qt plugins
echo "Checking Qt plugins directory..."
find /opt/ | grep "/plugins" | grep qt
echo "Checking contents of /opt/: "
echo "Checking /opt directory for Qt:"
find /opt | grep qt

echo ""

# Download and run linuxdeployqt tool
echo "Downloading linuxdeployqt tool: "
wget --no-verbose "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
# echo "Downloading appimagetool tool (in GO): "
# wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)


echo ""
echo "Make executable the linuxdeployqt tool: "
# Make linuxdeployqt executable
echo "Making linuxdeployqt executable..."
chmod a+x linuxdeployqt*.AppImage
# chmod +x appimagetool-*.AppImage
unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH

echo ""
echo "Check SocNetV executable libraries (AGAIN):"
ldd appdir/usr/bin/socnetv

# export VERSION=... # linuxdeployqt uses this for naming the file
echo ""
# echo "Run the linuxdeployqt tool: "
unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH

# Run linuxdeployqt to bundle dependencies
echo "Running linuxdeployqt to create AppImage..."
./linuxdeployqt*.AppImage appdir/usr/share/applications/*.desktop -appimage -extra-plugins=iconengines,imageformats -qmake=/usr/bin/qmake6

# echo "Run the appimagetool: "
Expand All @@ -144,22 +118,22 @@ if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
# VERSION=1.0 ./appimagetool-*.AppImage ./Some.AppDir # turn AppDir into AppImage


echo ""
echo "Removing linuxdeployqt-continuous-x86_64.AppImage..."
# Clean up
echo "Cleaning up linuxdeployqt tool..."
rm linuxdeployqt-continuous-x86_64.AppImage

echo ""
echo "Check whether the SocNetV AppImage has been created..."
find . -type f -name "*AppImage"


elif [ "${TRAVIS_OS_NAME}" == "osx" ]; then
# nothing here, go away...
echo "Strange. I am running in macOS although I am a Linux build script :)"
else
exit 1
echo "Error: This script should be running on Linux, but detected TRAVIS_OS_NAME=${TRAVIS_OS_NAME}."
exit 1
fi


echo "Done!"

# always return zero
exit 0

0 comments on commit ff49c7a

Please sign in to comment.