Skip to content

Instantly share code, notes, and snippets.

@curtisalexander
Last active March 3, 2018 20:30
Show Gist options
  • Save curtisalexander/7dd6ddff900c2a7aa4461b34aa4dbde8 to your computer and use it in GitHub Desktop.
Save curtisalexander/7dd6ddff900c2a7aa4461b34aa4dbde8 to your computer and use it in GitHub Desktop.

Revisions

  1. curtisalexander revised this gist Mar 3, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_openssl_R_pkgs.sh
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ if [ ! -d "cran-dl" ] ; then
    fi


    echo "Please ensure the following R packages are installed: "
    echo "Note that cran-dl requires the following R packages be installed:"
    echo " - docopt"
    echo " - httr"
    echo " - purrr"
  2. curtisalexander renamed this gist Mar 3, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. curtisalexander revised this gist Mar 3, 2018. 1 changed file with 55 additions and 1 deletion.
    56 changes: 55 additions & 1 deletion install_R_pkg_openssl.sh
    Original file line number Diff line number Diff line change
    @@ -1 +1,55 @@
    sudo R CMD INSTALL -l /Library/Frameworks/R.framework/Resources/library --configure-vars='INCLUDE_DIR=/usr/local/Cellar/[email protected]/1.1.0g_1/include LIB_DIR=/usr/local/Cellar/[email protected]/1.1.0g_1/lib' ~/Downloads/openssl_1.0.tar.gz
    #!/usr/bin/env zsh

    # where to begin?
    DIR="${HOME}/code"
    cd "${DIR}"

    echo
    echo "Working from within ${PWD}"
    echo

    # clone cran-dl repo
    if [ ! -d "cran-dl" ] ; then
    printf "Would you like to clone cran-dl? [y/N]: "
    if read -q; then
    echo; git clone https://github.com/curtisalexander/cran-dl; echo
    fi
    fi


    echo "Please ensure the following R packages are installed: "
    echo " - docopt"
    echo " - httr"
    echo " - purrr"
    echo " - rvest"
    echo " - xml2"
    echo
    echo "To install within R, execute the following:"
    echo " - install.packages(c(\"docopt\", \"httr\", \"purrr\", \"rvest\", \"xml2\"))"

    # create the directory if it does not exist
    if [ ! -d "r-pkgs" ] ; then
    echo
    echo "Making the directory r-pkgs"
    mkdir -p "${DIR}/r-pkgs"
    fi

    # from the command line, download the tar.gz file
    echo
    echo "Download the package using cran-dl"
    ${DIR}/cran-dl/cran-dl --pkg=openssl --path="${DIR}/r-pkgs"
    echo

    # get the current openssl version
    echo
    echo "Get the current version of openssl"
    OPENSSL_VER="$(openssl version | cut -d' ' -f 2)"
    echo " - ${OPENSSL_VER}"

    # install using appropriate configuration
    OPENSSL_R_VER="$(ls -1 ${DIR}/r-pkgs | grep ^openssl | sort -R | head -1)"
    echo
    echo "Installing...${OPENSSL_R_VER}"
    echo

    sudo R CMD INSTALL -l /Library/Frameworks/R.framework/Resources/library --configure-vars='INCLUDE_DIR=/usr/local/opt/openssl/include LIB_DIR=/usr/local/opt/openssl/lib' "${DIR}/r-pkgs/${OPENSSL_R_VER}"
  4. curtisalexander created this gist Feb 8, 2018.
    1 change: 1 addition & 0 deletions install_R_pkg_openssl.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    sudo R CMD INSTALL -l /Library/Frameworks/R.framework/Resources/library --configure-vars='INCLUDE_DIR=/usr/local/Cellar/[email protected]/1.1.0g_1/include LIB_DIR=/usr/local/Cellar/[email protected]/1.1.0g_1/lib' ~/Downloads/openssl_1.0.tar.gz