pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/51689: devel/ncurses DragonFly libncurses.la has wrong libdir



>Number:         51689
>Category:       pkg
>Synopsis:       devel/ncurses DragonFly libncurses.la has wrong libdir
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 04 07:25:00 +0000 2016
>Originator:     David Shao
>Release:        current pkgsrc
>Organization:
>Environment:
DragonFly  4.7-DEVELOPMENT DragonFly v4.7.0.945.gcac153-DEVELOPMENT #4: Sat Dec  3 10:39:18 PST 2016     xxxxxx@:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64

>Description:
On DragonFly 4.7-DEVELOPMENT, building devel/ncurses with entries in
/usr/pkg/etc/mk.conf:

PREFER_PKGSRC=		yes

CURSES_DEFAULT=ncurses
READLINE_DEFAULT=readline

results in /usr/pkg/lib/libncurses.la having an incorrect line:

# Directory that this library needs to be installed in:
libdir='/usr/pkgsrc/devel/ncurses/work/.destdir/usr/pkg/lib'

instead of 
libdir='/usr/pkg/lib'

Following the build one can see DESTDIR changing from:

cd c++ && /usr/pkg/bin/gmake DESTDIR="" RPATH_LIST="/usr/pkg/lib" all
gmake[1]: Entering directory '/usr/pkgsrc/devel/ncurses/work/ncurses-6.0/c++'

to what seems to result in an incorrect libdir being deduced once the build progresses to:

===> Installing for ncurses-6.0nb2
=> Creating installation directories
cd man && /usr/pkg/bin/gmake DESTDIR="/usr/pkgsrc/devel/ncurses/work/.destdir" RPATH_LIST="/usr/pkg/lib" install
gmake[1]: Entering directory '/usr/pkgsrc/devel/ncurses/work/ncurses-6.0/man'

This problem was submitted upstream but the upstream maintainer was unable to diagnose the problem, "libtool pkgsrc DragonFly base ncurses made private":

http://lists.gnu.org/archive/html/bug-ncurses/2016-02/msg00008.html

To quote:

"Other frameworks seem to support pkgconfig, but, I believe due to
pkgsrc not wanting conflicts with NetBSD's native xorg, pkgsrc
actively impedes the use of pkgconfig in preference to pkgsrc's
buildlink.  Other frameworks also seem to not use libtool to install
whereas pkgsrc does for ncurses.

The problem is that the libdir field in the resulting pkgsrc
libncurses.la on recent DragonFly alone draws in the build directory
from DESTDIR in addition to the desired /usr/pkg/lib.

It appears to me that what is happening is that at least one source
file in the ncurses subdirectory is being regenerated in the second
install pass, leading to the wrong DESTDIR being appended to
libncurses.la libdir.  In the initial pass to make the object files,
the DESTDIR of "" is what is desired for libdir: ...

As a workaround the patch below simply adds another pass into the
ncurses subdirectory right before the c++ subdirectory is processed.
This fixes the problem on recent DragonFly using pkgsrc and seems to
do no harm on FreeBSD 11-current amd64, FreeBSD 10-2-release, NetBSD
7.99.26 amd64 native xorg, and NetBSD 7.99.26 amd64 modular xorg."

In current patch I threw in various other fixes such as the rpath syntax.  Does devel/ncurses actually build on recent FreeBSD that has switched to a different name for the C++ lib?






>How-To-Repeat:

>Fix:

As a diff between devel/ncurses directories:

diff -Nur devel/ncurses/distinfo devel/ncurses.new/distinfo
--- devel/ncurses/distinfo	2015-11-02 19:27:50.000000000 -0800
+++ devel/ncurses.new/distinfo	2016-03-22 08:26:24.000000000 -0700
@@ -6,6 +6,7 @@
 Size (ncurses-6.0.tar.gz) = 3131891 bytes
 SHA1 (patch-aa) = 6acf84077e84fd693bb2b52377774db3d15b4f8f
 SHA1 (patch-ab) = 235ae1d844721a5ea9d027d051eedc0f7898413c
-SHA1 (patch-ac) = fd1892bfb4dcf8a22ae4654eb944eda9725f964e
+SHA1 (patch-ac) = 9737d0341cfd3128f8f8e61adb8d54399350ac10
+SHA1 (patch-aclocal.m4) = 905d3d933adbd96fc50d829e42a5b194e1618847
 SHA1 (patch-ncurses_base_MKlib__gen.sh) = f8ce67fbd273529e4161a2820677d05a623fd527
 SHA1 (patch-ncurses_tinfo_lib__baudrate.c) = e383a11530a3045e729ab8c738e57a9e217a994f
diff -Nur devel/ncurses/patches/patch-ac devel/ncurses.new/patches/patch-ac
--- devel/ncurses/patches/patch-ac	2015-08-17 10:10:32.000000000 -0700
+++ devel/ncurses.new/patches/patch-ac	2016-03-22 08:25:59.000000000 -0700
@@ -7,7 +7,28 @@
 
 --- configure.orig	2015-08-05 09:20:32.000000000 +0000
 +++ configure
-@@ -11090,12 +11090,7 @@ case ".$MANPAGE_RENAMES" in
+@@ -1496,7 +1496,7 @@ echo $ECHO_N "checking for prefix... $EC
+ if test "x$prefix" = "xNONE" ; then
+ 	case "$cf_cv_system_name" in
+ 		# non-vendor systems don't have a conflict
+-	(openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
++	(openbsd*|freebsd*|dragonfly*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
+ 		prefix=/usr
+ 		;;
+ 	(*)	prefix=$ac_default_prefix
+@@ -5862,7 +5862,10 @@ case $cf_cv_system_name in
+ (openbsd[2-9].*|mirbsd*)
+ 	LD_RPATH_OPT="-Wl,-rpath,"
+ 	;;
+-(dragonfly*|freebsd*)
++(dragonfly*)
++	LD_RPATH_OPT="-Wl,-rpath,"
++	;;
++(freebsd*)
+ 	LD_RPATH_OPT="-rpath "
+ 	;;
+ (netbsd*)
+@@ -11090,12 +11093,7 @@ case ".$MANPAGE_RENAMES" in
  (.no)
  	;;
  (.|.yes)
@@ -21,3 +42,24 @@
  	;;
  esac
  
+@@ -19307,6 +19305,9 @@ ac_main_return=return
+ 
+ if test -n "$GXX" ; then
+ case $cf_cv_system_name in
++(freebsd*)
++	cf_stdcpp_libname=c++
++	;;
+ (os2*)
+ 	cf_stdcpp_libname=stdcpp
+ 	;;
+@@ -23916,6 +23919,10 @@ echo "${as_me:-configure}:23723: testing
+ 		done
+ 	fi
+ 
++	if test "$cf_dir" == "c++" ; then
++		echo '	cd ncurses && ${MAKE} ${TOP_MFLAGS} $@' >>Makefile
++	fi
++
+ 	echo '	cd '$cf_dir' && ${MAKE} ${TOP_MFLAGS} $@' >>Makefile
+ done
+ 
diff -Nur devel/ncurses/patches/patch-aclocal.m4 devel/ncurses.new/patches/patch-aclocal.m4
--- devel/ncurses/patches/patch-aclocal.m4	1969-12-31 16:00:00.000000000 -0800
+++ devel/ncurses.new/patches/patch-aclocal.m4	2016-02-10 10:36:00.000000000 -0800
@@ -0,0 +1,46 @@
+$NetBSD$
+
+--- aclocal.m4.orig	2015-08-06 00:46:34.000000000 +0000
++++ aclocal.m4
+@@ -751,7 +751,7 @@ AC_MSG_CHECKING(for prefix)
+ if test "x$prefix" = "xNONE" ; then
+ 	case "$cf_cv_system_name" in
+ 		# non-vendor systems don't have a conflict
+-	(openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
++	(openbsd*|freebsd*|dragonfly*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
+ 		prefix=/usr
+ 		;;
+ 	(*)	prefix=$ac_default_prefix
+@@ -3140,7 +3140,10 @@ case $cf_cv_system_name in
+ (openbsd[[2-9]].*|mirbsd*)
+ 	LD_RPATH_OPT="-Wl,-rpath,"
+ 	;;
+-(dragonfly*|freebsd*)
++(dragonfly*)
++	LD_RPATH_OPT="-Wl,-rpath,"
++	;;
++(freebsd*)
+ 	LD_RPATH_OPT="-rpath "
+ 	;;
+ (netbsd*)
+@@ -3589,6 +3592,10 @@ CF_EOF
+ 		done
+ 	fi
+ 
++	if test "$cf_dir" == "c++" ; then
++		echo '	cd ncurses && ${MAKE} ${TOP_MFLAGS} [$]@' >>Makefile
++	fi
++
+ 	echo '	cd '$cf_dir' && ${MAKE} ${TOP_MFLAGS} [$]@' >>Makefile
+ done
+ 
+@@ -6253,6 +6260,9 @@ AC_DEFUN([CF_STDCPP_LIBRARY],
+ [
+ if test -n "$GXX" ; then
+ case $cf_cv_system_name in
++(freebsd*)
++	cf_stdcpp_libname=c++
++	;;
+ (os2*)
+ 	cf_stdcpp_libname=stdcpp
+ 	;;

Here is an individual new file patch for aclocal.m4:

$NetBSD$

--- aclocal.m4.orig	2015-08-06 00:46:34.000000000 +0000
+++ aclocal.m4
@@ -751,7 +751,7 @@ AC_MSG_CHECKING(for prefix)
 if test "x$prefix" = "xNONE" ; then
 	case "$cf_cv_system_name" in
 		# non-vendor systems don't have a conflict
-	(openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
+	(openbsd*|freebsd*|dragonfly*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
 		prefix=/usr
 		;;
 	(*)	prefix=$ac_default_prefix
@@ -3140,7 +3140,10 @@ case $cf_cv_system_name in
 (openbsd[[2-9]].*|mirbsd*)
 	LD_RPATH_OPT="-Wl,-rpath,"
 	;;
-(dragonfly*|freebsd*)
+(dragonfly*)
+	LD_RPATH_OPT="-Wl,-rpath,"
+	;;
+(freebsd*)
 	LD_RPATH_OPT="-rpath "
 	;;
 (netbsd*)
@@ -3589,6 +3592,10 @@ CF_EOF
 		done
 	fi
 
+	if test "$cf_dir" == "c++" ; then
+		echo '	cd ncurses && ${MAKE} ${TOP_MFLAGS} [$]@' >>Makefile
+	fi
+
 	echo '	cd '$cf_dir' && ${MAKE} ${TOP_MFLAGS} [$]@' >>Makefile
 done
 
@@ -6253,6 +6260,9 @@ AC_DEFUN([CF_STDCPP_LIBRARY],
 [
 if test -n "$GXX" ; then
 case $cf_cv_system_name in
+(freebsd*)
+	cf_stdcpp_libname=c++
+	;;
 (os2*)
 	cf_stdcpp_libname=stdcpp
 	;;




Home | Main Index | Thread Index | Old Index