mysql2-replication 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6ae9d1fad0e2e04991f29377512bbb06a581e22816940081f5700858d049fe7
4
- data.tar.gz: 9fb9fbc2a541d0a7d0ac6a5e88a2c7c8a43fcb1a1f37fe7c8ed9b98b2e47e7d5
3
+ metadata.gz: e4e53fa99301ddf9de5e0152b67093098271e727d7dbf21f4228bb0f1d1857cc
4
+ data.tar.gz: 7345a93462c78c4d0fa7ff94f7c14e09005b4119366a58130855de1d3c94a7b6
5
5
  SHA512:
6
- metadata.gz: 0f372f65fca1c3325715e64bd494762133571ad32626b696ffe93824a55bcb05e60c40f73da3d9794df0a6af8e298ebdb53ada2e023eb987e68626141a145407
7
- data.tar.gz: 77abcac0b26e45cca163d14ea83e7204f262ad2407a2265744c124ac7dc6d5590a00fdbc78ec292f2df1ce7719bd3a9b7eca35c7de8f6a0bb925277d8a0b0fed
6
+ metadata.gz: 3d3cac78675064583fc9f02a6f362a1dc5d5ed75bc7ae61873e734697f72f14ab5c5fe87335370dbb4be3231d604140b0a1e258bc615c730582c9db441ce2823
7
+ data.tar.gz: fb7bddd05753618b6fcef07c4e8ddea0ac611d9b94df1c80dd51671432799974b84667bb11d72475c405c73c80c56d90363a793fa5b036e29cb11dca3c83c1c8
@@ -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")