pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/boost-libs devel/boost-libs: fix libbacktrace logic



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ccc99e5836b3
branches:  trunk
changeset: 458923:ccc99e5836b3
user:      thor <thor%pkgsrc.org@localhost>
date:      Fri Sep 24 18:56:16 2021 +0000

description:
devel/boost-libs: fix libbacktrace logic

This avoids calling the compiler and the barrier in the Makefile which
broke build for some folks. If libbacktrace-related files appear, they
are automatically included in PLIST. This depends on a detail of the
external toolchain (e.g. on Ubuntu) which may or may not include
libbacktrace.

diffstat:

 devel/boost-libs/Makefile                |  17 +++++++----------
 devel/boost-libs/PLIST                   |   5 +----
 devel/boost-libs/files/test-backtrace.sh |  23 -----------------------
 3 files changed, 8 insertions(+), 37 deletions(-)

diffs (77 lines):

diff -r 0b9a9ef6243e -r ccc99e5836b3 devel/boost-libs/Makefile
--- a/devel/boost-libs/Makefile Fri Sep 24 18:35:28 2021 +0000
+++ b/devel/boost-libs/Makefile Fri Sep 24 18:56:16 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.87 2021/04/24 14:12:17 thor Exp $
+# $NetBSD: Makefile,v 1.88 2021/09/24 18:56:16 thor Exp $
 
 BOOST_PACKAGE=         libs
 BOOST_COMMENT=         (binary libraries)
@@ -47,15 +47,12 @@
 PLIST.longdbl=         yes
 .endif
 
-# libboost_stacktrace_backtrace requires libbacktrace.
-# FIXME: Test on non-Linux. It should just work.
-TEST_BACKTRACE_CMD=    ${PKGSRC_SETENV} ${MAKE_ENV} ${TOOLS_PLATFORM.sh} \
-  ${FILESDIR}/test-backtrace.sh '${CXX} ${CXXFLAGS} ${CPPFLAGS}'
-.if !defined(_PKGSRC_BARRIER)
-.if ${OPSYS} == "Linux" && ${TEST_BACKTRACE_CMD:sh} == "yes"
-PLIST.backtrace=       yes
-.endif
-.endif
+# Add backtrace libs when they got built because of libbacktrace
+# being available in the toolchain (not easy to detect beforehand).
+GENERATE_PLIST+=       cd ${DESTDIR:Q}/${PREFIX:Q}; \
+  for f in lib/libboost_stacktrace_backtrace.*; do \
+   if [ -f "$$f" ]; then echo "$$f"; fi; \
+  done;
 
 UNLIMIT_RESOURCES+=    stacksize
 
diff -r 0b9a9ef6243e -r ccc99e5836b3 devel/boost-libs/PLIST
--- a/devel/boost-libs/PLIST    Fri Sep 24 18:35:28 2021 +0000
+++ b/devel/boost-libs/PLIST    Fri Sep 24 18:56:16 2021 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.42 2021/01/01 08:19:02 ryoon Exp $
+@comment $NetBSD: PLIST,v 1.43 2021/09/24 18:56:16 thor Exp $
 lib/libboost_atomic.a
 lib/libboost_atomic.so
 lib/libboost_atomic.so.${PKGVERSION}
@@ -84,9 +84,6 @@
 lib/libboost_stacktrace_addr2line.a
 lib/libboost_stacktrace_addr2line.so
 lib/libboost_stacktrace_addr2line.so.${PKGVERSION}
-${PLIST.backtrace}lib/libboost_stacktrace_backtrace.a
-${PLIST.backtrace}lib/libboost_stacktrace_backtrace.so
-${PLIST.backtrace}lib/libboost_stacktrace_backtrace.so.${BOOST_VERSION}
 lib/libboost_stacktrace_basic.a
 lib/libboost_stacktrace_basic.so
 lib/libboost_stacktrace_basic.so.${PKGVERSION}
diff -r 0b9a9ef6243e -r ccc99e5836b3 devel/boost-libs/files/test-backtrace.sh
--- a/devel/boost-libs/files/test-backtrace.sh  Fri Sep 24 18:35:28 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# Given a compiler command, test if libbacktrace is available.
-# It is shipped with GCC, sometimes, and not in the official
-# places.
-
-set -e
-
-cc=$1; shift
-dir=$(mktemp -d "${TMPDIR:-/tmp}/conftest.XXXXXX")
-cd "$dir"
-cat > test.c <<EOT
-#include <backtrace.h>
-int main()
-{
-  return 0;
-}
-EOT
-$cc -o test test.c -lbacktrace 2>/dev/null  &&
-echo yes ||
-echo no
-cd
-rm -rf "$dir"



Home | Main Index | Thread Index | Old Index