Missing <iwlib.h>: compiling conky from source

I’m trying to compile conky but it requires iwlib.h headers and dnf provides produces no results:
dnf provides */iwlib.h Last metadata expiration check: 3:42:08 ago on Tue Oct 18 01:04:54 2022. Error: No matches found. If searching for a file, try specifying the full path or using a wildcard prefix ("*/") at the beginning.

try compiling and installing wireless-tools package.

or download and install/extract files from here.

https://kojipkgs.fedoraproject.org//packages/wireless-tools/29/28.fc35/x86_64/wireless-tools-devel-29-28.fc35.x86_64.rpm

Hi @dawidp , welcome to the community.

Is there a reason you’re trying to build conky from source instead of using the package in the Fedora repositories?

You can also see the spec file used to build the Fedora conky package here (use the different branches to check for different Fedora releases):

https://src.fedoraproject.org/rpms/conky/blob/rawhide/f/conky.spec

An easy way to install all the build time dependencies for any packages already in the Fedora repositories is to use dnf builddep:

sudo dnf builddep conky

Main reason is that version 1.12.2-3.fc36 which is currently in workstation repo does not have all features enabled. When I start conky -c conkyrc I get the following warnings:

conky: desktop window (600012) is subwindow of root window (3c6)
conky: window type - normal
conky: drawing to created window (0xe00002)
conky: drawing to double buffer
conky: unknown variable '$wireless_essid'
conky: unknown variable '$wireless_link_qual_perc'
conky: unknown variable '$wireless_essid'
conky: unknown variable '$wireless_link_qual_perc'
conky: unknown variable '$wireless_essid'
conky: unknown variable '$wireless_link_qual_perc'
conky: unknown variable '$wireless_essid'
conky: unknown variable '$wireless_link_qual_perc'

and here is conkyrc

conky.config = {
    minimum_height = 720,
    minimum_width = 1240,
    gap_y = 40,
    gap_x = 2,
    alignment = 'middle_middle',
    text_buffer_size = 2048,
    double_buffer = true,
    background = false,
    update_interval = 1,
    own_window = true,
    own_window_class = 'Conky',
    own_window_type = 'normal',
    own_window_transparent = true,
    own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
    own_window_argb_visual = true,
    own_window_argb_value = 0,
    use_xft = true,
    override_utf8_locale = true,
}

conky.text = [[
SSID: ${wireless_essid wlp1s0}
Quality: ${wireless_link_qual_perc wlp1s0}%
]]

and searching through internet I’ve found this post saying that WLAN support is not enabled by default. But and according to the link you’ve provided, spec file for fc36 says WLAN support should be enabled:

%bcond_with audacious	
%bcond_without curl
%bcond_without ibm
%bcond_without imlib
%bcond_without lua_cairo
%bcond_without lua_imlib
%bcond_with moc
%bcond_without mpd
%bcond_with ncurses
%bcond_with nvidia
%bcond_without portmon
%bcond_without rss
%bcond_without weather
%bcond_without weather_xoap
%if 0%{?fedora} < 36
%bcond_without wlan
%else
%bcond_with wlan
%endif
%bcond_without xdbe
%bcond_without xinerama

Same with curl support, it’s not enabled.

======== [ UPDATE ]========

I’ve downloaded spec file from f36 repo, removed conditional part around wlan:

%bcond_without weather_xoap
%bcond_with wlan
%bcond_without xdbe
%bcond_without xinerama

built it with

rpmbuild -ba SPECS/conky.spec

and

sudo rpm -ivh RPMS/x86_64/conky-1.12.2-3.fc36.x86_64.rpm

BUT conky still complains about $wireless_essid. Next I changed the %build section replacing

    %{?with_weather_xoap:   -DBUILD_WEATHER_XOAP=ON} \
    %{?with_wlan:           -DBUILD_WLAN=ON} \
    %{?with_xdbe:           -DBUILD_XDBE=ON} \

with

    %{?with_weather_xoap:   -DBUILD_WEATHER_XOAP=ON} \
                            -DBUILD_WLAN=ON \
    %{?with_xdbe:           -DBUILD_XDBE=ON} \

and now conky runs smoothly. Soo… can someone explain why this conditional check isn’t working? Or maybe I got something wrong…

I’m not sure of the details, but this looks like a known issue:

https://discussion.fedoraproject.org/t/conky-wireless-support/27556/3?u=ankursinha

The bug notes why this is and that it has been reported upstream:

https://bugzilla.redhat.com/show_bug.cgi?id=2091210

https://github.com/brndnmtthws/conky/issues/1001

Confusingly, the %bcond_* macros define the default option; that means for F36, wlan is off by default.

1 Like

Ah, yeh, I read that wrongly too.

bcond_with means it’s disabled, and can be enabled in builds using the --with flag. bcond_without means it’s enabled, and can be disabled in builds using the --without flag.

This has been improved in newer RPM versions. The docs are here:

https://rpm-software-management.github.io/rpm/manual/conditionalbuilds.html

1 Like

OK, if they are reversed that explains A LOT :smiley: Thanks for clarification.

1 Like

david, where you able to get conky to compile from source?