Linuxbrew / legacy-linuxbrew

:skull: This repository is defunct, because it has been split into https://github.com/Linuxbrew/brew and https://github.com/Linuxbrew/homebrew-core
http://linuxbrew.sh
Other
2.23k stars 297 forks source link

ncurses: configure: error: Cannot link with GPM library #1081

Closed bsmith89 closed 6 years ago

bsmith89 commented 8 years ago

ncurses is required for many packages, but brew install ncurses fails with the following:

Last 15 lines from /home/bjsm/.cache/Homebrew/Logs/ncurses/01.configure:
checking if you want to build shared libraries... yes
checking if you want to build static libraries... yes
checking if you want to build debug libraries... yes
checking if you want to build profiling libraries... no
checking if you want to build C++ shared libraries... no
checking for specified models...  shared normal debug
checking for default model... shared
checking if you want to have a library-prefix... auto
checking for PATH separator... :
checking if you want to build a separate terminfo library... no
checking if you want to build a separate tic library... no
checking if you want to link with the GPM mouse library... maybe
checking for gpm.h... yes
checking for Gpm_Open in -lgpm... no
configure: error: Cannot link with GPM library

READ THIS: https://github.com/Linuxbrew/linuxbrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
  https://github.com/Homebrew/homebrew-dupes/issues

These open issues may also help:
Fish: depends on ncurses https://github.com/Linuxbrew/linuxbrew/pull/1080
Fish depends on ncurses https://github.com/Linuxbrew/linuxbrew/issues/1079

libgpm itself requires ncurses, so brew install libgpm doesn't help.

gist-logs link: https://gist.github.com/86e900649aeb67b561041639bda39c39.

sjackman commented 8 years ago

Wow, a circular dependency between ncurses and libgpm? That's not fun at all. Really not. For weird situations like this Linux From Scratch usually has helpful information. Off the top of my head, I'd suggest trying adding an option like --without-gpm (you'll have to check its exact name with ./configure --help) to the configure command of ncurses.

bsmith89 commented 8 years ago

--without-gpm appears to be the correct flag, but brew install ncurses --without-gpm fails with the same error.

It would appear that that flag is not being passed through to the configure script.

bsmith89 commented 8 years ago

I am able to build and install ncurses myself with the --without-gpm flag.

bsmith89 commented 8 years ago

I was able to solve my issue by adding that flag directly to the formula. I am curious why the flag wasn't being passed through, though.

sjackman commented 8 years ago

Glad to hear that you got it working! You do have to add the flag to the formula. There's no automatic passing of brew command line arguments to the configure command. Please submit a pull request.