Skip to content

Commit f14d932

Browse files
committed
Use universal darwin build for previous crystal
For last crystal releases there is only crystal-darwin-universal. It means, there is no need to separate on ARCH. Update `darwin/Makefile` to use folder name without arch suffix.
1 parent f2c1e13 commit f14d932

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
omnibus/pkg/
22
omnibus/.bundle
33
omnibus/bin
4-
omnibus/crystal-darwin-*
4+
omnibus/crystal-darwin-universal
55
omnibus/shards-darwin-*
66
omnibus/vendor
77

darwin/Makefile

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

11-
PREVIOUS_CRYSTAL_RELEASE_DARWIN_TARGZ ?= ## url to crystal-{version}-{package}-darwin-x86_64.tar.gz
11+
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
1212

1313
OUTPUT_DIR = build
1414

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

4141
.PHONY: darwin-previous
42-
darwin-previous: $(CURDIR)/../omnibus/crystal-darwin-x86_64/embedded/bin/crystal ## download previous crystal darwin release
42+
darwin-previous: $(CURDIR)/../omnibus/crystal-darwin-universal/embedded/bin/crystal ## download previous crystal darwin release
4343

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

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

omnibus/config/software/crystal.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
crflags = "--no-debug"
5757

58-
copy "#{Dir.pwd}/crystal-#{ohai['os']}-#{ohai['kernel']['machine']}/embedded/bin/crystal", ".build/crystal"
58+
copy "#{Dir.pwd}/crystal-darwin-universal/embedded/bin/crystal", ".build/crystal"
5959

6060
# Compile for Intel
6161
command "make crystal stats=true release=true FLAGS=\"#{crflags}\" CRYSTAL_CONFIG_LIBRARY_PATH= O=#{output_path}", env: env

0 commit comments

Comments
 (0)