Skip to content

Commit e8ca2da

Browse files
techknowlogicklafriks
authored andcommitted
Fix cross-compile builds (#6609) (#6615)
* Fix cross-compile builds (#6609) * Update Makefile * remove bash requirement
1 parent f64b8eb commit e8ca2da

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ IMPORT := code.gitea.io/gitea
33

44
GO ?= go
55
SED_INPLACE := sed -i
6+
SHASUM ?= shasum -a 256
67

78
export PATH := $($(GO) env GOPATH)/bin:$(PATH)
89

@@ -327,7 +328,7 @@ release-windows:
327328
fi
328329
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
329330
ifeq ($(CI),drone)
330-
mv /build/* $(DIST)/binaries
331+
cp /build/* $(DIST)/binaries
331332
endif
332333

333334
.PHONY: release-linux
@@ -337,7 +338,7 @@ release-linux:
337338
fi
338339
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/*' -out gitea-$(VERSION) .
339340
ifeq ($(CI),drone)
340-
mv /build/* $(DIST)/binaries
341+
cp /build/* $(DIST)/binaries
341342
endif
342343

343344
.PHONY: release-darwin
@@ -347,23 +348,23 @@ release-darwin:
347348
fi
348349
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) .
349350
ifeq ($(CI),drone)
350-
mv /build/* $(DIST)/binaries
351+
cp /build/* $(DIST)/binaries
351352
endif
352353

353354
.PHONY: release-copy
354355
release-copy:
355-
$(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),cp $(file) $(DIST)/release/$(notdir $(file));)
356+
cd $(DIST); for file in `find /build -type f -name "*"`; do cp $${file} ./release/; done;
356357

357358
.PHONY: release-check
358359
release-check:
359-
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
360+
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "checksumming $${file}" && $(SHASUM) `echo $${file} | sed 's/^..//'` > $${file}.sha256; done;
360361

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

368369
.PHONY: javascripts
369370
javascripts: public/js/index.js

0 commit comments

Comments
 (0)