x11/picom is currently v9.1 released on Feb 13 2022 and updated in pkgsrc on Sep 4 2022.
Currently, picom is at v11.2 released on Feb 13 2024, a package for this version is available as wip/picom.
All versions of picom after v9.1 require MesaLib >= 21 and need to be built with graphics/MesaLib from pkgsrc, as the base system uses MesaLib 19.
~> uname -rsv
NetBSD 10.99.10 NetBSD 10.99.10 (GENERIC) #0: Mon Apr 22 03:38:49 UTC 2024 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC
~> glxinfo -B
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Intel Open Source Technology Center (0x8086)
Device: Mesa DRI Intel(R) Haswell Mobile (0xa16)
Version: 19.1.17
Accelerated: yes
Video memory: 1536MB
Unified memory: yes
Preferred profile: core (0x1)
Max core profile version: 4.5
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.1
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
OpenGL core profile version string: 4.5 (Core Profile) Mesa 19.1.17
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 3.0 Mesa 19.1.17
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 19.1.17
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
Although, the base system also contains MesaLib 21, this is not on by default.
After some discussion with maya@ and wiz@, thank you both, I've decided to build a custom install image with MesaLib 21 enabled.
Upgrading the system using this custom image should allow me to build wip/picom without the need to install graphics/MesaLib from pkgsrc.
As a bonus, this should also avoids the need to have multiple LLVM versions installed, as graphics/MesaLib requires LLVM-13 and I already have 17 installed.
We need to fetch the sources, only src
and xsrc
are needed, and create the image using build.sh
.
Note: approx. 32 Gb of free disk space are required.
~> ./build.sh -h
Usage: build.sh [-EnoPRrUux] [-a ARCH] [-B BID] [-C EXTRAS]
[-c COMPILER] [-D DEST] [-j NJOB] [-M MOBJ] [-m MACH]
[-N NOISY] [-O OOBJ] [-R RELEASE] [-S SEED] [-T TOOLS]
[-V VAR=[VALUE]] [-w WRAPPER] [-X X11SRC]
[-Z VAR]
OPERATION ...
build.sh ( -h | -? )
Build OPERATIONs (all imply "obj" and "tools"):
build Run "make build".
distribution Run "make distribution" (includes DESTDIR/etc/ files).
release Run "make release" (includes kernels & distrib media).
Other OPERATIONs:
help Show this help message, and exit.
makewrapper Create nbmake-${MACHINE} wrapper and nbmake.
Always performed.
cleandir Run "make cleandir". [Default unless -u is used]
dtb Build devicetree blobs.
obj Run "make obj". [Default unless -o is used]
tools Build and install tools.
install=IDIR Run "make installworld" to IDIR to install all sets
except 'etc'. Useful after "distribution" or "release".
kernel=CONF Build kernel with config file CONF.
kernel.gdb=CONF Build kernel (including netbsd.gdb) with config
file CONF.
releasekernel=CONF Install kernel built by kernel=CONF to RELEASEDIR.
kernels Build all kernels.
installmodules=IDIR Run "make installmodules" to IDIR to install all
kernel modules.
modules Build kernel modules.
rumptest Do a linktest for rump (for developers).
sets Create binary sets in
RELEASEDIR/RELEASEMACHINEDIR/binary/sets.
DESTDIR should be populated beforehand.
distsets Same as "distribution sets".
sourcesets Create source sets in RELEASEDIR/source/sets.
syspkgs Create syspkgs in
RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs.
iso-image Create CD-ROM image in RELEASEDIR/images.
iso-image-source Create CD-ROM image with source in RELEASEDIR/images.
live-image Create bootable live image in
RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage.
install-image Create bootable installation image in
RELEASEDIR/RELEASEMACHINEDIR/installation/installimage.
disk-image=TARGET Create bootable disk image in
RELEASEDIR/RELEASEMACHINEDIR/binary/gzimg/TARGET.img.gz.
params Create params file with various make(1) parameters.
show-params Show various make(1) parameters.
list-arch Show a list of valid MACHINE/MACHINE_ARCH values,
and exit. The list may be narrowed by passing glob
patterns or exact values in MACHINE or MACHINE_ARCH.
mkrepro-timestamp Show the latest source timestamp used for reproducible
builds and exit. Requires -P or -V MKREPRO=yes.
Options:
-a ARCH Set MACHINE_ARCH=ARCH. [Default: deduced from MACHINE]
-B BID Set BUILDID=BID.
-C EXTRAS Append EXTRAS to CDEXTRA for inclusion on CD-ROM.
-c COMPILER Select compiler from COMPILER:
clang
gcc
[Default: gcc]
-D DEST Set DESTDIR=DEST. [Default: destdir.${MACHINE}]
-E Set "expert" mode; disables various safety checks.
Should not be used without expert knowledge of the build
system.
-h Show this help message, and exit.
-j NJOB Run up to NJOB jobs in parallel; see make(1) -j.
-M MOBJ Set obj root directory to MOBJ; sets MAKEOBJDIRPREFIX=MOBJ,
unsets MAKEOBJDIR.
-m MACH Set MACHINE=MACH. Some MACH values are actually
aliases that set MACHINE/MACHINE_ARCH pairs.
[Default: deduced from the host system if the host
OS is NetBSD]
-N NOISY Set the noisiness (MAKEVERBOSE) level of the build to NOISY:
0 Minimal output ("quiet").
1 Describe what is occurring.
2 Describe what is occurring and echo the actual
command.
3 Ignore the effect of the "@" prefix in make
commands.
4 Trace shell commands using the shell's -x flag.
[Default: 2]
-n Show commands that would be executed, but do not execute
them.
-O OOBJ Set obj root directory to OOBJ; sets a MAKEOBJDIR pattern
using OOBJ, unsets MAKEOBJDIRPREFIX.
-o Set MKOBJDIRS=no; do not create objdirs at start of build.
-P Set MKREPRO and MKREPRO_TIMESTAMP to the latest source
CVS timestamp for reproducible builds.
-R RELEASE Set RELEASEDIR=RELEASE. [Default: releasedir]
-r Remove contents of TOOLDIR and DESTDIR before building.
-S SEED Set BUILDSEED=SEED. [Default: NetBSD-majorversion]
-T TOOLS Set TOOLDIR=TOOLS. If unset, and TOOLDIR is not set
in the environment, nbmake will be (re)built
unconditionally.
-U Set MKUNPRIVED=yes; build without requiring root privileges,
install from an unprivileged build with proper file
permissions.
-u Set MKUPDATE=yes; do not run "make cleandir" first.
Without this, everything is rebuilt, including the tools.
-V VAR=[VALUE] Set variable VAR=VALUE.
-w WRAPPER Create nbmake script as WRAPPER.
[Default: ${TOOLDIR}/bin/nbmake-${MACHINE}]
-X X11SRC Set X11SRCDIR=X11SRC. [Default: /usr/xsrc]
-x Set MKX11=yes; build X11 from X11SRCDIR.
-Z VAR Unset ("zap") variable VAR.
-? Show this help message, and exit.
The following steps can be done with one command only but, I was curious about the time it takes for each step.
NOTE: The build should be done in unprivileged mode, else creating the install image will fail.
Without any further due ...
~> cd /usr/src
~> ./build.sh -u -U -j4 -O ~/obj tools
[...]
===> Summary of results:
build.sh command: ./build.sh -u -U -j4 -O /home/pin/obj tools
build.sh started: Thu Apr 25 15:21:18 CEST 2024
NetBSD version: 10.99.10
MACHINE: amd64
MACHINE_ARCH: x86_64
Build platform: NetBSD 10.99.10 amd64
HOST_SH: /bin/sh
No $TOOLDIR/bin/nbmake, needs building.
Bootstrapping nbmake
share/mk MAKECONF: /etc/mk.conf
MAKECONF file: /etc/mk.conf
TOOLDIR path: /home/pin/obj/tooldir.NetBSD-10.99.10-amd64
DESTDIR path: /home/pin/obj/destdir.amd64
RELEASEDIR path: /home/pin/obj/releasedir
Created /home/pin/obj/tooldir.NetBSD-10.99.10-amd64/bin/nbmake
Updated makewrapper: /home/pin/obj/tooldir.NetBSD-10.99.10-amd64/bin/nbmake-amd64
Tools built to /home/pin/obj/tooldir.NetBSD-10.99.10-amd64
build.sh ended: Thu Apr 25 15:49:31 CEST 2024
~> ./build.sh -u -U -j4 -V HAVE_MESA_VER=21 -x -O ~/obj release
[...]
===> Summary of results:
build.sh command: ./build.sh -u -U -j4 -V HAVE_MESA_VER=21 -x -O /home/pin/obj release
build.sh started: Thu Apr 25 15:52:10 CEST 2024
NetBSD version: 10.99.10
MACHINE: amd64
MACHINE_ARCH: x86_64
Build platform: NetBSD 10.99.10 amd64
HOST_SH: /bin/sh
share/mk MAKECONF: /etc/mk.conf
MAKECONF file: /etc/mk.conf
TOOLDIR path: /home/pin/obj/tooldir.NetBSD-10.99.10-amd64
DESTDIR path: /home/pin/obj/destdir.amd64
RELEASEDIR path: /home/pin/obj/releasedir
Updated makewrapper: /home/pin/obj/tooldir.NetBSD-10.99.10-amd64/bin/nbmake-amd64
Successful make release
build.sh ended: Thu Apr 25 22:57:38 CEST 2024
~> ./build.sh -u -U -j4 -V HAVE_MESA_VER=21 -x -O ~/obj install-image
[...]
===> Summary of results:
build.sh command: ./build.sh -u -U -j4 -V HAVE_MESA_VER=21 -x -O /home/pin/obj install-image
build.sh started: Fri Apr 26 05:02:44 CEST 2024
NetBSD version: 10.99.10
MACHINE: amd64
MACHINE_ARCH: x86_64
Build platform: NetBSD 10.99.10 amd64
HOST_SH: /bin/sh
share/mk MAKECONF: /etc/mk.conf
MAKECONF file: /etc/mk.conf
TOOLDIR path: /home/pin/obj/tooldir.NetBSD-10.99.10-amd64
DESTDIR path: /home/pin/obj/destdir.amd64
RELEASEDIR path: /home/pin/obj/releasedir
Updated makewrapper: /home/pin/obj/tooldir.NetBSD-10.99.10-amd64/bin/nbmake-amd64
Successful make install-image
build.sh ended: Fri Apr 26 05:23:55 CEST 2024
We should now have the desired install images in obj/releasedir/images
.
~> ls /home/pin/obj/releasedir/images/
.rw-r--r-- pin wheel 161 B Fri Apr 26 05:23:41 2024 MD5
.r--r--r-- pin wheel 426 MB Fri Apr 26 05:23:28 2024 NetBSD-10.99.10-amd64-bios-install.img.gz
.r--r--r-- pin wheel 426 MB Fri Apr 26 05:13:03 2024 NetBSD-10.99.10-amd64-install.img.gz
.rw-r--r-- pin wheel 359 B Fri Apr 26 05:23:55 2024 SHA512
As we built release above, a manual upgrade is also possible but, let's unpack the newly built image, copy it to an usb and use sysinst
.
~> gunzip NetBSD-10.99.10-amd64-install.img.gz
~> su
Password:
# dd if=/dev/zero of=/dev/rsd0d bs=1m count=1m
# dd if=NetBSD-10.99.10-amd64-install.img ibs=1m | progress dd of=/dev/rsd0d obs=1m
2493 MiB 6.52 MiB/s 2500+0 records in
5120000+0 records out
2621440000 bytes transferred in 382.641 secs (6850912 bytes/sec)
5120000+0 records in
2500+0 records out
2621440000 bytes transferred in 382.721 secs (6849480 bytes/sec)
2500 MiB 6.53 MiB/s
# exit
Boot from the newly created install media and perform an upgrade of the system.
~> uname -rsv
NetBSD 10.99.10 NetBSD 10.99.10 (GENERIC) #0: Thu Apr 25 22:39:14 CEST 2024 pin@mybox:/home/pin/obj/sys/arch/amd64/compile/GENERIC
~> glxinfo -B
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Intel Open Source Technology Center (0x8086)
Device: Mesa DRI Intel(R) HD Graphics 4400 (HSW GT2) (0xa16)
Version: 21.3.7
Accelerated: yes
Video memory: 1536MB
Unified memory: yes
Preferred profile: core (0x1)
Max core profile version: 4.5
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.1
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 4400 (HSW GT2)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 21.3.7
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 3.0 Mesa 21.3.7
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 21.3.7
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
And yes, I only have one version of MesaLib and LLVM installed 😊