diff --git a/.github/workflows/build-deb.yml b/.github/workflows/build-deb.yml new file mode 100644 index 0000000..f48bae8 --- /dev/null +++ b/.github/workflows/build-deb.yml @@ -0,0 +1,67 @@ +name: Build Debian Package (ARM64) + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +jobs: + build-deb: + name: Debian package - ${{ matrix.config.name }} + runs-on: ubuntu-latest + permissions: + contents: read + + strategy: + fail-fast: false + matrix: + config: + - name: standard-rpi5 + hardware_header: mandeye-standard-rpi5.h + cmake_extra: -DMANDEYE_USE_LIBCAMERA=FALSE + - name: direct-cm5 + hardware_header: mandeye-direct-cm5.h + cmake_extra: "" + + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Build Debian package + run: | + docker run --rm --platform linux/arm64 \ + -v ${{ github.workspace }}:/workspace \ + -w /workspace \ + arm64v8/debian:bookworm \ + bash -c " + set -e + apt-get update -qq + apt-get install -y -qq --no-install-recommends \ + build-essential cmake git pkg-config ca-certificates \ + libserial-dev libgpiod-dev libzmq3-dev libboost-all-dev \ + libpistache-dev rapidjson-dev nlohmann-json3-dev cppzmq-dev \ + libcamera-dev libopencv-dev pps-tools + update-ca-certificates + git config --global --add safe.directory '*' + cmake -B build-pkg \ + -DCMAKE_BUILD_TYPE=Release \ + -DMANDEYE_HARDWARE_HEADER=${{ matrix.config.hardware_header }} \ + ${{ matrix.config.cmake_extra }} + cmake --build build-pkg -j\$(nproc) + cd build-pkg + cpack -G DEB + " + + - name: Upload Debian package + uses: actions/upload-artifact@v4 + with: + name: mandeye-deb-${{ matrix.config.name }} + path: build-pkg/*.deb + if-no-files-found: error \ No newline at end of file diff --git a/code/gpios.h b/code/gpios.h index 639b28f..998d91f 100644 --- a/code/gpios.h +++ b/code/gpios.h @@ -13,6 +13,7 @@ struct gpiod_line; namespace mandeye { + using namespace hardware; // forward declaration of cppgpio type that I want to keep inside compliation unit @@ -108,7 +109,8 @@ class GpioClient std::mutex m_lock; std::atomic m_running{true}; }; -static std::mutex gpioClientPtrLock; -static std::shared_ptr gpioClientPtr; + +inline std::mutex gpioClientPtrLock; +inline std::shared_ptr gpioClientPtr; } // namespace mandeye \ No newline at end of file