mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
mk: fix maketarball to work with gomod
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
parent
245c40b8fd
commit
a6053d631a
@ -8,19 +8,17 @@ IFS=$'\n\t'
|
||||
# readlink doesn't work on macos
|
||||
OUTPUT="${1:-go-ipfs-source.tar.gz}"
|
||||
if ! [[ "$OUTPUT" = /* ]]; then
|
||||
OUTPUT="$PWD/$OUTPUT"
|
||||
OUTPUT="$PWD/$OUTPUT"
|
||||
fi
|
||||
|
||||
TMPDIR="$(mktemp -d)"
|
||||
NEWIPFS="$TMPDIR/src/github.com/ipfs/go-ipfs"
|
||||
mkdir -p "$NEWIPFS"
|
||||
cp -r . "$NEWIPFS"
|
||||
( cd "$NEWIPFS" &&
|
||||
echo $PWD &&
|
||||
GOPATH="$TMPDIR" gx install --local &&
|
||||
(git rev-parse --short HEAD || true) > .tarball &&
|
||||
chmod -R u=rwX,go=rX "$NEWIPFS" # normalize permissions
|
||||
tar -czf "$OUTPUT" --exclude="./.git" .
|
||||
)
|
||||
cp -r . "$TMPDIR"
|
||||
( cd "$TMPDIR" &&
|
||||
echo $PWD &&
|
||||
go mod vendor &&
|
||||
(git describe --always --match=NeVeRmAtCh --dirty 2>/dev/null || true) > .tarball &&
|
||||
chmod -R u=rwX,go=rX "$TMPDIR" # normalize permissions
|
||||
tar -czf "$OUTPUT" --exclude="./.git" .
|
||||
)
|
||||
|
||||
rm -rf "$TMPDIR"
|
||||
|
||||
@ -10,6 +10,10 @@ unexport GOFLAGS
|
||||
GOFLAGS ?=
|
||||
GOTFLAGS ?=
|
||||
|
||||
ifeq ($(tarball-is),1)
|
||||
GOFLAGS += -mod=vendor
|
||||
endif
|
||||
|
||||
# match Go's default GOPATH behaviour
|
||||
export GOPATH ?= $(shell $(GOCC) env GOPATH)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user