Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Sep 2007 12:05:00 +0200
From:      Martin Kammerhofer <dada@pluto.tugraz.at>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/116687: Update port: devel/libedit enable non-GPL readline emulation
Message-ID:  <200709271005.l8RA5099001303@pluto.tugraz.at>
Resent-Message-ID: <200709271010.l8RAA1F4075456@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         116687
>Category:       ports
>Synopsis:       Update port: devel/libedit enable non-GPL readline emulation
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 27 10:10:01 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Martin Kammerhofer
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD Martin.liebt.Susi 6.2-STABLE FreeBSD 6.2-STABLE #0: Sun Aug 19 14:22:22 CEST 2007 toor@Martin.liebt.Susi:/usr/obj/usr/src/sys/P2B-S i386
>Description:

Libedit is BSD licensed and contains a GNU Readline emulation. This is
very useful, because GNU Readline - AND THEREFORE EVERY PROGRAM
LINKING AGAINST IT - is under the GPL. Unfortunately in FreeBSD this
emulation feature is not available because it has been disabled.

These patches enable the feature. To avoid conflicts with GNU readline
(either from ports or the base system) headers are installed under
include/editline rather than include/readline and no compatibility
links are made. This is similar to what Debian did. (Yes, they do have
a BSD licensed readline replacement!)

Using the patchset below I have been able to compile
http://sourceforge.net/projects/java-readline/ on FreeBSD and link it
against libedit. I'll submit this too when this PR has been done.

>How-To-Repeat:
>Fix:
diff -ruN /usr/ports/devel/libedit/Makefile devel/libedit/Makefile
--- /usr/ports/devel/libedit/Makefile	2007-02-06 04:06:29.000000000 +0100
+++ devel/libedit/Makefile	2007-09-25 18:20:14.000000000 +0200
@@ -7,6 +7,7 @@
 
 PORTNAME=	libedit
 PORTVERSION=	2.6.10
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	ftp://ftp.astron.com/pub/libedit/ \
 		http://www.canonware.com/download/libedit/
@@ -16,7 +17,6 @@
 
 GNU_CONFIGURE=	yes
 USE_LDCONFIG=	yes
-CONFIGURE_ARGS=	--disable-readline
 
 MAN3=		editline.3
 MAN5=		editrc.5
@@ -39,6 +39,9 @@
 		editline.3 history.3
 MANCOMPRESSED=	no
 
+post-extract:
+	${MV} ${WRKSRC}/readline ${WRKSRC}/editline
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|CFLAGS -O|CFLAGS|g ; \
 		 s|MAJOR="2"|MAJOR="6"|g' ${WRKSRC}/configure
diff -ruN /usr/ports/devel/libedit/files/patch-configure devel/libedit/files/patch-configure
--- /usr/ports/devel/libedit/files/patch-configure	1970-01-01 01:00:00.000000000 +0100
+++ devel/libedit/files/patch-configure	2007-09-25 20:46:15.000000000 +0200
@@ -0,0 +1,32 @@
+--- configure.orig	2006-11-24 18:13:57.000000000 +0100
++++ configure	2007-09-25 20:39:26.000000000 +0200
+@@ -4601,7 +4601,7 @@
+   LIB_S="libedit.so.$LIB_MAJOR"
+   LIB_S_LINK="libedit.so"
+   LIB_S_LINKS="$LIB_S $LIB_S_LINK"
+-  S_LDFLAGS="-shared"
++  S_LDFLAGS="-shared -Wl,-soname=${LIB_S_LINK}.${LIB_MAJOR}"
+ elif test "x$ABI" = "xaout" ; then
+   LIB_S="libedit.so.$LIB_MAJOR.$LIB_MINOR"
+   LIB_S_LINKS=
+@@ -4623,17 +4623,9 @@
+ 
+ if test "x$enable_readline" = "xyes" ; then
+   CCSRCS="$CCSRCS readline.c"
+-  IHDRS="$IHDRS readline/readline.h"
+-  IHDR_LINKS="readline.h readline/history.h"
+-  HDR_DIRS="$HDR_DIRS include/readline"
+-  LIB_A_LINKS="$LIB_A_LINKS libedit.a libreadline.a"
+-  if test "x$ABI" = "xelf" ; then
+-    LIB_S_LINKS="$LIB_S_LINKS $LIB_S_LINK libreadline.so"
+-  elif test "x$ABI" = "xaout" ; then
+-    LIB_S_LINKS="$LIB_S_LINKS $LIB_S libreadline.so.$LIB_MAJOR.$LIB_MINOR"
+-  elif test "x$ABI" = "xmacho" ; then
+-    LIB_S_LINKS="$LIB_S_LINKS $LIB_S_LINK libreadline.dylib"
+-  fi
++  IHDRS="$IHDRS editline/readline.h"
++  IHDR_LINKS="readline.h editline/history.h"
++  HDR_DIRS="$HDR_DIRS include/editline"
+ fi
+ 
+ case "${host}" in
diff -ruN /usr/ports/devel/libedit/files/patch-readline.c devel/libedit/files/patch-readline.c
--- /usr/ports/devel/libedit/files/patch-readline.c	1970-01-01 01:00:00.000000000 +0100
+++ devel/libedit/files/patch-readline.c	2007-09-25 18:20:14.000000000 +0200
@@ -0,0 +1,11 @@
+--- readline.c.orig	2006-11-24 17:52:04.000000000 +0100
++++ readline.c	2007-09-25 17:59:54.000000000 +0200
+@@ -61,7 +61,7 @@
+ #include "el.h"
+ #include "fcns.h"		/* for EL_NUM_FCNS */
+ #include "histedit.h"
+-#include "readline/readline.h"
++#include "editline/readline.h"
+ #include "filecomplete.h"
+ 
+ void rl_prep_terminal(int);
diff -ruN /usr/ports/devel/libedit/pkg-plist devel/libedit/pkg-plist
--- /usr/ports/devel/libedit/pkg-plist	2006-01-12 10:22:29.000000000 +0100
+++ devel/libedit/pkg-plist	2007-09-25 18:20:14.000000000 +0200
@@ -1,4 +1,7 @@
+include/editline/history.h
+include/editline/readline.h
 include/histedit.h
 lib/libedit.a
 lib/libedit.so.6
 lib/libedit.so
+@dirrm include/editline
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709271005.l8RA5099001303>