Created attachment 144561 [details]
Not every port requires GNU libreadline. And the base system already replaced it with libedit (except gdb). Let's do the same by default for ports if old version was enough. But allow users to opt out.
/usr/include/edit exists on every supported release. So, -exp runs is to catch -lreadline hardcodes as in lang/lua52.
using libedit by default is a bad idea given that:
1/ we are out of sync with upstream libedit and syncing is not easy
2/ libedit unicode support is a total crap
in my opinion the default should remain libreadline from ports how ever being able to specify (non automatic) USES= readline:edit for ports to say if readline is not in base switch to libedit because I know the given port is working properly with libedit I'm ok with it.
So the patch should imho be changed in that direction.
Another reason is that readline api/abi has changed bit between the old version we had in base and the newer ones and the libedit interface is applicable to the old version, not the new one.
What I mean it libedit is not good enough to replace readline in general cases but can be from time to time, so it should be explicit.
OK. READLINE_FLAVOR can still be used to test/override from make.conf.
Created attachment 145601 [details]
add :edit flavor
mmm this will overlink libedit...
So now that libedit in head and the port version is able correctly accept unicode
I think this work can be resumed. By depending on the port for all but head.
2 issues to fix:
1/ find a way to avoid overlink (or prevent it)
2/ allow to enforce readline for some ports (gdbtui (in gdb port) for example is known to fail with libedit)
Maybe 1/ can be fixed by adding a readline.pc in the libedit port and add it to pkgconf path before the gnu readline one?
(In reply to Jan Beich from comment #0)
Thanks for logging this PR Jan. It also reduces the obligations of systems that have to eliminate or reduce GPL compliance. I have a client that insisted upon no GPLv3 code on his servers. Replacing readline with libedit on ports that were not intended to be GPL licenced, was only part of the "fun"!