Skip to content

Commit 7b6c8c9

Browse files
committed
Support Linux + GCC builds
1 parent 5edb956 commit 7b6c8c9

File tree

5 files changed

+73
-17
lines changed

5 files changed

+73
-17
lines changed

1.8.7-p374

+9-3
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,17 @@ install_bundler() {
3434
}
3535

3636
# Clang errors on warnings. Tell it to ignore this one.
37-
export RUBY_CFLAGS="-Wno-error=implicit-function-declaration"
37+
if cc -v 2>&1 | grep clang >/dev/null; then
38+
export RUBY_CFLAGS="-Wno-error=implicit-function-declaration"
39+
fi
3840

3941
# M1-compatible OpenSSL 1.0 from https://github.com/basecamp/homebrew-dev
40-
brew install basecamp/dev/[email protected]
41-
package_option ruby configure --with-openssl-dir="$(brew --prefix basecamp/dev/[email protected])"
42+
if type -p brew >/dev/null; then
43+
brew install basecamp/dev/[email protected]
44+
package_option ruby configure --with-openssl-dir="$(brew --prefix basecamp/dev/[email protected])"
45+
else
46+
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if needs_openssl:0.9.6-1.0.x
47+
fi
4248

4349
require_gcc
4450
install_package "ruby-1.8.7-p374" "https://cache.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p374.tar.bz2#b4e34703137f7bfb8761c4ea474f7438d6ccf440b3d35f39cc5e4d4e239c07e3" freshen_automake_config patch_lex_c99 auto_tcltk standard

1.9.3-p551

+9-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ install_bundler() {
1515
}
1616

1717
# Clang errors on warnings. Tell it to ignore this one.
18-
export RUBY_CFLAGS="-Wno-error=implicit-function-declaration"
18+
if cc -v 2>&1 | grep clang >/dev/null; then
19+
export RUBY_CFLAGS="-Wno-error=implicit-function-declaration"
20+
fi
1921

2022
# M1-compatible OpenSSL 1.0 from https://github.com/basecamp/homebrew-dev
21-
brew install basecamp/dev/[email protected]
22-
package_option ruby configure --with-openssl-dir="$(brew --prefix basecamp/dev/[email protected])"
23+
if type -p brew >/dev/null; then
24+
brew install basecamp/dev/[email protected]
25+
package_option ruby configure --with-openssl-dir="$(brew --prefix basecamp/dev/[email protected])"
26+
else
27+
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if needs_openssl:0.9.6-1.0.x
28+
fi
2329

2430
install_package "yaml-0.1.6" "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz#7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749" --if needs_yaml
2531
install_package "ruby-1.9.3-p551" "https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p551.tar.bz2#b0c5e37e3431d58613a160504b39542ec687d473de1d4da983dabcf3c5de771e" freshen_automake_config standard

2.3.3

+20-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,29 @@ build_package_freshen_automake_config() {
66
} >&4 2>&1
77
}
88

9+
install_gem() {
10+
RBENV_VERSION="$VERSION_NAME" rbenv-exec gem install "$@"
11+
}
12+
13+
install_bundler() {
14+
install_gem bundler -v "< 2"
15+
}
16+
917
# Suppress warnings we aren't going to address so they don't flood build output"
10-
export RUBY_CFLAGS="-Wno-implicit-function-declaration -Wno-compound-token-split-by-macro"
18+
if cc -v 2>&1 | grep clang >/dev/null; then
19+
export RUBY_CFLAGS="-Wno-implicit-function-declaration -Wno-compound-token-split-by-macro"
20+
fi
1121

1222
# M1-compatible OpenSSL 1.0 from https://github.com/basecamp/homebrew-dev
13-
brew install basecamp/dev/[email protected]
14-
openssl_prefix_path="$(brew --prefix basecamp/dev/[email protected])"
15-
package_option ruby configure --with-openssl-dir="$openssl_prefix_path"
16-
export PKG_CONFIG_PATH="$openssl_prefix_path/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
23+
if type -p brew >/dev/null; then
24+
brew install basecamp/dev/[email protected]
25+
openssl_prefix_path="$(brew --prefix basecamp/dev/[email protected])"
26+
package_option ruby configure --with-openssl-dir="$openssl_prefix_path"
27+
export PKG_CONFIG_PATH="$openssl_prefix_path/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
28+
else
29+
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if needs_openssl:0.9.6-1.0.x
30+
fi
1731

1832
package_option ruby configure --with-out-ext=tk --disable-install-doc
1933
install_package "ruby-2.3.3" "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.bz2#882e6146ed26c6e78c02342835f5d46b86de95f0dc4e16543294bc656594cc5b" freshen_automake_config ldflags_dirs standard verify_openssl
34+
install_bundler

2.3.8

+20-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,29 @@ build_package_freshen_automake_config() {
66
} >&4 2>&1
77
}
88

9+
install_gem() {
10+
RBENV_VERSION="$VERSION_NAME" rbenv-exec gem install "$@"
11+
}
12+
13+
install_bundler() {
14+
install_gem bundler -v "< 2"
15+
}
16+
917
# Suppress warnings we aren't going to address so they don't flood build output"
10-
export RUBY_CFLAGS="-Wno-implicit-function-declaration -Wno-compound-token-split-by-macro"
18+
if cc -v 2>&1 | grep clang >/dev/null; then
19+
export RUBY_CFLAGS="-Wno-implicit-function-declaration -Wno-compound-token-split-by-macro"
20+
fi
1121

1222
# M1-compatible OpenSSL 1.0 from https://github.com/basecamp/homebrew-dev
13-
brew install basecamp/dev/[email protected]
14-
openssl_prefix_path="$(brew --prefix basecamp/dev/[email protected])"
15-
package_option ruby configure --with-openssl-dir="$openssl_prefix_path"
16-
export PKG_CONFIG_PATH="$openssl_prefix_path/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
23+
if type -p brew >/dev/null; then
24+
brew install basecamp/dev/[email protected]
25+
openssl_prefix_path="$(brew --prefix basecamp/dev/[email protected])"
26+
package_option ruby configure --with-openssl-dir="$openssl_prefix_path"
27+
export PKG_CONFIG_PATH="$openssl_prefix_path/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
28+
else
29+
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if needs_openssl:0.9.6-1.0.x
30+
fi
1731

1832
package_option ruby configure --with-out-ext=tk --disable-install-doc
1933
install_package "ruby-2.3.8" "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.bz2#4d1a3a88e8cf9aea624eb73843fbfc60a9a281582660f86d5e4e00870397407c" freshen_automake_config ldflags_dirs standard verify_openssl
34+
install_bundler

2.7.8

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1-
export RUBY_CFLAGS="-O3 -march=native -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types"
1+
install_gem() {
2+
RBENV_VERSION="$VERSION_NAME" rbenv-exec gem install "$@"
3+
}
4+
5+
install_bundler() {
6+
install_gem bundler -v "< 3"
7+
}
8+
9+
export RUBY_CFLAGS="-O3 -march=native"
10+
11+
# GCC will complain about unrecognized warnings
12+
if cc -v 2>&1 | grep clang >/dev/null; then
13+
export RUBY_CFLAGS="$RUBY_CFLAGS -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion"
14+
fi
215

316
package_option ruby configure --with-out-ext=tcl --with-out-ext=tk --disable-install-doc
417

518
install_package "openssl-1.1.1w" "https://www.openssl.org/source/openssl-1.1.1w.tar.gz#cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8" openssl
619
install_package "ruby-2.7.8" "https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.8.tar.gz#c2dab63cbc8f2a05526108ad419efa63a67ed4074dbbcf9fc2b1ca664cb45ba0" enable_shared standard
20+
install_bundler

0 commit comments

Comments
 (0)