Consolidation of the mesa libraries in the FreeBSD ports collection

r400699 created some headache for me. The UPDATING file has so far nothing on the matter.

In one instance only graphics/libGL was installed. The transition was simplified by running these two commands:

portupgrade -fpvo graphics/mesa-libs graphics/libGL
portupgrade -fprvx graphics/mesa-libs graphics/mesa-libs

If you’re able to do the above, then similar commands can be run to change graphics/dri to graphics/mesa-dri:

portupgrade -fpvo graphics/mesa-dri graphics/dri
portupgrade -fprvx graphics/mesa-dri graphics/mesa-dri

Other systems had installed two or more of these ports:

  • graphics/dri
  • graphics/gbm
  • graphics/libEGL
  • graphics/libGL
  • graphics/libglapi
  • graphics/libglesv2

In such cases it is more prudent to delete all the orphaned ports and reinstall the missing applications. A system or role specific meta-port is very handy in these cases.

pkg delete graphics/dri graphics/gbm graphics/libEGL graphics/libGL graphics/libglapi graphics/libglesv2
portupgrade -Nfprv local/bsdnet-labs

I experimented on my virtual machines at home this weekend, doing all kinds of senseless actions like forcefully installing graphics/mesa-libs from a package built by yours truly, and running commands such as pkg set -n new-name:old-name and pkg set -o new-origin:old-origin. As soon as I tried to upgrade graphics/libGL to graphics/mesa-libs using portupgrade, the build system complained about overwriting files belonging to other ports. Setting FORCE_PKG_REGISTER in the environment had no effect.

Maybe all I missed is a command for changing the old dependencies to point to the new common one, and another command for removing the old entries without actually removing any of the installed files. The pkg delete -D command exists, but it also removes the consumers of the Mesa libraries, which I wanted to avoid.

Clearly the pkg package manager isn’t clever enough to handle multiple ports changing their names and origins to common values. Removing the orphaned ports and reinstalling the missing ports takes less time.

Leave a Reply

Your email address will not be published. Required fields are marked *