Skip to content

Commit

Permalink
Merge pull request #234 from Stivius/appimage_package
Browse files Browse the repository at this point in the history
Appimage package
  • Loading branch information
dasgarner committed Jan 6, 2021
2 parents b1ae057 + f179e0c commit 3717675
Show file tree
Hide file tree
Showing 24 changed files with 354 additions and 73 deletions.
176 changes: 176 additions & 0 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
name: AppImage packaging

on:
push:
branches:
- master
release:
types:
- published

jobs:
test:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Installing main dependencies
run: |
sudo apt-get update
sudo apt-get -y install software-properties-common apt-transport-https ca-certificates libglibmm-2.4-dev libssl-dev
sudo apt-get -y install gnupg curl wget unzip libgtkmm-3.0-dev libwebkitgtk-3.0-dev libxss-dev
sudo apt-get -y install gnupg curl wget unzip libgtkmm-3.0-dev libwebkitgtk-3.0-dev libxss-dev
- name: Installing newer boost
run: |
sudo add-apt-repository ppa:mhier/libboost-latest
sudo apt-get update
sudo apt-get install -y libboost1.70-dev
- name: Installing newer zmq
run: |
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/xUbuntu_18.04/ /' > /etc/apt/sources.list.d/network:messaging:zeromq:release-stable.list"
wget -nv https://download.opensuse.org/repositories/network:messaging:zeromq:release-stable/xUbuntu_18.04/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo apt-get update
sudo apt-get install -y libzmq3-dev
- name: Installing newer gcc-8
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y g++-8
- name: Installing newer cmake
run: |
wget -nv https://apt.kitware.com/keys/kitware-archive-latest.asc -O Release.key
sudo apt-key add - < Release.key
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
sudo apt-get update
sudo apt-get install -y cmake
- name: Installing cryptopp
run: |
curl -o cryptopp.tar.gz -SL https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_1_0.tar.gz
curl -o cryptopp_pem.zip -SL https://github.com/noloader/cryptopp-pem/archive/095f08ff2ef9bca7b81036a59f2395e4f08ce2e8.zip
tar -zxvf cryptopp.tar.gz
unzip -a cryptopp_pem.zip
cp -r cryptopp-pem-095f08ff2ef9bca7b81036a59f2395e4f08ce2e8/. cryptopp-CRYPTOPP_8_1_0
cd cryptopp-CRYPTOPP_8_1_0
make -j4
sudo make install
- name: Installing spdlog
run: |
curl -o spdlog.tar.gz -SL https://github.com/gabime/spdlog/archive/v1.4.1.tar.gz
tar -zxvf spdlog.tar.gz
cd spdlog-1.4.1
cmake . -DCMAKE_BUILD_TYPE=Release
make -j4
sudo make install
- name: Installing gtest
run: |
curl -o spdlog.tar.gz -SL https://codeload.github.com/google/googletest/tar.gz/release-1.8.1
tar -zxvf spdlog.tar.gz
cd googletest-release-1.8.1
cmake . -DCMAKE_BUILD_TYPE=Release
make -j4
sudo make install
- name: Installing gstreamer dependencies
run: |
sudo apt install -y autopoint bison yasm flex gettext liborc-0.4-dev libpulse-dev libva-dev libfribidi-dev libxv-dev
sudo apt install -y libtag1-dev libwavpack-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev
- name: Installing gstreamer
run: |
git clone https://github.com/GStreamer/gstreamer.git
cd gstreamer
git checkout 1.16.2
./autogen.sh --disable-gtk-doc
make -j4
sudo make install
- name: Installing gst-plugins-base
run: |
git clone https://github.com/GStreamer/gst-plugins-base.git
cd gst-plugins-base
git checkout 1.16.2
./autogen.sh --disable-gtk-doc
make -j4
sudo make install
- name: Installing gst-libav
run: |
git clone https://github.com/GStreamer/gst-libav.git
cd gst-libav
git checkout 1.16.2
./autogen.sh --disable-gtk-doc
make -j4
sudo make install
- name: Installing gst-plugins-good
run: |
git clone https://github.com/GStreamer/gst-plugins-good.git
cd gst-plugins-good
git checkout 1.16.2
./autogen.sh --disable-gtk-doc
make -j4
sudo make install
- name: Update ldconfig cache
run: |
ldd /usr/local/lib/gstreamer-1.0/libgstopengl.so
sudo ldconfig
ldd /usr/local/lib/gstreamer-1.0/libgstopengl.so
- name: Building player
run: |
CXX=g++-8 CC=gcc-8 cmake player -Bbuild -DAPP_ENV=AppImage -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
cd build
make -j4
make install DESTDIR=AppDir
- name: Installing linuxdeploy and linuxdeploy-plugin-gstreamer
run: |
wget -c https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
git clone https://github.com/Stivius/linuxdeploy-plugin-gstreamer
cp linuxdeploy-plugin-gstreamer/linuxdeploy-plugin-gstreamer.sh .
./linuxdeploy-x86_64.AppImage --list-plugins
- name: Running linuxdeploy
env:
VERSION: 1_8
GSTREAMER_PLUGINS_DIR: /usr/local/lib/gstreamer-1.0
GSTREAMER_HELPERS_DIR: /usr/local/libexec/gstreamer-1.0
run: |
./linuxdeploy-x86_64.AppImage --appdir build/AppDir --plugin gstreamer --output appimage
tar czvf xibo_player.tar.gz Xibo_Player-1_8-x86_64.AppImage
- name: Getting short SHA commit
id: short-sha
if: github.event_name == 'push'
uses: benjlevesque/[email protected]
with:
length: 7
- name: Create Pre-Release
if: github.event_name == 'push'
id: create_prerelease
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: edge-${{ steps.short-sha.outputs.sha }}
release_name: edge-${{ steps.short-sha.outputs.sha }}
draft: false
prerelease: true
- name: Upload Pre-Release Asset
if: github.event_name == 'push'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_prerelease.outputs.upload_url }}
asset_path: ./xibo_player.tar.gz
asset_name: xibo_player.tar.gz
asset_content_type: application/gzip
- name: Get Release URL
if: github.event_name == 'release'
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload Release Asset
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./xibo_player.tar.gz
asset_name: xibo_player.tar.gz
asset_content_type: application/gzip
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
*.autosave
*.txt.user
xibo-*.snap*
*.AppImage*
snap
gcov
build*
WORK
root
pch.py
*.json
commits_config
third_party
snapcraft.login
41 changes: 31 additions & 10 deletions player/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.14.1)

project(player)
project(xibo-player)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -11,10 +11,11 @@ pkg_check_modules(GTKMM REQUIRED gtkmm-3.0>=3.22.0)
pkg_check_modules(GLIBMM REQUIRED glibmm-2.4>=2.56.0)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/)
set(CMAKE_TESTS_DIRECTORY ${CMAKE_BINARY_DIR}/bin/tests/)
set(CMAKE_TESTS_DIRECTORY ${CMAKE_BINARY_DIR}/tests)

set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
add_compile_options(
-static-libstdc++ -pthread -Wall -Wno-parentheses -Wno-cast-function-type -W -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings
-pthread -Wall -Wno-parentheses -Wno-cast-function-type -W -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings
"$<$<CONFIG:RELEASE>:-O2>"
"$<$<CONFIG:DEBUG>:-g3;-O0>"
)
Expand All @@ -26,10 +27,18 @@ add_compile_definitions(
BOOST_STACKTRACE_USE_BACKTRACE
)

option(SNAP_BUILD "Use SNAP environment during build" OFF)
if(SNAP_BUILD)
set(APP_ENV "" CACHE STRING "Player environment (SNAP/AppImage)")
if("${APP_ENV}" STREQUAL "SNAP")
message("Build will be done for SNAP environment")
set(SNAP_BUILD ON)
add_compile_definitions(SNAP_ENABLED)
endif(SNAP_BUILD)
elseif("${APP_ENV}" STREQUAL "AppImage")
message("Build will be done for AppImage environment")
set(APPIMAGE_BUILD ON)
add_compile_definitions(APPIMAGE_ENABLED)
else()
message("Build will be done for custom environment")
endif()

option(GTK_UI "Use GTK library for UI" ON)
if(GTK_UI)
Expand All @@ -56,10 +65,22 @@ target_link_libraries(${PROJECT_NAME}
backtrace
)

configure_file(ui.glade ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ui.glade COPYONLY)
configure_file(splash.jpg ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/splash.jpg COPYONLY)
configure_file(snap_run.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/snap_run.sh COPYONLY)
install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DESTINATION bin USE_SOURCE_PERMISSIONS)
if(SNAP_BUILD)
install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DESTINATION bin USE_SOURCE_PERMISSIONS)
install(FILES resources/ui.glade resources/splash.jpg DESTINATION share/xibo-player)
install(
FILES snap_run.sh
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
DESTINATION bin
)
elseif(APPIMAGE_BUILD)
install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DESTINATION bin USE_SOURCE_PERMISSIONS)
install(FILES resources/ui.glade resources/splash.jpg DESTINATION share/xibo-player)
install(FILES resources/xibo-player.desktop DESTINATION share/applications)
install(FILES resources/xibo-player.png DESTINATION share/icons/hicolor/512x512/apps)
else()
install(FILES resources/ui.glade resources/splash.jpg DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif()

enable_testing()

Expand Down
2 changes: 1 addition & 1 deletion player/XiboApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ GeneralInfo XiboApp::collectGeneralInfo()
info.cmsAddress = cmsSettings_.address();
info.resourcesPath = cmsSettings_.resourcesPath();
info.codeVersion = AppConfig::codeVersion();
info.projectVersion = AppConfig::version();
info.projectVersion = AppConfig::releaseVersion();
info.screenShotInterval = playerSettings_.screenshotInterval();
info.displayName = playerSettings_.displayName();
info.windowWidth = mainWindow_->width();
Expand Down
2 changes: 1 addition & 1 deletion player/cms/CollectionInterval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void CollectionInterval::collectNow()
Log::debug("[CollectionInterval] Started");

auto registerDisplayResult =
xmdsSender_.registerDisplay(AppConfig::codeVersion(), AppConfig::version(), "Display").get();
xmdsSender_.registerDisplay(AppConfig::codeVersion(), AppConfig::releaseVersion(), "Display").get();
onDisplayRegistered(registerDisplayResult);
});
}
Expand Down
2 changes: 1 addition & 1 deletion player/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project(common)

find_package(Boost 1.70 REQUIRED system thread filesystem date_time)
find_package(Boost 1.70 EXACT REQUIRED system thread filesystem date_time)

# TODO move to utils
add_library(${PROJECT_NAME}
Expand Down
2 changes: 1 addition & 1 deletion player/common/crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ target_link_libraries(${PROJECT_NAME}
config
fs
logger
Boost::headers
Boost::boost
${CRYPTOPP}
${OPENSSL_LINK_LIBRARIES}
)
Expand Down
2 changes: 1 addition & 1 deletion player/common/system/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ add_library(${PROJECT_NAME}

target_link_libraries(${PROJECT_NAME}
crypto
Boost::headers
Boost::boost
${DBUS_LINK_LIBRARIES}
)

Expand Down
2 changes: 1 addition & 1 deletion player/common/types/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ add_library(${PROJECT_NAME}

target_link_libraries(${PROJECT_NAME}
fs
Boost::headers
Boost::boost
)

add_subdirectory(tests)
Loading

0 comments on commit 3717675

Please sign in to comment.