ngs-lang / ngs

Next Generation Shell (NGS)
https://ngs-lang.org/
GNU General Public License v3.0
1.4k stars 43 forks source link

Remove /usr/local and /opt/homebrew #668

Open ryandesign opened 2 weeks ago

ryandesign commented 2 weeks ago

This code is wrong, or at least partly unnecessary and partly inconvenient:

https://github.com/ngs-lang/ngs/blob/dd1bc7021e7315878613e20e6393b1c33f3925c3/CMakeLists.txt#L24-L25

/usr/local does not need to be mentioned here because compilers look in /usr/local by default.

/opt/homebrew should not be mentioned here because the user may not be using Homebrew or may not want to use its software.

For example, a user installing ngs without Homebrew installed will see the warning:

ld: warning: directory not found for option '-L/opt/homebrew/lib'

Another example: if a user is installing ngs with MacPorts, but they also happen to have Homebrew installed (which MacPorts does not support and strongly discourages but some users can't help themselves), then they definitely do not want ngs's dependencies to be satisfied by things installed using Homebrew.

ilyash-b commented 2 weeks ago

Thanks! This will take some time to fix as I'll need to reproduce the issues that caused me to add this and solve them somehow differently.

ryandesign commented 2 weeks ago

Presumably you were building ngs from source and you wanted to use dependencies installed with Homebrew on Apple Silicon. (On Intel, Homebrew installs to /usr/local which as I said compilers use by default.) The solution would be to specify the -I/opt/homebrew/include and -L/opt/homebrew/lib flags in CFLAGS/CXXFLAGS and LDFLAGS respectively when invoking cmake.

ilyash-b commented 2 weeks ago

Sounds about right. Still need to check though.