Skip to content

Selecting Homebrew version of Tk on macOS #18

@poldy

Description

@poldy

On macOS, when I installed using "opam install labltk" this linked against Apple's version of Tk which honestly isn't very good.

To use the better version I installed using "brew install tcl-tk", I had to run "opam uninstall labltk" again (which probably left its dependencies in place), then the following commands in a git clone of this repo (these are a slightly-extended version of what "opam show --raw labltk" gave):

./configure -use-findlib -verbose -installbindir $HOME/.opam/5.0.0+flambda/bin -tkdefs -I/opt/homebrew/opt/tcl-tk/include -tklibs -L/opt/homebrew/opt/tcl-tk/lib -tk-no-x11
make library opt
make install

This worked, but I was wondering if there was a nicer way to do this with some options to opam?

If it helps, you can set PKG_CONFIG_PATH=/opt/homebrew/opt/tcl-tk/lib/pkgconfig:$PKG_CONFIG_PATH then pkg-config --cflags tk gives the required value for -tkdefs above; and pkg-config --libs tk give the equivalent of LDFLAGS in make (i.e. library search directory for -tklibs and required libraries).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions