Skip to content

Commit

Permalink
net-wireless/hostapd: Correctly detect libnl when cross-compiling
Browse files Browse the repository at this point in the history
* Build system tries to find libnl only on the host system, which
  breaks cross-compilation as it cannot find it:

```
Package libnl-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libnl-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libnl-3.0', required by 'virtual:world', not found
```

* We can solve this using pkg-config to pass additional include
  for the cross-compilation libnl to the CFLAGS

Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr>
  • Loading branch information
jsmolic committed Aug 16, 2021
1 parent 2c460de commit b6b1963
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion net-wireless/hostapd/hostapd-2.9-r6.ebuild
Expand Up @@ -3,7 +3,7 @@

EAPI=7

inherit toolchain-funcs systemd savedconfig
inherit flag-o-matic systemd savedconfig toolchain-funcs

DESCRIPTION="IEEE 802.11 wireless LAN Host AP daemon"
HOMEPAGE="https://w1.fi/ https://w1.fi/cgit/hostap/"
Expand Down Expand Up @@ -40,6 +40,7 @@ DEPEND="
netlink? ( net-libs/libnfnetlink )
sqlite? ( >=dev-db/sqlite-3 )"
RDEPEND="${DEPEND}"
BDEPEND="virtual/pkgconfig"

pkg_pretend() {
if use internal-tls; then
Expand Down Expand Up @@ -194,6 +195,7 @@ src_configure() {
# support it.
if has_version ">=dev-libs/libnl-3.2"; then
echo "CONFIG_LIBNL32=y" >> ${CONFIG} || die
append-cflags $($(tc-getPKG_CONFIG) --cflags libnl-3.0)
fi

# TODO: Add support for BSD drivers
Expand Down
4 changes: 3 additions & 1 deletion net-wireless/hostapd/hostapd-9999.ebuild
Expand Up @@ -3,7 +3,7 @@

EAPI=7

inherit toolchain-funcs systemd savedconfig
inherit flag-o-matic systemd savedconfig toolchain-funcs

DESCRIPTION="IEEE 802.11 wireless LAN Host AP daemon"
HOMEPAGE="https://w1.fi/ https://w1.fi/cgit/hostap/"
Expand Down Expand Up @@ -40,6 +40,7 @@ DEPEND="
netlink? ( net-libs/libnfnetlink )
sqlite? ( >=dev-db/sqlite-3 )"
RDEPEND="${DEPEND}"
BDEPEND="virtual/pkgconfig"

pkg_pretend() {
if use internal-tls; then
Expand Down Expand Up @@ -184,6 +185,7 @@ src_configure() {
# support it.
if has_version ">=dev-libs/libnl-3.2"; then
echo "CONFIG_LIBNL32=y" >> ${CONFIG} || die
append-cflags $($(tc-getPKG_CONFIG) --cflags libnl-3.0)
fi

# TODO: Add support for BSD drivers
Expand Down

0 comments on commit b6b1963

Please sign in to comment.