Skip to content

Commit

Permalink
RSDK-2890: Find OpenSSL correctly on MacOS (#69)
Browse files Browse the repository at this point in the history
Co-authored-by: Katharina Xenia Kufieta <katharina.kufieta@gmail.com>
  • Loading branch information
dmhilly and kkufieta authored May 23, 2023
1 parent 994d7b3 commit 5de54fe
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pullrequest-trusted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
if: github.event.label.name == 'safe to test' ||
contains(github.event.pull_request.labels.*.name, 'appimage') ||
contains(github.event.pull_request.labels.*.name, 'appimage-ignore-tests')
uses: viamrobotics/viam-cartographer/.github/workflows/test.yml@main
uses: viamrobotics/viam-cartographer/.github/workflows/test.yml@RSDK-2890

# This lets people add an "appimage" tag to have appimages built for the PR
appimage:
Expand All @@ -28,14 +28,14 @@ jobs:
always() && !cancelled() && contains(github.event.pull_request.labels.*.name, 'safe to test') &&
!contains(github.event.pull_request.labels.*.name, 'appimage-ignore-tests') &&
contains(github.event.pull_request.labels.*.name, 'appimage') && needs.test.result == 'success'
uses: viamrobotics/viam-cartographer/.github/workflows/appimage.yml@main
uses: viamrobotics/viam-cartographer/.github/workflows/appimage.yml@RSDK-2890
secrets:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}

appimage-ignore-tests:
if: |
always() && !cancelled() && contains(github.event.pull_request.labels.*.name, 'safe to test') &&
contains(github.event.pull_request.labels.*.name, 'appimage-ignore-tests')
uses: viamrobotics/viam-cartographer/.github/workflows/appimage.yml@main
uses: viamrobotics/viam-cartographer/.github/workflows/appimage.yml@RSDK-2890
secrets:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ GIT_REVISION = $(shell git rev-parse HEAD | tr -d '\n')
TAG_VERSION?=$(shell git tag --points-at | sort -Vr | head -n1)
GO_BUILD_LDFLAGS = -ldflags "-X 'main.Version=${TAG_VERSION}' -X 'main.GitRevision=${GIT_REVISION}'"

set-pkg-config-openssl:
pkg-config openssl || export PKG_CONFIG_PATH=$$PKG_CONFIG_PATH:`find \`which brew > /dev/null && brew --prefix\` -name openssl.pc | head -n1 | xargs dirname`

bufinstall:
sudo apt-get install -y protobuf-compiler-grpc libgrpc-dev libgrpc++-dev || brew install grpc openssl --quiet

bufsetup: set-pkg-config-openssl
bufsetup:
GOBIN=`pwd`/grpc/bin go install github.com/bufbuild/buf/cmd/buf@v1.8.0
ln -sf `which grpc_cpp_plugin` grpc/bin/protoc-gen-grpc-cpp

Expand Down Expand Up @@ -68,14 +65,13 @@ lint-go:

lint: ensure-submodule-initialized lint-cpp lint-go

setup: ensure-submodule-initialized set-pkg-config-openssl
setup: ensure-submodule-initialized
ifeq ("Darwin", "$(shell uname -s)")
cd viam-cartographer/scripts && ./setup_cartographer_macos.sh
else
cd viam-cartographer/scripts && ./setup_cartographer_linux.sh
endif


build: build-module
ifneq ($(wildcard viam-cartographer/cartographer/build/.),)
cd viam-cartographer && ./scripts/build_viam_cartographer.sh
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ These containers are set to persist between sessions via the `persistent` parame
make bufinstall && make buf
# Install dependencies
make setup
# Build the binary
# Build & install the binary
make build
# Install lua files
make install-lua-files
Expand Down
1 change: 1 addition & 0 deletions viam-cartographer/scripts/build_viam_cartographer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ if [ "$(uname)" == "Linux" ]; then
elif [ "$(uname)" == "Darwin" ]; then
readlinkorreal() { readlink "$1" || echo "$1"; }
cd $(dirname string readlinkorreal "${BASH_SOURCE}")/..
which brew && export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:`brew --prefix openssl@3`/lib/pkgconfig"
else
echo ERROR: your OS is not handled yet
exit 1
Expand Down
5 changes: 2 additions & 3 deletions viam-cartographer/scripts/setup_cartographer_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
echo "Installing cartographer external dependencies"
brew update
brew upgrade
brew install abseil boost ceres-solver protobuf ninja cairo googletest lua@5.3
brew install abseil boost ceres-solver protobuf ninja cairo googletest lua@5.3 pkg-config cmake go@1.20 grpc
brew link lua@5.3
brew install openssl eigen gflags glog suite-sparse sphinx-doc pcl
brew install openssl@3 eigen gflags glog suite-sparse sphinx-doc pcl
brew link protobuf
brew link openssl --force

0 comments on commit 5de54fe

Please sign in to comment.