mysql2-replication 1.0.0 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/mysql2-replication/extconf.rb +62 -0
- data/ext/mysql2-replication/mysql2_replication.c +1435 -0
- data/lib/mysql2-replication/version.rb +1 -1
- data/mysql2-replication.gemspec +5 -1
- metadata +36 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dae33ecb6c6b2ecfade5316344529e995ef41efefbf22791cef85b07c14253f6
|
4
|
+
data.tar.gz: 9407c34a9d180cb06ee7e22072db0f4727213ef96e5134f6c47c7e2c7aef48d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c991529269be9df8fb90d312ff644eb069103dc80538c5c5f0484a04d9bfd12b8218e164e48aff82011646a2bd3a9a1f827050211277d676ff3cb0c8095775c1
|
7
|
+
data.tar.gz: 6c56fc58282cff73dc930f791945bdf23d872df53e70b3b655c0e7dbb78a0c89823d8105438856aee8d642f10b793599932a26b60100fdf19824fffd60d65cf2
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "mkmf"
|
4
|
+
|
5
|
+
require "pkg-config"
|
6
|
+
require "native-package-installer"
|
7
|
+
|
8
|
+
def gcc?
|
9
|
+
CONFIG["GCC"] == "yes"
|
10
|
+
end
|
11
|
+
|
12
|
+
def disable_optimization_build_flag(flags)
|
13
|
+
if gcc?
|
14
|
+
RbConfig.expand(flags.dup).gsub(/(^|\s)?-O\d(\s|$)?/, '\\1-O0\\2')
|
15
|
+
else
|
16
|
+
flags
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def enable_debug_build_flag(flags)
|
21
|
+
if gcc?
|
22
|
+
expanded_flags = RbConfig.expand(flags.dup)
|
23
|
+
debug_option_pattern = /(^|\s)-g(?:gdb)?\d?(\s|$)/
|
24
|
+
if debug_option_pattern =~ expanded_flags
|
25
|
+
expanded_flags.gsub(debug_option_pattern, '\\1-ggdb3\\2')
|
26
|
+
else
|
27
|
+
flags + " -ggdb3"
|
28
|
+
end
|
29
|
+
else
|
30
|
+
flags
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
checking_for(checking_message("--enable-debug-build option")) do
|
35
|
+
enable_debug_build = enable_config("debug-build", false)
|
36
|
+
if enable_debug_build
|
37
|
+
$CFLAGS = disable_optimization_build_flag($CFLAGS)
|
38
|
+
$CFLAGS = enable_debug_build_flag($CFLAGS)
|
39
|
+
|
40
|
+
$CXXFLAGS = disable_optimization_build_flag($CXXFLAGS)
|
41
|
+
$CXXFLAGS = enable_debug_build_flag($CXXFLAGS)
|
42
|
+
end
|
43
|
+
enable_debug_build
|
44
|
+
end
|
45
|
+
|
46
|
+
spec = Gem::Specification.find_by_name("mysql2")
|
47
|
+
source_dir = File.join(spec.full_gem_path, "ext", "mysql2")
|
48
|
+
$INCFLAGS += " -I#{source_dir}"
|
49
|
+
|
50
|
+
unless PKGConfig.have_package("libmariadb")
|
51
|
+
unless NativePackageInstaller.install(debian: "libmariadb-dev",
|
52
|
+
homebrew: "mariadb-connector-c",
|
53
|
+
msys2: "libmariadbclient",
|
54
|
+
redhat: "mariadb-connector-c-devel")
|
55
|
+
exit(false)
|
56
|
+
end
|
57
|
+
unless PKGConfig.have_package("libmariadb")
|
58
|
+
exit(false)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
create_makefile("mysql2_replication")
|