$OpenBSD: patch-lgi_core_c,v 1.2 2012/09/21 13:57:32 jasper Exp $

commit 44676d0ec67ac19385917eb537423f235d5d3a7b
Author: Jasper Lievisse Adriaanse <jasper@humppa.nl>
Date:   Thu Sep 20 22:41:59 2012 +0200
Subject: Unbreak loading of shared objects/modules on OpenBSD.

https://github.com/pavouk/lgi/commit/44676d0ec67ac19385917eb537423f235d5d3a7b

--- lgi/core.c.orig	Mon Jun 25 10:25:21 2012
+++ lgi/core.c	Thu Sep 20 22:29:55 2012
@@ -487,12 +487,18 @@ core_module (lua_State *L)
 {
   char *name;
 
-  /* If the version is present, combine it with basename. */
+  /* If the version is present, combine it with basename.
+     Except on OpenBSD, where libraries are versioned like libfoo.so.0.0
+     and we will always load the shared object with the highest version
+     number.
+   */
+#ifndef __OpenBSD__
   if (!lua_isnoneornil (L, 2))
     name = g_strdup_printf (MODULE_NAME_FORMAT_VERSION,
 			    luaL_checkstring (L, 1),
 			    (int) luaL_checkinteger (L, 2));
   else
+#endif
     name = g_strdup_printf (MODULE_NAME_FORMAT_PLAIN,
 			    luaL_checkstring (L, 1));
 
