Skip to content

Fails to build on Mac #500

Open
Open
@jenstroeger

Description

@jenstroeger

Today I wanted to build i3status from source because it doesn’t seem to be available from MacPorts (whereas i3 is, albeit not maintained).

So, following the instructions got me a few warnings and then

FAILED: i3status.p/src_print_disk_info.c.o 
cc -Ii3status.p -I. -I.. -I../include -I/opt/local/include -I/opt/local/include/yajl -fcolor-diagnostics -Wall -Winvalid-pch -std=c11 -O0 -g -Wunused-value -D_GNU_SOURCE -D_REENTRANT -MD -MQ i3status.p/src_print_disk_info.c.o -MF i3status.p/src_print_disk_info.c.o.d -o i3status.p/src_print_disk_info.c.o -c ../src/print_disk_info.c
../src/print_disk_info.c:138:16: error: use of undeclared identifier 'path'
    if (statfs(path, &buf) == -1)
               ^
1 error generated.

and it seems the __APPLE__ code is the culprit:

#if defined(__DragonFly__) || defined(__APPLE__)
struct statfs buf;
if (statfs(path, &buf) == -1)
return;
mounted = true;

Changing path to ctx->path compiles and seems to run:

savage@pooh ~/opt/src/i3status/build > i3status 
i3status: trying to auto-detect output_format setting
i3status: auto-detected "term"
no IPv6 | 33.7 GiB | W: down | E: down | No battery | 2.09 | 2022-09-10 19:49:28
no IPv6 | 33.7 GiB | W: down | E: down | No battery | 2.09 | 2022-09-10 19:49:29
no IPv6 | 33.7 GiB | W: down | E: down | No battery | 2.00 | 2022-09-10 19:49:30
no IPv6 | 33.7 GiB | W: down | E: down | No battery | 2.00 | 2022-09-10 19:49:31

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions