GhostNaN / mpvpaper

A video wallpaper program for wlroots based wayland compositors.
GNU General Public License v3.0
713 stars 21 forks source link

Build failed due to unable to find the Wayland header files #51

Closed JohnDoeAntler closed 1 year ago

JohnDoeAntler commented 1 year ago

The meson build logs:

The Meson build system
Version: 1.1.1
Source dir: /home/john/.cache/yay/mpvpaper/src/mpvpaper-1.3
Build dir: /home/john/.cache/yay/mpvpaper/src/build
Build type: native build
Project name: mpvpaper
Project version: undefined
C compiler for the host machine: cc (gcc 13.1.0 "cc (conda-forge gcc 13.1.0-0) 13.1.0")
C linker for the host machine: cc ld.bfd 2.40
Host machine cpu family: x86_64
Host machine cpu: x86_64
Library dl found: YES
Found pkg-config: /usr/bin/pkg-config (1.8.1)
Run-time dependency wayland-protocols found: YES 1.31
Run-time dependency wayland-client found: YES 1.22.0
Run-time dependency wayland-egl found: YES 18.1.0
Run-time dependency egl found: YES 1.5
Run-time dependency mpv found: YES 2.0.0
Run-time dependency threads found: YES
Program wayland-scanner found: YES (/usr/bin/wayland-scanner)
Library rt found: YES
Build targets in project: 3

And my /usr/include directory:

$ ll /usr/include/wayland-*.h
.rw-r--r-- 9.3k root  7 Apr 02:29 /usr/include/wayland-client-core.h
.rw-r--r-- 204k root  7 Apr 02:29 /usr/include/wayland-client-protocol.h
.rw-r--r-- 1.6k root  7 Apr 02:29 /usr/include/wayland-client.h
.rw-r--r-- 2.7k root  7 Apr 02:29 /usr/include/wayland-cursor.h
.rw-r--r-- 1.9k root  7 Apr 02:29 /usr/include/wayland-egl-backend.h
.rw-r--r-- 1.8k root  7 Apr 02:29 /usr/include/wayland-egl-core.h
.rw-r--r-- 1.3k root  7 Apr 02:29 /usr/include/wayland-egl.h
.rw-r--r--  20k root  7 Apr 02:29 /usr/include/wayland-server-core.h
.rw-r--r-- 154k root  7 Apr 02:29 /usr/include/wayland-server-protocol.h
.rw-r--r-- 3.2k root  7 Apr 02:29 /usr/include/wayland-server.h
.rw-r--r--  24k root  7 Apr 02:29 /usr/include/wayland-util.h
.rw-r--r-- 1.4k root  7 Apr 02:29 /usr/include/wayland-version.h

However during the building process seems like it could not find the Wayland header files:

libprotocols.a.p/wlr-layer-shell-unstable-v1-protocol.c:30:10: fatal error: wayland-util.h: No such file or directory
   30 | #include "wayland-util.h"
      |          ^~~~~~~~~~~~~~~~

libprotocols.a.p/xdg-shell-protocol.c:33:10: fatal error: wayland-util.h: No such file or directory
   33 | #include "wayland-util.h"
      |          ^~~~~~~~~~~~~~~~

../mpvpaper-1.3/src/holder.c:11:10: fatal error: wayland-client.h: No such file or directory
   11 | #include <wayland-client.h>
      |          ^~~~~~~~~~~~~~~~~~

../mpvpaper-1.3/src/main.c:14:10: fatal error: wayland-client.h: No such file or directory
   14 | #include <wayland-client.h>
      |          ^~~~~~~~~~~~~~~~~~

Do I missing something here?

Full build logs:

:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  mpvpaper-1.3-3

  1 mpvpaper                                 (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==>
:: PKGBUILD up to date, Skipping (1/0): mpvpaper
  1 mpvpaper                                 (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==>
:: (1/1) Parsing SRCINFO: mpvpaper
==> Making package: mpvpaper 1.3-3 (Thu 22 Jun 2023 06:20:49 PM HKT)
==> Retrieving sources...
  -> Found mpvpaper-1.3.tar.gz
==> Validating source files with b2sums...
    mpvpaper-1.3.tar.gz ... Passed
==> Making package: mpvpaper 1.3-3 (Thu 22 Jun 2023 06:20:49 PM HKT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found mpvpaper-1.3.tar.gz
==> Validating source files with b2sums...
    mpvpaper-1.3.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting mpvpaper-1.3.tar.gz with bsdtar
==> Sources are ready.
==> Making package: mpvpaper 1.3-3 (Thu 22 Jun 2023 06:20:51 PM HKT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Removing existing $pkgdir/ directory...
==> Starting build()...
+ exec meson setup --prefix /usr --libexecdir lib --sbindir bin --buildtype plain --auto-features enabled --wrap-mode nodownload -D b_lto=true -D b_pie=true mpvpaper-1.3 build
The Meson build system
Version: 1.1.1
Source dir: /home/john/.cache/yay/mpvpaper/src/mpvpaper-1.3
Build dir: /home/john/.cache/yay/mpvpaper/src/build
Build type: native build
Project name: mpvpaper
Project version: undefined
C compiler for the host machine: cc (gcc 13.1.0 "cc (conda-forge gcc 13.1.0-0) 13.1.0")
C linker for the host machine: cc ld.bfd 2.40
Host machine cpu family: x86_64
Host machine cpu: x86_64
Library dl found: YES
Found pkg-config: /usr/bin/pkg-config (1.8.1)
Run-time dependency wayland-protocols found: YES 1.31
Run-time dependency wayland-client found: YES 1.22.0
Run-time dependency wayland-egl found: YES 18.1.0
Run-time dependency egl found: YES 1.5
Run-time dependency mpv found: YES 2.0.0
Run-time dependency threads found: YES
Program wayland-scanner found: YES (/usr/bin/wayland-scanner)
Library rt found: YES
Build targets in project: 3

mpvpaper undefined

  User defined options
    auto_features: enabled
    buildtype    : plain
    libexecdir   : lib
    prefix       : /usr
    sbindir      : bin
    wrap_mode    : nodownload
    b_lto        : true
    b_pie        : true

Found ninja-1.11.1 at /usr/bin/ninja
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /home/john/.cache/yay/mpvpaper/src/build
ninja: Entering directory `/home/john/.cache/yay/mpvpaper/src/build'
[6/14] Compiling C object libprotocols.a.p/meson-generated_wlr-layer-shell-unstable-v1-protocol.c.o
FAILED: libprotocols.a.p/meson-generated_wlr-layer-shell-unstable-v1-protocol.c.o
cc -Ilibprotocols.a.p -I. -I../mpvpaper-1.3 -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fPIC -MD -MQ libprotocols.a.p/meson-generated_wlr-layer-shell-unstable-v1-protocol.c.o -MF libprotocols.a.p/meson-generated_wlr-layer-shell-unstable-v1-protocol.c.o.d -o libprotocols.a.p/meson-generated_wlr-layer-shell-unstable-v1-protocol.c.o -c libprotocols.a.p/wlr-layer-shell-unstable-v1-protocol.c
libprotocols.a.p/wlr-layer-shell-unstable-v1-protocol.c:30:10: fatal error: wayland-util.h: No such file or directory
   30 | #include "wayland-util.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
[7/14] Compiling C object libprotocols.a.p/meson-generated_xdg-shell-protocol.c.o
FAILED: libprotocols.a.p/meson-generated_xdg-shell-protocol.c.o
cc -Ilibprotocols.a.p -I. -I../mpvpaper-1.3 -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fPIC -MD -MQ libprotocols.a.p/meson-generated_xdg-shell-protocol.c.o -MF libprotocols.a.p/meson-generated_xdg-shell-protocol.c.o.d -o libprotocols.a.p/meson-generated_xdg-shell-protocol.c.o -c libprotocols.a.p/xdg-shell-protocol.c
libprotocols.a.p/xdg-shell-protocol.c:33:10: fatal error: wayland-util.h: No such file or directory
   33 | #include "wayland-util.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
[9/14] Compiling C object mpvpaper-holder.p/src_holder.c.o
FAILED: mpvpaper-holder.p/src_holder.c.o
cc -Impvpaper-holder.p -I. -I../mpvpaper-1.3 -I../mpvpaper-1.3/inc -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fPIE -MD -MQ mpvpaper-holder.p/src_holder.c.o -MF mpvpaper-holder.p/src_holder.c.o.d -o mpvpaper-holder.p/src_holder.c.o -c ../mpvpaper-1.3/src/holder.c
../mpvpaper-1.3/src/holder.c:11:10: fatal error: wayland-client.h: No such file or directory
   11 | #include <wayland-client.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
[10/14] Compiling C object mpvpaper.p/src_main.c.o
FAILED: mpvpaper.p/src_main.c.o
cc -Impvpaper.p -I. -I../mpvpaper-1.3 -I../mpvpaper-1.3/inc -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fPIE -pthread -MD -MQ mpvpaper.p/src_main.c.o -MF mpvpaper.p/src_main.c.o.d -o mpvpaper.p/src_main.c.o -c ../mpvpaper-1.3/src/main.c
../mpvpaper-1.3/src/main.c:14:10: fatal error: wayland-client.h: No such file or directory
   14 | #include <wayland-client.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
[11/14] Compiling C object mpvpaper.p/src_glad.c.o
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: mpvpaper
GhostNaN commented 1 year ago

Do I missing something here?

Nope. You have included all the proper logs I could think of. Meson found your headers, but gcc didn't, odd. Have you tried manually cloning and compiling the project?

JohnDoeAntler commented 1 year ago

Sorry for the late response.

Have you tried manually cloning and compiling the project? Yes, I have cloned it manually, executed the lines from the readme build section, but have the same errors like I installed it from AUR.

Before the ninja build command executed, everything seems to work fine, the line meson build --prefix=/usr/local is executed without poping up any errorsp.

I got the same errors during the execution of the command ninja -C build.

GhostNaN commented 1 year ago

You could try manaully pointing to the Wayland directory by adding this to meson.build at around line 3:

add_project_arguments( '-I/usr/include/wayland', language : 'c')

Edit: Never mind this was a separate issue I saw online.

GhostNaN commented 1 year ago

I wonder if this is a system issue.

Are you able to compile other Wayland projects such as sway?

JohnDoeAntler commented 1 year ago

Are you able to compile other Wayland projects such as sway?

No, same errors like building this project.

I wonder if this is a system issue.

Mostly I guess, sorry for bothering your time, I will close this issue.

GhostNaN commented 1 year ago

No problem. I knew something was off from the start, but wanted to try to help anyway. But I'm at a loss with this issue. Best of luck to you.

JohnDoeAntler commented 1 year ago

Yep, just found out a few days ago, my gcc and some other C build tools were overwritten by the miniconda binary path, and that explains why I failed the build even though I could find those header files in /usr/include. Anyways, thanks for your help.