When you directly deal with the root directory, you have to prefix with ${ROOT}. pkg_preinst() { # removing wrong symlink which is created by previous ebuild. if [ -L ${ROOT}/usr/include/libpq ]; then rm ${ROOT}/usr/include/libpq fi } Also you don't have to filter -ffast-math. The flag is unsupported. Bugs of those who use it can directly go to /dev/null. At last it would be nice to get a pointer regarding https://bugs.kde.org/show_bug.cgi?id=110033
Fixed I forgot ${ROOT} thing. Thank you for reporting. I'm going to fix pg_config problem..
Eh, I was keen on a comment on the linked bug report, especially because I think it's unreasonable to expect that upstream should support /usr/include/postgresql/libpq-${SLOT}/libpq-fe.h. Is slotting here so important? It'll lead to a lot of patch work. If this issue wouldn't be, I had not detected the missing ${ROOT} in the first place.
Uh sorry, got the pg_config pointer.