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

MacOS install issue with ncurses (locally fixed but maybe not ideally) #86

Open
dfischer opened this issue Aug 20, 2023 · 0 comments
Open

Comments

@dfischer
Copy link

dfischer commented Aug 20, 2023

0x44@_ ~/c0d3/Orca-c (master)
❯ make                                                                                                              (base)
Error: ncurses directory not found at /usr/local/opt/ncurses
Install with: brew install ncurses
make: *** [release] Error 1

Self descriptive.

My fix:

❯ git diff                                                                                                          (base)
diff --git a/tool b/tool
index e32b94d..f004042 100755
--- a/tool
+++ b/tool
@@ -346,7 +346,7 @@ build_target() {
       case $os in
         mac)
           if ! brew_prefix=$(printenv HOMEBREW_PREFIX); then
-             brew_prefix=/usr/local
+             brew_prefix=/opt/homebrew
           fi
           ncurses_dir="$brew_prefix/opt/ncurses"
           if ! [ -d "$ncurses_dir" ]; then
0x44@_ ~/c0d3/Orca-c (master)
❯                                                   

Maybe not ideal but it works. I think that type of checking is specific to how brew handles env vars within a particular recipe (that is HOMEBREW_PREFIX because on my system which is a M1 Mac mini there is no such thing as HOMEBREW_PREFIX on my env. I investigated the brew docs and it came up only in specification of writing a recipe but not a particular global, so it might function as some closure over the recipe and exporting then unexporting a ENV var during that 'install session.' I am just speculating though.

❯ echo $HOMEBREW_PREFIX                                                                                             (base)

0x44@_ ~/c0d3/Orca-c (master)
❯ echo cc_vers^C                                                                                                    (base)
0x44@_ ~/c0d3/Orca-c (master)
❯ ./tool info                                                                                                       (base)
Operating system: mac
Architecture:     unknown
Compiler name:    cc
Compiler type:    clang
Compiler version: 3.9.0
Linker:           default
0x44@_ ~/c0d3/Orca-c (master)
❯                            

I can submit a PR if this is good enough or let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant