I don't think pkg really knows whether Xorg is from ports or a package repo... /var/db/pkg will record installed package name and version, but not where it's from... commandSo pkg "knows" you have installed xorg from ports, for example.
pkg info -o
is the closest thing I can find in pkg(8), but I think it will only tell you if the package is from -quarterly or -latest repo... so absence of such information can hint at (but not confirm) the idea that it might be from ports. Even then, package origin is usually specified in /etc/pkg.conf...FWIW, the Makefiles in Ports first apply FreeBSD patches, and THEN do the
./configure && make
from the original tarball anyway. Just cloning from github is likely to result in compilation failures anyway, which is why we have the Porter's Handbook.