File: pypy3.11-7.3.18

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 (77 lines) | stat: -rw-r--r-- 2,160 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
VERSION='7.3.18'
PYVER='3.11'

# https://www.pypy.org/checksums.html
aarch64_hash=95bc3021cb9be2aa766ecb776c215e97ae8c0dda99dd48840b40b5b87d90bc45
linux32_hash=70357a69cdbf4ce449b5743901fcd36208e0a89eadcfb4d2ebdc9b4711a0612c
linux64_hash=df5fa534800ff09d990e50ca4fdb02d8a06b9ed948dbcb3a09bea0739ef42de7
osarm64_hash=cc4d6dd621dffd474eb9a2d01e5844d1b6a6f88b404aac2c48a9c267b5370df4
osx64_hash=4f2274ffb4b787fd5b5f15cd61f7fef5a3710bf0ecbd4293bf0251035b468865

### 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
      ;;
    * )
      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'