Thanks for posting this. I tried to connect my new D500 today and sure I kept getting the indi_nikon_ccd driver crashed, and wouldn't startup at all.
Jasem's libgphoto fix worked!
As I already have a Pentax K1 ii with the 3rd_party inid repo pulled from Github, it was just a matter of updating the libgphoto portion then building.
For now it doesn't crash and allows me to take preview images - as that's all I've tested. Unfortunately I don't have a mount yet so I can't really test it in the field right now
Even though my setup is pretty much lacking everything at this point I still want to say thanks