Mac+M1+Crystal+Lucky
This is the series of steps I followed to get Crystal and Lucky running on a Mac M1 from scratch, as of Oct. 2021.
Prerequisites
- Ensure
~/binand/optboth exist. /optwill have to be created withsudobut should be owned by your user.- Make sure your
$PATHincludes~/bin. Doing so is up to you and will vary a bit depending on your shell.
Installing crystal
From this issue comment the “second gen” build comes as a tar.gz. This is a direct link to the archive.
- In
/opt, extract crystal-ci-univ2nd-dev-1.tar.gz. - In
~/bin,touch crystal ; chmod u+x crystaland then edit~/bin/crystalto have these contents:
#!/bin/bash
export CRYSTAL_PATH='lib:/opt/crystal-ci-univ2nd-dev-1/src'
export CRYSTAL_LIBRARY_PATH="$(brew --prefix)/lib"
export LDFLAGS="/opt/homebrew/opt/openssl@1.1/lib"
export CPPFLAGS="/opt/homebrew/opt/openssl@1.1/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.1/lib/pkgconfig"
export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"
exec '/opt/crystal-ci-univ2nd-dev-1/bin/crystal' "${@}"
which crystalshould now show/Users/user/bin/crystalcrystal -vshould now show:
Crystal 1.2.0-dev [d7f25e0c6] (2021-09-15)
LLVM: 10.0.0
Default target: aarch64-apple-darwin
Setting up shards
- Clone the shards repo to
/opt/shards - From
/opt/shardsrunmake - From
~/binrunln -s /opt/shards/bin/shards which shardsshould now point to /opt/shards/bin/shards`shards --versionshould beShards 0.15.0 [6471b2b] (2021-10-04)
Setting up lucky cli
- Clone the lucky_cli repo to
/opt/lucky_cli - From
/opt/lucky_clirunshards build - From
~/binrunln -s /opt/lucky_cli/bin/lucky