chore: Update build.yml to build v4l-utils for webOS #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build v4l-utils for webOS | |
on: | |
push: | |
workflow_dispatch: | |
env: | |
TOOLCHAIN_URL: https://github.com/openlgtv/buildroot-nc4/releases/download/webos-d7ed7ee/arm-webos-linux-gnueabi_sdk-buildroot.tar.gz | |
TOOLCHAIN_SHA256: 32816626e99fb34922a49d0c639f7c8a30356fffb222372d4823027f1382f640 | |
TOOLCHAIN_DIR: /opt/arm-webos-linux-gnueabi_sdk-buildroot | |
TOOLCHAIN_FILE: /opt/arm-webos-linux-gnueabi_sdk-buildroot/share/buildroot/toolchainfile.cmake | |
INSTALL_DIR: ${{ github.workspace }}/v4l-utils-install | |
KEYTABLE_USER_DIR: ${{ github.workspace }}/v4l-utils-install/etc/rc_keymaps | |
KEYTABLE_SYSTEM_DIR: ${{ github.workspace }}/v4l-utils-install/etc/rc_keymaps | |
UDEV_RULES_DIR: ${{ github.workspace }}/v4l-utils-install/lib/udev/rules.d | |
jobs: | |
build-v4l-utils: | |
strategy: | |
matrix: | |
build-type: [Debug, Release] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Download and unpack toolchain | |
working-directory: /opt | |
run: | | |
wget -q -O toolchain.tar.gz ${TOOLCHAIN_URL} | |
echo "${TOOLCHAIN_SHA256} toolchain.tar.gz" | sha256sum -c - | |
tar xf toolchain.tar.gz | |
- name: Relocate toolchain | |
working-directory: ${{ env.TOOLCHAIN_DIR }} | |
run: | | |
./relocate-sdk.sh | |
- name: CMake Version | |
run: cmake --version | |
- name: Create Build directory | |
run: cmake -E make_directory ${{github.workspace}}/build | |
- name: Clean previous build | |
working-directory: ${{github.workspace}}/build | |
run: | | |
make clean || true | |
rm -rf * | |
- name: Configure v4l-utils | |
working-directory: ${{github.workspace}}/build | |
shell: bash | |
run: | | |
source ${TOOLCHAIN_DIR}/environment-setup | |
# export CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" | |
# export CXXFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" | |
../configure \ | |
--host=arm-webos-linux-gnueabi \ | |
--prefix=${{ github.workspace }}/v4l-utils-install \ | |
--with-sysroot=${{ env.TOOLCHAIN_DIR }}/arm-webos-linux-gnueabi/sysroot | |
- name: Build v4l-utils | |
working-directory: ${{github.workspace}}/build | |
run: | | |
source ${TOOLCHAIN_DIR}/environment-setup | |
make | |
- name: Install v4l-utils | |
working-directory: ${{github.workspace}}/build | |
run: | | |
source ${TOOLCHAIN_DIR}/environment-setup | |
make install \ | |
keytableuserdir=${{ env.KEYTABLE_USER_DIR }} \ | |
keytablesystemdir=${{ env.KEYTABLE_SYSTEM_DIR }} \ | |
udevrulesdir=${{ env.UDEV_RULES_DIR }} | |
- name: List installed files | |
run: find ${{github.workspace}}/v4l-utils-install | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: v4l-utils_${{ matrix.build-type }} | |
path: | | |
${{github.workspace}}/v4l-utils-install | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.build-type == 'Release' }} | |
with: | |
files: | | |
${{github.workspace}}/v4l-utils-install/bin/* |