mirror of
https://github.com/logos-storage/logos-storage-go-bindings-example.git
synced 2026-01-02 13:33:12 +00:00
Provide better flexibility for passing OS and ARCH
This commit is contained in:
parent
7a09d02768
commit
2dfd2a8faa
8
Makefile
8
Makefile
@ -6,9 +6,9 @@ CGO_CFLAGS := -I$(LIBS_DIR)
|
||||
CGO_LDFLAGS := -L$(LIBS_DIR) -Wl,-rpath,$(LIBS_DIR)
|
||||
|
||||
# Configuration for fetching the right binary
|
||||
OS := "linux"
|
||||
ARCH := "amd64"
|
||||
VERSION := "v0.0.15"
|
||||
OS ?= "linux"
|
||||
ARCH ?= "amd64"
|
||||
VERSION ?= "v0.0.15"
|
||||
LATEST_URL := "https://github.com/codex-storage/codex-go-bindings/releases/latest/download/codex-${OS}-${ARCH}.zip"
|
||||
VERSIONED_URL := "https://github.com/codex-storage/codex-go-bindings/releases/download/$(VERSION)/codex-${OS}-${ARCH}.zip"
|
||||
|
||||
@ -20,7 +20,7 @@ all: run
|
||||
fetch:
|
||||
@echo "Fetching libcodex from GitHub Actions: ${LATEST_URL}"
|
||||
@curl -fSL --create-dirs -o $(LIBS_DIR)/codex-${OS}-${ARCH}.zip ${LATEST_URL}
|
||||
@unzip $(LIBS_DIR)/codex-${OS}-${ARCH}.zip -d $(LIBS_DIR)
|
||||
@unzip $(LIBS_DIR)/codex-${OS}-${ARCH}.zip -d -qq $(LIBS_DIR)
|
||||
@rm -f $(LIBS_DIR)/*.zip
|
||||
|
||||
build:
|
||||
|
||||
13
README.md
13
README.md
@ -15,14 +15,17 @@ go get
|
||||
### Fetch the artifacts
|
||||
|
||||
```sh
|
||||
# Adapt for your OS
|
||||
OS := "linux" # can be linux, macos or windows
|
||||
ARCH := "amd64" # can amd64 or arm64
|
||||
make fetch
|
||||
```
|
||||
|
||||
By default, the last release will be downloaded and extracted to libs folder. You can change the `Makefile`
|
||||
to specify another folder or download a specific version.
|
||||
The default `OS` is `linux` and the default `ARCH` is `amd64`.
|
||||
You can update them like this:
|
||||
|
||||
```sh
|
||||
OS="macos" ARCH="arm64" make fetch
|
||||
```
|
||||
|
||||
By default, the last release will be downloaded and extracted to libs folder.
|
||||
|
||||
### Build
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user