Skip to content

Commit c84c6f8

Browse files
committed
Build with docker sysroot lol
1 parent 5a7fc7b commit c84c6f8

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
apt-get update
2424
apt-get install -y libopencv-dev libegl1-mesa-dev libcamera-dev cmake build-essential libdrm-dev libgbm-dev openjdk-17-jdk
2525
cmake -B build-pi -DCMAKE_BUILD_TYPE=Release
26-
cmake --build build-pi -j 4
26+
cmake --build build-pi -- -j
2727
2828
- run: find .
2929

@@ -54,3 +54,21 @@ jobs:
5454
if: startsWith(github.ref, 'refs/tags/v')
5555
env:
5656
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
58+
build-chroot:
59+
runs-on: ubuntu-latest
60+
container:
61+
image: mcm001/photon-libcamera-builder-entry:latest
62+
defaults:
63+
run:
64+
shell: bash
65+
steps:
66+
- uses: actions/checkout@v3
67+
- run: |
68+
find .
69+
cmake -B build-pi -DCMAKE_BUILD_TYPE=Release
70+
cmake --build build-pi -- -j
71+
- uses: actions/upload-artifact@master
72+
with:
73+
name: libcamera-driver
74+
path: build-pi/*.so

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.16)
1+
cmake_minimum_required(VERSION 3.15)
22
project(libcamera_meme)
33

44
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM photon-libcamera-builder
2+
3+
ENTRYPOINT ["/bin/bash", "/opt/start_chroot.sh"]

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,15 @@ This should spit out the shared library into the build directory.
3030

3131
Compile with `g++ -std=c++17 -o eglinfo eglinfo.c headless_opengl.cpp -lEGL -lGLESv2 -lgbm`, and then run with `./eglinfo`
3232

33+
## Chroot stuff
34+
35+
Using our docker image and run with --privileged
36+
37+
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
38+
/opt/photon_sysroot_v2023.4.2/opt/photon-libcamera-gl-driver/start_chroot.sh
39+
40+
Or
41+
42+
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
43+
44+
# git clone ${{ github.repositoryUrl }} && cd "$(basename "$_" .git)"

0 commit comments

Comments
 (0)