Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support MacOS along side Linux #32

Merged
merged 2 commits into from
Mar 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ WASM_RELEASE_PATH = $(PROJECT_PATH)/target/wasm32-unknown-unknown/release/wasm_s

PROTOC_BIN=$(PROJECT_PATH)/bin/protoc
PROTOC_VERSION=21.1
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
PROTOC_OS="linux-x86_64"
endif
ifeq ($(UNAME_S),Darwin)
PROTOC_OS="osx-universal_binary"
endif
$(PROTOC_BIN):
mkdir -p $(PROJECT_PATH)/bin
$(call get-protoc,$(PROJECT_PATH)/bin,https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-$(PROTOC_VERSION)-linux-x86_64.zip,sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0)
$(call get-protoc,$(PROJECT_PATH),https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-$(PROTOC_VERSION)-$(PROTOC_OS).zip,sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is that sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0) for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno, didn't touch that... 🤣

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 with that


# builds the module and move to deploy folder
build: export BUILD?=debug
Expand Down Expand Up @@ -68,9 +74,8 @@ set -e ;\
TMP_DIR=$$(mktemp -d) ;\
cd $$TMP_DIR ;\
curl -Lo protoc.zip $(2) ;\
unzip -q protoc.zip bin/protoc ;\
cp bin/protoc $(1) ;\
chmod a+x $(1)/protoc ;\
unzip -q protoc.zip bin/protoc -d $(1)/. ;\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about this change

diff --git a/Makefile b/Makefile
index 367fb37..7226e6f 100644
--- a/Makefile
+++ b/Makefile
@@ -68,8 +68,8 @@ stop-development:
 
 # get-protoc will download zip from $2 and install it to $1.
 define get-protoc
-@[ -f $(1) ] || { \
-echo "Downloading $(2) and installing in $(1)" ;\
+@{ \
+echo "Downloading $(2) and installing in $(1)/bin" ;\
 set -e ;\
 TMP_DIR=$$(mktemp -d) ;\
 cd $$TMP_DIR ;\

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add that, initially, as per the comment in the PR, I was also extracting the includes in $(1)/include...

chmod a+x $(1)/bin/protoc ;\
rm -rf $$TMP_DIR ;\
}
endef