File workaround_mysql_config_libs.patch of Package rubygem-mysql2

Index: mysql2-0.5.3/ext/mysql2/extconf.rb
===================================================================
--- mysql2-0.5.3.orig/ext/mysql2/extconf.rb
+++ mysql2-0.5.3/ext/mysql2/extconf.rb
@@ -243,19 +243,23 @@ else
     $LDFLAGS << rpath_flags
   else
     if (libdir = rpath_dir[%r{(-L)?(/[^ ]+)}, 2])
+      libdir.gsub!(/\/\//, '/')
+      libdir.gsub!(/\/$/, '')
+      if libdir != RbConfig::CONFIG['libdir']
       rpath_flags = " -Wl,-rpath,#{libdir}"
-      if RbConfig::CONFIG["RPATHFLAG"].to_s.empty? && try_link('int main() {return 0;}', rpath_flags)
-        # Usually Ruby sets RPATHFLAG the right way for each system, but not on OS X.
-        warn "-----\nSetting rpath to #{libdir}\n-----"
-        $LDFLAGS << rpath_flags
-      else
-        if RbConfig::CONFIG["RPATHFLAG"].to_s.empty?
-          # If we got here because try_link failed, warn the user
-          warn "-----\nDon't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load\n-----"
+        if RbConfig::CONFIG["RPATHFLAG"].to_s.empty? && try_link('int main() {return 0;}', rpath_flags)
+          # Usually Ruby sets RPATHFLAG the right way for each system, but not on OS X.
+          warn "-----\nSetting rpath to #{libdir}\n-----"
+          $LDFLAGS << rpath_flags
+        else
+          if RbConfig::CONFIG["RPATHFLAG"].to_s.empty?
+            # If we got here because try_link failed, warn the user
+            warn "-----\nDon't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load\n-----"
+          end
+          # Make sure that LIBPATH gets set if we didn't explicitly set the rpath.
+          warn "-----\nSetting libpath to #{libdir}\n-----"
+          $LIBPATH << libdir unless $LIBPATH.include?(libdir)
         end
-        # Make sure that LIBPATH gets set if we didn't explicitly set the rpath.
-        warn "-----\nSetting libpath to #{libdir}\n-----"
-        $LIBPATH << libdir unless $LIBPATH.include?(libdir)
       end
     end
   end
openSUSE Build Service is sponsored by