Skip to content

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

@dfischer

Description

@dfischer
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions