fix.sh in checkoff-0.10.0 vs fix.sh in checkoff-0.11.0

- old
+ new

@@ -1,9 +1,19 @@ #!/bin/bash -eu set -o pipefail +apt_upgraded=0 + +update_apt() { + if [ "${apt_upgraded}" = 0 ] + then + sudo apt-get update -y + apt_upgraded=1 + fi +} + install_rbenv() { if [ "$(uname)" == "Darwin" ] then HOMEBREW_NO_AUTO_UPDATE=1 brew install rbenv || true if ! type rbenv 2>/dev/null @@ -75,10 +85,12 @@ fi } ensure_ruby_build_requirements() { ensure_dev_library readline/readline.h readline libreadline-dev + ensure_dev_library zlib.h zlib zlib1g-dev + ensure_dev_library openssl/ssl.h openssl libssl-dev } # You can find out which feature versions are still supported / have # been release here: https://www.ruby-lang.org/en/downloads/ ensure_ruby_versions() { @@ -90,20 +102,40 @@ ensure_ruby_build_requirements for ver in $ruby_versions do - rbenv install -s "${ver}" + # These CFLAGS can be retired once 2.6.7 is no longer needed : + # + # https://github.com/rbenv/ruby-build/issues/1747 + # https://github.com/rbenv/ruby-build/issues/1489 + # https://bugs.ruby-lang.org/issues/17777 + if [ "${ver}" == 2.6.7 ] + then + CFLAGS="-Wno-error=implicit-function-declaration" rbenv install -s "${ver}" + else + rbenv install -s "${ver}" + fi done } ensure_bundle() { # Not sure why this is needed a second time, but it seems to be? # # https://app.circleci.com/pipelines/github/apiology/source_finder/21/workflows/88db659f-a4f4-4751-abc0-46f5929d8e58/jobs/107 set_rbenv_env_variables - bundle --version >/dev/null 2>&1 || gem install bundler + bundle --version >/dev/null 2>&1 || gem install --no-document bundler + bundler_version=$(bundle --version | cut -d ' ' -f3) + bundler_version_major=$(cut -d. -f1 <<< "${bundler_version}") + bundler_version_minor=$(cut -d. -f2 <<< "${bundler_version}") + # Version 2.1 of bundler seems to have some issues with nokogiri: + # + # https://app.asana.com/0/1107901397356088/1199504270687298 + if [ "${bundler_version_major}" == 2 ] && [ "${bundler_version_minor}" -lt 2 ] + then + gem install --no-document bundler + fi make bundle_install # https://bundler.io/v2.0/bundle_lock.html#SUPPORTING-OTHER-PLATFORMS # # "If you want your bundle to support platforms other than the one # you're running locally, you can run bundle lock --add-platform @@ -136,12 +168,13 @@ WARNING: seems you still have not added 'pyenv' to the load path. # Load pyenv automatically by adding # the following to ~/.bashrc: -export PATH="$HOME/.pyenv/bin:$PATH" -eval "$(pyenv init -)" +export PYENV_ROOT="${HOME}/.pyenv" +export PATH="${PYENV_ROOT}/bin:$PATH" +eval "$(pyenv init --path)" eval "$(pyenv virtualenv-init -)" EOF fi else curl https://pyenv.run | bash @@ -151,12 +184,13 @@ set_pyenv_env_variables() { # looks like pyenv scripts aren't -u clean: # # https://app.circleci.com/pipelines/github/apiology/cookiecutter-pypackage/15/workflows/10506069-7662-46bd-b915-2992db3f795b/jobs/15 set +u - export PATH="${HOME}/.pyenv/bin:$PATH" - eval "$(pyenv init -)" + export PYENV_ROOT="${HOME}/.pyenv" + export PATH="${PYENV_ROOT}/bin:$PATH" + eval "$(pyenv init --path)" eval "$(pyenv virtualenv-init -)" set -u } ensure_pyenv() { @@ -177,11 +211,11 @@ if [ "$(uname)" == "Darwin" ] then HOMEBREW_NO_AUTO_UPDATE=1 brew install "${homebrew_package}" elif type apt-get >/dev/null 2>&1 then - sudo apt-get update -y + update_apt sudo apt-get install -y "${apt_package}" else >&2 echo "Teach me how to install packages on this plaform" exit 1 fi @@ -190,9 +224,10 @@ ensure_python_build_requirements() { ensure_dev_library zlib.h zlib zlib1g-dev ensure_dev_library bzlib.h bzip2 libbz2-dev ensure_dev_library openssl/ssl.h openssl libssl-dev ensure_dev_library ffi.h libffi libffi-dev + ensure_dev_library sqlite3.h sqlite3 libsqlite3-dev } # You can find out which feature versions are still supported / have # been release here: https://www.python.org/downloads/ ensure_python_versions() {