Skip to content

Conversation

06kellyjac
Copy link
Contributor

Allow for custom install prefix
Also create the dir if it doesn't exist and ensure 755 perms

@06kellyjac 06kellyjac force-pushed the allow_custom_prefix branch from 637a576 to b0803be Compare July 17, 2021 18:26
@06kellyjac 06kellyjac changed the title Allow for custom build prefix Allow for custom install prefix Jul 17, 2021
@06kellyjac
Copy link
Contributor Author

@stanley-cheung @sampajano Please can I get a review on this

This is required for us to easily package this for nixpkgs https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/tools/protoc-gen-grpc-web/default.nix#L16-L25


all: protoc-gen-grpc-web

protoc-gen-grpc-web: grpc_generator.o
$(CXX) $^ $(LDFLAGS) -o $@

install: protoc-gen-grpc-web
install protoc-gen-grpc-web /usr/local/bin/protoc-gen-grpc-web
install -Dm755 protoc-gen-grpc-web $(PREFIX)/bin/protoc-gen-grpc-web
Copy link
Collaborator

@sampajano sampajano Aug 11, 2021

Choose a reason for hiding this comment

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

I don't think -Dm755 work on macOS (BSD) version of install..

Is there a way you can make this work for both? :)

(Also from what i read 755 is the default so i'm curious why you'd need to specify it?)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we leave this -Dm755 out and just use the system default? the PREFIX change looks good.

Copy link
Contributor Author

@06kellyjac 06kellyjac Aug 11, 2021

Choose a reason for hiding this comment

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

I can either drop it or add a mkdir -p $(PREFIX)/bin above install

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah this is cool with me.. But i'll defer to @stanley-cheung's for approval :)

Thanks for the change :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes mkdir sounds good. thanks.

Also create the dir if it doesn't exist
@stanley-cheung stanley-cheung merged commit a56e721 into grpc:master Aug 11, 2021
@06kellyjac 06kellyjac deleted the allow_custom_prefix branch August 11, 2021 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants