File: pypy3.9-7.3.15

package info (click to toggle)
pyenv 2.6.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,496 kB
  • sloc: sh: 4,914; python: 410; makefile: 161; ansic: 60
file content (81 lines) | stat: -rw-r--r-- 2,285 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
VERSION='7.3.15'
PYVER='3.9'

# https://www.pypy.org/checksums.html
aarch64_hash=03e35fcba290454bb0ccf7ee57fb42d1e63108d10d593776a382c0a2fe355de0
linux32_hash=c6209380977066c9e8b96e8258821c70f996004ce1bc8659ae83d4fd5a89ff5c
linux64_hash=f062be307200bde434817e1620cebc13f563d6ab25309442c5f4d0f0d68f0912
osarm64_hash=300541c32125767a91b182b03d9cc4257f04971af32d747ecd4d62549d72acfd
osx64_hash=18ad7c9cb91c5e8ef9d40442b2fd1f6392ae113794c5b6b7d3a45e04f19edec6
s390x_hash=deeb5e54c36a0fd9cfefd16e63a0d5bed4f4a43e6bbc01c23f0ed8f7f1c0aaf3

### end of manual settings - following lines same for every download

function err_no_binary {
    local archmsg="${1}"
    local ver="pypy${PYVER}-v${VERSION}-src"
    local url="https://downloads.python.org/pypy/${ver}.tar.bz2"
    { echo
      colorize 1 "ERROR"
      echo ": The binary distribution of PyPy is not available for ${archmsg}."
      echo "try '${url}' to build from source."
      echo
    } >&2
    exit 1
}

function pypy_pkg_data {
    # pypy architecture tag
    local ARCH="${1}"

    # defaults
    local cmd='install_package'  # use bz2
    local pkg="${ARCH}" # assume matches
    local ext='tar.bz2'
    local hash='' # undefined

    # select the hash, fix pkg if not match ARCH
    case "${ARCH}" in
    'linux-aarch64' )
      hash="${aarch64_hash}"
      pkg='aarch64'
      ;;
    'linux' )
      hash="${linux32_hash}"
      pkg='linux32'
      ;;
    'linux64' )
      hash="${linux64_hash}"
      ;;
    'osarm64' )
      hash="${osarm64_hash}"
      pkg='macos_arm64'
      ;;
    'osx64' )
      if require_osx_version "10.13"; then
        hash="${osx64_hash}"
        pkg='macos_x86_64'
      else
        err_no_binary "${ARCH}, OS X < 10.13"
      fi
      ;;
    's390x' )
      hash="${s390x_hash}"
      ;;
    * )
      err_no_binary "${ARCH}"
      ;;
    esac

    local basever="pypy${PYVER}-v${VERSION}"
    local baseurl="https://downloads.python.org/pypy/${basever}"

    # result - command, package dir, url+hash
    echo "${cmd}" "${basever}-${pkg}" "${baseurl}-${pkg}.${ext}#${hash}"
}

# determine command, package directory, url+hash
declare -a pd="$(pypy_pkg_data "$(pypy_architecture 2>/dev/null || true)")"

# install
${pd[0]} "${pd[1]}" "${pd[2]}" 'pypy' "verify_py${PYVER//./}" 'ensurepip'