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

OS X color support lost on 0.4.0 #107

Closed
stsg opened this issue Dec 8, 2016 · 18 comments
Closed

OS X color support lost on 0.4.0 #107

stsg opened this issue Dec 8, 2016 · 18 comments

Comments

@stsg
Copy link

stsg commented Dec 8, 2016

Building on macOS 10.12.1 with latest homebrew ncurses, but color support is lost in 0.4.0.
Running in latest iTerm2 with TERM=xterm-256color
Any ideas?

@andmarti1424
Copy link
Owner

No colors at all? Please check USECOLORS in your Makefile.

@stsg
Copy link
Author

stsg commented Dec 8, 2016

No color at all. Bright only.
Makefile diff:

< prefix=/usr
> prefix=/usr/local

< LINUX := -DLINUX
> LINUX :=

< MACOSX :=
> MACOSX := -DMACOSX

@stsg
Copy link
Author

stsg commented Dec 8, 2016

USECOLORS := -DUSECOLORS

@stsg
Copy link
Author

stsg commented Dec 8, 2016

version 0.3.0

030

version 0.4.0

040

@andmarti1424
Copy link
Owner

Do you use the same terminal?

@stsg
Copy link
Author

stsg commented Dec 12, 2016

Yes, of course.

> echo $TERM
xterm-256color

@andmarti1424
Copy link
Owner

I meant your terminal emulator. Not your TERM env. variable.

@stsg
Copy link
Author

stsg commented Dec 12, 2016

Yes, shure.
ITerm 2 Build 3.0.13

@stsg
Copy link
Author

stsg commented Dec 12, 2016

version 0.3.0

> otool -L /usr/local/bin/scim
/usr/local/bin/scim:
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
        /usr/local/opt/ncurses/lib/libncursesw.6.dylib (compatibility version 6.0.0, current version 6.0.0)

version 0.4.0

> otool -L ./scim
./scim:
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
        /usr/local/opt/ncurses/lib/libncursesw.6.dylib (compatibility version 6.0.0, current version 6.0.0)

@andmarti1424
Copy link
Owner

I really do not know what the problem could be. Will wait for other OS X users to get their feedback and see if this happen to them as well.

@andmarti1424
Copy link
Owner

Does colors in headings show correctly?

@stsg
Copy link
Author

stsg commented Dec 12, 2016

No! No colors at all.
0.3.0
header_030
0.4.0
header_040

@andmarti1424
Copy link
Owner

Could you please attach the entire Makefile?

@stsg
Copy link
Author

stsg commented Dec 12, 2016

@andmarti1424
Copy link
Owner

andmarti1424 commented Dec 13, 2016

I have installed sc-im v4.0 today in a OS X Sierra virtual machine running in Virtual Box:
It was a fresh OS X install and these were my steps to get sc-im running:

  1. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. brew install homebrew/dupes/ncurses
  3. git clone https://github.com/andmarti1424/sc-im
  4. edit Makefile (just these lines:)
    < LINUX := -DLINUX
    > LINUX :=
    < MACOSX :=
    > MACOSX := -DMACOSX`
  5. brew link - - force ncurses
  6. make

and after finished building, I run sc-im and see colors without issue!

@stsg
Copy link
Author

stsg commented Dec 13, 2016

I have reinstalled ncurses:

brew uninstall ncurses
brew install homebrew/dupes/ncurses
brew link --force ncurses

I then downloaded v 3.0 from https://github.com/andmarti1424/sc-im/archive/v0.3.0.tar.gz
When building, I get following error:

./macros.h:48:10: fatal error: 'ncursesw/curses.h' file not found

I changed Makefile in following way:

diff Makefile.orig Makefile

37,38c37,38
< LINUX := -DLINUX
< #LINUX :=
---
> #LINUX := -DLINUX
> LINUX :=
49,50c49,50
< #MACOSX := -DMACOSX
< MACOSX :=
---
> MACOSX := -DMACOSX
> #MACOSX :=
137c137
< CFLAGS := $(LINUX) $(FREEBSD) $(NETBSD) $(MACOSX) -O2 -Wall -pipe -g -I/usr/include/libxml2
---
> CFLAGS := $(LINUX) $(FREEBSD) $(NETBSD) $(MACOSX) -O2 -Wall -pipe -g -I/usr/include/libxml2 $(shell pkg-config --cflags ncursesw)
144c144
< LDLIBS := -lm -lncursesw
---
> LDLIBS := -lm $(shell pkg-config --libs ncursesw)

Running v3.0 and it has color support.

I then cloned v4.0:

git clone https://github.com/andmarti1424/sc-im

changed Makefile:

diff Makefile.orig Makefile

37,38c37,38
< LINUX := -DLINUX
< #LINUX :=
---
> #LINUX := -DLINUX
> LINUX :=
49,50c49,50
< #MACOSX := -DMACOSX
< MACOSX :=
---
> MACOSX := -DMACOSX
> #MACOSX :=

building and running, v4.0 has no colors!

Once again, I changed Makefile:

diff Makefile.orig Makefile

37,38c37,38
< LINUX := -DLINUX
< #LINUX :=
---
> #LINUX := -DLINUX
> LINUX :=
49,50c49,50
< #MACOSX := -DMACOSX
< MACOSX :=
---
> MACOSX := -DMACOSX
> #MACOSX :=
137c137
< CFLAGS := $(LINUX) $(FREEBSD) $(NETBSD) $(MACOSX) -O2 -Wall -pipe -g -I/usr/include/libxml2 $(shell pkg-config --cflags ncursesw)
---
> CFLAGS := $(LINUX) $(FREEBSD) $(NETBSD) $(MACOSX) -O2 -Wall -pipe -g -I/usr/include/libxml2
142c142
< LDLIBS := -lm $(shell pkg-config --libs ncursesw)
---
> LDLIBS := -lm -lncursesw -L/usr/local/Cellar/ncurses/6.0_2/lib

Building:

make clean
make

And now v4.0 has color support!

pkg-config output:

pkg-config --cflags ncursesw
-D_DARWIN_C_SOURCE -I/usr/local/Cellar/ncurses/6.0_2/include -I/usr/local/Cellar/ncurses/6.0_2/include/ncursesw

pkg-config --libs ncursesw
-L/usr/local/Cellar/ncurses/6.0_2/lib -lncursesw

@andmarti1424
Copy link
Owner

This is definitely a building/linking to ncurses problem.
I will close this, since I cannot reproduce it and since it works in a fresh OSX install.
Will link this to the WIKI though.

@andmarti1424
Copy link
Owner

Thanks again.

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

No branches or pull requests

2 participants