I can’t tell what is the oldest opencv version that can be built (this may be related to your L4T version and Linux kernel version), but for a better future, you may alternatively try to use a version of Osiris that has been ported to more recent version of opencv.
The following builds fine with recent versions of JetPack, but not tested with real cases, though: