2020-12-08 10:54:12 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-12-08 11:02:20 +01:00
|
|
|
os="$1"
|
2020-12-08 11:34:07 +01:00
|
|
|
webengine="$2"
|
2020-12-08 11:02:20 +01:00
|
|
|
|
2020-12-08 11:49:19 +01:00
|
|
|
# Determine OS.
|
2020-12-08 11:02:20 +01:00
|
|
|
if [[ "$os" == *"ubuntu"* ]]; then
|
|
|
|
echo "We are building for GNU/Linux on Ubuntu."
|
|
|
|
is_linux=true
|
2022-01-31 13:11:48 +05:00
|
|
|
prefix="AppDir/usr"
|
2020-12-08 11:02:20 +01:00
|
|
|
else
|
2021-11-16 06:39:21 +00:00
|
|
|
echo "We are building for macOS."
|
2020-12-08 11:02:20 +01:00
|
|
|
is_linux=false
|
2022-01-31 13:11:48 +05:00
|
|
|
prefix="RSS Guard.app"
|
2020-12-08 11:04:40 +01:00
|
|
|
fi
|
|
|
|
|
2020-12-08 11:34:07 +01:00
|
|
|
echo "OS: $os; WebEngine: $webengine"
|
2020-12-08 11:21:01 +01:00
|
|
|
|
|
|
|
# Prepare environment.
|
|
|
|
if [ $is_linux = true ]; then
|
2021-09-08 07:06:28 +02:00
|
|
|
sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-bionic -y
|
2020-12-08 11:21:01 +01:00
|
|
|
sudo apt-get update
|
2021-09-08 07:06:28 +02:00
|
|
|
|
2022-01-31 13:11:48 +05:00
|
|
|
sudo apt-get -qy install qt515tools qt515base qt515webengine qt515svg qt515multimedia
|
|
|
|
sudo apt-get -qy install cmake ninja-build openssl libssl-dev libgl1-mesa-dev gstreamer1.0-alsa gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-qt5 gstreamer1.0-pulseaudio
|
2020-12-08 11:30:45 +01:00
|
|
|
|
2021-09-08 07:06:28 +02:00
|
|
|
source /opt/qt515/bin/qt515-env.sh
|
2022-07-13 08:21:03 +02:00
|
|
|
|
|
|
|
BUILD_WITH_QT6="OFF"
|
2020-12-08 11:21:01 +01:00
|
|
|
else
|
|
|
|
pip3 install aqtinstall
|
2020-12-08 11:24:26 +01:00
|
|
|
|
|
|
|
QTPATH="$(pwd)/Qt"
|
2022-07-13 08:15:03 +02:00
|
|
|
QTVERSION="6.3.0"
|
2022-07-13 09:05:14 +02:00
|
|
|
QTBIN="$QTPATH/$QTVERSION/macos/bin"
|
2020-12-08 11:24:26 +01:00
|
|
|
|
|
|
|
echo "Qt bin directory is: $QTBIN"
|
|
|
|
echo "Qt will be installed to: $QTPATH"
|
|
|
|
|
2022-07-13 09:15:57 +02:00
|
|
|
aqt install-qt -O "$QTPATH" "mac" "desktop" "$QTVERSION" "clang_64" -m "qtwebengine" "qtwebchannel" "qtmultimedia" "qt5compat" "qtpositioning"
|
2022-01-31 13:11:48 +05:00
|
|
|
aqt install-tool -O "$QTPATH" "mac" "desktop" "tools_cmake"
|
|
|
|
aqt install-tool -O "$QTPATH" "mac" "desktop" "tools_ninja"
|
2020-12-08 11:24:26 +01:00
|
|
|
|
2022-07-13 09:05:14 +02:00
|
|
|
export QT_PLUGIN_PATH="$QTPATH/$QTVERSION/macos/plugins"
|
2022-01-31 13:11:48 +05:00
|
|
|
export PATH="$QTBIN:$QTPATH/Tools/CMake/bin:$QTPATH/Tools/Ninja:$PATH"
|
2022-07-13 08:21:03 +02:00
|
|
|
|
|
|
|
BUILD_WITH_QT6="ON"
|
2020-12-08 11:30:45 +01:00
|
|
|
fi
|
|
|
|
|
2022-01-31 13:11:48 +05:00
|
|
|
cmake --version
|
2020-12-10 07:31:07 +01:00
|
|
|
|
2020-12-08 11:30:45 +01:00
|
|
|
# Build application and package it.
|
2022-01-31 13:11:48 +05:00
|
|
|
git_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
|
2020-12-08 11:49:19 +01:00
|
|
|
git_revision=$(git rev-parse --short HEAD)
|
|
|
|
|
|
|
|
mkdir rssguard-build && cd rssguard-build
|
2022-07-20 13:06:31 +02:00
|
|
|
cmake .. -G Ninja -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DFORCE_BUNDLE_ICONS="ON" -DCMAKE_BUILD_TYPE="MinSizeRel" -DCMAKE_INSTALL_PREFIX="$prefix" -DREVISION_FROM_GIT="ON" -DBUILD_WITH_QT6="$BUILD_WITH_QT6" -DUSE_WEBENGINE="$webengine" -DFEEDLY_CLIENT_ID="$FEEDLY_CLIENT_ID" -DFEEDLY_CLIENT_SECRET="$FEEDLY_CLIENT_SECRET" -DGMAIL_CLIENT_ID="$GMAIL_CLIENT_ID" -DGMAIL_CLIENT_SECRET="$GMAIL_CLIENT_SECRET" -DINOREADER_CLIENT_ID="$INOREADER_CLIENT_ID" -DINOREADER_CLIENT_SECRET="$INOREADER_CLIENT_SECRET"
|
2022-01-31 13:11:48 +05:00
|
|
|
cmake --build .
|
|
|
|
cmake --install . --prefix "$prefix"
|
|
|
|
|
2020-12-08 11:30:45 +01:00
|
|
|
if [ $is_linux = true ]; then
|
2020-12-08 11:49:19 +01:00
|
|
|
# Obtain linuxdeployqt.
|
2022-01-31 13:11:48 +05:00
|
|
|
wget -qc https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
|
2020-12-08 11:49:19 +01:00
|
|
|
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
|
|
|
|
|
2021-09-08 02:18:28 -04:00
|
|
|
# Copy Gstreamer libs.
|
2021-09-08 09:12:35 +02:00
|
|
|
install -v -Dm755 "/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner" "AppDir/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
|
2021-09-08 02:18:28 -04:00
|
|
|
gst_executables="-executable=AppDir/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
|
|
|
|
|
2022-01-31 13:11:48 +05:00
|
|
|
for plugin in /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgst*.so; do
|
2021-09-08 02:55:44 -04:00
|
|
|
basen=$(basename "$plugin")
|
2021-09-08 09:12:35 +02:00
|
|
|
install -v -Dm755 "$plugin" "AppDir/usr/lib/gstreamer-1.0/$basen"
|
2021-09-08 02:55:44 -04:00
|
|
|
gst_executables="${gst_executables} -executable=AppDir/usr/lib/gstreamer-1.0/$basen"
|
2021-09-08 02:18:28 -04:00
|
|
|
done
|
|
|
|
|
2021-09-08 09:12:35 +02:00
|
|
|
echo "Gstream command line for AppImage is: $gst_executables"
|
|
|
|
|
2020-12-08 11:49:19 +01:00
|
|
|
# Create AppImage.
|
|
|
|
unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
|
2021-09-08 02:18:28 -04:00
|
|
|
./linuxdeployqt-continuous-x86_64.AppImage "./AppDir/usr/share/applications/com.github.rssguard.desktop" -bundle-non-qt-libs -no-translations $gst_executables
|
|
|
|
./linuxdeployqt-continuous-x86_64.AppImage "./AppDir/usr/share/applications/com.github.rssguard.desktop" -bundle-non-qt-libs -no-translations $gst_executables
|
2020-12-08 11:49:19 +01:00
|
|
|
|
2022-01-31 13:11:48 +05:00
|
|
|
if [[ "$webengine" == "ON" ]]; then
|
2020-12-08 11:49:19 +01:00
|
|
|
# Copy some NSS3 files to prevent WebEngine crashes.
|
|
|
|
cp /usr/lib/x86_64-linux-gnu/nss/* ./AppDir/usr/lib/ -v
|
|
|
|
fi
|
|
|
|
|
2021-09-08 02:18:28 -04:00
|
|
|
./linuxdeployqt-continuous-x86_64.AppImage "./AppDir/usr/share/applications/com.github.rssguard.desktop" -appimage -no-translations $gst_executables
|
2020-12-08 11:30:45 +01:00
|
|
|
|
2020-12-08 11:49:19 +01:00
|
|
|
# Rename AppImaage.
|
|
|
|
set -- R*.AppImage
|
|
|
|
imagename="$1"
|
|
|
|
|
2022-01-31 13:11:48 +05:00
|
|
|
if [[ "$webengine" == "ON" ]]; then
|
2020-12-08 11:49:19 +01:00
|
|
|
imagenewname="rssguard-${git_tag}-${git_revision}-linux64.AppImage"
|
|
|
|
else
|
|
|
|
imagenewname="rssguard-${git_tag}-${git_revision}-nowebengine-linux64.AppImage"
|
|
|
|
fi
|
|
|
|
else
|
2020-12-08 11:30:45 +01:00
|
|
|
# Fix .dylib linking.
|
2022-03-23 07:42:39 +01:00
|
|
|
otool -L "RSS Guard.app/Contents/MacOS/rssguard"
|
|
|
|
|
|
|
|
install_name_tool -add_rpath "@executable_path" "RSS Guard.app/Contents/MacOS/rssguard"
|
|
|
|
install_name_tool -add_rpath "@executable_path/../Frameworks" "RSS Guard.app/Contents/MacOS/rssguard"
|
2022-03-22 13:46:18 +01:00
|
|
|
|
2022-03-22 14:23:54 +01:00
|
|
|
otool -L "RSS Guard.app/Contents/MacOS/rssguard"
|
2022-03-23 07:42:39 +01:00
|
|
|
|
2022-03-22 14:58:09 +01:00
|
|
|
macdeployqt "./RSS Guard.app" -dmg
|
2020-12-08 11:30:45 +01:00
|
|
|
|
|
|
|
# Rename DMG.
|
|
|
|
set -- *.dmg
|
2020-12-08 11:49:19 +01:00
|
|
|
imagename="$1"
|
|
|
|
|
2022-02-02 08:52:54 +01:00
|
|
|
if [[ "$webengine" == "ON" ]]; then
|
2020-12-08 11:49:19 +01:00
|
|
|
imagenewname="rssguard-${git_tag}-${git_revision}-mac64.dmg"
|
|
|
|
else
|
|
|
|
imagenewname="rssguard-${git_tag}-${git_revision}-nowebengine-mac64.dmg"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
mv "$imagename" "$imagenewname"
|
2021-09-08 02:18:28 -04:00
|
|
|
ls
|