Skip to content

Commit

Permalink
Support ruby 1.4.0 or higher (#104)
Browse files Browse the repository at this point in the history
* Remove support for Ruby < 2.4.0

---------

Co-authored-by: Christopher Harrop <[email protected]>
  • Loading branch information
1 parent 5dc1602 commit 51e7c05
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 54 deletions.
73 changes: 19 additions & 54 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,13 @@ fi
# Abort if any command returns an error
set -e

# Make sure ruby is at least 1.8.7 or higher
good_ruby=$($RUBY -e "puts RUBY_VERSION >= '1.8.7'")
# Make sure ruby is at least 2.4.0 or higher
good_ruby=$($RUBY -e "puts RUBY_VERSION >= '2.4.0'")
if [ "$good_ruby" = "false" ]; then
echo "Ruby 1.8.7 or higher (and not 2.1.2) is required"
echo "Ruby 2.4.0 or higher is required"
exit 1
fi

# Make sure ruby is not 2.1.2
good_ruby=$($RUBY -e "puts RUBY_VERSION != '2.1.2'")
if [ "$good_ruby" = "false" ]; then
echo "Ruby 1.8.7 or higher (and not 2.1.2) is required"
exit 1
fi

# Check if we are using ruby 1.9.x or higher
new_ruby=$($RUBY -e "puts RUBY_VERSION >= '1.9.0'")

# Replace ruby shebangs with path to ruby
for file in $(ls sbin | grep -v '\.sh'); do

Expand Down Expand Up @@ -114,27 +104,23 @@ fi
# Create the build directory
mkdir -p ${BUILD_DIR}

if [ "$new_ruby" = "true" ]; then

# Install rubysl-date
echo "==========================================="
echo "= INSTALLING rubysl-date"
echo "==========================================="
cd ${LIB_DIR}
gunzip -c ${TAR_DIR}/rubysl-date-${RUBYSL_DATE_VERSION}.tar.gz | tar -xvf -
rm -rf rubysl-date
mv rubysl-date-${RUBYSL_DATE_VERSION} rubysl-date

# Install rubysl-parsedate
echo "==========================================="
echo "= INSTALLING rubysl-parsedate"
echo "==========================================="
cd ${LIB_DIR}
gunzip -c ${TAR_DIR}/rubysl-parsedate-${RUBYSL_PARSEDATE_VERSION}.tar.gz | tar -xvf -
rm -rf rubysl-parsedate
mv rubysl-parsedate-${RUBYSL_PARSEDATE_VERSION} rubysl-parsedate
# Install rubysl-date
echo "==========================================="
echo "= INSTALLING rubysl-date"
echo "==========================================="
cd ${LIB_DIR}
gunzip -c ${TAR_DIR}/rubysl-date-${RUBYSL_DATE_VERSION}.tar.gz | tar -xvf -
rm -rf rubysl-date
mv rubysl-date-${RUBYSL_DATE_VERSION} rubysl-date

fi
# Install rubysl-parsedate
echo "==========================================="
echo "= INSTALLING rubysl-parsedate"
echo "==========================================="
cd ${LIB_DIR}
gunzip -c ${TAR_DIR}/rubysl-parsedate-${RUBYSL_PARSEDATE_VERSION}.tar.gz | tar -xvf -
rm -rf rubysl-parsedate
mv rubysl-parsedate-${RUBYSL_PARSEDATE_VERSION} rubysl-parsedate

# Install Open4
echo "==========================================="
Expand Down Expand Up @@ -187,27 +173,6 @@ mkdir ${LIB_DIR}/libxml-ruby
cp -r ${BUILD_DIR}/libxml-ruby-${LIBXML_RUBY_VERSION}/lib/* ${LIB_DIR}/libxml-ruby
cp libxml_ruby.so ${LIB_DIR}/libxml-ruby

# Install SystemTimer unless we are using ruby > 1.8.7
if [ "$new_ruby" = "true" ]; then
echo "==========================================="
echo "= SKIPPING SystemTimer for ruby > 1.8.7 ="
echo "==========================================="
else
echo "==========================================="
echo "= INSTALLING SystemTimer ="
echo "==========================================="
cd ${BUILD_DIR}
gunzip -c ${TAR_DIR}/SystemTimer-${SYSTEMTIMER_VERSION}.tar.gz | tar -xvf -
cd SystemTimer-${SYSTEMTIMER_VERSION}/ext/system_timer
${RUBY} extconf.rb
make clean
make
rm -rf ${LIB_DIR}/SystemTimer
mkdir ${LIB_DIR}/SystemTimer
cp -r ${BUILD_DIR}/SystemTimer-${SYSTEMTIMER_VERSION}/lib/* ${LIB_DIR}/SystemTimer
cp system_timer_native.so ${LIB_DIR}/SystemTimer
fi

# Install sqlite3
echo "==========================================="
echo "= INSTALLING sqlite3 ="
Expand Down
Binary file removed tarfiles/SystemTimer-1.2.3.tar.gz
Binary file not shown.

0 comments on commit 51e7c05

Please sign in to comment.