$OpenBSD: patch-release_scripts_addons_io_scene_gltf2_io_com_gltf2_io_draco_compression_extension_py,v 1.1 2021/05/24 20:08:15 sthen Exp $

Fix the GLTF2 exporter crash: even if we don't have the draco
compression library, avoid path and library_name being None.

Index: release/scripts/addons/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py
--- release/scripts/addons/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py.orig
+++ release/scripts/addons/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py
@@ -46,11 +46,17 @@ def dll_path() -> Path:
         'darwin': 'lib{}.dylib'.format(lib_name)
     }.get(sys.platform)
 
-    if path is None or library_name is None:
-        print_console('WARNING', 'Unsupported platform {}, Draco mesh compression is unavailable'.format(sys.platform))
+    if sys.platform.startswith('openbsd'):
+        path = blender_root.parent / 'lib'
+        library_name = 'libdraco.so'
 
-    return path / library_name
+    lib_file = sorted(Path(path).glob(library_name + '*'))
 
+    if not lib_file:
+        print_console('WARNING', 'Unsupported platform {}, Draco mesh compression is unavailable'.format(sys.platform))
+        return path / library_name
+    else:
+        return lib_file[-1]
 
 def dll_exists(quiet=False) -> bool:
     """
