# emulators/qemu + ncurses



## _martin (Jan 8, 2018)

Issue with qemu + ncurses seems to hunt me down for some time. I even opened PR 211973 for it. Issue was not solved at all, I always found some workaround to have it done manually. 

TL;DR version: qemu is installed without the ncurses support even when selected in port's menu config, refuses to install at all when you're using devel/ncurses.

The issue I have with recent versions can be found in PR, I'm not going to double post. For me it seems a bit ridiculous this bug was not fixed by proper port maintainer. So I'm thinking maybe I'm the problem here... 

And hence my question: are you using qemu with ncurses , and if so, do you have any problems with it?


----------



## Snurg (Jan 9, 2018)

I know it's no big help and I might be totally wrong in this case.

I had some time ago a problem because a port was failing to build.
Problem was in the linker stage.
Only solution was to compile without linking and then do a separate linker run, with explicitly specifying the correct libraries to use.

Cause/Background of the problem probably was mixing ports and packages, leading to incompatible lib versions.
So, maybe switching FreeBSD.conf from *quarterly* to *latest* and then running `pkg update` could solve this problem by updating pkg libraries to latest, so they are on sync with ports.


----------



## _martin (Jan 9, 2018)

You are not wrong .. If you read the last posts in that PR I did you'll see I'm talking about the same issue. If I omit prepocessor issue (which is weird why nobody else reported a problem) it boils down to the linking issue. 

Port itself has some faulty logic during configuration stage, pkg-config returns paths for ncurses from ports when present. The whole package is built against port library and linked together with a system one. That produces garbled output when qemu is started and is unusable. 

Linker flags are -L"/usr/lib" -L"/usr/local/lib" which makes it a problem to link to a proper library when you want to use ports. I had to manually edit the linker flags to be the other way around ( -L"/usr/local/lib" -L"/usr/lib"  ) to link it successfully. Problem is what if you have some other library you want to use from system first ? I'm not aware of any library like that, only ncurses, but still ..


----------



## Snurg (Jan 9, 2018)

Yes I read your PR. And this reminded me of the ordeal of getting Firefox built back then.
I had installed it via pkg, deleted it later and tried to build it via ports, because I wanted to experiment a bit with sessionstore.js due to a bug in regard to FVWM.
As it was only one library that caused problems, I finally solved it by building that single library, putting its path at the beginning of the linker paths list.

But I suspect this wouldn't have been necessary if I had switched from quarterly to latest versions in FreeBSD.conf.
I have somehow the feeling that most of the problems with mixing pkg and ports are related to the fact that ports are always "latest", *and so one will run into problems unless s/he switches FreeBSD.conf to "latest" immediately after base system install.*


----------



## _martin (Jan 9, 2018)

Note I'm using the "latest", or current for ports (daily portsnap) and don't mix the pkg vs port install. I think this port is just broken, but I really like to hear other voices and their experience with such installation of qemu.


----------

