WayfireWM / wayfire

A modular and extensible wayland compositor
https://wayfire.org/
MIT License
2.37k stars 176 forks source link

Help building from source. #1965

Closed ItsTerm1n4l closed 11 months ago

ItsTerm1n4l commented 11 months ago

I already have wayfire installed as i am using Raspberry Pi OS bookworm but I would like to install WCM and especially wayfire-extra-plugins, however I am having trouble trying to build from source with meson, how should I install on the Pi? or is there any other build system i can use? Thank you.

ammen99 commented 11 months ago

We support only meson, but probably the errors you are getting are because RPi uses Wayfire 0.7.x. You will likely need to use the 0.7.x branches of the wayfire-plugins-extra and wcm.

ItsTerm1n4l commented 11 months ago

I have just tried again, I made sure and downloaded wayfire-plugins-extra for 7.5.0 ran meson setup --prefix=/usr --buildtype=release build and got this error;

The Meson build system
Version: 1.0.1
Source dir: /home/pi/Documents/wayfire-plugins-extra-0.7.5
Build dir: /home/pi/Documents/wayfire-plugins-extra-0.7.5/build
Build type: native build
Project name: wayfire-plugins-extra
Project version: 0.7.5
C compiler for the host machine: cc (gcc 12.2.0 "cc (Debian 12.2.0-14) 12.2.0")
C linker for the host machine: cc ld.bfd 2.40
C++ compiler for the host machine: c++ (gcc 12.2.0 "c++ (Debian 12.2.0-14) 12.2.0")
C++ linker for the host machine: c++ ld.bfd 2.40
Host machine cpu family: aarch64
Host machine cpu: aarch64
Found pkg-config: /usr/bin/pkg-config (1.8.1)
Found CMake: /usr/bin/cmake (3.25.1)
Run-time dependency wayfire found: NO (tried pkgconfig and cmake)

meson.build:16:0: ERROR: Dependency "wayfire" not found, tried pkgconfig and cmake

A full log can be found at /home/pi/Documents/wayfire-plugins-extra-0.7.5/build/meson-logs/meson-log.txt
ammen99 commented 11 months ago

Is there a wayfire-dev or wayfire-devel package for RPi?

ItsTerm1n4l commented 11 months ago

yes there is a wayfire-dev package abalible in the apt repos I don't have it installed, I just installed it and tried again but no success and same message.

PeterOGB commented 11 months ago

I've built the "master" branch with no problems once I had a list of all the extra packages needed to be installed first. There maybe a few unnecessary ones in the list ! The install.sh script makes it quite easy to do.

sudo apt install alacritty apt apt-file autoconf cmake git hwdata libasound2-dev libcairo2-dev libdbusmenu-gtk3-dev libdrm-dev libegl1-mesa-dev libffi-dev libgbm-dev libgirepository1.0-dev libgles2-mesa-dev libglm-dev libgtkmm-3.0-dev libinput-dev libjpeg-dev libpixman-1-dev libpulse-dev libseat-dev libsystemd-dev libtool libwayland-dev libx11-xcb-dev libxcb-composite0 libxcb-composite0-dev libxcb-dri3-dev libxcb-icccm4-dev libxcb-present-dev libxcb-render0 libxcb-res0-dev libxcb-xfixes0 libxcb-xinput-dev libxkbcommon-dev libxkbregistry-dev libxml2-dev locate meson pkg-config policykit-1 python3-pip python3-xcbgen valac valac-0.56-vapi vim x11-utils xcb xcb-proto xutils-dev xwayland HTH

ItsTerm1n4l commented 11 months ago

@PeterOGB the problem is, I already have wayfire installed! but pkg-config can't see it or something, meson hasn't given me an error for any other dependencies so I should need those, I have looked at the install script and inside it runs the same command I did.

PeterOGB commented 11 months ago

@ItsTerm1n4l What was your starting point (which PiOS version did you install) ? What did you install after that ? I have a spare SDcard I can try and reproduce your setup and see what I get.

ItsTerm1n4l commented 11 months ago

I tried following the instructions for ubuntu and set the PKG_CONFIG_DIR variable and ran eson build --prefix=$prefix and got the same error as before.

ItsTerm1n4l commented 11 months ago

@PeterOGB I had a fresh install of RPI OS bookworm I installed Tuesday. uname -a gives this Linux raspberrypi 6.1.0-rpi4-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.54-1+rpt2 (2023-10-05) aarch64 GNU/Linux

PeterOGB commented 11 months ago

From the tests I just did on a fresh PiOS install, it doesn't seem to like wcm ! I built all of 0.7.x from git, and tried running the version of wcm it produced. It logged me out, and seems to have broken the wayfire config somewhere as all I get now is a blank screen and a mouse cursor :-( More testing to folow... I have had more success when running the whole of the freshly built wayfire, but there are problems around permissions for things like package managers which seem to silently fail to do anything.

ItsTerm1n4l commented 11 months ago

XD I think you just found another bug! this seems completely unrelated though and I have not built wayfire, Iam just using the base install that was on bookworm. thank you for trying.

ammen99 commented 11 months ago

@ItsTerm1n4l I am not sure how to help any further, the last error you posted (Dependency "wayfire" not found, tried pkgconfig and cmake) simply means that the wayfire development package is not installed or could not be found by the meson build system ... After installing wayfire-dev(el), do you have a wayfire.pc file somewhere on your system?

spl237 commented 11 months ago

I've built the "master" branch with no problems once I had a list of all the extra packages needed to be installed first. There maybe a few unnecessary ones in the list ! The install.sh script makes it quite easy to do.

sudo apt install alacritty apt apt-file autoconf cmake git hwdata libasound2-dev libcairo2-dev libdbusmenu-gtk3-dev libdrm-dev libegl1-mesa-dev libffi-dev libgbm-dev libgirepository1.0-dev libgles2-mesa-dev libglm-dev libgtkmm-3.0-dev libinput-dev libjpeg-dev libpixman-1-dev libpulse-dev libseat-dev libsystemd-dev libtool libwayland-dev libx11-xcb-dev libxcb-composite0 libxcb-composite0-dev libxcb-dri3-dev libxcb-icccm4-dev libxcb-present-dev libxcb-render0 libxcb-res0-dev libxcb-xfixes0 libxcb-xinput-dev libxkbcommon-dev libxkbregistry-dev libxml2-dev locate meson pkg-config policykit-1 python3-pip python3-xcbgen valac valac-0.56-vapi vim x11-utils xcb xcb-proto xutils-dev xwayland HTH

Wouldn't "sudo apt build-dep wayfire" have been a lot easier?

PeterOGB commented 11 months ago

Maybe, but that would be for 0.7.X and I was building the master branch from github. The list was built up on a Debian 12 box that didn't have wayfire already installed on it and the list satisfies the dependencies for using the wayfire build/install script. See https://github.com/WayfireWM/wayfire#wayfire-dependencies

spl237 commented 11 months ago

Maybe, but that would be for 0.7.X and I was building the master branch from github.

As far as I am aware, the build dependencies haven't changed between 0.7.x and 0.8.x - I didn't need to do anything other than using build-deps to build 0.8.

The list was built up on a Debian 12 box that didn't have wayfire already installed on it

Doesn't matter - build-dep doesn't require the package to be installed; it just pulls the dependencies from apt.

My life became a lot easier 8 or 9 years ago when I discovered build-dep. My understanding is that checking the dependencies in the control file are correct is a part of a package being accepted by Debian. I don't think I can recall a single occasion since where I have had dependency problems as a result of using it - it just worked in every case I have tried.

PeterOGB commented 11 months ago

As I've said I was following the build instructions on https://github.com/WayfireWM/wf-install If you know a better way can you submit a pull request with updated instructions so we can all benefit ?

spl237 commented 11 months ago

I was only trying to help. Don't worry - I shan't bother in future....

ItsTerm1n4l commented 11 months ago

@ammen99 I have looked this up and there is no wayfire.pc file at /usr/share/pkg-config/ I did try creating one and it fixed the first error but I got another error, although my wayfire.pc file probably wasn't correct as I couldn't find any template online. I have been very impressed by the insane performance of wayfire even on my Pi 4. Thank you to all of you for creating the highest performing WM and wayland compositor.

ammen99 commented 11 months ago

Here is my wayfire.pc file. The .pc files are usually provided by the -dev packages so that other programs can find that which Wayfire provides .. I would raise a bug report to the package, they should include it ..

In the meantime, here is my wayfire.pc file from the development version - you might need to adjust the version and the paths for your system:

prefix=/usr
includedir=${prefix}/include
libdir=${prefix}/lib64

metadatadir=${prefix}/share/wayfire/metadata
sysconfdir=/etc
plugindir=${libdir}/wayfire
icondir=${prefix}/share/wayfire/icons
pkgdatadir=/usr/share/wayfire/protocols

Name: wayfire
Description: A Wayland Compositor
Version: 0.9.0
Requires: cairo, pango, pangocairo, wayland-server, pixman-1, wlroots, wf-config
Cflags: -I${includedir}
ItsTerm1n4l commented 11 months ago

I'm not very familiar with the way plugins are installed but would it be possible now that Pi users will be a large part of your userbase if you could provide prebuilt binaries for at least the WCM and maybe plugins?

ammen99 commented 11 months ago

We do not provide any binaries, you'll have to ask the Pi devs for this. cc @spl237

ItsTerm1n4l commented 11 months ago

How would I contact them (they removed the wayfire-pi repo on their github)?

spl237 commented 11 months ago

Errr - https://github.com/raspberrypi-ui/wayfire doesn't look removed to me...

Anything we have as binaries can be downloaded from apt. We don't package wcm - we have our own configuration tools.

PeterOGB commented 11 months ago

@spl237 are you planning to support more of the wayfire plugins with your config tools ? There are already forum questions about configuring ones not currently "officially supported" shall we say, and also about using ones from the extra set that are not packaged for PiOS (yet?). Having to rely on manual editing of wayfire.ini (especially by beginners) is not ideal (especially when wcm can already configure all the plugins).

ItsTerm1n4l commented 11 months ago

@spl237 sorry, I was looking at https://github.com/orgs/raspberrypi instead of https://github.com/orgs/raspberrypi-ui

ItsTerm1n4l commented 11 months ago

@ammen99 I used your wayfire.pc file and ran meson build --prefix=/usr --buildtype=release --reconfigure (I used --reconfigure because I had already managed to build somehow but failed at the next stage, probably due to a bodged build) and got this error.

metadata/meson.build:1:0: ERROR: Could not get pkg-config variable and no default provided for <PkgConfigDependency wayfire: True None>
ammen99 commented 11 months ago

@ItsTerm1n4l if you somehow managed to obtain the proper wayfire.pc file, you should definitely use that instead of the one from my system

ItsTerm1n4l commented 11 months ago

@ammen99 I have not been able to find any wayfire.pc file.

ammen99 commented 11 months ago

Then how did you manage to move forward? As you said here:

I had already managed to build somehow but failed at the next stage

ItsTerm1n4l commented 11 months ago

@ammen99 I had created a wayfire.pc file or edited the meson.build file, I can't remember which, but it didn't work.

ammen99 commented 11 months ago

@ItsTerm1n4l I am not really sure how to help you any further, if the packages do not provide a wayfire.pc file, that is a bug in the packages. Your only alternative would be building Wayfire from source, you can try the build dep command that was already suggested to install dependencies, and then build the 0.7.x 'stream' with wf-install. wf-install will also provide you with the option of installing w-p-e and WCM.

PeterOGB commented 11 months ago

wayfire.pc is installed as part of the wayfire-dev package. It should be in /usr/lib/aarch64-linux-gnu/pkgconfig/wayfire.pc


includedir=${prefix}/include
libdir=${prefix}/lib/aarch64-linux-gnu

metadatadir=${prefix}/share/wayfire/metadata
sysconfdir=/etc
plugindir=${libdir}/wayfire
icondir=${prefix}/share/wayfire/icons
pkgdatadir=/usr/share/wayfire/protocols

Name: wayfire
Description: A Wayland Compositor
Version: 0.7.5
Requires: cairo, pango, pangocairo, wayland-server, pixman-1, wlroots, wf-config
Cflags: -I${includedir}

You will also need to install libwlroots-dev and libwf-config-dev before pkgconfig will work.

pkg-config --cflags --libs wayfire -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -pthread -I/usr/include/libdrm -I/usr/include/libevdev-1.0/ -I/usr/include/libxml2 -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lcairo -lwayland-server -lpixman-1 -lwlroots -lwf-config

HTH PeterO

ItsTerm1n4l commented 11 months ago

ok, I have done this, and run meson build --prefix=/usr --buildtype=release --reconfigure and received no errors but when I run the next command ninja -C build I get

ninja: Entering directory `build'
[1/34] Compiling C++ object src/libfoc...prevent.so.p/focus-steal-prevent.cpp.o
FAILED: src/libfocus-steal-prevent.so.p/focus-steal-prevent.cpp.o 
c++ -Isrc/libfocus-steal-prevent.so.p -Isrc -I../src -I/usr/include/libevdev-1.0/ -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++17 -O3 -DWLR_USE_UNSTABLE -DWAYFIRE_PLUGIN -Wno-unused-parameter -fPIC -MD -MQ src/libfocus-steal-prevent.so.p/focus-steal-prevent.cpp.o -MF src/libfocus-steal-prevent.so.p/focus-steal-prevent.cpp.o.d -o src/libfocus-steal-prevent.so.p/focus-steal-prevent.cpp.o -c ../src/focus-steal-prevent.cpp
../src/focus-steal-prevent.cpp:23:10: fatal error: wayfire/per-output-plugin.hpp: No such file or directory
   23 | #include <wayfire/per-output-plugin.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[2/34] Compiling C++ object src/libbackground-view.so.p/background-view.cpp.o
FAILED: src/libbackground-view.so.p/background-view.cpp.o 
c++ -Isrc/libbackground-view.so.p -Isrc -I../src -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++17 -O3 -DWLR_USE_UNSTABLE -DWAYFIRE_PLUGIN -Wno-unused-parameter -fPIC -MD -MQ src/libbackground-view.so.p/background-view.cpp.o -MF src/libbackground-view.so.p/background-view.cpp.o.d -o src/libbackground-view.so.p/background-view.cpp.o -c ../src/background-view.cpp
../src/background-view.cpp:27:10: fatal error: wayfire/txn/transaction-manager.hpp: No such file or directory
   27 | #include <wayfire/txn/transaction-manager.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[3/34] Compiling C++ object src/libfollow-focus.so.p/follow-focus.cpp.o
FAILED: src/libfollow-focus.so.p/follow-focus.cpp.o 
c++ -Isrc/libfollow-focus.so.p -Isrc -I../src -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++17 -O3 -DWLR_USE_UNSTABLE -DWAYFIRE_PLUGIN -Wno-unused-parameter -fPIC -MD -MQ src/libfollow-focus.so.p/follow-focus.cpp.o -MF src/libfollow-focus.so.p/follow-focus.cpp.o.d -o src/libfollow-focus.so.p/follow-focus.cpp.o -c ../src/follow-focus.cpp
In file included from /usr/include/wayfire/plugin.hpp:6,
                 from ../src/follow-focus.cpp:23:
/usr/include/wayfire/util.hpp:6:10: fatal error: pixman.h: No such file or directory
    6 | #include <pixman.h>
      |          ^~~~~~~~~~
compilation terminated.
[4/34] Compiling C++ object src/libcrosshair.so.p/crosshair.cpp.o
FAILED: src/libcrosshair.so.p/crosshair.cpp.o 
c++ -Isrc/libcrosshair.so.p -Isrc -I../src -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++17 -O3 -DWLR_USE_UNSTABLE -DWAYFIRE_PLUGIN -Wno-unused-parameter -fPIC -MD -MQ src/libcrosshair.so.p/crosshair.cpp.o -MF src/libcrosshair.so.p/crosshair.cpp.o.d -o src/libcrosshair.so.p/crosshair.cpp.o -c ../src/crosshair.cpp
In file included from /usr/include/wayfire/plugin.hpp:6,
                 from ../src/crosshair.cpp:25:
/usr/include/wayfire/util.hpp:6:10: fatal error: pixman.h: No such file or directory
    6 | #include <pixman.h>
      |          ^~~~~~~~~~
compilation terminated.
[5/34] Compiling C++ object src/libbench.so.p/bench.cpp.o
FAILED: src/libbench.so.p/bench.cpp.o 
c++ -Isrc/libbench.so.p -Isrc -I../src -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++17 -O3 -DWLR_USE_UNSTABLE -DWAYFIRE_PLUGIN -Wno-unused-parameter -fPIC -MD -MQ src/libbench.so.p/bench.cpp.o -MF src/libbench.so.p/bench.cpp.o.d -o src/libbench.so.p/bench.cpp.o -c ../src/bench.cpp
In file included from /usr/include/wayfire/plugin.hpp:6,
                 from ../src/bench.cpp:28:
/usr/include/wayfire/util.hpp:6:10: fatal error: pixman.h: No such file or directory
    6 | #include <pixman.h>
      |          ^~~~~~~~~~
compilation terminated.
[6/34] Compiling C++ object src/libannotate.so.p/annotate.cpp.o
FAILED: src/libannotate.so.p/annotate.cpp.o 
c++ -Isrc/libannotate.so.p -Isrc -I../src -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++17 -O3 -DWLR_USE_UNSTABLE -DWAYFIRE_PLUGIN -Wno-unused-parameter -fPIC -MD -MQ src/libannotate.so.p/annotate.cpp.o -MF src/libannotate.so.p/annotate.cpp.o.d -o src/libannotate.so.p/annotate.cpp.o -c ../src/annotate.cpp
In file included from /usr/include/wayfire/nonstd/wlroots.hpp:59,
                 from /usr/include/wayfire/geometry.hpp:5,
                 from ../src/annotate.cpp:28:
/usr/include/wlr/types/wlr_output.h:12:10: fatal error: pixman.h: No such file or directory
   12 | #include <pixman.h>
      |          ^~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
ammen99 commented 11 months ago

You are most likely trying to build w-p-e for Wayfire 0.8.0. Check out the 0.7.x branch first - this is the release which is available on RPi.

ItsTerm1n4l commented 11 months ago

YES!, thank you @ammen99, I had downloaded w-p-e for wayfire 0.8.x and then 0.7.5 which is what I needed, but when I had tried again today to build and used the wayfire.pc file suggested above by @PeterOGB I forgot and cd'ed into the 0.8.x directory, I have finally successfully built wayland-plugins-extra. Thank you everyone for helping resolve this issue. As a solution maybe there should be a section at the bottom of the README for Pi users explaining this issue and including the wayfire.pc file posted by @PeterOGB?

ammen99 commented 11 months ago

As a solution maybe there should be a section at the bottom of the README for Pi users explaining this issue and including the wayfire.pc file posted by @PeterOGB?

Ideally, RPi should update their -dev package so that it includes the .pc file (if that is not already the case) :)

ItsTerm1n4l commented 11 months ago

yes, they should, but n the meantime should I open a pull request with the changes?

ammen99 commented 11 months ago

yes, they should, but n the meantime should I open a pull request with the changes?

I would prefer to not include so special instructions in the README, but feel free to add them to the Wiki pages - Wayfire has a tips & tricks section, I suppose you can create the same thing for w-p-e :)

ItsTerm1n4l commented 11 months ago

ok, thank you.

ItsTerm1n4l commented 11 months ago

done.

PeterOGB commented 11 months ago

As a solution maybe there should be a section at the bottom of the README for Pi users explaining this issue and including the wayfire.pc file posted by @PeterOGB?

You should never have to create a .pc file (unless you are making it for a package you are building). Installing the correct "-dev" packages is the way to get pkg-config working.

Of course the wayfire build instruction can't use a pre-built wayland-dev package to get the dependencies because there may not be one on a new platform or it may be undesirable to install one if working on a "clean" build.

ammen99 commented 11 months ago

You should never have to create a .pc file (unless you are making it for a package you are building). Installing the correct "-dev" packages is the way to get pkg-config working.

Yeah but as far as I have gathered, the problem is that RPi's wayfire-dev doesn't include the .pc file.

ammen99 commented 11 months ago

Ah, I see: the file is at a location that pkgconfig does not pick up. @ItsTerm1n4l in this case, the real solution would be setting PKG_CONFIG_PATH to include the directory where the .pc file is. I have updated the instructions :)

PeterOGB commented 11 months ago

You should never have to create a .pc file (unless you are making it for a package you are building). Installing the correct "-dev" packages is the way to get pkg-config working.

Yeah but as far as I have gathered, the problem is that RPi's wayfire-dev doesn't include the .pc file.

Yes it does, I just installed it to get the information I posted above.