Download raw body.
net/tcpflow: fix build
On Sun, Jun 09, 2024 at 11:03:54AM +0100, Kirill A. Korinsky wrote:
> On Sat, 08 Jun 2024 23:35:32 +0100,
> Kirill A. Korinsky <kirill@korins.ky> wrote:
> >
> > Probably it worth to add an -extra flavor with all features.
> >
>
> Here small update for net/tcpflow which includes:
> - add textproc/tre to enjoy regexes;
> - extended flavor to use cairo and exiv2.
tcpflow isn't linked against libexiv2 and its header files aren't
included because HAVE_EXIV2 isn't defined. portcheck warns about it.
So exiv2 doesn't bring any feature and it doesn't make sense to add
it as a dep.
Regarding cairo support I don't know if it is useful. What bothers me
is that configure.ac adds a bunch of other libraries because upstream
uses a static link there on mingw. Self-inflicted pain, and extra
libs look extra. LIB_DEPENDS=archivers/bzip2 just look bogus, cairo
doesn't depend on it in our tree.
To me this all looks fragile and I wouldn't link a privileged tool to
such libraries. You don't *have* to ship such a FLAVOR.
The reordering in the Makefile make AUTOCONF_VERSION/AUTOMAKE_VERSION
+ the lone CONFIGURE_STYLE at the end look bizarre.
So that leaves the addition of textproc/tre (I didn't look) and the
need to add --without-o3 because the build currently uses -O3 instead
of respecting CFLAGS.
> I don't enable X11-related stuff by default to allow use it on machines
> without installed x11 sets.
>
> The diff:
>
> diff --git net/tcpflow/Makefile net/tcpflow/Makefile
> index 094dcec0696..2e539a179ad 100644
> --- net/tcpflow/Makefile
> +++ net/tcpflow/Makefile
> @@ -3,6 +3,7 @@ COMMENT= tool for capturing data from TCP connections
> V= 1.6.1
> DISTNAME= tcpflow-${V}
> CATEGORIES= net
> +REVISION= 0
>
> SITES= https://github.com/simsong/tcpflow/releases/download/tcpflow-${V}/
>
> @@ -13,16 +14,26 @@ MAINTAINER= Kirill A. Korinsky <kirill@korins.ky>
> # GPLv3
> PERMIT_PACKAGE= Yes
>
> -WANTLIB += ${COMPILER_LIBCXX} c crypto m pcap sqlite3 ssl z
> +WANTLIB += ${COMPILER_LIBCXX} c crypto m tre pcap sqlite3 ssl z
>
> COMPILER= base-clang ports-gcc
>
> BUILD_DEPENDS= devel/boost
> -LIB_DEPENDS= databases/sqlite3
> -
> -# a test for cairo has a side effect which brokes pcap test
> -# when it can't find cairo, so, disable it.
> +LIB_DEPENDS= databases/sqlite3 \
> + textproc/tre
> +
> +FLAVORS= extended
> +FLAVOR?=
> +
> +# allow using tcpflow on machine without X11 set by default
> +.if ${FLAVOR:Mextended}
> +WANTLIB += bz2 cairo expat fontconfig freetype pixman-1
> +LIB_DEPENDS+= archivers/bzip2 \
> + graphics/cairo \
> + graphics/exiv2
> +.else
> CONFIGURE_ARGS= --enable-cairo=false
> +.endif
>
> AUTOCONF_VERSION= 2.71
> AUTOMAKE_VERSION= 1.16
> diff --git net/tcpflow/patches/patch-configure_ac net/tcpflow/patches/patch-configure_ac
> index a9e99810a6d..97353f53303 100644
> --- net/tcpflow/patches/patch-configure_ac
> +++ net/tcpflow/patches/patch-configure_ac
> @@ -1,6 +1,15 @@
> Index: configure.ac
> --- configure.ac.orig
> +++ configure.ac
> +@@ -77,7 +77,7 @@ esac
> + if test x"${mingw}" == "xno" ; then
> + # Bring additional directories where things might be found into our
> + # search path. I don't know why autoconf doesn't do this by default
> +- for spfx in /usr/local /opt/local /sw /usr/local/ssl /usr/boost/include ; do
> ++ for spfx in /usr/local /opt/local /sw /usr/local/ssl /usr/boost/include /usr/X11R6 ; do
> + AC_MSG_NOTICE([checking ${spfx}/include])
> + if test -d ${spfx}/include; then
> + CPPFLAGS="-I${spfx}/include $CPPFLAGS"
> @@ -490,36 +490,6 @@ AC_CHECK_TYPES([sa_family_t], [], [],
> ]]
> )
>
>
> --
> wbr, Kirill
>
--
jca
net/tcpflow: fix build