From 59fbf8d1030db28dd37ba418ab2f84fbcb170370 Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Tue, 4 Feb 2014 12:24:22 +0900 Subject: [PATCH] Add Anaconda 1.8.0 --- plugins/python-build/bin/python-build | 38 +++++++++++++++++++ .../share/python-build/anaconda-1.8.0 | 19 ++++++++++ 2 files changed, 57 insertions(+) create mode 100644 plugins/python-build/share/python-build/anaconda-1.8.0 diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index 9f724e62..9a84006d 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -131,6 +131,10 @@ install_zip() { install_package_using "zip" 1 "$@" } +install_script() { + install_package_using "script" 1 "$@" +} + install_package_using() { local package_type="$1" local package_type_nargs="$2" @@ -470,6 +474,34 @@ fetch_zip() { } >&4 2>&1 } +fetch_script() { + local package_name="$1" + local package_url="$2" + local mirror_url + local checksum + + if [ "$package_url" != "${package_url/\#}" ]; then + checksum="${package_url#*#}" + package_url="${package_url%%#*}" + + if [ -n "$PYTHON_BUILD_MIRROR_URL" ]; then + mirror_url="${PYTHON_BUILD_MIRROR_URL}/$checksum" + fi + fi + + local package_filename="${package_name}.sh" # TODO: extract suffix from ${package_url} + + if ! symlink_tarball_from_cache "$package_filename" "$checksum"; then + echo "Downloading ${package_filename}..." >&2 + http head "$mirror_url" && + download_tarball "$mirror_url" "$package_filename" "$checksum" || + download_tarball "$package_url" "$package_filename" "$checksum" + fi + + mkdir -p "$(dirname "${package_name}/${package_filename}")" + mv -f "${package_filename}" "${package_name}/${package_filename}" +} + build_package() { local package_name="$1" shift @@ -694,6 +726,12 @@ build_package_pypy_builder() { build_package_pypy } +build_package_anaconda() { + local package_name="$1" + { bash "${package_name}.sh" -b -p "${PREFIX_PATH}" + } >&4 2>&1 +} + build_package_copy() { mkdir -p "$PREFIX_PATH" cp -fR . "$PREFIX_PATH" diff --git a/plugins/python-build/share/python-build/anaconda-1.8.0 b/plugins/python-build/share/python-build/anaconda-1.8.0 new file mode 100644 index 00000000..9151f60e --- /dev/null +++ b/plugins/python-build/share/python-build/anaconda-1.8.0 @@ -0,0 +1,19 @@ +case "$(uname -s)" in +"Darwin" ) + install_script "Anaconda-1.8.0-MacOSX-x86_64" "http://repo.continuum.io/archive/Anaconda-1.8.0-MacOSX-x86_64.sh#9fd7dd485c5f04fb65699a290e69671c" "anaconda" verify_py27 + ;; +"Linux" ) + case "$(uname -m)" in + "i386" | "i486" | "i586" | "i686" | "i786" ) + install_script "Anaconda-1.8.0-Linux-x86" "http://repo.continuum.io/archive/Anaconda-1.8.0-Linux-x86.sh#5028bf0aa7ff8a071d5532b8f8ec924c" "anaconda" verify_py27 + ;; + "x86_64" ) + install_script "Anaconda-1.8.0-Linux-x86_64" "http://repo.continuum.io/archive/Anaconda-1.8.0-Linux-x86_64.sh#398d4b7ddc5c0a16c556c415b2444266" "anaconda" verify_py27 + esac + ;; +* ) + { echo "Precompiled binary of anaconda-1.8.0 is not available for $(uname -s)-$(uname -m)." + } 1>&4 2>&1 + false + ;; +esac