Skip to content

Commit a18dc06

Browse files
committed
Add CI dependencies
Signed-off-by: Tin Švagelj <[email protected]>
1 parent bffecae commit a18dc06

File tree

6 files changed

+49
-64
lines changed

6 files changed

+49
-64
lines changed

.github/workflows/build-and-test-linux.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ jobs:
9696
libimlib2-dev \
9797
libircclient-dev \
9898
libiw-dev \
99+
libnl-3-dev\
100+
libnl-route-3-dev\
99101
liblua5.3-dev \
100102
libmicrohttpd-dev \
101103
libmysqlclient-dev \

.github/workflows/codeql.yml

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444
libimlib2-dev \
4545
libircclient-dev \
4646
libiw-dev \
47+
libnl-3-dev\
48+
libnl-route-3-dev\
4749
liblua5.3-dev \
4850
libmicrohttpd-dev \
4951
libmysqlclient-dev \

.github/workflows/publish-appimage.yml

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
libimlib2-dev \
5151
libircclient-dev \
5252
libiw-dev \
53+
libnl-3-dev\
54+
libnl-route-3-dev\
5355
liblua5.3-dev \
5456
libmicrohttpd-dev \
5557
libmysqlclient-dev \

cmake/ConkyPlatformChecks.cmake

+4-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,10 @@ if(BUILD_WLAN AND OS_LINUX)
290290

291291
if(NOT NL_FOUND)
292292
message(FATAL_ERROR "Unable to find netlink library")
293-
endif(NOT NL_FOUND)
293+
endif()
294+
if(NOT HAVE_LIBNL_ROUTE)
295+
message(FATAL_ERROR "Unable to find netlink route library")
296+
endif()
294297

295298
set(conky_includes ${conky_includes} ${NL_INCLUDE_DIRS})
296299
set(conky_libs ${conky_libs} ${NL_LIBRARIES})

cmake/FindNL.cmake

+35-59
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ else()
2727
pkg_check_modules(NL3 libnl-3.0 libnl-genl-3.0 libnl-route-3.0)
2828
if(NOT NL3_FOUND)
2929
pkg_search_module(NL2 libnl-2.0)
30+
if (NL2_FOUND)
31+
mark_as_advanced(NL2_INCLUDE_DIR NL2_LIBRARY)
32+
endif()
3033
endif()
3134

3235
# Try to find NL 2.0, 3.0 or 3.1 (/usr/include/netlink/version.h) or
@@ -38,11 +41,12 @@ else()
3841
NAMES
3942
netlink/version.h
4043
HINTS
41-
"${NL3_libnl-3.0_INCLUDEDIR}"
42-
"${NL2_INCLUDEDIR}"
44+
"${NL3_libnl-3.0_includeDIR}"
45+
"${NL2_includeDIR}"
4346
PATHS
4447
$(SEARCHPATHS)
4548
)
49+
4650
# NL version >= 2
4751
if(NL3_INCLUDE_DIR)
4852
find_library(NL3_LIBRARY
@@ -56,6 +60,16 @@ else()
5660
PATHS
5761
$(SEARCHPATHS)
5862
)
63+
64+
if(NL3_LIBRARY)
65+
set(NL_LIBRARIES ${NL_LIBRARIES} ${NL3_LIBRARY})
66+
set(NL_INCLUDE_DIRS ${NL_INCLUDE_DIRS} ${NL3_INCLUDE_DIR})
67+
set(HAVE_LIBNL 1)
68+
mark_as_advanced(NL3_LIBRARY HAVE_LIBNL)
69+
else()
70+
71+
endif()
72+
5973
find_library(NLGENL_LIBRARY
6074
NAMES
6175
nl-genl-3 nl-genl
@@ -67,6 +81,13 @@ else()
6781
PATHS
6882
$(SEARCHPATHS)
6983
)
84+
85+
if(NLGENL_LIBRARY)
86+
mark_as_advanced(NLGENL_LIBRARY)
87+
set(NL_LIBRARIES ${NL_LIBRARIES} ${NLGENL_LIBRARY})
88+
set(HAVE_LIBNL_GENL 1)
89+
endif()
90+
7091
find_library(NLROUTE_LIBRARY
7192
NAMES
7293
nl-route-3 nl-route
@@ -78,67 +99,22 @@ else()
7899
PATHS
79100
$(SEARCHPATHS)
80101
)
81-
#
82-
# If we don't have all of those libraries, we can't use libnl.
83-
#
84-
if(NL3_LIBRARY AND NLGENL_LIBRARY AND NLROUTE_LIBRARY)
85-
set(NL_LIBRARY ${NL3_LIBRARY})
86-
if(NL3_INCLUDE_DIR)
87-
# NL2 and NL3 are similar and just affect how the version is reported in
88-
# the --version output. In cast of doubt, assume NL3 since a library
89-
# without version number could be any of 2.0, 3.0 or 3.1.
90-
if(NOT NL3_FOUND AND NL2_FOUND)
91-
set(HAVE_LIBNL2 1)
92-
else()
93-
set(HAVE_LIBNL3 1)
94-
endif()
95-
endif()
102+
103+
if(NLROUTE_LIBRARY)
104+
mark_as_advanced(NLROUTE_LIBRARY)
105+
set(NL_LIBRARIES ${NL_LIBRARIES} ${NLROUTE_LIBRARY})
106+
set(HAVE_LIBNL_ROUTE 1)
96107
endif()
97-
set(NL_INCLUDE_DIR ${NL3_INCLUDE_DIR})
98-
endif()
99108

100-
# libnl-2 and libnl-3 not found, try NL version 1
101-
if(NOT (NL_LIBRARY AND NL_INCLUDE_DIR))
102-
pkg_search_module(NL1 libnl-1)
103-
find_path(NL1_INCLUDE_DIR
104-
NAMES
105-
netlink/netlink.h
106-
HINTS
107-
"${NL1_INCLUDEDIR}"
108-
PATHS
109-
$(SEARCHPATHS)
110-
)
111-
find_library(NL1_LIBRARY
112-
NAMES
113-
nl
114-
PATH_SUFFIXES
115-
lib64 lib
116-
HINTS
117-
"${NL1_LIBDIR}"
118-
PATHS
119-
$(SEARCHPATHS)
120-
)
121-
set(NL_LIBRARY ${NL1_LIBRARY})
122-
set(NL_INCLUDE_DIR ${NL1_INCLUDE_DIR})
123-
if(NL1_LIBRARY AND NL1_INCLUDE_DIR)
124-
set(HAVE_LIBNL1 1)
109+
if(NOT NL3_FOUND AND NL2_FOUND)
110+
set(HAVE_LIBNL2 1)
111+
else()
112+
set(HAVE_LIBNL3 1)
125113
endif()
126114
endif()
127115
endif()
128-
# MESSAGE(STATUS "LIB Found: ${NL_LIBRARY}, Suffix: ${NLSUFFIX}\n 1:${HAVE_LIBNL1}, 2:${HAVE_LIBNL2}, 3:${HAVE_LIBNL3}.")
129116

130-
# handle the QUIETLY and REQUIRED arguments and set NL_FOUND to TRUE if
131-
# all listed variables are TRUE
132-
INCLUDE(FindPackageHandleStandardArgs)
133-
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NL DEFAULT_MSG NL_LIBRARY NL_INCLUDE_DIR)
134-
135-
IF(NL_FOUND)
136-
set(NL_LIBRARIES ${NLGENL_LIBRARY} ${NLROUTE_LIBRARY} ${NL_LIBRARY})
137-
set(NL_INCLUDE_DIRS ${NL_INCLUDE_DIR})
138-
set(HAVE_LIBNL 1)
139-
else()
140-
set(NL_LIBRARIES )
141-
set(NL_INCLUDE_DIRS)
142-
endif()
117+
include(FindPackageHandleStandardArgs)
118+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NL DEFAULT_MSG NL_LIBRARIES NL_INCLUDE_DIRS)
119+
mark_as_advanced(NL_LIBRARIES NL_INCLUDE_DIRS)
143120

144-
MARK_AS_ADVANCED( NL_LIBRARIES NL_INCLUDE_DIRS )

src/linux.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@
8787
#endif
8888

8989
#ifdef BUILD_WLAN
90-
#include <libnl3/netlink/attr.h>
91-
#include <libnl3/netlink/cache.h>
92-
#include <libnl3/netlink/route/link.h>
90+
#include <netlink/attr.h>
91+
#include <netlink/cache.h>
92+
#include <netlink/route/link.h>
9393
#include <uapi/linux/nl80211.h>
9494
#endif
9595

@@ -680,7 +680,7 @@ void update_net_interfaces(FILE *net_dev_fp, bool is_first_update,
680680
ns->freq[0]
681681
*/
682682

683-
auto modes = rtnl_link_get_flags(struct rtnl_link * link);
683+
auto modes = rtnl_link_get_flags(nl_link);
684684
rtnl_link_flags2str(modes, ns->mode, 64);
685685
}
686686

0 commit comments

Comments
 (0)