From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A06CF13835A for ; Fri, 18 Jun 2021 21:07:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 02476E087C; Fri, 18 Jun 2021 21:07:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C7C33E087C for ; Fri, 18 Jun 2021 21:07:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A25FC340B46 for ; Fri, 18 Jun 2021 21:07:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 301D67C1 for ; Fri, 18 Jun 2021 21:07:38 +0000 (UTC) From: "David Seifert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "David Seifert" Message-ID: <1624050422.4afd908c32d3bd1feceb96a602a759d4a7bf0e0a.soap@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/dfshow/files/, app-misc/dfshow/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-misc/dfshow/dfshow-0.9.1_beta-r1.ebuild app-misc/dfshow/files/dfshow-0.9.1_beta-use-PKG_CHECK_MODULES-for-ncurses-libconfig.patch X-VCS-Directories: app-misc/dfshow/files/ app-misc/dfshow/ X-VCS-Committer: soap X-VCS-Committer-Name: David Seifert X-VCS-Revision: 4afd908c32d3bd1feceb96a602a759d4a7bf0e0a X-VCS-Branch: master Date: Fri, 18 Jun 2021 21:07:38 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3ed1d9ff-f1bd-4a43-bf1f-e2d4e7a4f189 X-Archives-Hash: 1569cafebb97546638667536bc9df525 commit: 4afd908c32d3bd1feceb96a602a759d4a7bf0e0a Author: Sam James gentoo org> AuthorDate: Fri Jun 18 21:07:02 2021 +0000 Commit: David Seifert gentoo org> CommitDate: Fri Jun 18 21:07:02 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4afd908c app-misc/dfshow: use PKG_CHECK_MODULES for ncurses, libconfig * Use PKG_CHECK_MODULES to find ncurses (and libconfig while we're at it) rather than assuming e.g. split tinfo. * Add the standard macOS LDFLAGS needed. No point in bothering upstream with libtool just for this. Signed-off-by: Sam James gentoo.org> Signed-off-by: David Seifert gentoo.org> app-misc/dfshow/dfshow-0.9.1_beta-r1.ebuild | 15 +++- ...e-PKG_CHECK_MODULES-for-ncurses-libconfig.patch | 82 ++++++++++++++++++++++ 2 files changed, 94 insertions(+), 3 deletions(-) diff --git a/app-misc/dfshow/dfshow-0.9.1_beta-r1.ebuild b/app-misc/dfshow/dfshow-0.9.1_beta-r1.ebuild index 883ebd7c7fe..d6a901fd6e7 100644 --- a/app-misc/dfshow/dfshow-0.9.1_beta-r1.ebuild +++ b/app-misc/dfshow/dfshow-0.9.1_beta-r1.ebuild @@ -3,7 +3,7 @@ EAPI=7 -inherit autotools bash-completion-r1 +inherit autotools bash-completion-r1 flag-o-matic MY_PV="${PV//_beta/-beta}" DESCRIPTION="DF-SHOW is a Unix-like rewrite of some of the applications from DF-EDIT" @@ -19,11 +19,20 @@ DEPEND="dev-libs/libconfig:= sys-libs/ncurses:0= " RDEPEND="${DEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/${PN}-0.9.1_beta-use-PKG_CHECK_MODULES-for-ncurses-libconfig.patch +) src_prepare() { default - sed -i 's/LDADD = -lncursesw -lm -lconfig/LDADD = -lncursesw -lm -lconfig -ltinfow/' Makefile.am || - die "sed in Makefile.am failed" + + if [[ ${CHOST} == *-darwin* ]] ; then + # Standard on macOS + # No real motivation to push libtool upstream just for this + append-ldflags -Wl,-undefined -Wl,dynamic_lookup + fi eautoreconf } diff --git a/app-misc/dfshow/files/dfshow-0.9.1_beta-use-PKG_CHECK_MODULES-for-ncurses-libconfig.patch b/app-misc/dfshow/files/dfshow-0.9.1_beta-use-PKG_CHECK_MODULES-for-ncurses-libconfig.patch new file mode 100644 index 00000000000..33c5bc35dfb --- /dev/null +++ b/app-misc/dfshow/files/dfshow-0.9.1_beta-use-PKG_CHECK_MODULES-for-ncurses-libconfig.patch @@ -0,0 +1,82 @@ +From a8185ad9270db54b9e0c66002e7ceebdc264af19 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Fri, 30 Apr 2021 04:49:26 +0100 +Subject: [PATCH] Use PKG_CHECK_MODULES for ncurses, libconfig + +It's not always clear how to link against ncurses +and the choices before us are: +1) use a convoluted chain of autoconf checks +2) use pkg-config (this commit) +3) guess and hardcode the most popular values + +This is an iteration of a previous change [0] by a +Gentoo contributor which landed upstream. + +The previous change ended up doing 3) which is fine +but doesn't always work in strange situations. Gentoo +_usually_ builds 'split tinfo' on Linux but this isn't +guaranteed. + +This change now uses PKG_CHECK_MODULES which uses +pkg-config behind the scenes to query ncurses +for the correct way to build & link against it. + +(We do the same thing for libconfig too.) + +[0] https://github.com/roberthawdon/dfshow/pull/115 +--- + Makefile.am | 13 ++++--------- + configure.ac | 5 +++-- + 2 files changed, 7 insertions(+), 11 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 048ded5..6dcaa1f 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -4,21 +4,16 @@ dfshowconfdir = $(sysconfdir) + dfshowdatadir = $(datadir)/dfshow + + AM_CFLAGS = -DSYSCONFIG=\"$(dfshowconfdir)\" -DDATADIR=\"$(dfshowdatadir)\" -D_XOPEN_SOURCE_EXTENDED -fno-common ++AM_CFLAGS += $(ncurses_CFLAGS) $(libconfig_CFLAGS) + +-LDADD = -lm -lconfig +- +-if DARWIN +-LDADD += -lncurses +-else +-LDADD += -lncursesw +-endif ++LDADD = -lm $(ncurses_LIBS) $(libconfig_LIBS) + + if LINUX +-LDADD += -lacl -ltinfo ++LDADD += -lacl + endif + + if HURD +-LDADD += -lacl -ltinfo ++LDADD += -lacl + endif + + if SELINUX +diff --git a/configure.ac b/configure.ac +index f185b69..8acf1ab 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -32,10 +32,11 @@ AC_CHECK_FUNCS(acl_get facl_get acl_set facl_set) + + AC_CHECK_MEMBERS([struct stat.st_author]) + AC_CHECK_HEADERS([stdio.h limits.h signal.h ctype.h wctype.h getopt.h sys/types.h sys/stat.h dirent.h fcntl.h pwd.h string.h stdlib.h unistd.h time.h sys/statvfs.h libgen.h errno.h wchar.h hurd.h math.h sys/sysmacros.h regex.h utime.h sys/xattr.h acl/libacl.h stdint.h]) +-AC_CHECK_HEADERS(ncurses.h, , AC_MSG_ERROR(ncurses header (ncurses.h) not found. You may need to install an ncurses development package.)) +-AC_CHECK_HEADERS(libconfig.h, , AC_MSG_ERROR(libconfig header (libconfig.h) not found. You may need to install a libconfig development package.)) + AC_CHECK_HEADERS(sys/acl.h, , AC_MSG_ERROR(libacl header (sys/acl.h) not found. You may need to install a libacl development package.)) + ++PKG_CHECK_MODULES([ncurses], [ncurses]) ++PKG_CHECK_MODULES([libconfig], [libconfig]) ++ + AC_ARG_WITH([selinux], AS_HELP_STRING([--with-selinux], [Build with selinux library (default: disabled)])) + AC_ARG_ENABLE([move-between-devices], AS_HELP_STRING([--enable-move-between-devices], [Enable moving objects between mounted devices (default: disabled)])) + +-- +2.31.1 +