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
~/bin
and/opt
both exist. /opt
will have to be created withsudo
but should be owned by your user.- Make sure your
$PATH
includes~/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 crystal
and then edit~/bin/crystal
to 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 crystal
should now show/Users/user/bin/crystal
crystal -v
should 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/shards
runmake
- From
~/bin
runln -s /opt/shards/bin/shards
which shards
should now point to /opt/shards/bin/shards`shards --version
should beShards 0.15.0 [6471b2b] (2021-10-04)
Setting up lucky cli
- Clone the lucky_cli repo to
/opt/lucky_cli
- From
/opt/lucky_cli
runshards build
- From
~/bin
runln -s /opt/lucky_cli/bin/lucky