Skip to content

Commit

Permalink
Modify for HyperHDR
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxuser committed May 12, 2022
1 parent cb96b57 commit 4908695
Show file tree
Hide file tree
Showing 21 changed files with 5,445 additions and 5,223 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"lib/**",
"node_modules/**",
"dist/**",
"hyperion.ng/**",
"hyperhdr/**",
"hyperhdr-repo/**",
"service/**",
"tools/**"
],
Expand Down
120 changes: 38 additions & 82 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,45 @@ env:
TOOLCHAIN_DIR: /opt/arm-webos-linux-gnueabi_sdk-buildroot
TOOLCHAIN_ENV_FILE: /opt/arm-webos-linux-gnueabi_sdk-buildroot/environment-setup
TOOLCHAIN_FILE: /opt/arm-webos-linux-gnueabi_sdk-buildroot/share/buildroot/toolchainfile.cmake
BUILD_DIR_NATIVE: build-x86x64
BUILD_DIR_CROSS: build-cross
BUILD_DIR: build

CCACHE_DIR_NATIVE: .ccache-build-x86x64
CCACHE_DIR_CROSS: .ccache-build-cross
CCACHE_CACHE_DIR: .ccache-build
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 600M

jobs:
build_hyperion_ng:
build_hyperhdr:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./hyperion.ng
working-directory: ./hyperhdr-repo

steps:
- uses: actions/checkout@v3
with:
repository: hyperion-project/hyperion.ng
repository: awawa-dev/HyperHDR
ref: master
path: hyperion.ng
path: hyperhdr-repo
submodules: recursive
fetch-depth: 0

- name: Patch sources (force link w/ librt)
run: sed -i -e 's/hidapi-libusb)$/rt hidapi-libusb)/g w /dev/stdout' libsrc/leddevice/CMakeLists.txt
run: sed -i -e 's/ssdp$/rt ssdp/g w /dev/stdout' sources/leddevice/CMakeLists.txt

- name: Restore/Cache build directories
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/${{ env.CCACHE_DIR_NATIVE }}
${{ github.workspace }}/${{ env.CCACHE_DIR_CROSS }}
${{ github.workspace }}/${{ env.CCACHE_CACHE_DIR }}
key: ccache-${{ runner.os }}-${{github.run_id}}
restore-keys: |
ccache-${{ runner.os }}
- name: Create build directories
run: |
mkdir -p ./${{ env.BUILD_DIR_NATIVE }}
mkdir -p ./${{ env.BUILD_DIR_CROSS }}
mkdir -p ./${{ env.BUILD_DIR }}
- name: Download and unpack toolchain
working-directory: /opt
Expand All @@ -67,78 +63,38 @@ jobs:
- name: Install native dependencies
env:
apt_deps: ccache git cmake build-essential qtbase5-dev libqt5serialport5-dev libqt5sql5-sqlite libqt5svg5-dev libqt5x11extras5-dev python3-dev libxcb-image0-dev libxcb-util0-dev libxcb-shm0-dev libxcb-render0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libturbojpeg0-dev libssl-dev libmbedtls-dev
apt_deps: ccache git cmake build-essential flatbuffers-compiler
run: |
sudo apt update
sudo apt install -y ${{ env.apt_deps }}
- name: Build native
- name: Build (webos arm)
env:
CCACHE_DIR: ${{ github.workspace }}/${{ env.CCACHE_DIR_NATIVE }}
CCACHE_DIR: ${{ github.workspace }}/${{ env.CCACHE_CACHE_DIR }}
run: |
pushd ./${{ env.BUILD_DIR_NATIVE }}
pushd ./${{ env.BUILD_DIR }}
cmake .. \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_FLATBUF_SERVER=OFF \
-DENABLE_DISPMANX=OFF \
-DENABLE_FB=OFF \
-DPLATFORM=linux \
-DENABLE_SPIDEV=OFF \
-DENABLE_V4L2=OFF \
-DENABLE_X11=OFF \
-DENABLE_XCB=OFF \
-DENABLE_BOBLIGHT_SERVER=OFF \
-DENABLE_PIPEWIRE=OFF \
-DENABLE_WS281PWM=OFF \
-DENABLE_AVAHI=OFF \
-DENABLE_SOUNDCAPLINUX=OFF \
-DENABLE_CEC=OFF \
-DENABLE_DEV_NETWORK=OFF \
-DENABLE_DEV_SERIAL=OFF \
-DENABLE_DEV_TINKERFORGE=OFF \
-DENABLE_DEV_USB_HID=OFF \
-DENABLE_EFFECTENGINE=OFF \
-DENABLE_REMOTE_CTL=OFF \
-DENABLE_QT=OFF \
-DENABLE_FORWARDER=OFF \
-DENABLE_DEV_SPI=OFF \
-DENABLE_MDNS=OFF \
-DENABLE_FLATBUF_CONNECT=ON \
-DENABLE_PROTOBUF_SERVER=OFF \
-Wno-dev
make
popd
- name: Build cross (webos arm)
env:
CCACHE_DIR: ${{ github.workspace }}/${{ env.CCACHE_DIR_CROSS }}
run: |
pushd ./${{ env.BUILD_DIR_CROSS }}
cmake .. \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \
-DCMAKE_BUILD_TYPE=Release \
-DPLATFORM=rpi \
-DHYPERION_LIGHT=ON \
-DENABLE_QT=OFF \
-DENABLE_EFFECTENGINE=OFF \
-DENABLE_JSONCHECKS=OFF \
-DENABLE_DEV_SERIAL=ON \
-DENABLE_DEV_USB_HID=ON \
-DENABLE_DEV_WS281XPWM=OFF \
-DENABLE_DEV_TINKERFORGE=ON \
-DENABLE_MDNS=OFF \
-DENABLE_DEPLOY_DEPENDENCIES=OFF \
-DENABLE_BOBLIGHT_SERVER=ON \
-DENABLE_FLATBUF_SERVER=ON \
-DENABLE_PROTOBUF_SERVER=OFF \
-DENABLE_FORWARDER=ON \
-DENABLE_FLATBUF_CONNECT=ON \
-DIMPORT_FLATC=${GITHUB_WORKSPACE}/hyperion.ng/${BUILD_DIR_NATIVE}/flatc_export.cmake
-DENABLE_PROTOBUF=OFF
make
popd
- name: Copy built binaries to release/
run: |
mkdir ./release
cp -r ./${{ env.BUILD_DIR_CROSS }}/bin/* ./release/
cp -r ./${{ env.BUILD_DIR }}/bin/* ./release/
find ./release
- name: Copy dependencies to release/
Expand All @@ -156,13 +112,13 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: hyperion.ng-build
path: ${{ github.workspace }}/hyperion.ng/release/*
name: hyperhdr-build
path: ${{ github.workspace }}/hyperhdr-repo/release/*
if-no-files-found: error

build_ipk:
runs-on: ubuntu-latest
needs: build_hyperion_ng
needs: build_hyperhdr

steps:
- uses: actions/checkout@v1
Expand All @@ -171,8 +127,8 @@ jobs:

- uses: actions/download-artifact@v3
with:
name: hyperion.ng-build
path: hyperion.ng-build
name: hyperhdr-build
path: hyperhdr-build

- name: Display structure of downloaded files
run: ls -R
Expand Down Expand Up @@ -222,31 +178,31 @@ jobs:
popd
cp -r ./service/build/dist/* ./dist/service/
- name: Copy hyperion.ng into dist/service/hyperion
- name: Copy hyperhdr into dist/service/hyperhdr
run: |
ls -R
mkdir -p ./dist/service/hyperion
cp -r ./hyperion.ng-build/* ./dist/service/hyperion/
mkdir -p ./dist/service/hyperhdr
cp -r ./hyperhdr-build/* ./dist/service/hyperhdr/
ls -R
- name: Ensure executables +x
run: |
chmod +x ./dist/service/autostart.sh
chmod +x ./dist/service/loader_service
chmod +x ./dist/service/start_hyperiond
chmod +x ./dist/service/start_hyperhdr
chmod +x ./dist/service/hyperion/hyperiond
chmod +x ./dist/service/hyperion/hyperion-remote
chmod +x ./dist/service/hyperion/flatc
chmod +x ./dist/service/hyperion/flathash
chmod +x ./dist/service/hyperhdr/hyperhdr
chmod +x ./dist/service/hyperhdr/hyperhdr-remote
chmod +x ./dist/service/hyperhdr/flatc
chmod +x ./dist/service/hyperhdr/flathash
- run: npm run package
- run: npm run gen-manifest

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: hyperion.ng-ipk
name: hyperhdr-ipk
path: |
${{github.workspace}}/*.ipk
Expand All @@ -259,7 +215,7 @@ jobs:
title: "Development Build"
files: |
${{github.workspace}}/*.ipk
${{github.workspace}}/org.webosbrew.hyperion.ng.loader.manifest.json
${{github.workspace}}/org.webosbrew.hyperhdr.loader.manifest.json
- uses: marvinpinto/action-automatic-releases@latest
if: "startsWith(github.ref, 'refs/tags/v')"
Expand All @@ -269,4 +225,4 @@ jobs:
title: ${{ github.ref_name }}
files: |
${{github.workspace}}/*.ipk
${{github.workspace}}/org.webosbrew.hyperion.ng.loader.manifest.json
${{github.workspace}}/org.webosbrew.hyperhdr.loader.manifest.json
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ build/
node_modules/
dist/
.enyocache
hyperion/
hyperion.ng/
hyperhdr-repo/
hyperhdr/
**/*.ipk
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hyperion.NG for WebOS
# HyperHDR for WebOS

Binaries are ready to install from [Homebrew Channel](https://repo.webosbrew.org/apps/org.webosbrew.hyperion.ng.loader)
Binaries are ready to install from [Homebrew Channel](https://repo.webosbrew.org/apps/org.webosbrew.hyperhdr.loader)

## Requirements

Expand All @@ -12,22 +12,24 @@ Binaries are ready to install from [Homebrew Channel](https://repo.webosbrew.org

## Build

Build hyperion.ng: `./build_hyperion_ng.sh`
Build hyperhdr: `./build_hyperhdr.sh`

Build webOS frontend/service: `./build.sh`

Both scripts take an environment variable `TOOLCHAIN_DIR`, defaulting to: `$HOME/arm-webos-linux-gnueabi_sdk-buildroot`

To provide an individual path, call `export TOOLCHAIN_DIR=/your/toolchain/path` before executing respective scripts.

`build_hyperion_ng.sh` also takes two other environment variables:
`build_hyperhdr.sh` also takes two other environment variables:

- `HYPERION_NG_REPO`
- `HYPERION_NG_BRANCH`
- `HYPERHDR_REPO`
- `HYPERHDR_BRANCH`

## References

Ambient lighting service/daemon: [Hyperion.NG](https://github.com/hyperion-project/hyperion.ng)
[Hyperion.NG](https://github.com/hyperion-project/hyperion.ng)

[HyperHDR](https://github.com/awawa-dev/HyperHDR)

Video grabber of webOS: [hyperion-webos](https://github.com/webosbrew/hyperion-webos)

Expand All @@ -41,4 +43,5 @@ Frontend of Video grabber hyperion-webos: [piccap](https://github.com/TBSniller/
@Mariotaku
@Lord-Grey
@Paulchen-Panther
@Awawa
@chbartsch
8 changes: 4 additions & 4 deletions appinfo.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "org.webosbrew.hyperion.ng.loader",
"version": "0.1.3",
"id": "org.webosbrew.hyperhdr.loader",
"version": "0.1.0",
"vendor": "webosbrew.org",
"title": "Hyperion.NG",
"title": "HyperHDR",
"icon": "assets/logo_small.png",
"largeIcon": "assets/logo_big.png",
"splashBackground": "assets/splash_1080p.png",
Expand All @@ -11,5 +11,5 @@
"iconColor": "black",
"type": "web",
"supportGIP": true,
"appDescription": "Hyperion.NG for WebOS"
"appDescription": "HyperHDR for WebOS"
}
Binary file modified assets/logo_big.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/logo_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/splash_1080p.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ npm run build || exit 1
echo ":: Service ::"
npm run build-service || exit 1

echo ":: Hyperion.NG ::"
mkdir -p ${EXEC_DIR}/dist/service/hyperion
cp -r ${EXEC_DIR}/hyperion/* ${EXEC_DIR}/dist/service/hyperion/ || exit 1
echo ":: HyperHDR ::"
mkdir -p ${EXEC_DIR}/dist/service/hyperhdr
cp -r ${EXEC_DIR}/hyperhdr/* ${EXEC_DIR}/dist/service/hyperhdr/ || exit 1

echo ":: Ensure executable bit set ::"
for file in autostart.sh loader_service start_hyperiond
for file in autostart.sh loader_service start_hyperhdr
do
FILE="${EXEC_DIR}/dist/service/${file}"
echo "=> ${FILE}"
chmod +x ${FILE}
done

for file in hyperiond hyperion-remote flatc flathash
for file in hyperhdr hyperhdr-remote flatc flathash
do
FILE="${EXEC_DIR}/dist/service/hyperion/${file}"
FILE="${EXEC_DIR}/dist/service/hyperhdr/${file}"
echo "=> ${FILE}"
chmod +x ${FILE}
done
Expand Down
Loading

0 comments on commit 4908695

Please sign in to comment.