Commit cc355d2e by Mislav Marohnić Committed by GitHub

Merge pull request #1015 from yuichiro-naito/support_freebsd_11

support FreeBSD 11-RELEASE
parents c9ba0744 fdcc0a76
...@@ -552,7 +552,9 @@ build_package_standard() { ...@@ -552,7 +552,9 @@ build_package_standard() {
local PACKAGE_MAKE_INSTALL_OPTS_ARRAY="${package_var_name}_MAKE_INSTALL_OPTS_ARRAY[@]" local PACKAGE_MAKE_INSTALL_OPTS_ARRAY="${package_var_name}_MAKE_INSTALL_OPTS_ARRAY[@]"
local PACKAGE_CFLAGS="${package_var_name}_CFLAGS" local PACKAGE_CFLAGS="${package_var_name}_CFLAGS"
[ "$package_var_name" = "RUBY" ] && use_homebrew_readline || true if [ "$package_var_name" = "RUBY" ]; then
use_homebrew_readline || use_freebsd_pkg ||true
fi
( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then ( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then
export CFLAGS="$CFLAGS ${!PACKAGE_CFLAGS}" export CFLAGS="$CFLAGS ${!PACKAGE_CFLAGS}"
...@@ -918,6 +920,30 @@ use_homebrew_yaml() { ...@@ -918,6 +920,30 @@ use_homebrew_yaml() {
fi fi
} }
use_freebsd_pkg() {
# check if FreeBSD
if [ "FreeBSD" = "$(uname -s)" ]; then
# use openssl if installed from Ports Collection
if [ -f /usr/local/include/openssl/ssl.h ]; then
package_option ruby configure --with-openssl-dir="/usr/local"
fi
# check if 11-R or later
release="$(uname -r)"
if [ "${release%%.*}" -ge 11 ]; then
# prefers readline to compile most of ruby versions
if pkg info -e readline > /dev/null; then
# use readline from Ports Collection
package_option ruby configure --with-readline-dir="/usr/local"
elif pkg info -e libedit > /dev/null; then
# use libedit from Ports Collection
package_option ruby configure --enable-libedit
package_option ruby configure --with-libedit-dir="/usr/local"
fi
fi
fi
}
use_homebrew_readline() { use_homebrew_readline() {
if [[ "$RUBY_CONFIGURE_OPTS" != *--with-readline-dir=* ]]; then if [[ "$RUBY_CONFIGURE_OPTS" != *--with-readline-dir=* ]]; then
local libdir="$(brew --prefix readline 2>/dev/null || true)" local libdir="$(brew --prefix readline 2>/dev/null || true)"
......
...@@ -204,7 +204,7 @@ OUT ...@@ -204,7 +204,7 @@ OUT
@test "number of CPU cores defaults to 2" { @test "number of CPU cores defaults to 2" {
cached_tarball "ruby-2.0.0" cached_tarball "ruby-2.0.0"
stub uname '-s : echo Darwin' stub uname '-s : echo Darwin' false
stub sysctl false stub sysctl false
stub_make_install stub_make_install
...@@ -227,7 +227,7 @@ OUT ...@@ -227,7 +227,7 @@ OUT
@test "number of CPU cores is detected on Mac" { @test "number of CPU cores is detected on Mac" {
cached_tarball "ruby-2.0.0" cached_tarball "ruby-2.0.0"
stub uname '-s : echo Darwin' stub uname '-s : echo Darwin' false
stub sysctl '-n hw.ncpu : echo 4' stub sysctl '-n hw.ncpu : echo 4'
stub_make_install stub_make_install
...@@ -251,7 +251,7 @@ OUT ...@@ -251,7 +251,7 @@ OUT
@test "number of CPU cores is detected on FreeBSD" { @test "number of CPU cores is detected on FreeBSD" {
cached_tarball "ruby-2.0.0" cached_tarball "ruby-2.0.0"
stub uname '-s : echo FreeBSD' stub uname '-s : echo FreeBSD' false
stub sysctl '-n hw.ncpu : echo 1' stub sysctl '-n hw.ncpu : echo 1'
stub_make_install stub_make_install
...@@ -324,7 +324,7 @@ OUT ...@@ -324,7 +324,7 @@ OUT
@test "make on FreeBSD 9 defaults to gmake" { @test "make on FreeBSD 9 defaults to gmake" {
cached_tarball "ruby-2.0.0" cached_tarball "ruby-2.0.0"
stub uname "-s : echo FreeBSD" "-r : echo 9.1" stub uname "-s : echo FreeBSD" "-r : echo 9.1" false
MAKE=gmake stub_make_install MAKE=gmake stub_make_install
MAKE= install_fixture definitions/vanilla-ruby MAKE= install_fixture definitions/vanilla-ruby
...@@ -337,7 +337,7 @@ OUT ...@@ -337,7 +337,7 @@ OUT
@test "make on FreeBSD 10" { @test "make on FreeBSD 10" {
cached_tarball "ruby-2.0.0" cached_tarball "ruby-2.0.0"
stub uname "-s : echo FreeBSD" "-r : echo 10.0-RELEASE" stub uname "-s : echo FreeBSD" "-r : echo 10.0-RELEASE" false
stub_make_install stub_make_install
MAKE= install_fixture definitions/vanilla-ruby MAKE= install_fixture definitions/vanilla-ruby
......
...@@ -55,7 +55,7 @@ DEF ...@@ -55,7 +55,7 @@ DEF
mkdir -p "$INSTALL_ROOT" mkdir -p "$INSTALL_ROOT"
cd "$INSTALL_ROOT" cd "$INSTALL_ROOT"
stub uname '-s : echo Darwin' stub uname '-s : echo Darwin' '-s : echo Darwin'
stub sw_vers '-productVersion : echo 10.10' stub sw_vers '-productVersion : echo 10.10'
stub cc 'false' stub cc 'false'
stub brew 'false' stub brew 'false'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment