Commit a6053d63 authored by Jakub Sztandera's avatar Jakub Sztandera

mk: fix maketarball to work with gomod

License: MIT
Signed-off-by: default avatarJakub Sztandera <kubuxu@protonmail.ch>
parent 245c40b8
...@@ -8,19 +8,17 @@ IFS=$'\n\t' ...@@ -8,19 +8,17 @@ IFS=$'\n\t'
# readlink doesn't work on macos # readlink doesn't work on macos
OUTPUT="${1:-go-ipfs-source.tar.gz}" OUTPUT="${1:-go-ipfs-source.tar.gz}"
if ! [[ "$OUTPUT" = /* ]]; then if ! [[ "$OUTPUT" = /* ]]; then
OUTPUT="$PWD/$OUTPUT" OUTPUT="$PWD/$OUTPUT"
fi fi
TMPDIR="$(mktemp -d)" TMPDIR="$(mktemp -d)"
NEWIPFS="$TMPDIR/src/github.com/ipfs/go-ipfs" cp -r . "$TMPDIR"
mkdir -p "$NEWIPFS" ( cd "$TMPDIR" &&
cp -r . "$NEWIPFS" echo $PWD &&
( cd "$NEWIPFS" && go mod vendor &&
echo $PWD && (git describe --always --match=NeVeRmAtCh --dirty 2>/dev/null || true) > .tarball &&
GOPATH="$TMPDIR" gx install --local && chmod -R u=rwX,go=rX "$TMPDIR" # normalize permissions
(git rev-parse --short HEAD || true) > .tarball && tar -czf "$OUTPUT" --exclude="./.git" .
chmod -R u=rwX,go=rX "$NEWIPFS" # normalize permissions )
tar -czf "$OUTPUT" --exclude="./.git" .
)
rm -rf "$TMPDIR" rm -rf "$TMPDIR"
...@@ -10,6 +10,10 @@ unexport GOFLAGS ...@@ -10,6 +10,10 @@ unexport GOFLAGS
GOFLAGS ?= GOFLAGS ?=
GOTFLAGS ?= GOTFLAGS ?=
ifeq ($(tarball-is),1)
GOFLAGS += -mod=vendor
endif
# match Go's default GOPATH behaviour # match Go's default GOPATH behaviour
export GOPATH ?= $(shell $(GOCC) env GOPATH) export GOPATH ?= $(shell $(GOCC) env GOPATH)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment