File: remove_rpath_compilation_flag.patch

package info (click to toggle)
ruby-mysql2 0.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 744 kB
  • sloc: ansic: 2,997; ruby: 2,751; sh: 60; makefile: 3
file content (46 lines) | stat: -rw-r--r-- 1,872 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Description: Remove rpath from compilation flags
 This patch is required to pass the binary-or-shlib-defines-rpath lintian
 test. To fix this problem, any attempt to add rpath to $LDFLAGS
 inside of ext/mysql2/extconf.rb is patched out
Author: Michael Franzl <office@michaelfranzl.com>
Last-Update: 2013-11-26


--- a/ext/mysql2/extconf.rb
+++ b/ext/mysql2/extconf.rb
@@ -230,35 +230,6 @@ if RUBY_PLATFORM =~ /mswin|mingw/ && !de
     # Let's do it!
     Rake::Task[vendordll].invoke
   end
-else
-  case explicit_rpath = with_config('mysql-rpath')
-  when true
-    abort "-----\nOption --with-mysql-rpath must have an argument\n-----"
-  when false
-    warn "-----\nOption --with-mysql-rpath has been disabled at your request\n-----"
-  when String
-    # The user gave us a value so use it
-    rpath_flags = " -Wl,-rpath,#{explicit_rpath}"
-    warn "-----\nSetting mysql rpath to #{explicit_rpath}\n-----"
-    $LDFLAGS << rpath_flags
-  else
-    if (libdir = rpath_dir[%r{(-L)?(/[^ ]+)}, 2])
-      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-----"
-        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
 end
 
 create_makefile('mysql2/mysql2')