Please postpone reviewing this! (Sorry if I wasted anyone's time.) I was planning to do all the dlopen() patching later on in one commit, but realized that it means I will be adding a phase lambda that references the 's2tc' input, after which the 'mesa-without-s2tc' package breaks because it simply inherits from the full 'mesa' package. (I would have to hackishly take out that lambda from the phases again to make it work...)
I'm pondering on a solution using a much more minimal 'mesa-for-s2tc' package. I might even get away with only installing the libGL headers in the output of that package, without doing any compilation at all, since I think s2tc needs only the headers... Taylan