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

How to compile? #11

Closed
lpvm opened this issue Jul 4, 2021 · 2 comments
Closed

How to compile? #11

lpvm opened this issue Jul 4, 2021 · 2 comments

Comments

@lpvm
Copy link

lpvm commented Jul 4, 2021

It would be nice if you can show how to compile from source.

make release complains about the present directory not being .git repository.

a-h added a commit that referenced this issue Jul 5, 2021
@a-h
Copy link
Owner

a-h commented Jul 5, 2021

No problem.

make release attempts to build for all architectures, sign the binaries, and push a release to Github etc., so that's not what you want.

If you want to build from source for the architecture of the machine doing the building, the steps are:

  • Install Go >= v1.14
  • From the root of the source code, use Go to build the program go build -o gemini ./cmd/main.go
    • The -o gemini flag sets the output filename to gemini.
    • Go will download any 3rd party dependencies automatically, and produce a binary.
    • Once you've got the binary, you don't need to have Go installed on the machine.

I've just added a build step to the Makefile, so you should be able to do make build and get a binary out, if you've got Go >= 1.14 already installed.

If you want to build from one machine (e.g. an x64 Windows machine) to target another (e.g. an ARM Raspberry Pi), you can set Go's GOARCH and GOOS environment variables before compilation, and it will compile for that target.

Is that what you needed?

@lpvm
Copy link
Author

lpvm commented Jul 6, 2021

Thank you very much!
Yes, that's it. I'm sure it'll be of help for other people as well.

@lpvm lpvm closed this as completed Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants