Skip to content

Commit

Permalink
added test build for webos
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Dec 26, 2022
1 parent 48aa5cb commit 494efff
Show file tree
Hide file tree
Showing 19 changed files with 92 additions and 5 deletions.
43 changes: 42 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,47 @@ env:
BUILD_TYPE: Release

jobs:
build-webos:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'

- name: Install webOS CLI
run: sudo npm install -g @webosose/ares-cli

- name: Install Compatibility checker
run: sudo npm install -g @webosbrew/compat-checker

- name: Install webOS NDK
id: webos-ndk
uses: webosbrew/setup-webos-ndk-action@main

- name: Build
env:
TOOLCHAIN_FILE: ${{steps.webos-ndk.outputs.cmake-toolchain}}
run: ./tools/webos/easy_build.sh -DCMAKE_BUILD_TYPE=$BUILD_TYPE

- name: Compatibility Check
run: webosbrew-ipk-compat-checker --markdown --github-emoji --quiet dist/*.ipk >> $GITHUB_STEP_SUMMARY

- name: Add Commit Hash Suffix
shell: bash
working-directory: dist
run: for file in *.ipk ; do mv $file ${file//_arm/-${GITHUB_SHA:0:8}_arm} ; done

- uses: actions/upload-artifact@v3
with:
name: webos-snapshot
path: dist/*.ipk

build-raspi:
runs-on: ubuntu-20.04

Expand All @@ -26,7 +67,7 @@ jobs:

- name: Prepare Sysroot
id: pi-sysroot
uses: mariotaku/raspbian-sysroot-action@main
uses: mariotaku/raspbian-sysroot-action@v1.1
with:
packages: ${{github.workspace}}/deploy/raspbian/sysroot-packages.list

Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ pkg_check_modules(OPUS opus)

find_library(MBEDCRYPTO_LIBRARY mbedcrypto)

option(IHSPLAY_WIP_FEATURES "Enable Work-in-Progress Features" OFF)
set(IHSPLAY_FEATURE_RELMOUSE ON)

if ("$ENV{CROSS_COMPILE}" STREQUAL "arm-webos-linux-gnueabi-")
set(TARGET_WEBOS TRUE)
endif ()

if (NOT PROTOBUF_C_LIBRARIES OR NOT PROTOBUF_C_INCLUDEDIR)
option(BUILD_PROTOC "Disable protoc-c" OFF)
message("Using protobuf-c submodule")
set(BUILD_TESTS OFF)
option(BUILD_PROTOC "Disable protoc-c" OFF)
option(BUILD_TESTS "Disable protoc-c tests" OFF)
add_subdirectory(third_party/protobuf-c/build-cmake EXCLUDE_FROM_ALL)
unset(BUILD_TESTS)
set(PROTOBUF_C_FOUND 1)
set(PROTOBUF_C_LIBRARIES protobuf-c)
set(PROTOBUF_C_INCLUDEDIR ${CMAKE_SOURCE_DIR}/third_party/protobuf-c)
Expand Down
1 change: 1 addition & 0 deletions app/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

#define SS4S_MODULES_INI_PATH "@SS4S_MODULES_INI_PATH_RUNTIME@"
#cmakedefine01 IHSPLAY_IS_DEBUG
#cmakedefine01 IHSPLAY_WIP_FEATURES
#cmakedefine01 IHSPLAY_FEATURE_RELMOUSE
1 change: 1 addition & 0 deletions app/lvgl/lv_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
/* Use SDL draw backend */
#define LV_USE_GPU_SDL 1
#define LV_GPU_SDL_INCLUDE_PATH <SDL.h>
#define LV_GPU_SDL_CUSTOM_BLEND_MODE 0

/*Change the built in (v)snprintf functions*/
#define LV_SPRINTF_CUSTOM 1
Expand Down
2 changes: 1 addition & 1 deletion app/ui/launcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static lv_obj_t *create_obj(lv_fragment_t *self, lv_obj_t *container) {
lv_obj_set_style_width(actions, LV_PCT(50), 0);
lv_obj_add_event_cb(actions, focus_content, LV_EVENT_KEY, fragment);

#if IHSPLAY_IS_DEBUG
#if IHSPLAY_WIP_FEATURES
lv_obj_t *btn_settings = nav_btn_create(fragment, actions, BS_SYMBOL_GEAR_FILL);
lv_obj_add_event_cb(btn_settings, open_settings, LV_EVENT_CLICKED, fragment);
#endif
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions tools/webos/easy_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash

if [ ! -d app ] || [ ! -f CMakeLists.txt ]; then
echo "Please invoke this script in project root directory"
exit 1
fi

CMAKE_BIN=$(which cmake)
CPACK_BIN=$(which cpack)
if [ -z "${CMAKE_BINARY_DIR}" ]; then
CMAKE_BINARY_DIR=build
fi

if [ ! -x "$CMAKE_BIN" ]; then
echo "Please install CMake."
exit 1
fi

if [ -z "$CI" ]; then
echo "Update submodules"
git submodule update --init --recursive
fi

if [ -z "${TOOLCHAIN_FILE}" ]; then
echo "Setup environment"
. /opt/webos-sdk-x86_64/1.0.g/environment-setup-armv7a-neon-webos-linux-gnueabi
TOOLCHAIN_FILE=/opt/webos-sdk-x86_64/1.0.g/sysroots/x86_64-webossdk-linux/usr/share/cmake/OEToolchainConfig.cmake
fi

echo "Configure project"
if [ ! -d "${CMAKE_BINARY_DIR}" ]; then
mkdir -p "${CMAKE_BINARY_DIR}"
fi

BUILD_OPTIONS="-DTARGET_WEBOS=ON -DBUILD_TESTS=OFF"

# shellcheck disable=SC2068
$CMAKE_BIN -B"${CMAKE_BINARY_DIR}" -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN_FILE}" $BUILD_OPTIONS $@ || exit 1

$CMAKE_BIN --build "${CMAKE_BINARY_DIR}" -- -j "$(nproc)" || exit 1

echo "Build package"
cd "${CMAKE_BINARY_DIR}" || exit 1
$CPACK_BIN

0 comments on commit 494efff

Please sign in to comment.