Skip to content

Commit 075c916

Browse files
committed
cherry pick crystal-lang#266
1 parent e5a5658 commit 075c916

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

darwin/Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CRYSTAL_SHA1 ?= $(CRYSTAL_VERSION) ## Git tag/branch/sha1 to checkout and build
99
PACKAGE_ITERATION ?= 1
1010
FORCE_GIT_TAGGED ?= 1 ## Require build to be based on git tag/branch
1111

12-
PREVIOUS_CRYSTAL_RELEASE_DARWIN_TARGZ ?= ## url to crystal-{version}-{package}-darwin-x86_64.tar.gz
12+
PREVIOUS_CRYSTAL_RELEASE_DARWIN_TARGZ ?= ## url to crystal-{version}-{package}-darwin-universal.tar.gz. Eg: https://github.com/crystal-lang/crystal/releases/download/1.10.1/crystal-1.10.1-1-darwin-universal.tar.gz
1313

1414
OUTPUT_DIR = build
1515

@@ -40,15 +40,15 @@ help: ## Show this help
4040
awk 'BEGIN {FS = "## "}; /^## [a-zA-Z_-]/ {printf " \033[36m%s\033[0m\n", $$2}; /^## / {printf " %s\n", $$2}'
4141

4242
.PHONY: darwin-previous
43-
darwin-previous: $(CURDIR)/../omnibus/crystal-darwin-x86_64/embedded/bin/crystal ## download previous crystal darwin release
43+
darwin-previous: $(CURDIR)/../omnibus/crystal-darwin-universal/embedded/bin/crystal ## download previous crystal darwin release
4444

4545
# Once there are prior builds for arm64, this can use DARWIN_ARCH
46-
$(CURDIR)/../omnibus/crystal-darwin-x86_64/embedded/bin/crystal:
47-
curl -L -o /tmp/crystal-darwin-x86_64.tar.gz $(PREVIOUS_CRYSTAL_RELEASE_DARWIN_TARGZ) \
48-
&& mkdir -p $(CURDIR)/../omnibus/crystal-darwin-x86_64 \
49-
&& tar xfz /tmp/crystal-darwin-x86_64.tar.gz -C $(CURDIR)/../omnibus/crystal-darwin-x86_64 --strip-components=1 \
50-
&& rm /tmp/crystal-darwin-x86_64.tar.gz \
51-
&& chmod +x $(CURDIR)/../omnibus/crystal-darwin-x86_64/embedded/bin/crystal
46+
$(CURDIR)/../omnibus/crystal-darwin-universal/embedded/bin/crystal:
47+
curl -L -o /tmp/crystal-darwin-universal.tar.gz $(PREVIOUS_CRYSTAL_RELEASE_DARWIN_TARGZ) \
48+
&& mkdir -p $(CURDIR)/../omnibus/crystal-darwin-universal \
49+
&& tar xfz /tmp/crystal-darwin-universal.tar.gz -C $(CURDIR)/../omnibus/crystal-darwin-universal --strip-components=1 \
50+
&& rm /tmp/crystal-darwin-universal.tar.gz \
51+
&& chmod +x $(CURDIR)/../omnibus/crystal-darwin-universal/embedded/bin/crystal
5252

5353
$(OUTPUT_DIR)/$(DARWIN_NAME) $(OUTPUT_DIR)/$(DARWIN_PKG_NAME): ## Build omnibus crystal project
5454
ifeq ($(FORCE_GIT_TAGGED), 0)
@@ -75,6 +75,6 @@ clean: ## Clean up build directory
7575
rm -Rf $(CURDIR)/tmp
7676
rm -Rf $(CURDIR)/../omnibus/pkg/crystal-*
7777
rm -Rf $(CURDIR)/../omnibus/pkg/version-*
78-
rm -Rf $(CURDIR)/../omnibus/crystal-darwin-*
78+
rm -Rf $(CURDIR)/../omnibus/crystal-darwin-universal
7979
rm -Rf /var/cache/omnibus/*
8080
rm -Rf /opt/crystal/*

omnibus/config/software/crystal.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
mkdir ".build"
5555

5656
block { puts "\n=== Build native crystal bin with embedded universal crystal binary\n\n" }
57-
copy "#{Dir.pwd}/crystal-#{ohai['os']}-#{ohai['kernel']['machine']}/embedded/bin/crystal", ".build/crystal"
57+
copy "#{Dir.pwd}/crystal-darwin-universal/embedded/bin/crystal", ".build/crystal"
5858
command ".build/crystal --version", env: env.dup
5959
command "file .build/crystal", env: env.dup
6060

0 commit comments

Comments
 (0)