postgresql93 port and libedit

Waitman Gobble gobble.wa at
Thu Jan 15 15:37:50 UTC 2015

On Thu, Jan 15, 2015 at 12:26 AM, Dewayne Geraghty
<dewayne.geraghty at> wrote:
> On 15/01/2015 5:27 PM, Waitman Gobble wrote:
>> Hi,
>> I noticed that postgresql93-client port pulls in readline, which is GPLv3.
>> When I get rid of readline in Makefile 'USES' and also change the
>> bottom of the Makefile in postgresql93-server,
>> ...
>> .include "${.CURDIR}/../postgresql92-server/Makefile"
>> CONFIGURE_ARGS+=--with-libedit-preferred
>> It builds without readline and links against libedit in base:
>> # ldd /usr/local/bin/psql
>> /usr/local/bin/psql:
>> => /usr/local/lib/ (0x800885000)
>> => /usr/local/lib/ (0x800ab3000)
>> => /usr/lib/ (0x800cbe000)
>> => /lib/ (0x800f2a000)
>> => /lib/ (0x801161000)
>> => /lib/ (0x801385000)
>> => /lib/ (0x80171e000)
>> => /lib/ (0x801b16000)
>> .. there's a link to gettext libintl but that's LGPL (2.1)
>> Anyhow I haven't done testing with psql linked to libedit instead of
>> readline.. There's some noise about this a few years back but I don't
>> see anything recent. Anyone have any 'bad' recent experience with
>> libedit? pitfalls? It might be good to have libedit added as an
>> option. I'm working on an appliance and the readline dependency kinda
>> messes things up a bit for me. Obviously other remedies beyond ports
>> but I think it could be a nice option. Comments appreciated.
>> Thanks,
> Good catch Waitman.  And thanks for sharing an approach to avoid GPLv3
> inclusion.
> Though you've raised an interesting question as to whether the licencing
> information displayed by "pkg info" is accurate where a port pulls in
> mandatory dependencies that use a more restrictive open source licence.
> Of the subset of ports that I use (servers only), the ports [licences]
> that may be of concern are:  python27 [PSFL], mediawiki [GPLv2],
> mysql56-server [from mysql web GPL], pcre [BSD3CLAUSE] also use readline
> and aren't tagged as GPLv3 which they probably should as FreeBSD
> metaports requires readline?
> _______________________________________________
> freebsd-ports at mailing list
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe at"

There seems to be an issue that makes this problem more complicated,
could be worked out. I tried building in poudiere without any
readline, configure fails. Adding readline back to USES in client
Makefile gets a build, but --with-libedit-preferred links to base

In postgresql configure script, still looks for readline even if it
uses libedit. So the package built by poudiere still pulls in


if test "$with_readline" = yes; then

{ $as_echo "$as_me:$LINENO: checking for library containing readline" >&5
$as_echo_n "checking for library containing readline... " >&6; }
if test "${pgac_cv_check_readline+set}" = set; then
  $as_echo_n "(cached) " >&6
if test x"$with_libedit_preferred" != x"yes"
then    READLINE_ORDER="-lreadline -ledit"
else    READLINE_ORDER="-ledit -lreadline"

so basically it's setting the READLINE_ORDER with both libedit and
libreadline but in alternate order depending on 'preferred'

after a build using 'preferred' the client is linked to libedit, but
pkg still pulls in readline as dependency.

# pkg install postgresql93-server
New packages to be INSTALLED:
        postgresql93-server: 9.3.5
        postgresql93-client: 9.3.5
        readline: 6.3.8

# ldd /usr/local/bin/psql
/usr/local/bin/psql: => /usr/local/lib/ (0x2009a000) => /usr/local/lib/ (0x200c9000) => /usr/lib/ (0x200db000) => /lib/ (0x2013e000) => /lib/ (0x20173000) => /lib/ (0x20200000) => /lib/ (0x20400000) => /lib/ (0x2019e000) => /lib/ (0x20384000)

Apparently this behavior is because libedit doesn't work properly on
some (non BSD) platforms. (?)  ...reference: the notes in the
configure script.
So some work would need to be done to alter the configure script and
pull out the readline stuff, (but should probably be an option). This
makes for a more complicated port, but it's doable. For my own project
I can make a custom port with readline stripped out, but for everyone
with an 'optionally really remove readline' option that would be a
bigger challenge I think.

Waitman Gobble
Los Altos California USA

More information about the freebsd-ports mailing list