So I spotted threads.h being picked up by math/octave and the
libstdthreads being junked after the configure step, something already
fixed by ajacoutot@ in the following ports:

  math/octave
  math/pspp
  textproc/link-grammar

by adding devel/libstdthreads to BUILD_DEPENDS.  These three ports use
gnulib's threadlib.m4.  Other ports that may be affected by this issue:

  archivers/gcpio
  archivers/gtar
  astro/gnuastro
  converters/recode
  devel/bison
  devel/gettext
  devel/objfw
  devel/universal-ctags
  editors/le
  editors/nano
  editors/poke
  games/trader
  graphics/ttfautohint
  lang/guile3
  math/datamash
  misc/findutils
  net/dico
  net/isc-bind
  net/lftp
  net/monitoring-plugins
  net/wget
  net/wget2
  print/a2ps
  print/libpaper
  print/texinfo
  security/gnutls
  security/libgpg-error
  security/libgsasl
  sysutils/augeas
  sysutils/coreutils
  sysutils/ggrep
  textproc/gdiff
  textproc/gsed
  textproc/recutils
  x11/vlc

(List found with grep '^checking for threads.h' on the latest amd64
build logs.)

I can think of several approaches to fix this:

1. add libstdthreads as a build dep to all those ports.  Simple but
  slightly problematic:
  - IIUC, brings no functional value
  - increases the chance of libstdthreads being picked up by future ports

2. "poison" threads.h detection for gnu.port.mk ports.  This should be
  enough for the gnulib occurences.

3. move libstdthreads header and libs to a subdirectory, to avoid
  threads.h being picked up just because it's in the commonly used
  /usr/local/include directory.

The diff below, tested with sysutils/ggrep, implements approach #2.
If a gnu.port.mk port really wants libstdthreads, one needs to add
devel/libstdthreads to BUILD_DEPENDS (even though it really belongs in
LIB_DEPENDS), or add an override in CONFIGURE_ENV.
The diff isn't complete: it lacks at least REVISION bumps for at least
octave, pspp and link-grammar, and possibly safety bumps for all other
affected ports; but it shows the intent.

Approach #3 seems to work too but is slightly tricker.  wayland/foot
would need a meson.build patch.

Thoughts?


Index: infrastructure/db/config.no-stdthreads
===================================================================
RCS file: infrastructure/db/config.no-stdthreads
diff -N infrastructure/db/config.no-stdthreads
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ infrastructure/db/config.no-stdthreads      11 Sep 2024 17:11:24 -0000
@@ -0,0 +1,3 @@
+# $OpenBSD$
+# included unless devel/libstdthreads
+ac_cv_header_threads_h=${ac_cv_header_threads_h=no}
Index: infrastructure/mk/gnu.port.mk
===================================================================
RCS file: /home/cvs/ports/infrastructure/mk/gnu.port.mk,v
diff -u -p -r1.61 gnu.port.mk
--- infrastructure/mk/gnu.port.mk       14 May 2019 14:59:56 -0000      1.61
+++ infrastructure/mk/gnu.port.mk       11 Sep 2024 17:02:52 -0000
@@ -43,7 +43,8 @@ CONFIG_SITE_LIST += config.site
        textproc/gsed gsed \
        archivers/gtar* gtar \
        lang/gawk gawk \
-       sysutils/coreutils coreutils
+       sysutils/coreutils coreutils \
+       devel/libstdthreads stdthreads
 .  if !defined(BUILD_DEPENDS) || !${BUILD_DEPENDS:M$d}
 CONFIG_SITE_LIST += config.no-${name}
 .  endif


-- 
jca

Reply via email to