Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use universal darwin build for previous crystal #266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
omnibus/pkg/
omnibus/.bundle
omnibus/bin
omnibus/crystal-darwin-*
omnibus/crystal-darwin-universal
omnibus/shards-darwin-*
omnibus/vendor

Expand Down
18 changes: 9 additions & 9 deletions darwin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CRYSTAL_SHA1 ?= $(CRYSTAL_VERSION) ## Git tag/branch/sha1 to checkout and build
PACKAGE_ITERATION ?= 1
FORCE_GIT_TAGGED ?= 1 ## Require build to be based on git tag/branch

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

OUTPUT_DIR = build

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

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

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

$(OUTPUT_DIR)/$(DARWIN_NAME) $(OUTPUT_DIR)/$(DARWIN_PKG_NAME): ## Build omnibus crystal project
ifeq ($(FORCE_GIT_TAGGED), 0)
Expand All @@ -75,6 +75,6 @@ clean: ## Clean up build directory
rm -Rf $(CURDIR)/tmp
rm -Rf $(CURDIR)/../omnibus/pkg/crystal-*
rm -Rf $(CURDIR)/../omnibus/pkg/version-*
rm -Rf $(CURDIR)/../omnibus/crystal-darwin-*
rm -Rf $(CURDIR)/../omnibus/crystal-darwin-universal
rm -Rf /var/cache/omnibus/*
rm -Rf /opt/crystal/*
2 changes: 1 addition & 1 deletion omnibus/config/software/crystal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

crflags = "--no-debug"

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

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