Bug 191790

Summary: Uses/readline.mk: add readline:edit for base libedit with libreadline compat headers
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: New ---    
Severity: Affects Only Me CC: bapt, dewayne, koobs, michael.osipov, pizzamig, swills
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
default
none
add :edit flavor none

Description Jan Beich freebsd_committer freebsd_triage 2014-07-10 19:32:29 UTC
Created attachment 144561 [details]
default

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.
Comment 1 Baptiste Daroussin freebsd_committer freebsd_triage 2014-07-11 00:00:31 UTC
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.
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2014-07-11 00:02:50 UTC
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.
Comment 3 Jan Beich freebsd_committer freebsd_triage 2014-08-10 02:52:55 UTC
OK. READLINE_FLAVOR can still be used to test/override from make.conf.
Comment 4 Jan Beich freebsd_committer freebsd_triage 2014-08-10 02:52:59 UTC
Created attachment 145601 [details]
add :edit flavor
Comment 5 Antoine Brodin freebsd_committer freebsd_triage 2014-08-10 08:54:02 UTC
mmm this will overlink libedit...
Comment 6 Baptiste Daroussin freebsd_committer freebsd_triage 2015-01-16 23:23:24 UTC
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?
Comment 7 dewayne 2018-02-27 00:41:47 UTC
(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"!
Comment 8 Michael Osipov 2021-06-15 10:31:21 UTC
(In reply to Jan Beich from comment #3)

I would highly favorize to see something like this in make.conf to predefine to use readline from ports and not to fiddle with every port manually.