Skip to content
Closed
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
11 changes: 9 additions & 2 deletions Formula/c/crystal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def install
ENV.prepend_path "CRYSTAL_LIBRARY_PATH", dep.opt_lib
end

crystal_install_dir = bin
crystal_install_dir = OS.linux? ? libexec : bin
stdlib_install_dir = pkgshare

# Avoid embedding HOMEBREW_PREFIX references in `crystal` binary.
Expand All @@ -111,7 +111,6 @@ def install
release_flags = ["release=true", "FLAGS=--no-debug"]
crystal_build_opts = release_flags + [
"CRYSTAL_CONFIG_LIBRARY_PATH=#{config_library_path}",
"CRYSTAL_CONFIG_LIBRARY_RPATH=#{config_library_path}",
"CRYSTAL_CONFIG_PATH=#{config_path}",
"interpreter=true",
]
Expand Down Expand Up @@ -155,6 +154,14 @@ def install
fish_completion.install "etc/completion.fish" => "crystal.fish"

man1.install "man/crystal.1"

return unless OS.linux?

# Wrapper script so that Crystal can find libraries in HOMEBREW_PREFIX
(bin/"crystal").write_env_script(
crystal_install_dir/"crystal",
LD_RUN_PATH: "${LD_RUN_PATH:+${LD_RUN_PATH}:}#{HOMEBREW_PREFIX}/lib",
)
end

test do
Expand Down