svn commit: r520635 - in head/devel/readline: . files

Sunpoet Po-Chuan Hsieh sunpoet at FreeBSD.org
Sun Dec 22 15:00:45 UTC 2019


Author: sunpoet
Date: Sun Dec 22 15:00:43 2019
New Revision: 520635
URL: https://svnweb.freebsd.org/changeset/ports/520635

Log:
  Modernize this port
  
  - Remove TERMCAP option
  - Update patches
    - Drop old patch dating for the switch to ELF time
    - Add new patches to ensure FreeBSD is treated exactly as Linux
  - Use patch file instead of REINPLACE_CMD
  - Bump PORTREVISION for package change
  
  Differential Revision:	https://reviews.freebsd.org/D22793
  Reference:	https://people.freebsd.org/~bapt/0001-Modernize-FreeBSD-support.patch
  Submitted by:	bapt

Added:
  head/devel/readline/files/patch-readline.pc.in   (contents, props changed)
  head/devel/readline/files/patch-shlib-Makefile.in   (contents, props changed)
  head/devel/readline/files/patch-support-shlib-install   (contents, props changed)
Modified:
  head/devel/readline/Makefile
  head/devel/readline/files/patch-support-shobj-conf
  head/devel/readline/pkg-plist

Modified: head/devel/readline/Makefile
==============================================================================
--- head/devel/readline/Makefile	Sun Dec 22 14:59:11 2019	(r520634)
+++ head/devel/readline/Makefile	Sun Dec 22 15:00:43 2019	(r520635)
@@ -3,6 +3,7 @@
 
 PORTNAME=	readline
 PORTVERSION=	8.0.${PATCHLEVEL}
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	GNU
 DISTNAME=	${PORTNAME}-${PORTVERSION:R}
@@ -27,9 +28,7 @@ CPE_VENDOR=	gnu
 CPE_VERSION=	${PORTVERSION:R}
 CPE_UPDATE=	${PATCHLEVEL}
 
-OPTIONS_DEFINE=	TERMCAP DOCS
-OPTIONS_DEFAULT=TERMCAP
-TERMCAP_DESC=	Link against libtermcap
+OPTIONS_DEFINE=	DOCS
 
 #PATCHES=	1 2 3 4 5
 #PATCHLEVEL=	${PATCHES:O:[-1]}
@@ -39,15 +38,11 @@ PATCHLEVEL=	0
 #.endfor
 
 post-patch:
-# Comment out "Requires.private:" line since we do not have {curses,ncurses,tinfo,termcap}.pc in base system.
-# See PR/223130 for details.
-	@${REINPLACE_CMD} -e '/^Requires.private: @TERMCAP_PKG_CONFIG_LIB@/ s|^|#|' ${WRKSRC}/readline.pc.in
+.if exists(/usr/lib/libtermcapw.so)
+	@${REINPLACE_CMD} 's|-ltermcap|-ltermcapw|g' ${WRKSRC}/configure
+.endif
 
-post-patch-TERMCAP-on:
-	@${REINPLACE_CMD} -e '/SHOBJ_LDFLAGS = / s| = |&-ltermcapw |' ${WRKSRC}/shlib/Makefile.in
-
 post-install:
-	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libhistory.so.8 ${STAGEDIR}${PREFIX}/lib/libreadline.so.8
-	${INSTALL_DATA} ${WRKSRC}/readline.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libhistory.so.8.0 ${STAGEDIR}${PREFIX}/lib/libreadline.so.8.0
 
 .include <bsd.port.mk>

Added: head/devel/readline/files/patch-readline.pc.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/readline/files/patch-readline.pc.in	Sun Dec 22 15:00:43 2019	(r520635)
@@ -0,0 +1,9 @@
+--- readline.pc.in.orig	2018-04-23 15:45:38 UTC
++++ readline.pc.in
+@@ -7,6 +7,5 @@ Name: Readline
+ Description: Gnu Readline library for command line editing
+ URL: http://tiswww.cwru.edu/php/chet/readline/rltop.html
+ Version: @LIBVERSION@
+-Requires.private: @TERMCAP_PKG_CONFIG_LIB@
+ Libs: -L${libdir} -lreadline
+ Cflags: -I${includedir}/readline

Added: head/devel/readline/files/patch-shlib-Makefile.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/readline/files/patch-shlib-Makefile.in	Sun Dec 22 15:00:43 2019	(r520635)
@@ -0,0 +1,11 @@
+--- shlib/Makefile.in.orig	2015-07-12 22:41:58 UTC
++++ shlib/Makefile.in
+@@ -174,7 +174,7 @@ unsupported:
+ 
+ $(SHARED_READLINE):	$(SHARED_OBJ)
+ 	$(RM) $@
+-	$(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} -o $@ $(SHARED_OBJ) $(SHLIB_LIBS)
++	$(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} ${TERMCAP_LIB} -o $@ $(SHARED_OBJ) $(SHLIB_LIBS)
+ 
+ $(SHARED_HISTORY):	$(SHARED_HISTOBJ) xmalloc.so xfree.so
+ 	$(RM) $@

Added: head/devel/readline/files/patch-support-shlib-install
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/readline/files/patch-support-shlib-install	Sun Dec 22 15:00:43 2019	(r520635)
@@ -0,0 +1,50 @@
+--- support/shlib-install.orig	2018-05-04 13:45:39 UTC
++++ support/shlib-install
+@@ -118,7 +118,7 @@ INSTALL_LINK2='${echo} cd $INSTALLDIR && ${echo} ${LN}
+ # Create symlinks to the installed library.  This section is incomplete.
+ #
+ case "$host_os-$host_vendor" in
+-*linux*|freebsd*-gentoo)
++*linux*|freebsd*|dragonfly*)
+ 	# libname.so.M -> libname.so.M.N
+ 	${echo} ${RM} ${INSTALLDIR}/$LINK2
+ 	if [ -z "$uninstall" ]; then
+@@ -154,38 +154,6 @@ solaris2*|aix4.[2-9]*|aix[5-9]*|osf*|irix[56]*|sysv[45
+ 	fi
+ 	;;
+ 
+-
+-# FreeBSD 3.x and above can have either a.out or ELF shared libraries
+-freebsd3*|freebsdaout*)
+-	if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then
+-		# libname.so -> libname.so.M
+-		${echo} ${RM} ${INSTALLDIR}/$LINK1
+-		if [ -z "$uninstall" ]; then
+-			eval $INSTALL_LINK1
+-		fi
+-	else
+-		# libname.so.M -> libname.so.M.N
+-		${echo} ${RM} ${INSTALLDIR}/$LINK2
+-		if [ -z "$uninstall" ]; then
+-			eval $INSTALL_LINK2
+-		fi
+-
+-		# libname.so -> libname.so.M.N
+-		${echo} ${RM} ${INSTALLDIR}/$LINK1
+-		if [ -z "$uninstall" ]; then
+-			eval $INSTALL_LINK1
+-		fi
+-	fi
+-	;;
+-
+-freebsd[4-9]*|freebsd1[0-9]*|freebsdelf*|dragonfly*)
+-	# libname.so -> libname.so.M
+-	${echo} ${RM} ${INSTALLDIR}/$LINK1
+-	if [ -z "$uninstall" ]; then
+-		eval $INSTALL_LINK1
+-	fi
+-	;;
+-	
+ hpux1*)
+ 	# libname.sl -> libname.M
+ 	${echo} ${RM} ${INSTALLDIR}/$LINK1.sl

Modified: head/devel/readline/files/patch-support-shobj-conf
==============================================================================
--- head/devel/readline/files/patch-support-shobj-conf	Sun Dec 22 14:59:11 2019	(r520634)
+++ head/devel/readline/files/patch-support-shobj-conf	Sun Dec 22 15:00:43 2019	(r520635)
@@ -1,20 +1,55 @@
---- support/shobj-conf.orig	2009-10-28 13:20:21 UTC
+--- support/shobj-conf.orig	2016-10-05 20:02:11 UTC
 +++ support/shobj-conf
-@@ -128,17 +128,10 @@
+@@ -123,51 +123,13 @@ sunos5*|solaris2*)
+ 	;;
+ 
+ # All versions of Linux (including Gentoo/FreeBSD) or the semi-mythical GNU Hurd.
+-linux*-*|gnu*-*|k*bsd*-gnu-*|freebsd*-gentoo)
++linux*-*|gnu*-*|k*bsd*-gnu-*|freebsd*|dragonfly*)
  	SHOBJ_CFLAGS=-fPIC
  	SHOBJ_LD='${CC}'
+ 	SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
  
+ 	SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
+ 	SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+-	;;
+-
+-freebsd2*)
+-	SHOBJ_CFLAGS=-fpic
+-	SHOBJ_LD=ld
+-	SHOBJ_LDFLAGS='-x -Bshareable'
+-
+-	SHLIB_XLDFLAGS='-R$(libdir)'
+-	SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+-	;;
+-
+-# FreeBSD-3.x ELF
+-freebsd3*|freebsdaout*)
+-	SHOBJ_CFLAGS=-fPIC
+-	SHOBJ_LD='${CC}'
+-
 -	if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then
- 		SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
- 
- 		SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
- 		SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+-		SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
+-
+-		SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
+-		SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
 -	else
 -		SHOBJ_LDFLAGS='-shared'
 -
 -		SHLIB_XLDFLAGS='-R$(libdir)'
 -		SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
 -	fi
+-	;;
+-
+-# FreeBSD-4.x and later have only ELF
+-freebsd[4-9]*|freebsd1[0-9]*|freebsdelf*|dragonfly*)
+-	SHOBJ_CFLAGS=-fPIC
+-	SHOBJ_LD='${CC}'
+-
+-	SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
+-	SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
+-
+-	SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
  	;;
  
- # FreeBSD-4.x and later have only ELF
+ # Darwin/MacOS X

Modified: head/devel/readline/pkg-plist
==============================================================================
--- head/devel/readline/pkg-plist	Sun Dec 22 14:59:11 2019	(r520634)
+++ head/devel/readline/pkg-plist	Sun Dec 22 15:00:43 2019	(r520635)
@@ -9,9 +9,11 @@ include/readline/tilde.h
 lib/libhistory.a
 lib/libhistory.so
 lib/libhistory.so.8
+lib/libhistory.so.8.0
 lib/libreadline.a
 lib/libreadline.so
 lib/libreadline.so.8
+lib/libreadline.so.8.0
 libdata/pkgconfig/readline.pc
 man/man3/history.3.gz
 man/man3/readline.3.gz


More information about the svn-ports-all mailing list