mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-27 16:07:42 +08:00
Merge pull request #4920 from ipfs/feat/tarball
mk: add tarball support
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@ -17,3 +17,8 @@ gx-workspace-update.json
|
|||||||
bin/gx
|
bin/gx
|
||||||
bin/gx*
|
bin/gx*
|
||||||
bin/tmp
|
bin/tmp
|
||||||
|
|
||||||
|
|
||||||
|
vendor
|
||||||
|
.tarball
|
||||||
|
go-ipfs-source.tar.gz
|
||||||
|
2
Rules.mk
2
Rules.mk
@ -8,6 +8,8 @@ TEST_SHORT :=
|
|||||||
all: help # all has to be first defined target
|
all: help # all has to be first defined target
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
|
||||||
|
include mk/git.mk # has to be before tarball.mk
|
||||||
|
include mk/tarball.mk
|
||||||
include mk/util.mk
|
include mk/util.mk
|
||||||
include mk/golang.mk
|
include mk/golang.mk
|
||||||
include mk/gx.mk
|
include mk/gx.mk
|
||||||
|
22
bin/maketarball.sh
Executable file
22
bin/maketarball.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# vim: set expandtab sw=2 ts=2:
|
||||||
|
|
||||||
|
# bash safe mode
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
|
||||||
|
OUTPUT=$(realpath ${1:-go-ipfs-source.tar.gz})
|
||||||
|
|
||||||
|
TMPDIR="$(mktemp -d)"
|
||||||
|
NEWIPFS="$TMPDIR/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 &&
|
||||||
|
tar -czf "$OUTPUT" --exclude="./.git" .
|
||||||
|
)
|
||||||
|
|
||||||
|
rm -rf "$TMPDIR"
|
@ -13,7 +13,7 @@ PATH := $(realpath $(d)):$(PATH)
|
|||||||
# DEPS_OO_$(d) += merkledag/pb/merkledag.pb.go namesys/pb/namesys.pb.go
|
# DEPS_OO_$(d) += merkledag/pb/merkledag.pb.go namesys/pb/namesys.pb.go
|
||||||
# DEPS_OO_$(d) += pin/internal/pb/header.pb.go unixfs/pb/unixfs.pb.go
|
# DEPS_OO_$(d) += pin/internal/pb/header.pb.go unixfs/pb/unixfs.pb.go
|
||||||
|
|
||||||
$(d)_flags =-ldflags="-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(shell git rev-parse --short HEAD)"
|
$(d)_flags =-ldflags="-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(git-hash)"
|
||||||
|
|
||||||
$(d)-try-build $(IPFS_BIN_$(d)): GOFLAGS += $(cmd/ipfs_flags)
|
$(d)-try-build $(IPFS_BIN_$(d)): GOFLAGS += $(cmd/ipfs_flags)
|
||||||
|
|
||||||
|
1
mk/git.mk
Normal file
1
mk/git.mk
Normal file
@ -0,0 +1 @@
|
|||||||
|
git-commit:=$(shell git rev-parse --short HEAD 2>/dev/null)
|
3
mk/gx.mk
3
mk/gx.mk
@ -7,5 +7,8 @@ gx-deps:
|
|||||||
ifneq ($(IPFS_GX_USE_GLOBAL),1)
|
ifneq ($(IPFS_GX_USE_GLOBAL),1)
|
||||||
gx-deps: bin/gx bin/gx-go
|
gx-deps: bin/gx bin/gx-go
|
||||||
endif
|
endif
|
||||||
|
.PHONY: gx-deps
|
||||||
|
|
||||||
|
ifeq ($(tarball-is),0)
|
||||||
DEPS_GO += gx-deps
|
DEPS_GO += gx-deps
|
||||||
|
endif
|
||||||
|
13
mk/tarball.mk
Normal file
13
mk/tarball.mk
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
|
||||||
|
ifeq (,$(wildcard .tarball))
|
||||||
|
tarball-is:=0
|
||||||
|
else
|
||||||
|
tarball-is:=1
|
||||||
|
# override git hash
|
||||||
|
git-hash:=$(shell cat .tarball)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
go-ipfs-source.tar.gz: distclean
|
||||||
|
bin/maketarball.sh $@
|
Reference in New Issue
Block a user