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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6ae9d1fad0e2e04991f29377512bbb06a581e22816940081f5700858d049fe7
4
- data.tar.gz: 9fb9fbc2a541d0a7d0ac6a5e88a2c7c8a43fcb1a1f37fe7c8ed9b98b2e47e7d5
3
+ metadata.gz: dae33ecb6c6b2ecfade5316344529e995ef41efefbf22791cef85b07c14253f6
4
+ data.tar.gz: 9407c34a9d180cb06ee7e22072db0f4727213ef96e5134f6c47c7e2c7aef48d2
5
5
  SHA512:
6
- metadata.gz: 0f372f65fca1c3325715e64bd494762133571ad32626b696ffe93824a55bcb05e60c40f73da3d9794df0a6af8e298ebdb53ada2e023eb987e68626141a145407
7
- data.tar.gz: 77abcac0b26e45cca163d14ea83e7204f262ad2407a2265744c124ac7dc6d5590a00fdbc78ec292f2df1ce7719bd3a9b7eca35c7de8f6a0bb925277d8a0b0fed
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")