Add support for building on macOS, using endian code from "portable_endian.h" at https://gist.github.com/PkmX/63dd23f28ba885be53a5
Also as mentioned here: https://marc.info/?l=nix-dev&m=139641595817598&w=2
Previously, libpciaccess did not need to be built independently on macOS, as downstream packages such as libdrm did not need it for building with the X11 libraries which come with Xquartz.
But now that a Wayland compositor for macOS is available, it makes sense to build libdrm and it's dependencies without X11 support, so that xwayland can also be built for macos.
And since libdrm demands that libpciaccess be built...