Last active
April 14, 2025 11:46
-
-
Save kbingham/b35cc1402d02b0ef41b450941ad8f0c3 to your computer and use it in GitHub Desktop.
Revisions
-
kbingham revised this gist
Jun 20, 2022 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,8 @@ RUN dpkg --add-architecture arm64 # Expected system requirements RUN apt-get update && apt-get install -y \ sudo \ git \ dpkg-dev # Base libcamera image, with non-toolchain dependencies for building. # Base libcamera always-host packages (compilation dependencies) -
kbingham revised this gist
Jun 7, 2022 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -21,3 +21,6 @@ If this works well, I'll hope to wrap this up into a better system for testing c ### Install built components on RPi TODO: This could be a step to build a debian package (would be nice) or tar/scp built objects to the target... Another alternative is to run sshfs and mount the RPi rootfs directly. Then a script could call `DESTDIR=$RPI_MOUNT_POINT ninja -C ./build/rpi/bullsye install` -
kbingham revised this gist
May 17, 2022 . 3 changed files with 11 additions and 25 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -15,15 +15,11 @@ RUN apt-get update && apt-get install -y \ # Base libcamera image, with non-toolchain dependencies for building. # Base libcamera always-host packages (compilation dependencies) RUN apt-get install -y \ meson ninja-build pkg-config \ python3-yaml python3-ply python3-jinja2 \ openssl \ python3-sphinx doxygen graphviz texlive-latex-extra \ liblttng-ust-dev python3-jinja2 lttng-tools # Base libcamera cross compiler and target architecture packages RUN apt-get install -y \ @@ -37,11 +33,13 @@ RUN apt-get install -y \ qttools5-dev-tools:arm64 libtiff-dev:arm64 \ libexif-dev:arm64 libjpeg-dev:arm64 libyaml-dev:arm64 # Generate the meson cross file using the debian package helper RUN /usr/share/meson/debcrossgen --arch arm64 -o /usr/share/meson/arm64-cross # Create a custom user to operate in the container RUN adduser --disabled-password --gecos '' libcamera RUN adduser libcamera sudo RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers WORKDIR /home/libcamera USER libcamera This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,19 @@ # Cross compilation environment for libcamera for the RPi Bullseye OS This will let you build a cross compilation docker image, and use it to compile libcamera for the RPi. These commands are expected to be run in a checked out libcamera source, and save the Dockerfile file locally. A meson cross file will be automatically generated inside the debian bullseye environment. If this works well, I'll hope to wrap this up into a better system for testing cross compilation and automating the build of RPi packages. ### Build your cross compile docker image: `/usr/bin/docker build -t libcamera/debian/bullseye-cross-arm64 - < Dockerfile.debian.bullseye.cross-arm64` ### Run a shell in the new docker image in the local libcamera directory `docker run -v "$PWD":"$PWD" -w "$PWD" --rm -it libcamera/debian/bullseye-cross-arm64` ### Configure meson to perform the cross build `meson build/rpi/bullseye --cross-file /usr/share/meson/arm64-cross` ### (Cross-compile) Build libcamera at host compile speeds `ninja -C ./build/rpi/bullseye/` This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +0,0 @@ -
kbingham revised this gist
May 6, 2022 . 1 changed file with 15 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,23 @@ # Cross compilation environment for libcamera for the RPi Bullseye OS This will let you build a cross compilation docker image, and use it to compile libcamera for the RPi. These commands are expected to be run in a checkedout libcamera source, and save the Dockerfile and meson cross file locally. If this works well, I'll hope to wrap this up into a better system for testing cross compilation and automating the build of RPi packages. ### Build your cross compile docker image: `/usr/bin/docker build -t libcamera/debian/bullseye-cross-arm64 Dockerfile.debian.bullseye.cross-arm64` ### Run a shell in the new docker image in the local libcamera directory `docker run -v "$PWD":"$PWD" -v "$HOME":"$HOME" -w "$PWD" --rm -it libcamera/debian/bullseye-cross-arm64` ### Configure meson to perform the cross build `meson build/rpi/bullseye --cross-file aarch64-linux-gnu.mesoncross` ### (Cross-compile) Build libcamera at host compile speeds `ninja -C ./build/rpi/bullseye/` ### Install built components on RPi TODO: This could be a step to build a debian package (would be nice) or tar/scp built objects to the target... -
kbingham created this gist
May 6, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ FROM debian:bullseye ENV DEBIAN_FRONTEND noninteractive ENV LANG='C.UTF-8' LC_ALL='C.UTF-8' # Support multiarch builds to perform cross compilation # https://wiki.debian.org/Multiarch/HOWTO RUN dpkg --add-architecture arm64 # Expected system requirements RUN apt-get update && apt-get install -y \ sudo \ git # Base libcamera image, with non-toolchain dependencies for building. # Base libcamera always-host packages (compilation dependencies) RUN apt-get install -y \ ninja-build pkg-config \ python3-yaml python3-ply python3-jinja2 \ openssl \ python3-sphinx doxygen graphviz \ liblttng-ust-dev python3-jinja2 lttng-tools \ python3-pip # Install supported version of meson RUN pip3 install 'meson==0.55.3' # Base libcamera cross compiler and target architecture packages RUN apt-get install -y \ gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \ libgnutls28-dev:arm64 \ libboost-dev:arm64 \ libudev-dev:arm64 \ libgstreamer1.0-dev:arm64 libgstreamer-plugins-base1.0-dev:arm64 \ libevent-dev:arm64 \ qtbase5-dev:arm64 libqt5core5a:arm64 libqt5gui5:arm64 libqt5widgets5:arm64 \ qttools5-dev-tools:arm64 libtiff-dev:arm64 \ libexif-dev:arm64 libjpeg-dev:arm64 libyaml-dev:arm64 RUN adduser --disabled-password --gecos '' libcamera RUN adduser libcamera sudo RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers WORKDIR /home/libcamera USER libcamera This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ # Build your cross compile docker image: /usr/bin/docker build -t libcamera/debian/bullseye-cross-arm64 Dockerfile.debian.bullseye.cross-arm64 # Run a shell in the new docker image in the local libcamera directory docker run \ -v "$PWD":"$PWD" \ -v "$HOME":"$HOME" \ -w "$PWD" --rm -it libcamera/debian/bullseye-cross-arm64 # Configure meson to perform the cross build meson build/rpi/bullseye --cross-file aarch64-linux-gnu.mesoncross # (Cross-compile) Build libcamera at host compile speeds ninja -C ./build/rpi/bullseye/ # Install built components on RPi TODO: This could be a step to build a debian package (would be nice) or tar/scp built objects to the target... This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ [binaries] c = '/usr/bin/aarch64-linux-gnu-gcc' cpp = '/usr/bin/aarch64-linux-gnu-g++' ar = '/usr/bin/aarch64-linux-gnu-gcc-ar' strip = '/usr/bin/aarch64-linux-gnu-strip' pkgconfig = '/usr/bin/aarch64-linux-gnu-pkg-config' [host_machine] system = 'linux' cpu_family = 'aarch64' cpu = 'aarch64' endian = 'little'