Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Nov 2016 04:02:06 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 213956] [New Port] devel/libtuntap: Library for configuring TUN or TAP devices in a portable manner
Message-ID:  <bug-213956-13-MFlC1bdtlB@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-213956-13@https.bugs.freebsd.org/bugzilla/>
References:  <bug-213956-13@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D213956

Jan Beich (mail not working) <jbeich@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jbeich@FreeBSD.org

--- Comment #3 from Jan Beich (mail not working) <jbeich@FreeBSD.org> ---
Comment on attachment 176352
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D176352
Patch adds devel/libtuntap (with little comment fix)

CXX_WRPR=3Don build fails on FreeBSD 9.x (add USE_CXXSTD=3Dc++11 to fix):

  /usr/local/bin/g++48   -DFreeBSD -DUnix -Dtuntap___EXPORTS -I.
-I/usr/local/include -I/bindings/cpp -O2 -pipe -Wl,-rpath=3D/usr/local/lib/=
gcc48
-fno-strict-aliasing -Wl,-rpath=3D/usr/local/lib/gcc48 -O2 -pipe
-Wl,-rpath=3D/usr/local/lib/gcc48 -fno-strict-aliasing
-Wl,-rpath=3D/usr/local/lib/gcc48 -fPIC -o
CMakeFiles/tuntap++.dir/bindings/cpp/tuntap++.cc.o -c bindings/cpp/tuntap++=
.cc
  In file included from bindings/cpp/tuntap++.cc:1:0:
  bindings/cpp/tuntap++.hh:16:22: warning: defaulted and deleted functions =
only
available with -std=3Dc++11 or -std=3Dgnu++11 [enabled by default]
     tun(tun const &) =3D delete;
                        ^
  bindings/cpp/tuntap++.hh:17:36: warning: defaulted and deleted functions =
only
available with -std=3Dc++11 or -std=3Dgnu++11 [enabled by default]
     tun & operator =3D (tun const &) =3D delete;
                                      ^
  bindings/cpp/tuntap++.hh:18:11: error: expected ',' or '...' before '&&'
token
     tun(tun &&);
             ^
  bindings/cpp/tuntap++.hh:18:13: error: invalid constructor; you probably
meant 'tuntap::tun (const tuntap::tun&)'
     tun(tun &&);
               ^
  bindings/cpp/tuntap++.hh:44:22: warning: defaulted and deleted functions =
only
available with -std=3Dc++11 or -std=3Dgnu++11 [enabled by default]
     tap(tap const &) =3D delete;
                        ^
  bindings/cpp/tuntap++.hh:45:36: warning: defaulted and deleted functions =
only
available with -std=3Dc++11 or -std=3Dgnu++11 [enabled by default]
     tap & operator =3D (tap const &) =3D delete;
                                      ^
  bindings/cpp/tuntap++.hh:46:11: error: expected ',' or '...' before '&&'
token
     tap(tap &&);
             ^
  bindings/cpp/tuntap++.hh:46:13: error: invalid constructor; you probably
meant 'tuntap::tap (const tuntap::tap&)'
     tap(tap &&);
               ^
  bindings/cpp/tuntap++.cc:20:14: error: expected ',' or '...' before '&&'
token
   tun::tun(tun &&t)
                ^
  bindings/cpp/tuntap++.cc:20:1: error: prototype for
'tuntap::tun::tun(tuntap::tun)' does not match any in class 'tuntap::tun'
   tun::tun(tun &&t)
   ^
  In file included from bindings/cpp/tuntap++.cc:1:0:
  bindings/cpp/tuntap++.hh:16:3: error: candidates are: tuntap::tun::tun(co=
nst
tuntap::tun&)
     tun(tun const &) =3D delete;
     ^
  bindings/cpp/tuntap++.cc:9:1: error:                 tuntap::tun::tun()
   tun::tun()
   ^
  bindings/cpp/tuntap++.cc:97:14: error: expected ',' or '...' before '&&'
token
   tap::tap(tap &&t)
                ^
  bindings/cpp/tuntap++.cc:97:1: error: prototype for
'tuntap::tap::tap(tuntap::tap)' does not match any in class 'tuntap::tap'
   tap::tap(tap &&t)
   ^
  In file included from bindings/cpp/tuntap++.cc:1:0:
  bindings/cpp/tuntap++.hh:44:3: error: candidates are: tuntap::tap::tap(co=
nst
tuntap::tap&)
     tap(tap const &) =3D delete;
     ^
  bindings/cpp/tuntap++.cc:86:1: error:                 tuntap::tap::tap()
   tap::tap()
   ^
  *** [CMakeFiles/tuntap++.dir/bindings/cpp/tuntap++.cc.o] Error code 1

> +PORTNAME=3D		libtuntap
            ^^^^^^^^^^^^ - 2 tabs
> +PORTVERSION=3D	2.1
               ^ - 1 tab

Inconsistent whitespace. Adjust your editor to tab width 8 (if not default)
then reindent.

> +CATEGORIES=3D		devel
                        ^^^^^
Why not under net/ ? I don't think tun/tap devices can be used for
non-networking purposes.

> +COMMENT=3D	Library for configuring TUN or TAP devices in a portable mann=
er
                ^^^^^^^^^^^
Try to avoid redundant words for concise description e.g., "Library for" is
already evident from the port name.

> +USE_GITHUB=3D	yes

Don't forget to populate WWW field in pkg-descr, pointing to the project pa=
ge
on GitHub.

> +GH_ACCOUNT=3D	m0khi

Repos on GitHub share commit objects for all forks. GH_ACCOUNT=3DLaKabane w=
ould
work as well.

> +GH_TAGNAME=3D	6182ddf

Better use DISTVERSIONSUFFIX instead for better package version e.g.,

  $ git describe 6182ddf
  libtuntap-0.3-22-g6182ddf

turns into

  DISTVERSION=3D  0.3-22
  DISTVERSIONSUFFIX=3D    -g6182ddf

which is actually

  $ make -V PKGVERSION
  0.3.22

> +BUILD_DEPENDS=3D	cmake>=3D2.8:devel/cmake

cmake>=3D2.8 dates back to 2009-11-29. Do you expect the port to work on an=
 even
older tree? If not, drop the line.

> +OPTIONS_DEFINE+=3D		CXX_WRPR RGRSS_TEST

If you don't plan to have slave ports alter the value replace '+=3D' with '=
=3D'.

> +RGRSS_TEST_DESC=3D		Build Regression tests for libtuntap

Better use common TEST_DESC (defined in Mk/bsd.options.desc.mk) instead i.e=
.,
rename the option. TEST is also enabled by default if you have DEVELOPER=3D=
yes in
make.conf.

> +CMAKE_BUILD_TYPE=3D		Release

This is already the default value.

> +CXX_WRPR_CMAKE_ON=3D		-DENABLE_CXX=3DON
> +RGRSS_TEST_CMAKE_ON=3D	-DENABLE_REGRESS=3DON
                   ^^^
Convert to _CMAKE_BOOL option helper.

> +CXX_WRPR_USE+=3D			compiler:c++11-lib
               ^^
Most option helpers already append value, so '=3D' would work fine as well.=
 I
guess, it's just a typo, otherwise CXX_WRPR=3Don build would still use GCC =
4.2.1
on FreeBSD 9.x systems.

> +.include <bsd.port.options.mk>
> +
> +check: build
> +.if ${PORT_OPTIONS:MRGRSS_TEST}
> +	@(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFIL=
E} ${MAKE_ARGS} test)
> +.endif

Convert to TEST_TARGET, see /usr/ports/CHANGES from 20150928. To hook poudr=
iere
you may also need

  # XXX https://github.com/freebsd/poudriere/pull/355
  pre-install-TEST-on: do-test

unless some tests are expected to fail e.g., due to lack of permissions.

> +CXX_WRPR_DESC=3D			Build CXX wrapper for libtuntap
> +CXX_WRPR_CMAKE_ON=3D		-DENABLE_CXX=3DON
> +CXX_WRPR_USE+=3D			compiler:c++11-lib
[...]
> ++	if(ENABLE_CXX)
> ++		install(TARGETS tuntap++ DESTINATION lib)
> ++		install(TARGETS tuntap++-static DESTINATION lib)
> ++		install(FILES bindings/cpp/tuntap++.hh DESTINATION include)
> ++	endif(ENABLE_CXX)

Maybe move to a slave port instead. That way libtuntap consumers can be sure
its C++ wrapper is always avaliable from a specific port. For example,

  # master Makefile
  COMMENT?=3D     Configure TUN or TAP devices in a portable manner
  ...
  OPTIONS_EXCLUDE?=3D               CXX_WRPR

  # master pkg-plist
  %%NO_CXX_WRPR%%include/tuntap.h
  ...

  # slave Makefile
  PKGNAMESUFFIX=3D  -c++

  COMMENT=3D        C++ wrapper for libtuntap=20=20=20=20=20=20=20

  LIB_DEPENDS=3D    libtuntap.so:devel/libtuntap

  MASTERDIR=3D      ${.CURDIR}/../libtuntap

  OPTIONS_SLAVE=3D  CXX_WRPR
  OPTIONS_EXCLUDE=3D        # clear CXX_WRPR in master

  .include "${MASTERDIR}/Makefile"

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-213956-13-MFlC1bdtlB>