Updated tutorial about how to install Wayland / Wayfire on FreeBSD 14,keeping your nvidia gpu as primary.

Hello.

this is what I did to install Wayland and wayfire on a separate directory /opt/wayfire (to use the more updated version of the components) on FreeBSD 14. Actually I can use my GTX 1060 as primary GPU selected from the BIOS and everything works good.

Update ports tree :

Code:
# portsnap fetch extract
# portsnap fetch update

Install the following ports :

Code:
nvidia-driver
nvidia-settings
nvidia-drm-kmod
libva-intel-driver
libva-utils
linux-nvidia-libs
libc6-shim
libvdpau-va-gl
libva-nvidia-driver
xdg-desktop-portal-wlr
wlrobs
grim
slurp
wlr-which-key

like this :

Code:
# /usr/ports/x11/nvidia-driver # make
# /usr/ports/x11/nvidia-driver # make install
OK

# /usr/ports/graphics/nvidia-drm-kmod # make

....
awk -f /usr/src/sys/conf/kmod_syms.awk nvidia-drm.ko.full  export_syms | xargs -J% objcopy % nvidia-drm.ko.full
--- nvidia-drm.ko.debug ---
objcopy --only-keep-debug nvidia-drm.ko.full nvidia-drm.ko.debug
--- nvidia-drm.ko ---
objcopy --strip-debug --add-gnu-debuglink=nvidia-drm.ko.debug  nvidia-drm.ko.full nvidia-drm.ko
===>  Staging for nvidia-drm-515-kmod-550.54.14
===>   nvidia-drm-515-kmod-550.54.14 depends on file: /boot/modules/drm.ko - found
===>   nvidia-drm-515-kmod-550.54.14 depends on file: /boot/modules/nvidia.ko - found
===>   Generating temporary packing list
install -T release -o root -g wheel -m 555   nvidia-drm.ko /usr/ports/graphics/nvidia-drm-515-kmod/work/stage/boot/modules/
/bin/mkdir -p /usr/ports/graphics/nvidia-drm-515-kmod/work/stage/usr/local/share/X11/xorg.conf.d/
install  -m 0644 /usr/ports/graphics/nvidia-drm-515-kmod/work/20-nvidia-drm-outputclass.conf /usr/ports/graphics/nvidia-drm-515-kmod/work/stage/usr/local/share/X11/xorg.conf.d/
====> Compressing man pages (compress-man)
===>  Installing for nvidia-drm-515-kmod-550.54.14
===>  Checking if nvidia-drm-515-kmod is already installed
===>   Registering installation for nvidia-drm-515-kmod-550.54.14 as automatic
Installing nvidia-drm-515-kmod-550.54.14...
Modesetting must be enabled to use nvidia-drm.ko for graphics. This can be done
by setting the modeset sysctl, the equivalent of the modeset kernel parameter
on Linux.

hw.nvidiadrm.modeset=1

This must be set before loading nvdidia-drm.ko, most easily done by placing the above in /boot/loader.conf.

===>   nvidia-drm-kmod-550.54.14 depends on file: /boot/modules/nvidia-drm.ko - found
===>   Returning to build of nvidia-drm-kmod-550.54.14
===>   Generating temporary packing list
====> Compressing man pages (compress-man)

# /usr/ports/graphics/nvidia-drm-kmod # make install

===>  Installing for nvidia-drm-kmod-550.54.14
===>  Checking if nvidia-drm-kmod is already installed
===>   Registering installation for nvidia-drm-kmod-550.54.14

Installing nvidia-drm-kmod-550.54.14...

Modesetting must be enabled to use nvidia-drm.ko for graphics.
This can be done by setting the modeset sysctl,the equivalent of the modeset kernel parameter on Linux.

hw.nvidiadrm.modeset=1

This must be set before loading nvdidia-drm.ko, most easily done by placing the above in /boot/loader.conf.

# nano /boot/loader.conf :
hw.nvidiadrm.modeset=1
 
# /usr/ports/x11/nvidia-settings # make
# /usr/ports/x11/nvidia-settings # make install
OK

# /usr/ports/multimedia/libva-intel-driver # make
# /usr/ports/multimedia/libva-intel-driver # make install
OK

# /usr/ports/multimedia/libva-utils # make
# /usr/ports/multimedia/libva-utils # make install
OK

# nano /etc/rc.conf

kld_list="i915kms nvidia-modeset nvidia-drm linux linux64"

wf-install should take care of everything :

Code:
# git clone https://github.com/WayfireWM/wf-install && cd wf-install

but we should modify a little bit the installation script :

Code:
nano install.sh

changing the current seds with these :

Code:
if [ "${PREFIX}" != '/usr' ]; then
sed -i '' "s@^LD_.*@export LD_LIBRARY_PATH=${PREFIX}/${DEST_LIBDIR}:\$LD_LIBRARY_PATH@g" "$BUILDROOT/start_wayfire.sh"
sed -i '' "s@^PATH.*@export PATH=${PREFIX}/bin:\$PATH@g" "$BUILDROOT/start_wayfire.sh"
sed -i '' "s@^XDG_.*@export XDG_DATA_DIRS=${PREFIX}/share:\$XDG_DATA_DIRS@g" "$BUILDROOT/start_wayfire.sh"

cp "$BUILDROOT/wayfire.desktop.in" "$BUILDROOT/wayfire.desktop"
sed -i '' "s@^Exec.*@Exec=$PREFIX/bin/startwayfire@g" "$BUILDROOT/wayfire.desktop"
sed -i '' "s@^Icon.*@Icon=$PREFIX/share/wayfire/icons/wayfire.png@g" "$BUILDROOT/wayfire.desktop"

and then :

Code:
./install.sh --prefix /opt/wayfire

or we can install all the components one by one :

Code:
# git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git && cd wayland-protocols
# meson setup build --prefix=/opt/wayfire --buildtype=release
# ninja -C build && sudo ninja -C build/ install

# git clone https://gitlab.freedesktop.org/wlroots/wlroots.git && cd wlroots
# meson setup build --prefix=/opt/wayfire --buildtype=release
# ninja -C build && sudo ninja -C build/ install

# export PKG_CONFIG_PATH=/opt/wayfire/share/pkgconfig

# git clone https://github.com/WayfireWM/wayfire.git && cd wayfire
NO : # meson build --prefix=/opt/wayfire --buildtype=release
# meson build --prefix=/opt/wayfire -Duse_system_wlroots=disabled --buildtype=releas
# ninja -C build && sudo ninja -C build install

......
Installing /usr/home/marietto/Scaricati/wayfire/metadata/wsets.xml to /opt/wayfire/share/wayfire/metadata
Installing /usr/home/marietto/Scaricati/wayfire/metadata/wayfire-shell.xml to /opt/wayfire/share/wayfire/metadata
Installing /usr/home/marietto/Scaricati/wayfire/metadata/xdg-activation.xml to /opt/wayfire/share/wayfire/metadata
Installing /usr/home/marietto/Scaricati/wayfire/wayfire.desktop to /opt/wayfire/share/wayland-sessions
Installing symlink pointing to libwf-config.so.0.9.0 to /opt/wayfire/lib/libwf-config.so.1
Installing symlink pointing to libwf-config.so.1 to /opt/wayfire/lib/libwf-config.so
Installing symlink pointing to libwf-utils.so.0.4.0 to /opt/wayfire/lib/libwf-utils.so.0
Installing symlink pointing to libwf-utils.so.0 to /opt/wayfire/lib/libwf-utils.so
OK

export PKG_CONFIG_PATH=/opt/wayfire/share/pkgconfig:/opt/wayfire/libdata/pkgconfig

# git clone https://github.com/WayfireWM/wf-shell && cd wf-shell
# meson setup build --prefix=/opt/wayfire --buildtype=release
# ninja -C build && sudo ninja -C build install

# git clone https://github.com/WayfireWM/wayfire-plugins-extra && cd wayfire-plugins-extra
# meson build --prefix=/opt/wayfire --buildtype=release
# ninja -C build && sudo ninja -C build install

[root@marietto /var/run/user]==> rsync -avxHAX 1001 1001_

sending incremental file list
1001/
1001/ICEauthority
1001/at-spi/
1001/at-spi/bus_0
1001/dbus-1/
1001/dbus-1/services/
1001/dconf/
1001/dconf/user
1001/gvfsd/
1001/pulse/
1001/pulse/native
1001/pulse/pid

sent 747 bytes  received 107 bytes  1.708,00 bytes/sec
total size is 170  speedup is 0,20

[root@marietto /var/run/user]==> chmod 700 1001_
[root@marietto /var/run/user]==> chown -R marietto:wheel 1001_
[root@marietto /var/run/user]==> sudo chmod 700 /var/run/user/1001_

nano /home/marietto/.zshenv

export XDG_RUNTIME_DIR=/var/run/user/1001_
MOZ_ENABLE_WAYLAND=1 # is needed so Firefox works with Wayland
MOZ_DISABLE_WAYLAND_PROXY=1 # is needed for Firefox 123.01,2 on Freebsd

# source /home/marietto/.zshenv

nano /home/marietto/.config/wayfire.ini

and under [core] set xwayland to true

xwayland = true


nano wayfire-start-zsh :

#!/usr/local/bin/zsh
export LD_LIBRARY_PATH=/opt/wayfire/lib/$libdir
export PATH=/opt/wayfire/bin:$PATH
#export XDG_RUNTIME_DIR="/var/run/user/`id -u`"
export XDG_RUNTIME_DIR=/var/run/user/1001_
export PKG_CONFIG_PATH=/opt/wayfire/share/pkgconfig:/opt/wayfire/libdata/pkgconfig
env WLR_NO_HARDWARE_CURSORS=1 ck-launch-session dbus-run-session wayfire
 
Last edited:
Thanks; thought it might be a port/package in 14 so OP might need to update the original post (the original post already uses git so think there's a way of achiving the same outcome as the extract/update steps but using git).
 
Which graphics card did you use for i915kms?



If you list nvidia-modeset, you need not list nvidia.

Is ext2fs essential?

---> kld_list="i915kms nvidia nvidia-modeset nvidia-drm linux linux64 ext2fs"

I've added both i915kms and nvidia* because both are needed if you want to run wayland / wayfire with the Intel gpu as primary and the gpu nvidia as secondary. Actually I keep the nvidia gpu as primary and I've disabled the intel gpu. I keep both the drivers on rc.conf because they don't produce problems ; I have one "CoffeeLake-S GT2 [UHD Graphics 630]" ; ext2fs is not essential.
 
no ext2fs isnt needed at all
thats from my setup that ziomario copied

ext2fs is what i use to mount ext4 drives

I want to make a clarification : my tutorial has been tailored on my direct experience with wayland / wayfire on my system. My system is different than the Napoleon system. It is also true that I watched his tutorial and I've included some steps performed by Napoleon because they worked also for me. Anyway I want to say thank you to Napoleon because he did a great configuration job and a lot of very detailed tutorials. I would like to call him a "workaholic" for the amount and the quality of job that he is able to perform. And more important,he shares everything and help everyone tirelessly. Well done,Napoleon / Wilson.
 

If you list nvidia-modeset, you need not list nvidia. An example:

Code:
% sysrc kld_list
kld_list: fusefs filemon nvidia-modeset
% kldstat | grep nvidia
15    1 0xffffffff84333000   107330 nvidia-modeset.ko
16    1 0xffffffff84600000  1fcfa10 nvidia.ko
%

The load of nvidia.ko was automated without use of kld_list.
 
I'm experimenting somekind of bug with xfce4. In coexistence with wayland / wayfire sometime works sometime not (I mean if I run it before or after leaving wayfire,I see a blackscreen). Maybe also kde plasma. lxde and mate work good.
 
Hi! I installed FreeBSD (first time using it) few hours ago and decided to try wayfire but I'm stuck at this step:

`meson build --prefix=/opt/wayfire -Duse_system_wlroots=disabled --buildtype=release`


This is log:
Called: `/usr/local/bin/pkg-config --modversion nlohmann_json` -> 1
stderr:
Package nlohmann_json was not found in the pkg-config search path.
Perhaps you should add the directory containing `nlohmann_json.pc'
to the PKG_CONFIG_PATH environment variable
Package 'nlohmann_json' not found
-----------
CMake binary for host machine is cached.
Preliminary CMake check failed. Aborting.
Run-time dependency nlohmann_json found: NO (tried pkgconfig and cmake)

meson.build:36:17: ERROR: Dependency "nlohmann_json" not found, tried pkgconfig and cmake
 
freebsd handbook wayfire

wayfire install
 
Back
Top