Fix cross-compile builds (#6609) (#6615)

* Fix cross-compile builds (#6609)

* Update Makefile

* remove bash requirement
pull/6641/head
techknowlogick 6 years ago committed by Lauris BH
parent f64b8eb009
commit e8ca2da08f
  1. 13
      Makefile

@ -3,6 +3,7 @@ IMPORT := code.gitea.io/gitea
GO ?= go GO ?= go
SED_INPLACE := sed -i SED_INPLACE := sed -i
SHASUM ?= shasum -a 256
export PATH := $($(GO) env GOPATH)/bin:$(PATH) export PATH := $($(GO) env GOPATH)/bin:$(PATH)
@ -327,7 +328,7 @@ release-windows:
fi fi
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) . xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
ifeq ($(CI),drone) ifeq ($(CI),drone)
mv /build/* $(DIST)/binaries cp /build/* $(DIST)/binaries
endif endif
.PHONY: release-linux .PHONY: release-linux
@ -337,7 +338,7 @@ release-linux:
fi fi
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/*' -out gitea-$(VERSION) . xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/*' -out gitea-$(VERSION) .
ifeq ($(CI),drone) ifeq ($(CI),drone)
mv /build/* $(DIST)/binaries cp /build/* $(DIST)/binaries
endif endif
.PHONY: release-darwin .PHONY: release-darwin
@ -347,23 +348,23 @@ release-darwin:
fi fi
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) . xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) .
ifeq ($(CI),drone) ifeq ($(CI),drone)
mv /build/* $(DIST)/binaries cp /build/* $(DIST)/binaries
endif endif
.PHONY: release-copy .PHONY: release-copy
release-copy: release-copy:
$(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),cp $(file) $(DIST)/release/$(notdir $(file));) cd $(DIST); for file in `find /build -type f -name "*"`; do cp $${file} ./release/; done;
.PHONY: release-check .PHONY: release-check
release-check: release-check:
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;) cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "checksumming $${file}" && $(SHASUM) `echo $${file} | sed 's/^..//'` > $${file}.sha256; done;
.PHONY: release-compress .PHONY: release-compress
release-compress: release-compress:
@hash gxz > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ @hash gxz > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/ulikunitz/xz/cmd/gxz; \ $(GO) get -u github.com/ulikunitz/xz/cmd/gxz; \
fi fi
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),gxz -k -9 $(notdir $(file));) cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && gxz -k -9 $${file}; done;
.PHONY: javascripts .PHONY: javascripts
javascripts: public/js/index.js javascripts: public/js/index.js

Loading…
Cancel
Save