diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 204ac9f..d70d70a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: apt-get update apt-get install -y libopencv-dev libegl1-mesa-dev libcamera-dev cmake build-essential libdrm-dev libgbm-dev openjdk-17-jdk cmake -B build-pi -DCMAKE_BUILD_TYPE=Release - cmake --build build-pi -j 4 + cmake --build build-pi -- -j - run: find . @@ -54,3 +54,21 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build-chroot: + runs-on: ubuntu-latest + container: + image: mcm001/photon-libcamera-builder-entry:latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v3 + - run: | + find . + cmake -B build-pi -DCMAKE_BUILD_TYPE=Release + cmake --build build-pi -- -j + - uses: actions/upload-artifact@master + with: + name: libcamera-driver + path: build-pi/*.so diff --git a/CMakeLists.txt b/CMakeLists.txt index f913fb5..9ca75cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.15) project(libcamera_meme) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b866ac7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM photon-libcamera-builder + +ENTRYPOINT ["/bin/bash", "/opt/start_chroot.sh"] \ No newline at end of file diff --git a/README.md b/README.md index 793c762..07804ab 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,15 @@ This should spit out the shared library into the build directory. Compile with `g++ -std=c++17 -o eglinfo eglinfo.c headless_opengl.cpp -lEGL -lGLESv2 -lgbm`, and then run with `./eglinfo` +## Chroot stuff + +Using our docker image and run with --privileged + +docker run -it --privileged --mount type=bind,source="$(pwd)",target=/opt/photon_sysroot_v2023.4.2/opt/photon-libcamera-gl-driver photon-libcamera-builder:latest +/opt/photon_sysroot_v2023.4.2/opt/photon-libcamera-gl-driver/start_chroot.sh + +Or + +docker run -it --privileged --mount type=bind,source="$(pwd)",target=/opt/photon_sysroot_v2023.4.2/opt/photon-libcamera-gl-driver photon-libcamera-builder-entry:latest + +# git clone ${{ github.repositoryUrl }} && cd "$(basename "$_" .git)" \ No newline at end of file