Skip to content

Commit

Permalink
macos: Use makefat instead of lipo
Browse files Browse the repository at this point in the history
lipo is a macOS-only executable, while makefat can be built and used on
linux/macOS/Windows, which allows to cross-build crc as a universal
binary.
  • Loading branch information
cfergeau authored and anjannath committed Jul 25, 2022
1 parent da10d2b commit b5c1ac4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ e2e-story-registry: install
fmt:
@gofmt -l -w $(SOURCE_DIRS)

$(TOOLS_BINDIR)/makefat:
GOBIN=$(TOOLS_BINDIR) go install -mod=mod github.com/randall77/makefat@latest

.PHONY: golangci-lint
golangci-lint:
if $(TOOLS_BINDIR)/golangci-lint version 2>&1 | grep -vq $(GOLANGCI_LINT_VERSION); then\
Expand Down Expand Up @@ -311,9 +314,9 @@ endif
packaging/vfkit.entitlements:
curl -sL https://raw.githubusercontent.com/code-ready/vfkit/main/vf.entitlements -o $@

macos-universal-binary: macos-release-binary
macos-universal-binary: macos-release-binary $(TOOLS_BINDIR)/makefat
mkdir -p out/macos-universal
lipo -create out/macos-amd64/crc out/macos-arm64/crc -output out/macos-universal/crc
cd $(BUILD_DIR) && $(TOOLS_BINDIR)/makefat macos-universal/crc macos-amd64/crc macos-arm64/crc

packagedir: clean embed-download macos-universal-binary packaging/vfkit.entitlements
echo -n $(CRC_VERSION) > packaging/VERSION
Expand Down
1 change: 1 addition & 0 deletions tools/bin/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
golangci-lint
golangci-lint.exe
gomod2rpmdeps
makefat

0 comments on commit b5c1ac4

Please sign in to comment.