Skip to content

Commit 38889f0

Browse files
Fix cross-compile builds (#6609)
1 parent 3297b8d commit 38889f0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ export GO111MODULE=off
44

55
GO ?= go
66
SED_INPLACE := sed -i
7+
SHELL ?= bash
8+
SHASUM ?= shasum -a 256
79

810
export PATH := $($(GO) env GOPATH)/bin:$(PATH)
911

@@ -332,7 +334,7 @@ release-windows:
332334
fi
333335
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
334336
ifeq ($(CI),drone)
335-
mv /build/* $(DIST)/binaries
337+
cp /build/* $(DIST)/binaries
336338
endif
337339

338340
.PHONY: release-linux
@@ -342,7 +344,7 @@ release-linux:
342344
fi
343345
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/*' -out gitea-$(VERSION) .
344346
ifeq ($(CI),drone)
345-
mv /build/* $(DIST)/binaries
347+
cp /build/* $(DIST)/binaries
346348
endif
347349

348350
.PHONY: release-darwin
@@ -352,23 +354,23 @@ release-darwin:
352354
fi
353355
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) .
354356
ifeq ($(CI),drone)
355-
mv /build/* $(DIST)/binaries
357+
cp /build/* $(DIST)/binaries
356358
endif
357359

358360
.PHONY: release-copy
359361
release-copy:
360-
$(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),cp $(file) $(DIST)/release/$(notdir $(file));)
362+
cd $(DIST); for file in `find /build -type f -name "*"`; do cp $${file} ./release/; done;
361363

362364
.PHONY: release-check
363365
release-check:
364-
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
366+
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do $(SHASUM) $${file:2} > $${file}.sha256; done;
365367

366368
.PHONY: release-compress
367369
release-compress:
368370
@hash gxz > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
369371
$(GO) get -u github.com/ulikunitz/xz/cmd/gxz; \
370372
fi
371-
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),gxz -k -9 $(notdir $(file));)
373+
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && gxz -k -9 $${file}; done;
372374

373375
.PHONY: javascripts
374376
javascripts: public/js/index.js

0 commit comments

Comments
 (0)