diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml new file mode 100644 index 000000000..0e0b53c6a --- /dev/null +++ b/.github/workflows/debian.yml @@ -0,0 +1,56 @@ +on: + workflow_dispatch: + push: # DONOTMERGE + +env: + CMAKE_VERSION: 3.27.4 + +jobs: + build-deb: + strategy: + matrix: + include: + - container: debian:bookworm + label: bookworm-aarch64 + runs-on: buildjet-4vcpu-ubuntu-2204-arm + - container: debian:bookworm + label: bookworm-x86_64 + runs-on: buildjet-4vcpu-ubuntu-2204 + container: ${{ matrix.container }} + runs-on: ${{ matrix.runs-on }} + steps: + - uses: actions/checkout@v3 + - name: depends + run: | + apt-get update + apt-get install -qqy \ + build-essential \ + libabsl-dev \ + libboost-all-dev \ + libgrpc++-dev \ + libprotobuf-dev \ + pkg-config \ + ninja-build \ + protobuf-compiler-grpc \ + git \ + wget + - name: download cmake + run: | + ARCH=$(uname -m) + wget --quiet https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-$ARCH.sh + chmod +x cmake-${CMAKE_VERSION}-linux-$ARCH.sh + ./cmake-${CMAKE_VERSION}-linux-$ARCH.sh --skip-license --prefix=/usr + - name: remove examples + # todo(RSDK-4735): no longer needed once 'all' is cleaned up + run: sed -i '/add_subdirectory.examples/d' src/viam/CMakeLists.txt + - name: cmake + run: cmake -S . -B ./build -G Ninja -DCMAKE_INSTALL_PREFIX=/usr + - name: build + working-directory: build + run: | + cmake --build . --target libviamsdk.so + cpack + - uses: actions/upload-artifact@v3 + with: + name: debian-${{ matrix.label }} + path: build/viam-cpp-sdk-*.deb diff --git a/src/viam/api/config/viam-cpp-sdk-libviamapi.pc.in b/src/viam/api/config/viam-cpp-sdk-libviamapi.pc.in index 6033e512e..098de26fb 100644 --- a/src/viam/api/config/viam-cpp-sdk-libviamapi.pc.in +++ b/src/viam/api/config/viam-cpp-sdk-libviamapi.pc.in @@ -7,7 +7,6 @@ Name: @PROJECT_NAME@-libapi Description: @PROJECT_DESCRIPTION@ URL: @PROJECT_HOMEPAGE_URL@ Version: @PROJECT_VERSION@ -Requires: gRPC++ >= @VIAMCPPSDK_GRPCXX_VERSION@ protobuf >= @VIAMCPPSDK_PROTOBUF_VERSION@ Libs: -L${libdir} -L@Boost_LIBRARY_DIRS@ -lviamapi Cflags: -I${base_includedir} -I${deep_includedir} diff --git a/src/viam/sdk/CMakeLists.txt b/src/viam/sdk/CMakeLists.txt index 8da617bba..6f0e1ac25 100644 --- a/src/viam/sdk/CMakeLists.txt +++ b/src/viam/sdk/CMakeLists.txt @@ -249,3 +249,10 @@ install(FILES add_subdirectory(tests) + +set(CPACK_GENERATOR "DEB") +set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) +set(CPACK_COMPONENTS_ALL viam-cpp-sdk_dev) +set(CPACK_PACKAGE_CONTACT "packaging@viam.com") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libprotobuf-dev, libgrpc++-dev, libboost-log-dev") +include(CPack) diff --git a/src/viam/sdk/config/viam-cpp-sdk-libviamsdk.pc.in b/src/viam/sdk/config/viam-cpp-sdk-libviamsdk.pc.in index 98061c1bd..01a3f7122 100644 --- a/src/viam/sdk/config/viam-cpp-sdk-libviamsdk.pc.in +++ b/src/viam/sdk/config/viam-cpp-sdk-libviamsdk.pc.in @@ -1,12 +1,11 @@ prefix=@CMAKE_INSTALL_PREFIX@ libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ -includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/viam/sdk Name: @PROJECT_NAME@-libviamsdk Description: @PROJECT_DESCRIPTION@ URL: @PROJECT_HOMEPAGE_URL@ Version: @PROJECT_VERSION@ -Requires: gRPC++ >= @VIAMCPPSDK_GRPCXX_VERSION@ protobuf >= @VIAMCPPSDK_PROTOBUF_VERSION@ @PROJECT_NAME@-libviamapi >= @PROJECT_VERSION@ Libs: -L${libdir} -L@Boost_LIBRARY_DIRS@ -lviamsdk -lviam_rust_utils Libs.private: -lboost_log-mt Cflags: -I${includedir} -I@Boost_INCLUDE_DIR@