├── .github ├── dependabot.yml ├── pages │ └── index.html └── workflows │ ├── build_python.yml │ ├── build_python_on_branch.yml │ ├── pages.yml │ ├── release_python.yml │ └── update_nodejs_installers.yml ├── .gitignore ├── LICENSE ├── README.md ├── baseline └── requirements.txt ├── checksums ├── brotli-1.1.0.tar.gz.sha256 ├── expat-2.5.0.tar.gz.sha256 ├── expat-2.6.2.tar.gz.sha256 ├── fontconfig-2.15.0.tar.gz.sha256 ├── freetype-2.13.2.tar.gz.sha256 ├── gdbm-1.23.tar.gz.sha256 ├── inputproto-2.3.2.tar.gz.sha256 ├── kbproto-1.0.7.tar.gz.sha256 ├── libICE-1.0.7.tar.gz.sha256 ├── libSM-1.2.2.tar.gz.sha256 ├── libX11-1.8.7.tar.gz.sha256 ├── libXScrnSaver-1.2.4.tar.gz.sha256 ├── libXau-1.0.11.tar.gz.sha256 ├── libXdmcp-1.1.2.tar.gz.sha256 ├── libXext-1.3.5.tar.gz.sha256 ├── libXft-2.3.8.tar.gz.sha256 ├── libXrender-0.9.11.tar.gz.sha256 ├── libffi-3.4.2.tar.gz.sha256 ├── libffi-3.4.6.tar.gz.sha256 ├── libgcrypt-1.10.3.tar.bz2.sha256 ├── libgpg-error-1.47.tar.bz2.sha256 ├── libpng-1.6.41.tar.gz.sha256 ├── libpthread-stubs-0.5.tar.gz.sha256 ├── libxcb-1.16.tar.gz.sha256 ├── libxml2-2.12.4.tar.xz.sha256 ├── libxslt-1.1.39.tar.xz.sha256 ├── mpdecimal-2.5.0.tar.gz.sha256 ├── ncurses-6.4.tar.gz.sha256 ├── openssl-1.1.1w.tar.gz.sha256 ├── readline-8.2.tar.gz.sha256 ├── renderproto-0.11.1.tar.gz.sha256 ├── scrnsaverproto-1.2.2.tar.gz.sha256 ├── sqlite-amalgamation-3430100.zip.sha256 ├── sqlite-autoconf-3450000.tar.gz.sha256 ├── tcl8.6.13-src.tar.gz.sha256 ├── tk8.6.13-src.tar.gz.sha256 ├── util-linux-2.39.3.tar.gz.sha256 ├── util-macros-1.20.1.tar.gz.sha256 ├── xcb-proto-1.16.0.tar.gz.sha256 ├── xextproto-7.3.0.tar.gz.sha256 ├── xorgproto-2023.2.tar.gz.sha256 ├── xproto-7.0.31.tar.gz.sha256 ├── xtrans-1.5.0.tar.gz.sha256 ├── xz-5.4.5.tar.gz.sha256 └── zlib-1.3.1.tar.gz.sha256 ├── installers ├── nodejs-3.10 │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── index.ts │ │ └── pythonVersion.ts │ ├── tsconfig.json │ └── tsup.config.ts ├── nodejs-3.11 │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── index.ts │ │ └── pythonVersion.ts │ ├── tsconfig.json │ └── tsup.config.ts ├── nodejs-3.12 │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── index.ts │ │ └── pythonVersion.ts │ ├── tsconfig.json │ └── tsup.config.ts ├── nodejs-3.8 │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── index.ts │ │ └── pythonVersion.ts │ ├── tsconfig.json │ └── tsup.config.ts ├── nodejs-3.9 │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── index.ts │ │ └── pythonVersion.ts │ ├── tsconfig.json │ └── tsup.config.ts └── nodejs │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ └── index.ts │ └── tsconfig.json ├── scripts ├── build_freebsd.sh ├── build_linux_zig.sh ├── build_macos.sh ├── build_windows.sh ├── cc ├── patch_pip_script.py ├── pick_semver.sh ├── qemu_aarch64_interpreter ├── qemu_arm_interpreter ├── qemu_i386_interpreter ├── qemu_riscv64_interpreter ├── qemu_x86_64_interpreter ├── test.py ├── test_deps.py ├── update_installer.py └── utils.sh └── zigshim ├── patches ├── 01-arm-xstatver.h.patch └── 02-riscv64.patch ├── zig_ar ├── zig_cc └── zig_cxx /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | 8 | - package-ecosystem: "pip" 9 | directory: "/baseline/" 10 | schedule: 11 | interval: "daily" -------------------------------------------------------------------------------- /.github/pages/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | GitHub Releases - Portable Python 7 | 8 | 9 |

GitHub Releases - Portable Python

10 | 11 | 12 |
13 | 14 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /.github/workflows/build_python.yml: -------------------------------------------------------------------------------- 1 | name: Build Python 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | python_version: 7 | required: true 8 | type: string 9 | platforms: 10 | required: true 11 | type: string 12 | default: "linux-x86_64,linux-aarch64,linux-i386,linux-arm,linux-riscv64,macos,windows,freebsd13-x86_64,freebsd14-x86_64" 13 | buildsystem_branch: 14 | required: false 15 | type: string 16 | default: "portable-python" 17 | run_tests: 18 | required: false 19 | type: boolean 20 | debug: 21 | required: false 22 | type: boolean 23 | debug_interactive: 24 | required: false 25 | type: boolean 26 | verbose: 27 | required: false 28 | type: boolean 29 | workflow_call: 30 | inputs: 31 | python_version: 32 | required: true 33 | type: string 34 | platforms: 35 | required: true 36 | type: string 37 | buildsystem_branch: 38 | required: false 39 | type: string 40 | run_tests: 41 | required: false 42 | type: boolean 43 | debug: 44 | required: false 45 | type: boolean 46 | verbose: 47 | required: false 48 | type: boolean 49 | 50 | env: 51 | RUN_TESTS: ${{ inputs.run_tests }} 52 | DEBUG_CI: ${{ inputs.debug }} 53 | VERBOSE_CI: ${{ inputs.verbose }} 54 | PORTABLE_PYTHON_BUILDSYSTEM_BRANCH: ${{ inputs.buildsystem_branch || 'portable-python' }} 55 | image_map: '{"x86_64": "amd64/centos:7", "i386": "i386/centos:7", "aarch64": "arm64v8/centos:7", "arm": "arm32v7/debian:bullseye", "riscv64": "riscv64/debian:sid"}' 56 | freebsd_release_map: '{"14": "14.0", "13": "13.2"}' 57 | 58 | jobs: 59 | build_linux: 60 | name: Linux ${{ inputs.python_version }} ${{ matrix.arch }} 61 | if: ${{ contains(inputs.platforms, 'linux') }} 62 | runs-on: ubuntu-latest 63 | strategy: 64 | fail-fast: false 65 | matrix: 66 | arch: [x86_64, i386, aarch64, arm, riscv64] 67 | exclude: 68 | - arch: ${{ !contains(inputs.platforms, 'linux-x86_64') && 'x86_64' || '' }} 69 | - arch: ${{ !contains(inputs.platforms, 'linux-i386') && 'i386' || '' }} 70 | - arch: ${{ !contains(inputs.platforms, 'linux-aarch64') && 'aarch64' || '' }} 71 | - arch: ${{ !contains(inputs.platforms, 'linux-arm') && 'arm' || '' }} 72 | - arch: ${{ !contains(inputs.platforms, 'linux-riscv64') && 'riscv64' || '' }} 73 | 74 | steps: 75 | - name: Parse image 76 | id: parse_image 77 | run: | 78 | IMAGE=$(echo ${{ toJSON(env.image_map) }} | jq -r '.["${{ matrix.arch }}"]') 79 | echo "image=$IMAGE" >> "$GITHUB_OUTPUT" 80 | 81 | - name: Set up zig 82 | uses: goto-bus-stop/setup-zig@v2 83 | with: 84 | version: 0.13.0 85 | 86 | - name: Checkout 87 | uses: actions/checkout@v4 88 | 89 | - name: Build 90 | run: | 91 | ./scripts/build_linux_zig.sh ${{ matrix.arch }} ${{ inputs.python_version }} 92 | 93 | - name: Interactive debugging 94 | if: ${{ always() && inputs.debug_interactive }} 95 | uses: fawazahmed0/action-debug@v2 96 | 97 | - name: Upload artifacts 98 | uses: actions/upload-artifact@v4 99 | with: 100 | name: python-linux-${{ matrix.arch }}-${{ inputs.python_version }} 101 | path: ./python*.zip 102 | 103 | - name: Upload artifacts 104 | if: ${{ always() && inputs.debug }} 105 | uses: actions/upload-artifact@v4 106 | with: 107 | name: build-python-linux-${{ matrix.arch }}-${{ inputs.python_version }} 108 | path: ./*python*.tar.gz 109 | 110 | - name: Test python in clean environment 111 | uses: addnab/docker-run-action@v3 112 | with: 113 | image: ${{ steps.parse_image.outputs.image }} 114 | options: -v ${{ github.workspace }}:/work --workdir /tmp 115 | shell: bash 116 | run: | 117 | set -e 118 | uname -a 119 | 120 | if [ "${{ matrix.arch }}" == "arm" ] || [ "${{ matrix.arch }}" == "riscv64" ]; then 121 | apt update 122 | apt -y install unzip 123 | else 124 | yum -y install unzip 125 | fi 126 | 127 | cp /work/python*.zip . 128 | unzip ./python*.zip 129 | 130 | cd python-${{ inputs.python_version }}-linux-${{ matrix.arch }} 131 | chmod +x ./bin/python 132 | ldd -v -r ./bin/python 133 | ./bin/python --version 134 | ./bin/python -m sysconfig 135 | ./bin/python /work/scripts/test.py 136 | ./bin/pip3 137 | 138 | if [[ "${{ inputs.run_tests }}" == "true" ]]; then 139 | ./bin/python -m test -v -ulargefile,network,decimal,cpu,subprocess,urlfetch,tzdata --timeout 60 140 | fi 141 | 142 | build_windows: 143 | name: Windows ${{ inputs.python_version }} x86_64 (build) 144 | if: ${{ contains(inputs.platforms, 'windows') }} 145 | runs-on: windows-latest 146 | 147 | steps: 148 | - name: Set git to use LF 149 | run: | 150 | git config --global core.autocrlf false 151 | git config --global core.eol lf 152 | 153 | - name: Checkout 154 | uses: actions/checkout@v4 155 | 156 | - name: Configure build for x86_64 157 | uses: ilammy/msvc-dev-cmd@v1.13.0 158 | 159 | - name: Remove Strawberry 160 | shell: pwsh 161 | run: | 162 | Rename-Item c:\strawberry strawberry2 163 | 164 | - name: Build 165 | shell: bash 166 | run: | 167 | set -ex 168 | ./scripts/build_windows.sh x86_64 ${{ inputs.python_version }} 169 | 170 | - name: Interactive debugging 171 | uses: fawazahmed0/action-debug@v2 172 | if: ${{ always() && inputs.debug_interactive }} 173 | 174 | - name: Upload artifacts 175 | uses: actions/upload-artifact@v4 176 | with: 177 | name: python-windows-x86_64-${{ inputs.python_version }} 178 | path: ./python*.zip 179 | 180 | - name: Upload artifacts 181 | uses: actions/upload-artifact@v4 182 | if: ${{ always() && inputs.debug }} 183 | with: 184 | name: build-python-windows-x86_64-${{ inputs.python_version }} 185 | path: ./*python*.tar.gz 186 | 187 | test_windows: 188 | name: Windows ${{ inputs.python_version }} x86_64 (test) 189 | needs: build_windows 190 | runs-on: windows-latest 191 | 192 | steps: 193 | - name: Set git to use LF 194 | run: | 195 | git config --global core.autocrlf false 196 | git config --global core.eol lf 197 | 198 | - name: Checkout 199 | uses: actions/checkout@v4 200 | 201 | - name: Download artifact 202 | uses: actions/download-artifact@v4 203 | with: 204 | name: python-windows-x86_64-${{ inputs.python_version }} 205 | path: ./python/ 206 | 207 | - name: Test python in clean environment 208 | shell: bash 209 | run: | 210 | 7z.exe x python/python-${{ inputs.python_version }}-windows-x86_64.zip 211 | 212 | cd python-${{ inputs.python_version }}-windows-x86_64 213 | ./bin/python --version 214 | ./bin/python -m sysconfig 215 | ./bin/python ../scripts/test.py 216 | 217 | if [[ "${{ inputs.run_tests }}" == "true" ]]; then 218 | ./bin/python -m test -v -ulargefile,network,decimal,cpu,subprocess,urlfetch,tzdata --timeout 60 219 | fi 220 | 221 | build_macos: 222 | name: MacOS ${{ inputs.python_version }} universal2 (build) 223 | if: ${{ contains(inputs.platforms, 'macos') }} 224 | runs-on: macos-12 225 | 226 | steps: 227 | - name: Checkout 228 | uses: actions/checkout@v4 229 | 230 | - name: Install coreutils 231 | run: brew install coreutils gpatch autoconf automake libtool 232 | 233 | - name: Build 234 | run: | 235 | set -ex 236 | ./scripts/build_macos.sh universal2 ${{ inputs.python_version }} 237 | 238 | - name: Interactive debugging 239 | uses: fawazahmed0/action-debug@v2 240 | if: ${{ always() && inputs.debug_interactive }} 241 | 242 | - name: Upload artifacts 243 | uses: actions/upload-artifact@v4 244 | with: 245 | name: python-darwin-universal2-${{ inputs.python_version }} 246 | path: ./python*.zip 247 | 248 | - name: Upload artifacts 249 | uses: actions/upload-artifact@v4 250 | if: ${{ always() && inputs.debug }} 251 | with: 252 | name: build-python-darwin-universal2-${{ inputs.python_version }} 253 | path: ./*python*.tar.gz 254 | 255 | test_macos: 256 | name: MacOS ${{ inputs.python_version }} ${{ matrix.arch }} (test) 257 | needs: build_macos 258 | runs-on: ${{ matrix.os }} 259 | strategy: 260 | fail-fast: false 261 | matrix: 262 | os: [ macos-11, macos-14 ] 263 | include: 264 | - os: macos-11 265 | arch: x86_64 266 | - os: macos-14 267 | arch: arm64 268 | 269 | steps: 270 | - name: Checkout 271 | uses: actions/checkout@v4 272 | 273 | - name: Download artifact 274 | uses: actions/download-artifact@v4 275 | with: 276 | name: python-darwin-universal2-${{ inputs.python_version }} 277 | path: ./python/ 278 | 279 | - name: Test python in clean environment 280 | shell: bash 281 | run: | 282 | unzip python/python-${{ inputs.python_version }}-darwin-universal2.zip 283 | 284 | cd python-${{ inputs.python_version }}-darwin-universal2 285 | chmod +x ./bin/python 286 | ./bin/python --version 287 | ./bin/python -m sysconfig 288 | ./bin/python ${{ github.workspace }}/scripts/test.py 289 | ./bin/pip3 290 | 291 | if [[ "${{ inputs.run_tests }}" == "true" ]]; then 292 | ./bin/python -m test -v -ulargefile,network,decimal,cpu,subprocess,urlfetch,tzdata --timeout 60 293 | fi 294 | 295 | build_freebsd: 296 | name: FreeBSD ${{ matrix.release }} ${{ inputs.python_version }} x86_64 (build) 297 | if: ${{ contains(inputs.platforms, 'freebsd') }} 298 | runs-on: ubuntu-latest 299 | strategy: 300 | fail-fast: false 301 | matrix: 302 | release: [13, 14] 303 | exclude: 304 | - release: ${{ !contains(inputs.platforms, 'freebsd13-x86_64') && '13' || '' }} 305 | - release: ${{ !contains(inputs.platforms, 'freebsd14-x86_64') && '14' || '' }} 306 | 307 | steps: 308 | - name: Parse release 309 | id: parse_release 310 | run: | 311 | RELEASE=$(echo ${{ toJSON(env.freebsd_release_map) }} | jq -r '.["${{ matrix.release }}"]') 312 | echo "release=$RELEASE" >> "$GITHUB_OUTPUT" 313 | 314 | - name: Checkout 315 | uses: actions/checkout@v4 316 | 317 | - name: Build in VM 318 | uses: vmactions/freebsd-vm@v1 319 | with: 320 | envs: 'RUN_TESTS DEBUG_CI VERBOSE_CI PORTABLE_PYTHON_BUILDSYSTEM_BRANCH' 321 | usesh: true 322 | release: ${{ steps.parse_release.outputs.release }} 323 | prepare: | 324 | pkg install -y cmake bash wget patch git zip python3 autoconf automake libtool gettext bison pkgconf gmake gperf patchelf 325 | run: | 326 | export PLATFORM=freebsd${{ matrix.release }} 327 | bash ./scripts/build_freebsd.sh x86_64 ${{ inputs.python_version }} 328 | 329 | - name: Interactive debugging 330 | if: ${{ always() && inputs.debug_interactive }} 331 | uses: fawazahmed0/action-debug@v2 332 | 333 | - name: Upload artifacts 334 | uses: actions/upload-artifact@v4 335 | with: 336 | name: python-freebsd${{ matrix.release }}-x86_64-${{ inputs.python_version }} 337 | path: ./python*.zip 338 | 339 | - name: Upload artifacts 340 | if: ${{ always() && inputs.debug }} 341 | uses: actions/upload-artifact@v4 342 | with: 343 | name: build-python-freebsd${{ matrix.release }}-x86_64-${{ inputs.python_version }} 344 | path: ./*python*.tar.gz 345 | 346 | test_freebsd: 347 | name: FreeBSD ${{ matrix.release }} ${{ inputs.python_version }} x86_64 (test) 348 | needs: build_freebsd 349 | runs-on: ubuntu-latest 350 | strategy: 351 | fail-fast: false 352 | matrix: 353 | release: [13, 14] 354 | exclude: 355 | - release: ${{ !contains(inputs.platforms, 'freebsd13-x86_64') && '13' || '' }} 356 | - release: ${{ !contains(inputs.platforms, 'freebsd14-x86_64') && '14' || '' }} 357 | 358 | steps: 359 | - name: Parse release 360 | id: parse_release 361 | run: | 362 | RELEASE=$(echo ${{ toJSON(env.freebsd_release_map) }} | jq -r '.["${{ matrix.release }}"]') 363 | echo "release=$RELEASE" >> "$GITHUB_OUTPUT" 364 | 365 | - name: Checkout 366 | uses: actions/checkout@v4 367 | 368 | - name: Download artifact 369 | uses: actions/download-artifact@v4 370 | with: 371 | name: python-freebsd${{ matrix.release }}-x86_64-${{ inputs.python_version }} 372 | path: ./python/ 373 | 374 | - name: Test in VM 375 | uses: vmactions/freebsd-vm@v1 376 | with: 377 | envs: 'RUN_TESTS DEBUG_CI VERBOSE_CI PORTABLE_PYTHON_BUILDSYSTEM_BRANCH' 378 | usesh: true 379 | copyback: false 380 | release: ${{ steps.parse_release.outputs.release }} 381 | prepare: | 382 | pkg install -y bash 383 | run: | 384 | cat > /tmp/test.sh <> $GITHUB_ENV 54 | 55 | - name: Pick tag 56 | id: pick_tag 57 | run: | 58 | SELECTED_TAG=$(./scripts/pick_semver.sh ${{ inputs.python_version }} ${{ inputs.beta }}) 59 | echo "SELECTED_TAG=$SELECTED_TAG" >> $GITHUB_ENV 60 | echo "::set-output name=release_tag::$SELECTED_TAG" 61 | 62 | - name: Create release 63 | run: | 64 | gh release create ${{ env.SELECTED_TAG }} \ 65 | --title ${{ env.SELECTED_TAG }} \ 66 | --target ${{ github.sha }} \ 67 | ${{ env.LATEST_TAG && format('--generate-notes --notes-start-tag {0}', env.LATEST_TAG) || format('--notes "Python {0}"', inputs.python_version) }} \ 68 | ${{ inputs.beta && '--prerelease' || '' }} 69 | env: 70 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 71 | 72 | - name: Upload files 73 | uses: softprops/action-gh-release@v2 74 | with: 75 | files: /tmp/python/python*.zip 76 | tag_name: ${{ env.SELECTED_TAG }} 77 | 78 | outputs: 79 | release_tag: ${{ steps.pick_tag.outputs.release_tag }} 80 | 81 | update_installers: 82 | name: Update installers 83 | needs: publish 84 | permissions: 85 | contents: write 86 | uses: ./.github/workflows/update_nodejs_installers.yml 87 | with: 88 | python_version: ${{ inputs.python_version }} 89 | release_tag: ${{ needs.publish.outputs.release_tag }} 90 | beta: ${{ inputs.beta }} 91 | secrets: inherit 92 | -------------------------------------------------------------------------------- /.github/workflows/update_nodejs_installers.yml: -------------------------------------------------------------------------------- 1 | name: Update NodeJS Installers 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | python_version: 7 | required: true 8 | type: string 9 | release_tag: 10 | required: true 11 | type: string 12 | beta: 13 | required: false 14 | type: boolean 15 | default: false 16 | workflow_call: 17 | inputs: 18 | python_version: 19 | required: true 20 | type: string 21 | release_tag: 22 | required: true 23 | type: string 24 | beta: 25 | required: false 26 | type: boolean 27 | default: false 28 | 29 | permissions: 30 | contents: write 31 | 32 | jobs: 33 | update_base: 34 | name: Update NodeJS installers 35 | runs-on: ubuntu-latest 36 | steps: 37 | - name: Checkout 38 | uses: actions/checkout@v4 39 | 40 | - name: Pull latest 41 | run: | 42 | git pull 43 | 44 | - name: Setup Python 45 | uses: actions/setup-python@v5 46 | with: 47 | python-version: "3.10" 48 | 49 | - name: Setup NodeJS 50 | uses: actions/setup-node@v4 51 | with: 52 | node-version: '20.x' 53 | registry-url: 'https://registry.npmjs.org' 54 | 55 | - name: Update and publish installers 56 | run: | 57 | python ./scripts/update_installer.py ${{ inputs.python_version }} ${{ inputs.release_tag }} 58 | 59 | MAJOR=$(echo ${{ inputs.python_version }} | cut -d. -f1) 60 | MINOR=$(echo ${{ inputs.python_version }} | cut -d. -f2) 61 | 62 | cd ./installers/nodejs 63 | npm i 64 | npm run build 65 | npm publish ${{ inputs.beta && '--tag beta' || '' }} 66 | cd - 67 | 68 | cd ./installers/nodejs-$MAJOR.$MINOR 69 | npm i || true 70 | npm run build 71 | npm i 72 | npm publish ${{ inputs.beta && '--tag beta' || '' }} 73 | env: 74 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 75 | 76 | - name: Commit and push 77 | uses: stefanzweifel/git-auto-commit-action@v5 78 | with: 79 | commit_user_name: "github-actions[bot]" 80 | commit_user_email: "github-actions[bot]@users.noreply.github.com" 81 | commit_author: "github-actions[bot] " 82 | commit_message: Releasing ${{ inputs.release_tag }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | *.swp 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # portable-python 2 | This project provides self-contained (hence, "portable") Python distributions to a variety of target platforms and architectures. These Python distributions can be downloaded and extracted to anywhere on the filesystem, making installation trivially easy and configurable. 3 | 4 | ## Usage 5 | 6 | To get started, download archives from [GitHub releases](https://github.com/bjia56/portable-python/releases). Alternatively, use any of the following installers: 7 | - `npm i @bjia56/portable-python-3.8` 8 | - `npm i @bjia56/portable-python-3.9` 9 | - `npm i @bjia56/portable-python-3.10` 10 | - `npm i @bjia56/portable-python-3.11` 11 | - `npm i @bjia56/portable-python-3.12` 12 | 13 | For example, on Linux via bash: 14 | ``` 15 | $ wget -q https://github.com/bjia56/portable-python/releases/download/v3.9.17-build.4/python-3.9 16 | .17-linux-x86_64.zip 17 | $ unzip -qq python-3.9.17-linux-x86_64.zip 18 | $ ./python-3.9.17-linux-x86_64/bin/python --version 19 | Python 3.9.17 20 | ``` 21 | 22 | Or via the node installer: 23 | ``` 24 | $ npm i --silent @bjia56/portable-python-3.9 25 | $ ./node_modules/@bjia56/portable-python-3.9/python-3.9.17-linux-x86_64/bin/python --version 26 | Python 3.9.17 27 | ``` 28 | 29 | Or via node: 30 | ```js 31 | var pythonExe = require("@bjia56/portable-python-3.9"); 32 | var child_process = require("child_process"); 33 | console.log(child_process.execSync(`${pythonExe} --version`).toString()); 34 | ``` 35 | 36 | ## Available distributions 37 | 38 | Currently, Python 3.9, 3.10, 3.11, and 3.12 are built for the following targets: 39 | - Linux x86_64, i386, aarch64, arm [1](#f1), riscv64 40 | - Windows x86_64 41 | - MacOS x86_64, arm64 [2](#f2) 42 | 43 | Python 3.8 builds are available, but will no longer be actively updated. 44 | 45 | 1 The arm builds target armv6, specifically the configuration of the Raspberry Pi 1. Current arm builds do not work properly on old glibc, but a recent version of Raspbian like Debian bullseye should provide a new enough glibc to work. [↩](#a1) 46 | 47 | 2 MacOS distributions are provided as universal2, which will work on both x86_64 and arm64. [↩](#a2) 48 | 49 | Download stats: 📊 50 | 51 | ## Licensing 52 | 53 | The build scripts and code in this repository are available under the Apache-2.0 License. Note that compilation of Python involves linking against other libraries, some of which may include different licensing terms. Copies of the licenses from known dependencies are included under the `licenses` directory of each Python distribution. 54 | -------------------------------------------------------------------------------- /baseline/requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2024.6.2 -------------------------------------------------------------------------------- /checksums/brotli-1.1.0.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | e720a6ca29428b803f4ad165371771f5398faba397edf6778837a18599ea13ff brotli-1.1.0.tar.gz -------------------------------------------------------------------------------- /checksums/expat-2.5.0.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 6b902ab103843592be5e99504f846ec109c1abb692e85347587f237a4ffa1033 expat-2.5.0.tar.gz -------------------------------------------------------------------------------- /checksums/expat-2.6.2.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | d4cf38d26e21a56654ffe4acd9cd5481164619626802328506a2869afab29ab3 expat-2.6.2.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/fontconfig-2.15.0.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | f5f359d6332861bd497570848fcb42520964a9e83d5e3abe397b6b6db9bcaaf4 fontconfig-2.15.0.tar.gz -------------------------------------------------------------------------------- /checksums/freetype-2.13.2.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 1ac27e16c134a7f2ccea177faba19801131116fd682efc1f5737037c5db224b5 freetype-2.13.2.tar.gz -------------------------------------------------------------------------------- /checksums/gdbm-1.23.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 74b1081d21fff13ae4bd7c16e5d6e504a4c26f7cde1dca0d963a484174bbcacd gdbm-1.23.tar.gz -------------------------------------------------------------------------------- /checksums/inputproto-2.3.2.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 10eaadd531f38f7c92ab59ef0708ca195caf3164a75c4ed99f0c04f2913f6ef3 inputproto-2.3.2.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/kbproto-1.0.7.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 828cb275b91268b1a3ea950d5c0c5eb076c678fdf005d517411f89cc8c3bb416 kbproto-1.0.7.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/libICE-1.0.7.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 8463d080da6f87d5c20b21fe694dfb81f97319a8617030ea4720e97d1bb4659c libICE-1.0.7.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/libSM-1.2.2.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 14bb7c669ce2b8ff712fbdbf48120e3742a77edcd5e025d6b3325ed30cf120f4 libSM-1.2.2.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/libX11-1.8.7.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 793ebebf569f12c864b77401798d38814b51790fce206e01a431e5feb982e20b libX11-1.8.7.tar.gz -------------------------------------------------------------------------------- /checksums/libXScrnSaver-1.2.4.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 0656b2630475104d6df75d91ebb8e0153e61d14e9871ef1f403bcda4a62a838a libXScrnSaver-1.2.4.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/libXau-1.0.11.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 3a321aaceb803577a4776a5efe78836eb095a9e44bbc7a465d29463e1a14f189 libXau-1.0.11.tar.gz -------------------------------------------------------------------------------- /checksums/libXdmcp-1.1.2.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 6f7c7e491a23035a26284d247779174dedc67e34e93cc3548b648ffdb6fc57c0 libXdmcp-1.1.2.tar.gz -------------------------------------------------------------------------------- /checksums/libXext-1.3.5.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 1a3dcda154f803be0285b46c9338515804b874b5ccc7a2b769ab7fd76f1035bd libXext-1.3.5.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/libXft-2.3.8.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 32e48fe2d844422e64809e4e99b9d8aed26c1b541a5acf837c5037b8d9f278a8 libXft-2.3.8.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/libXrender-0.9.11.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 6aec3ca02e4273a8cbabf811ff22106f641438eb194a12c0ae93c7e08474b667 libXrender-0.9.11.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/libffi-3.4.2.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 540fb721619a6aba3bdeef7d940d8e9e0e6d2c193595bc243241b77ff9e93620 libffi-3.4.2.tar.gz -------------------------------------------------------------------------------- /checksums/libffi-3.4.6.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | b0dea9df23c863a7a50e825440f3ebffabd65df1497108e5d437747843895a4e libffi-3.4.6.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/libgcrypt-1.10.3.tar.bz2.sha256: -------------------------------------------------------------------------------- 1 | 8b0870897ac5ac67ded568dcfadf45969cfa8a6beb0fd60af2a9eadc2a3272aa libgcrypt-1.10.3.tar.bz2 -------------------------------------------------------------------------------- /checksums/libgpg-error-1.47.tar.bz2.sha256: -------------------------------------------------------------------------------- 1 | 9e3c670966b96ecc746c28c2c419541e3bcb787d1a73930f5e5f5e1bcbbb9bdb libgpg-error-1.47.tar.bz2 -------------------------------------------------------------------------------- /checksums/libpng-1.6.41.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | f00a11840f60616bdced9056d0f4cf2e4897697db039f15ce911704f957d3c5d libpng-1.6.41.tar.gz -------------------------------------------------------------------------------- /checksums/libpthread-stubs-0.5.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 593196cc746173d1e25cb54a93a87fd749952df68699aab7e02c085530e87747 libpthread-stubs-0.5.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/libxcb-1.16.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | bc0f75f84b28e6496a19a1d094d7e47def861a50cb7cce5b23b62eecdc2a4479 libxcb-1.16.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/libxml2-2.12.4.tar.xz.sha256: -------------------------------------------------------------------------------- 1 | 497360e423cf0bd99eacdb7c6215dea92e6d6e89ee940393c2bae0e77cb9b7d0 libxml2-2.12.4.tar.xz -------------------------------------------------------------------------------- /checksums/libxslt-1.1.39.tar.xz.sha256: -------------------------------------------------------------------------------- 1 | 2a20ad621148339b0759c4d4e96719362dee64c9a096dbba625ba053846349f0 libxslt-1.1.39.tar.xz -------------------------------------------------------------------------------- /checksums/mpdecimal-2.5.0.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 15417edc8e12a57d1d9d75fa7e3f22b158a3b98f44db9d694cfd2acde8dfa0ca mpdecimal-2.5.0.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/ncurses-6.4.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 6931283d9ac87c5073f30b6290c4c75f21632bb4fc3603ac8100812bed248159 ncurses-6.4.tar.gz -------------------------------------------------------------------------------- /checksums/openssl-1.1.1w.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8 openssl-1.1.1w.tar.gz -------------------------------------------------------------------------------- /checksums/readline-8.2.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35 readline-8.2.tar.gz -------------------------------------------------------------------------------- /checksums/renderproto-0.11.1.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | a0a4be3cad9381ae28279ba5582e679491fc2bec9aab8a65993108bf8dbce5fe renderproto-0.11.1.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/scrnsaverproto-1.2.2.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | d8dee19c52977f65af08fad6aa237bacee11bc5a33e1b9b064e8ac1fd99d6e79 scrnsaverproto-1.2.2.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/sqlite-amalgamation-3430100.zip.sha256: -------------------------------------------------------------------------------- 1 | 7e634bbd4b2870a83dc7c1e3cc02e4d30b8555cd7db7b332f24e0c447fd0dd16 sqlite-amalgamation-3430100.zip 2 | -------------------------------------------------------------------------------- /checksums/sqlite-autoconf-3450000.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 72887d57a1d8f89f52be38ef84a6353ce8c3ed55ada7864eb944abd9a495e436 sqlite-autoconf-3450000.tar.gz -------------------------------------------------------------------------------- /checksums/tcl8.6.13-src.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 43a1fae7412f61ff11de2cfd05d28cfc3a73762f354a417c62370a54e2caf066 tcl8.6.13-src.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/tk8.6.13-src.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 2e65fa069a23365440a3c56c556b8673b5e32a283800d8d9b257e3f584ce0675 tk8.6.13-src.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/util-linux-2.39.3.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 2434edd1cf2aaca2a2b76b5de5ce7c98b12f75af9f600800c0655af20be85956 util-linux-2.39.3.tar.gz -------------------------------------------------------------------------------- /checksums/util-macros-1.20.1.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | b373f72887b1394ce2193180a60cb0d1fb8b17bc96ddd770cfd7a808cb489a15 util-macros-1.20.1.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/xcb-proto-1.16.0.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | d9c7f010b1105fc3858bf07b5169b2dd8e7493c6652b1fe45f3321d874f291d7 xcb-proto-1.16.0.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/xextproto-7.3.0.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 1b1bcdf91221e78c6c33738667a57bd9aaa63d5953174ad8ed9929296741c9f5 xextproto-7.3.0.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/xorgproto-2023.2.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | c791aad9b5847781175388ebe2de85cb5f024f8dabf526d5d699c4f942660cc3 xorgproto-2023.2.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/xproto-7.0.31.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 6d755eaae27b45c5cc75529a12855fed5de5969b367ed05003944cf901ed43c7 xproto-7.0.31.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/xtrans-1.5.0.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | a806f8a92f879dcd0146f3f1153fdffe845f2fc0df9b1a26c19312b7b0a29c86 xtrans-1.5.0.tar.gz 2 | -------------------------------------------------------------------------------- /checksums/xz-5.4.5.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 135c90b934aee8fbc0d467de87a05cb70d627da36abe518c357a873709e5b7d6 xz-5.4.5.tar.gz -------------------------------------------------------------------------------- /checksums/zlib-1.3.1.tar.gz.sha256: -------------------------------------------------------------------------------- 1 | 9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23 zlib-1.3.1.tar.gz -------------------------------------------------------------------------------- /installers/nodejs-3.10/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.tgz 4 | python-* -------------------------------------------------------------------------------- /installers/nodejs-3.10/README.md: -------------------------------------------------------------------------------- 1 | # portable-python 2 | This project provides self-contained (hence, "portable") Python distributions to a variety of target platforms and architectures. These Python distributions can be downloaded and extracted to anywhere on the filesystem, making installation trivially easy and configurable. 3 | 4 | ## Usage 5 | 6 | To get started, download archives from [GitHub releases](https://github.com/bjia56/portable-python/releases). Alternatively, use any of the following installers: 7 | - `npm i @bjia56/portable-python-3.8` 8 | - `npm i @bjia56/portable-python-3.9` 9 | - `npm i @bjia56/portable-python-3.10` 10 | - `npm i @bjia56/portable-python-3.11` 11 | - `npm i @bjia56/portable-python-3.12` 12 | 13 | For example, on Linux via bash: 14 | ``` 15 | $ wget -q https://github.com/bjia56/portable-python/releases/download/v3.9.17-build.4/python-3.9 16 | .17-linux-x86_64.zip 17 | $ unzip -qq python-3.9.17-linux-x86_64.zip 18 | $ ./python-3.9.17-linux-x86_64/bin/python --version 19 | Python 3.9.17 20 | ``` 21 | 22 | Or via the node installer: 23 | ``` 24 | $ npm i --silent @bjia56/portable-python-3.9 25 | $ ./node_modules/@bjia56/portable-python-3.9/python-3.9.17-linux-x86_64/bin/python --version 26 | Python 3.9.17 27 | ``` 28 | 29 | Or via node: 30 | ```js 31 | var pythonExe = require("@bjia56/portable-python-3.9"); 32 | var child_process = require("child_process"); 33 | console.log(child_process.execSync(`${pythonExe} --version`).toString()); 34 | ``` 35 | 36 | ## Available distributions 37 | 38 | Currently, Python 3.9, 3.10, 3.11, and 3.12 are built for the following targets: 39 | - Linux x86_64, i386, aarch64, arm [1](#f1), riscv64 40 | - Windows x86_64 41 | - MacOS x86_64, arm64 [2](#f2) 42 | 43 | Python 3.8 builds are available, but will no longer be actively updated. 44 | 45 | 1 The arm builds target armv6, specifically the configuration of the Raspberry Pi 1. Current arm builds do not work properly on old glibc, but a recent version of Raspbian like Debian bullseye should provide a new enough glibc to work. [↩](#a1) 46 | 47 | 2 MacOS distributions are provided as universal2, which will work on both x86_64 and arm64. [↩](#a2) 48 | 49 | Download stats: 📊 50 | 51 | ## Licensing 52 | 53 | The build scripts and code in this repository are available under the Apache-2.0 License. Note that compilation of Python involves linking against other libraries, some of which may include different licensing terms. Copies of the licenses from known dependencies are included under the `licenses` directory of each Python distribution. 54 | -------------------------------------------------------------------------------- /installers/nodejs-3.10/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bjia56/portable-python-3.10", 3 | "version": "0.1.15", 4 | "description": "Portable Python 3.10", 5 | "main": "./dist/index.js", 6 | "files": [ 7 | "dist" 8 | ], 9 | "scripts": { 10 | "build": "cp ../../README.md . && cd ../nodejs && npm run build && cd - && tsup", 11 | "prepublishOnly": "npm run build", 12 | "postinstall": "node ./dist/index.js" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/bjia56/portable-python.git" 17 | }, 18 | "keywords": [ 19 | "python" 20 | ], 21 | "author": "Brett Jia", 22 | "license": "Apache-2.0", 23 | "bugs": { 24 | "url": "https://github.com/bjia56/portable-python/issues" 25 | }, 26 | "homepage": "https://github.com/bjia56/portable-python", 27 | "dependencies": {}, 28 | "devDependencies": { 29 | "@bjia56/portable-python": "file:../nodejs", 30 | "@types/node": "^20.11.6", 31 | "ts-node": "^10.9.2", 32 | "tsup": "^8.0.1", 33 | "typescript": "^5.3.3" 34 | } 35 | } -------------------------------------------------------------------------------- /installers/nodejs-3.10/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import { PortablePython } from "@bjia56/portable-python"; 3 | import { pythonVersion } from "./pythonVersion"; 4 | if (require.main === module) { 5 | new PortablePython(pythonVersion, path.dirname(__dirname)).install(); 6 | } else { 7 | module.exports = new PortablePython(pythonVersion, path.dirname(__dirname)).executablePath; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /installers/nodejs-3.10/src/pythonVersion.ts: -------------------------------------------------------------------------------- 1 | export const pythonVersion = "3.10"; -------------------------------------------------------------------------------- /installers/nodejs-3.10/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "module": "commonjs", 5 | "target": "esnext", 6 | "noImplicitAny": true, 7 | "outDir": "./dist", 8 | "esModuleInterop": true, 9 | // skip error: Interface 'WebGL2RenderingContext' incorrectly extends interface 'WebGL2RenderingContextBase'. 10 | // https://github.com/tensorflow/tfjs/issues/4201 11 | "skipLibCheck": true, 12 | "sourceMap": true 13 | }, 14 | "include": [ 15 | "src/**/*" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /installers/nodejs-3.10/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "tsup"; 2 | 3 | export default defineConfig({ 4 | entry: ["src/index.ts"], 5 | format: ["cjs", "esm"], // Build for commonJS and ESmodules 6 | dts: true, // Generate declaration file (.d.ts) 7 | splitting: false, 8 | sourcemap: true, 9 | clean: true, 10 | }); 11 | -------------------------------------------------------------------------------- /installers/nodejs-3.11/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.tgz 4 | python-* -------------------------------------------------------------------------------- /installers/nodejs-3.11/README.md: -------------------------------------------------------------------------------- 1 | # portable-python 2 | This project provides self-contained (hence, "portable") Python distributions to a variety of target platforms and architectures. These Python distributions can be downloaded and extracted to anywhere on the filesystem, making installation trivially easy and configurable. 3 | 4 | ## Usage 5 | 6 | To get started, download archives from [GitHub releases](https://github.com/bjia56/portable-python/releases). Alternatively, use any of the following installers: 7 | - `npm i @bjia56/portable-python-3.8` 8 | - `npm i @bjia56/portable-python-3.9` 9 | - `npm i @bjia56/portable-python-3.10` 10 | - `npm i @bjia56/portable-python-3.11` 11 | - `npm i @bjia56/portable-python-3.12` 12 | 13 | For example, on Linux via bash: 14 | ``` 15 | $ wget -q https://github.com/bjia56/portable-python/releases/download/v3.9.17-build.4/python-3.9 16 | .17-linux-x86_64.zip 17 | $ unzip -qq python-3.9.17-linux-x86_64.zip 18 | $ ./python-3.9.17-linux-x86_64/bin/python --version 19 | Python 3.9.17 20 | ``` 21 | 22 | Or via the node installer: 23 | ``` 24 | $ npm i --silent @bjia56/portable-python-3.9 25 | $ ./node_modules/@bjia56/portable-python-3.9/python-3.9.17-linux-x86_64/bin/python --version 26 | Python 3.9.17 27 | ``` 28 | 29 | Or via node: 30 | ```js 31 | var pythonExe = require("@bjia56/portable-python-3.9"); 32 | var child_process = require("child_process"); 33 | console.log(child_process.execSync(`${pythonExe} --version`).toString()); 34 | ``` 35 | 36 | ## Available distributions 37 | 38 | Currently, Python 3.9, 3.10, 3.11, and 3.12 are built for the following targets: 39 | - Linux x86_64, i386, aarch64, arm [1](#f1), riscv64 40 | - Windows x86_64 41 | - MacOS x86_64, arm64 [2](#f2) 42 | 43 | Python 3.8 builds are available, but will no longer be actively updated. 44 | 45 | 1 The arm builds target armv6, specifically the configuration of the Raspberry Pi 1. Current arm builds do not work properly on old glibc, but a recent version of Raspbian like Debian bullseye should provide a new enough glibc to work. [↩](#a1) 46 | 47 | 2 MacOS distributions are provided as universal2, which will work on both x86_64 and arm64. [↩](#a2) 48 | 49 | Download stats: 📊 50 | 51 | ## Licensing 52 | 53 | The build scripts and code in this repository are available under the Apache-2.0 License. Note that compilation of Python involves linking against other libraries, some of which may include different licensing terms. Copies of the licenses from known dependencies are included under the `licenses` directory of each Python distribution. 54 | -------------------------------------------------------------------------------- /installers/nodejs-3.11/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bjia56/portable-python-3.11", 3 | "version": "0.1.11", 4 | "description": "Portable Python 3.11", 5 | "main": "./dist/index.js", 6 | "files": [ 7 | "dist" 8 | ], 9 | "scripts": { 10 | "build": "cp ../../README.md . && cd ../nodejs && npm run build && cd - && tsup", 11 | "prepublishOnly": "npm run build", 12 | "postinstall": "node ./dist/index.js" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/bjia56/portable-python.git" 17 | }, 18 | "keywords": [ 19 | "python" 20 | ], 21 | "author": "Brett Jia", 22 | "license": "Apache-2.0", 23 | "bugs": { 24 | "url": "https://github.com/bjia56/portable-python/issues" 25 | }, 26 | "homepage": "https://github.com/bjia56/portable-python", 27 | "dependencies": {}, 28 | "devDependencies": { 29 | "@bjia56/portable-python": "file:../nodejs", 30 | "@types/node": "^20.11.6", 31 | "ts-node": "^10.9.2", 32 | "tsup": "^8.0.1", 33 | "typescript": "^5.3.3" 34 | } 35 | } -------------------------------------------------------------------------------- /installers/nodejs-3.11/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import { PortablePython } from "@bjia56/portable-python"; 3 | import { pythonVersion } from "./pythonVersion"; 4 | if (require.main === module) { 5 | new PortablePython(pythonVersion, path.dirname(__dirname)).install(); 6 | } else { 7 | module.exports = new PortablePython(pythonVersion, path.dirname(__dirname)).executablePath; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /installers/nodejs-3.11/src/pythonVersion.ts: -------------------------------------------------------------------------------- 1 | export const pythonVersion = "3.11"; -------------------------------------------------------------------------------- /installers/nodejs-3.11/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "module": "commonjs", 5 | "target": "esnext", 6 | "noImplicitAny": true, 7 | "outDir": "./dist", 8 | "esModuleInterop": true, 9 | // skip error: Interface 'WebGL2RenderingContext' incorrectly extends interface 'WebGL2RenderingContextBase'. 10 | // https://github.com/tensorflow/tfjs/issues/4201 11 | "skipLibCheck": true, 12 | "sourceMap": true 13 | }, 14 | "include": [ 15 | "src/**/*" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /installers/nodejs-3.11/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "tsup"; 2 | 3 | export default defineConfig({ 4 | entry: ["src/index.ts"], 5 | format: ["cjs", "esm"], // Build for commonJS and ESmodules 6 | dts: true, // Generate declaration file (.d.ts) 7 | splitting: false, 8 | sourcemap: true, 9 | clean: true, 10 | }); 11 | -------------------------------------------------------------------------------- /installers/nodejs-3.12/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.tgz 4 | python-* -------------------------------------------------------------------------------- /installers/nodejs-3.12/README.md: -------------------------------------------------------------------------------- 1 | # portable-python 2 | This project provides self-contained (hence, "portable") Python distributions to a variety of target platforms and architectures. These Python distributions can be downloaded and extracted to anywhere on the filesystem, making installation trivially easy and configurable. 3 | 4 | ## Usage 5 | 6 | To get started, download archives from [GitHub releases](https://github.com/bjia56/portable-python/releases). Alternatively, use any of the following installers: 7 | - `npm i @bjia56/portable-python-3.8` 8 | - `npm i @bjia56/portable-python-3.9` 9 | - `npm i @bjia56/portable-python-3.10` 10 | - `npm i @bjia56/portable-python-3.11` 11 | - `npm i @bjia56/portable-python-3.12` 12 | 13 | For example, on Linux via bash: 14 | ``` 15 | $ wget -q https://github.com/bjia56/portable-python/releases/download/v3.9.17-build.4/python-3.9 16 | .17-linux-x86_64.zip 17 | $ unzip -qq python-3.9.17-linux-x86_64.zip 18 | $ ./python-3.9.17-linux-x86_64/bin/python --version 19 | Python 3.9.17 20 | ``` 21 | 22 | Or via the node installer: 23 | ``` 24 | $ npm i --silent @bjia56/portable-python-3.9 25 | $ ./node_modules/@bjia56/portable-python-3.9/python-3.9.17-linux-x86_64/bin/python --version 26 | Python 3.9.17 27 | ``` 28 | 29 | Or via node: 30 | ```js 31 | var pythonExe = require("@bjia56/portable-python-3.9"); 32 | var child_process = require("child_process"); 33 | console.log(child_process.execSync(`${pythonExe} --version`).toString()); 34 | ``` 35 | 36 | ## Available distributions 37 | 38 | Currently, Python 3.9, 3.10, 3.11, and 3.12 are built for the following targets: 39 | - Linux x86_64, i386, aarch64, arm [1](#f1), riscv64 40 | - Windows x86_64 41 | - MacOS x86_64, arm64 [2](#f2) 42 | 43 | Python 3.8 builds are available, but will no longer be actively updated. 44 | 45 | 1 The arm builds target armv6, specifically the configuration of the Raspberry Pi 1. Current arm builds do not work properly on old glibc, but a recent version of Raspbian like Debian bullseye should provide a new enough glibc to work. [↩](#a1) 46 | 47 | 2 MacOS distributions are provided as universal2, which will work on both x86_64 and arm64. [↩](#a2) 48 | 49 | Download stats: 📊 50 | 51 | ## Licensing 52 | 53 | The build scripts and code in this repository are available under the Apache-2.0 License. Note that compilation of Python involves linking against other libraries, some of which may include different licensing terms. Copies of the licenses from known dependencies are included under the `licenses` directory of each Python distribution. 54 | -------------------------------------------------------------------------------- /installers/nodejs-3.12/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bjia56/portable-python-3.12", 3 | "version": "0.1.10", 4 | "description": "Portable Python 3.12", 5 | "main": "./dist/index.js", 6 | "files": [ 7 | "dist" 8 | ], 9 | "scripts": { 10 | "build": "cp ../../README.md . && cd ../nodejs && npm run build && cd - && tsup", 11 | "prepublishOnly": "npm run build", 12 | "postinstall": "node ./dist/index.js" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/bjia56/portable-python.git" 17 | }, 18 | "keywords": [ 19 | "python" 20 | ], 21 | "author": "Brett Jia", 22 | "license": "Apache-2.0", 23 | "bugs": { 24 | "url": "https://github.com/bjia56/portable-python/issues" 25 | }, 26 | "homepage": "https://github.com/bjia56/portable-python", 27 | "dependencies": {}, 28 | "devDependencies": { 29 | "@bjia56/portable-python": "file:../nodejs", 30 | "@types/node": "^20.11.6", 31 | "ts-node": "^10.9.2", 32 | "tsup": "^8.0.1", 33 | "typescript": "^5.3.3" 34 | } 35 | } -------------------------------------------------------------------------------- /installers/nodejs-3.12/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import { PortablePython } from "@bjia56/portable-python"; 3 | import { pythonVersion } from "./pythonVersion"; 4 | if (require.main === module) { 5 | new PortablePython(pythonVersion, path.dirname(__dirname)).install(); 6 | } else { 7 | module.exports = new PortablePython(pythonVersion, path.dirname(__dirname)).executablePath; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /installers/nodejs-3.12/src/pythonVersion.ts: -------------------------------------------------------------------------------- 1 | export const pythonVersion = "3.12"; -------------------------------------------------------------------------------- /installers/nodejs-3.12/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "module": "commonjs", 5 | "target": "esnext", 6 | "noImplicitAny": true, 7 | "outDir": "./dist", 8 | "esModuleInterop": true, 9 | // skip error: Interface 'WebGL2RenderingContext' incorrectly extends interface 'WebGL2RenderingContextBase'. 10 | // https://github.com/tensorflow/tfjs/issues/4201 11 | "skipLibCheck": true, 12 | "sourceMap": true 13 | }, 14 | "include": [ 15 | "src/**/*" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /installers/nodejs-3.12/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "tsup"; 2 | 3 | export default defineConfig({ 4 | entry: ["src/index.ts"], 5 | format: ["cjs", "esm"], // Build for commonJS and ESmodules 6 | dts: true, // Generate declaration file (.d.ts) 7 | splitting: false, 8 | sourcemap: true, 9 | clean: true, 10 | }); 11 | -------------------------------------------------------------------------------- /installers/nodejs-3.8/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.tgz 4 | python-* -------------------------------------------------------------------------------- /installers/nodejs-3.8/README.md: -------------------------------------------------------------------------------- 1 | # portable-python 2 | This project provides self-contained (hence, "portable") Python distributions to a variety of target platforms and architectures. These Python distributions can be downloaded and extracted to anywhere on the filesystem, making installation trivially easy and configurable. 3 | 4 | ## Usage 5 | 6 | To get started, download archives from [GitHub releases](https://github.com/bjia56/portable-python/releases). Alternatively, use any of the following installers: 7 | - `npm i @bjia56/portable-python-3.8` 8 | - `npm i @bjia56/portable-python-3.9` 9 | - `npm i @bjia56/portable-python-3.10` 10 | 11 | For example, on Linux via bash: 12 | ``` 13 | $ wget -q https://github.com/bjia56/portable-python/releases/download/v3.9.17-build.4/python-3.9 14 | .17-linux-x86_64.zip 15 | $ unzip -qq python-3.9.17-linux-x86_64.zip 16 | $ ./python-3.9.17-linux-x86_64/bin/python --version 17 | Python 3.9.17 18 | ``` 19 | 20 | Or via the node installer: 21 | ``` 22 | $ npm i --silent @bjia56/portable-python-3.9 23 | $ ./node_modules/@bjia56/portable-python-3.9/python-3.9.17-linux-x86_64/bin/python --version 24 | Python 3.9.17 25 | ``` 26 | 27 | Or via node: 28 | ```js 29 | var pythonExe = require("@bjia56/portable-python-3.9"); 30 | var child_process = require("child_process"); 31 | console.log(child_process.execSync(`${pythonExe} --version`).toString()); 32 | ``` 33 | 34 | ## Available distributions 35 | 36 | Currently, Python 3.9, and 3.10 are built for the following targets: 37 | - Linux x86_64, i386, aarch64, arm [1](#f1), riscv64 38 | - Windows x86_64 39 | - MacOS x86_64, arm64 [2](#f2) 40 | 41 | Python 3.8 builds are available, but will no longer be actively updated. 42 | 43 | 1 The arm builds target armv6, specifically the configuration of the Raspberry Pi 1. Current arm builds do not work properly on old glibc, but a recent version of Raspbian like Debian bullseye should provide a new enough glibc to work. [↩](#a1) 44 | 45 | 2 MacOS distributions are provided as universal2, which will work on both x86_64 and arm64. [↩](#a2) 46 | 47 | Download stats: 📊 48 | 49 | ## Licensing 50 | 51 | The build scripts and code in this repository are available under the Apache-2.0 License. Note that compilation of Python involves linking against other libraries, some of which may include different licensing terms. Copies of the licenses from known dependencies are included under the `licenses` directory of each Python distribution. 52 | -------------------------------------------------------------------------------- /installers/nodejs-3.8/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bjia56/portable-python-3.8", 3 | "version": "0.1.3", 4 | "description": "Portable Python 3.8", 5 | "main": "./dist/index.js", 6 | "files": [ 7 | "dist" 8 | ], 9 | "scripts": { 10 | "build": "cp ../../README.md . && cd ../nodejs && npm run build && cd - && tsup", 11 | "prepublishOnly": "npm run build", 12 | "postinstall": "node ./dist/index.js" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/bjia56/portable-python.git" 17 | }, 18 | "keywords": [ 19 | "python" 20 | ], 21 | "author": "Brett Jia", 22 | "license": "Apache-2.0", 23 | "bugs": { 24 | "url": "https://github.com/bjia56/portable-python/issues" 25 | }, 26 | "homepage": "https://github.com/bjia56/portable-python", 27 | "dependencies": { 28 | }, 29 | "devDependencies": { 30 | "@bjia56/portable-python": "file:../nodejs", 31 | "@types/node": "^20.11.6", 32 | "ts-node": "^10.9.2", 33 | "tsup": "^8.0.1", 34 | "typescript": "^5.3.3" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /installers/nodejs-3.8/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import { PortablePython } from "@bjia56/portable-python"; 3 | import { pythonVersion } from "./pythonVersion"; 4 | if (require.main === module) { 5 | new PortablePython(pythonVersion, path.dirname(__dirname)).install(); 6 | } else { 7 | module.exports = new PortablePython(pythonVersion, path.dirname(__dirname)).executablePath; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /installers/nodejs-3.8/src/pythonVersion.ts: -------------------------------------------------------------------------------- 1 | export const pythonVersion = "3.8"; -------------------------------------------------------------------------------- /installers/nodejs-3.8/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "module": "commonjs", 5 | "target": "esnext", 6 | "noImplicitAny": true, 7 | "outDir": "./dist", 8 | "esModuleInterop": true, 9 | // skip error: Interface 'WebGL2RenderingContext' incorrectly extends interface 'WebGL2RenderingContextBase'. 10 | // https://github.com/tensorflow/tfjs/issues/4201 11 | "skipLibCheck": true, 12 | "sourceMap": true 13 | }, 14 | "include": [ 15 | "src/**/*" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /installers/nodejs-3.8/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "tsup"; 2 | 3 | export default defineConfig({ 4 | entry: ["src/index.ts"], 5 | format: ["cjs", "esm"], // Build for commonJS and ESmodules 6 | dts: true, // Generate declaration file (.d.ts) 7 | splitting: false, 8 | sourcemap: true, 9 | clean: true, 10 | }); 11 | -------------------------------------------------------------------------------- /installers/nodejs-3.9/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.tgz 4 | python-* -------------------------------------------------------------------------------- /installers/nodejs-3.9/README.md: -------------------------------------------------------------------------------- 1 | # portable-python 2 | This project provides self-contained (hence, "portable") Python distributions to a variety of target platforms and architectures. These Python distributions can be downloaded and extracted to anywhere on the filesystem, making installation trivially easy and configurable. 3 | 4 | ## Usage 5 | 6 | To get started, download archives from [GitHub releases](https://github.com/bjia56/portable-python/releases). Alternatively, use any of the following installers: 7 | - `npm i @bjia56/portable-python-3.8` 8 | - `npm i @bjia56/portable-python-3.9` 9 | - `npm i @bjia56/portable-python-3.10` 10 | - `npm i @bjia56/portable-python-3.11` 11 | - `npm i @bjia56/portable-python-3.12` 12 | 13 | For example, on Linux via bash: 14 | ``` 15 | $ wget -q https://github.com/bjia56/portable-python/releases/download/v3.9.17-build.4/python-3.9 16 | .17-linux-x86_64.zip 17 | $ unzip -qq python-3.9.17-linux-x86_64.zip 18 | $ ./python-3.9.17-linux-x86_64/bin/python --version 19 | Python 3.9.17 20 | ``` 21 | 22 | Or via the node installer: 23 | ``` 24 | $ npm i --silent @bjia56/portable-python-3.9 25 | $ ./node_modules/@bjia56/portable-python-3.9/python-3.9.17-linux-x86_64/bin/python --version 26 | Python 3.9.17 27 | ``` 28 | 29 | Or via node: 30 | ```js 31 | var pythonExe = require("@bjia56/portable-python-3.9"); 32 | var child_process = require("child_process"); 33 | console.log(child_process.execSync(`${pythonExe} --version`).toString()); 34 | ``` 35 | 36 | ## Available distributions 37 | 38 | Currently, Python 3.9, 3.10, 3.11, and 3.12 are built for the following targets: 39 | - Linux x86_64, i386, aarch64, arm [1](#f1), riscv64 40 | - Windows x86_64 41 | - MacOS x86_64, arm64 [2](#f2) 42 | 43 | Python 3.8 builds are available, but will no longer be actively updated. 44 | 45 | 1 The arm builds target armv6, specifically the configuration of the Raspberry Pi 1. Current arm builds do not work properly on old glibc, but a recent version of Raspbian like Debian bullseye should provide a new enough glibc to work. [↩](#a1) 46 | 47 | 2 MacOS distributions are provided as universal2, which will work on both x86_64 and arm64. [↩](#a2) 48 | 49 | Download stats: 📊 50 | 51 | ## Licensing 52 | 53 | The build scripts and code in this repository are available under the Apache-2.0 License. Note that compilation of Python involves linking against other libraries, some of which may include different licensing terms. Copies of the licenses from known dependencies are included under the `licenses` directory of each Python distribution. 54 | -------------------------------------------------------------------------------- /installers/nodejs-3.9/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bjia56/portable-python-3.9", 3 | "version": "0.1.20", 4 | "description": "Portable Python 3.9", 5 | "main": "./dist/index.js", 6 | "files": [ 7 | "dist" 8 | ], 9 | "scripts": { 10 | "build": "cp ../../README.md . && cd ../nodejs && npm run build && cd - && tsup", 11 | "prepublishOnly": "npm run build", 12 | "postinstall": "node ./dist/index.js" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/bjia56/portable-python.git" 17 | }, 18 | "keywords": [ 19 | "python" 20 | ], 21 | "author": "Brett Jia", 22 | "license": "Apache-2.0", 23 | "bugs": { 24 | "url": "https://github.com/bjia56/portable-python/issues" 25 | }, 26 | "homepage": "https://github.com/bjia56/portable-python", 27 | "dependencies": {}, 28 | "devDependencies": { 29 | "@bjia56/portable-python": "file:../nodejs", 30 | "@types/node": "^20.11.6", 31 | "ts-node": "^10.9.2", 32 | "tsup": "^8.0.1", 33 | "typescript": "^5.3.3" 34 | } 35 | } -------------------------------------------------------------------------------- /installers/nodejs-3.9/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import { PortablePython } from "@bjia56/portable-python"; 3 | import { pythonVersion } from "./pythonVersion"; 4 | if (require.main === module) { 5 | new PortablePython(pythonVersion, path.dirname(__dirname)).install(); 6 | } else { 7 | module.exports = new PortablePython(pythonVersion, path.dirname(__dirname)).executablePath; 8 | } 9 | -------------------------------------------------------------------------------- /installers/nodejs-3.9/src/pythonVersion.ts: -------------------------------------------------------------------------------- 1 | export const pythonVersion = "3.9"; -------------------------------------------------------------------------------- /installers/nodejs-3.9/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "module": "commonjs", 5 | "target": "esnext", 6 | "noImplicitAny": true, 7 | "outDir": "./dist", 8 | "esModuleInterop": true, 9 | // skip error: Interface 'WebGL2RenderingContext' incorrectly extends interface 'WebGL2RenderingContextBase'. 10 | // https://github.com/tensorflow/tfjs/issues/4201 11 | "skipLibCheck": true, 12 | "sourceMap": true 13 | }, 14 | "include": [ 15 | "src/**/*" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /installers/nodejs-3.9/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "tsup"; 2 | 3 | export default defineConfig({ 4 | entry: ["src/index.ts"], 5 | format: ["cjs", "esm"], // Build for commonJS and ESmodules 6 | dts: true, // Generate declaration file (.d.ts) 7 | splitting: false, 8 | sourcemap: true, 9 | clean: true, 10 | }); 11 | -------------------------------------------------------------------------------- /installers/nodejs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.tgz -------------------------------------------------------------------------------- /installers/nodejs/README.md: -------------------------------------------------------------------------------- 1 | # portable-python 2 | This project provides self-contained (hence, "portable") Python distributions to a variety of target platforms and architectures. These Python distributions can be downloaded and extracted to anywhere on the filesystem, making installation trivially easy and configurable. 3 | 4 | ## Usage 5 | 6 | To get started, download archives from [GitHub releases](https://github.com/bjia56/portable-python/releases). Alternatively, use any of the following installers: 7 | - `npm i @bjia56/portable-python-3.8` 8 | - `npm i @bjia56/portable-python-3.9` 9 | - `npm i @bjia56/portable-python-3.10` 10 | - `npm i @bjia56/portable-python-3.11` 11 | - `npm i @bjia56/portable-python-3.12` 12 | 13 | For example, on Linux via bash: 14 | ``` 15 | $ wget -q https://github.com/bjia56/portable-python/releases/download/v3.9.17-build.4/python-3.9 16 | .17-linux-x86_64.zip 17 | $ unzip -qq python-3.9.17-linux-x86_64.zip 18 | $ ./python-3.9.17-linux-x86_64/bin/python --version 19 | Python 3.9.17 20 | ``` 21 | 22 | Or via the node installer: 23 | ``` 24 | $ npm i --silent @bjia56/portable-python-3.9 25 | $ ./node_modules/@bjia56/portable-python-3.9/python-3.9.17-linux-x86_64/bin/python --version 26 | Python 3.9.17 27 | ``` 28 | 29 | Or via node: 30 | ```js 31 | var pythonExe = require("@bjia56/portable-python-3.9"); 32 | var child_process = require("child_process"); 33 | console.log(child_process.execSync(`${pythonExe} --version`).toString()); 34 | ``` 35 | 36 | ## Available distributions 37 | 38 | Currently, Python 3.9, 3.10, 3.11, and 3.12 are built for the following targets: 39 | - Linux x86_64, i386, aarch64, arm [1](#f1), riscv64 40 | - Windows x86_64 41 | - MacOS x86_64, arm64 [2](#f2) 42 | 43 | Python 3.8 builds are available, but will no longer be actively updated. 44 | 45 | 1 The arm builds target armv6, specifically the configuration of the Raspberry Pi 1. Current arm builds do not work properly on old glibc, but a recent version of Raspbian like Debian bullseye should provide a new enough glibc to work. [↩](#a1) 46 | 47 | 2 MacOS distributions are provided as universal2, which will work on both x86_64 and arm64. [↩](#a2) 48 | 49 | Download stats: 📊 50 | 51 | ## Licensing 52 | 53 | The build scripts and code in this repository are available under the Apache-2.0 License. Note that compilation of Python involves linking against other libraries, some of which may include different licensing terms. Copies of the licenses from known dependencies are included under the `licenses` directory of each Python distribution. 54 | -------------------------------------------------------------------------------- /installers/nodejs/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bjia56/portable-python", 3 | "version": "0.1.52", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "@bjia56/portable-python", 9 | "version": "0.1.52", 10 | "license": "Apache-2.0", 11 | "dependencies": { 12 | "adm-zip": "^0.5.10" 13 | }, 14 | "devDependencies": { 15 | "@types/adm-zip": "^0.5.5", 16 | "rimraf": "^5.0.5", 17 | "ts-node": "^10.9.1", 18 | "typescript": "^5.3.2" 19 | } 20 | }, 21 | "node_modules/@cspotcode/source-map-support": { 22 | "version": "0.8.1", 23 | "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", 24 | "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", 25 | "dev": true, 26 | "dependencies": { 27 | "@jridgewell/trace-mapping": "0.3.9" 28 | }, 29 | "engines": { 30 | "node": ">=12" 31 | } 32 | }, 33 | "node_modules/@isaacs/cliui": { 34 | "version": "8.0.2", 35 | "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", 36 | "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", 37 | "dev": true, 38 | "dependencies": { 39 | "string-width": "^5.1.2", 40 | "string-width-cjs": "npm:string-width@^4.2.0", 41 | "strip-ansi": "^7.0.1", 42 | "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", 43 | "wrap-ansi": "^8.1.0", 44 | "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" 45 | }, 46 | "engines": { 47 | "node": ">=12" 48 | } 49 | }, 50 | "node_modules/@jridgewell/resolve-uri": { 51 | "version": "3.1.1", 52 | "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", 53 | "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", 54 | "dev": true, 55 | "engines": { 56 | "node": ">=6.0.0" 57 | } 58 | }, 59 | "node_modules/@jridgewell/sourcemap-codec": { 60 | "version": "1.4.15", 61 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", 62 | "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", 63 | "dev": true 64 | }, 65 | "node_modules/@jridgewell/trace-mapping": { 66 | "version": "0.3.9", 67 | "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", 68 | "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", 69 | "dev": true, 70 | "dependencies": { 71 | "@jridgewell/resolve-uri": "^3.0.3", 72 | "@jridgewell/sourcemap-codec": "^1.4.10" 73 | } 74 | }, 75 | "node_modules/@pkgjs/parseargs": { 76 | "version": "0.11.0", 77 | "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", 78 | "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", 79 | "dev": true, 80 | "optional": true, 81 | "engines": { 82 | "node": ">=14" 83 | } 84 | }, 85 | "node_modules/@tsconfig/node10": { 86 | "version": "1.0.9", 87 | "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", 88 | "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", 89 | "dev": true 90 | }, 91 | "node_modules/@tsconfig/node12": { 92 | "version": "1.0.11", 93 | "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", 94 | "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", 95 | "dev": true 96 | }, 97 | "node_modules/@tsconfig/node14": { 98 | "version": "1.0.3", 99 | "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", 100 | "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", 101 | "dev": true 102 | }, 103 | "node_modules/@tsconfig/node16": { 104 | "version": "1.0.4", 105 | "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", 106 | "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", 107 | "dev": true 108 | }, 109 | "node_modules/@types/adm-zip": { 110 | "version": "0.5.5", 111 | "resolved": "https://registry.npmjs.org/@types/adm-zip/-/adm-zip-0.5.5.tgz", 112 | "integrity": "sha512-YCGstVMjc4LTY5uK9/obvxBya93axZOVOyf2GSUulADzmLhYE45u2nAssCs/fWBs1Ifq5Vat75JTPwd5XZoPJw==", 113 | "dev": true, 114 | "dependencies": { 115 | "@types/node": "*" 116 | } 117 | }, 118 | "node_modules/@types/node": { 119 | "version": "20.10.0", 120 | "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.0.tgz", 121 | "integrity": "sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ==", 122 | "dev": true, 123 | "dependencies": { 124 | "undici-types": "~5.26.4" 125 | } 126 | }, 127 | "node_modules/acorn": { 128 | "version": "8.11.2", 129 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", 130 | "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", 131 | "dev": true, 132 | "bin": { 133 | "acorn": "bin/acorn" 134 | }, 135 | "engines": { 136 | "node": ">=0.4.0" 137 | } 138 | }, 139 | "node_modules/acorn-walk": { 140 | "version": "8.3.0", 141 | "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.0.tgz", 142 | "integrity": "sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==", 143 | "dev": true, 144 | "engines": { 145 | "node": ">=0.4.0" 146 | } 147 | }, 148 | "node_modules/adm-zip": { 149 | "version": "0.5.10", 150 | "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz", 151 | "integrity": "sha512-x0HvcHqVJNTPk/Bw8JbLWlWoo6Wwnsug0fnYYro1HBrjxZ3G7/AZk7Ahv8JwDe1uIcz8eBqvu86FuF1POiG7vQ==", 152 | "engines": { 153 | "node": ">=6.0" 154 | } 155 | }, 156 | "node_modules/ansi-regex": { 157 | "version": "6.0.1", 158 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", 159 | "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", 160 | "dev": true, 161 | "engines": { 162 | "node": ">=12" 163 | }, 164 | "funding": { 165 | "url": "https://github.com/chalk/ansi-regex?sponsor=1" 166 | } 167 | }, 168 | "node_modules/ansi-styles": { 169 | "version": "6.2.1", 170 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", 171 | "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", 172 | "dev": true, 173 | "engines": { 174 | "node": ">=12" 175 | }, 176 | "funding": { 177 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 178 | } 179 | }, 180 | "node_modules/arg": { 181 | "version": "4.1.3", 182 | "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", 183 | "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", 184 | "dev": true 185 | }, 186 | "node_modules/balanced-match": { 187 | "version": "1.0.2", 188 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 189 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 190 | "dev": true 191 | }, 192 | "node_modules/brace-expansion": { 193 | "version": "2.0.1", 194 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", 195 | "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", 196 | "dev": true, 197 | "dependencies": { 198 | "balanced-match": "^1.0.0" 199 | } 200 | }, 201 | "node_modules/color-convert": { 202 | "version": "2.0.1", 203 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 204 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 205 | "dev": true, 206 | "dependencies": { 207 | "color-name": "~1.1.4" 208 | }, 209 | "engines": { 210 | "node": ">=7.0.0" 211 | } 212 | }, 213 | "node_modules/color-name": { 214 | "version": "1.1.4", 215 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 216 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 217 | "dev": true 218 | }, 219 | "node_modules/create-require": { 220 | "version": "1.1.1", 221 | "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", 222 | "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", 223 | "dev": true 224 | }, 225 | "node_modules/cross-spawn": { 226 | "version": "7.0.3", 227 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", 228 | "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", 229 | "dev": true, 230 | "dependencies": { 231 | "path-key": "^3.1.0", 232 | "shebang-command": "^2.0.0", 233 | "which": "^2.0.1" 234 | }, 235 | "engines": { 236 | "node": ">= 8" 237 | } 238 | }, 239 | "node_modules/diff": { 240 | "version": "4.0.2", 241 | "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", 242 | "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", 243 | "dev": true, 244 | "engines": { 245 | "node": ">=0.3.1" 246 | } 247 | }, 248 | "node_modules/eastasianwidth": { 249 | "version": "0.2.0", 250 | "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", 251 | "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", 252 | "dev": true 253 | }, 254 | "node_modules/emoji-regex": { 255 | "version": "9.2.2", 256 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", 257 | "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", 258 | "dev": true 259 | }, 260 | "node_modules/foreground-child": { 261 | "version": "3.1.1", 262 | "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", 263 | "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", 264 | "dev": true, 265 | "dependencies": { 266 | "cross-spawn": "^7.0.0", 267 | "signal-exit": "^4.0.1" 268 | }, 269 | "engines": { 270 | "node": ">=14" 271 | }, 272 | "funding": { 273 | "url": "https://github.com/sponsors/isaacs" 274 | } 275 | }, 276 | "node_modules/glob": { 277 | "version": "10.3.10", 278 | "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", 279 | "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", 280 | "dev": true, 281 | "dependencies": { 282 | "foreground-child": "^3.1.0", 283 | "jackspeak": "^2.3.5", 284 | "minimatch": "^9.0.1", 285 | "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", 286 | "path-scurry": "^1.10.1" 287 | }, 288 | "bin": { 289 | "glob": "dist/esm/bin.mjs" 290 | }, 291 | "engines": { 292 | "node": ">=16 || 14 >=14.17" 293 | }, 294 | "funding": { 295 | "url": "https://github.com/sponsors/isaacs" 296 | } 297 | }, 298 | "node_modules/is-fullwidth-code-point": { 299 | "version": "3.0.0", 300 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 301 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", 302 | "dev": true, 303 | "engines": { 304 | "node": ">=8" 305 | } 306 | }, 307 | "node_modules/isexe": { 308 | "version": "2.0.0", 309 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 310 | "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", 311 | "dev": true 312 | }, 313 | "node_modules/jackspeak": { 314 | "version": "2.3.6", 315 | "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", 316 | "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", 317 | "dev": true, 318 | "dependencies": { 319 | "@isaacs/cliui": "^8.0.2" 320 | }, 321 | "engines": { 322 | "node": ">=14" 323 | }, 324 | "funding": { 325 | "url": "https://github.com/sponsors/isaacs" 326 | }, 327 | "optionalDependencies": { 328 | "@pkgjs/parseargs": "^0.11.0" 329 | } 330 | }, 331 | "node_modules/lru-cache": { 332 | "version": "10.2.0", 333 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", 334 | "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", 335 | "dev": true, 336 | "engines": { 337 | "node": "14 || >=16.14" 338 | } 339 | }, 340 | "node_modules/make-error": { 341 | "version": "1.3.6", 342 | "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", 343 | "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", 344 | "dev": true 345 | }, 346 | "node_modules/minimatch": { 347 | "version": "9.0.3", 348 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", 349 | "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", 350 | "dev": true, 351 | "dependencies": { 352 | "brace-expansion": "^2.0.1" 353 | }, 354 | "engines": { 355 | "node": ">=16 || 14 >=14.17" 356 | }, 357 | "funding": { 358 | "url": "https://github.com/sponsors/isaacs" 359 | } 360 | }, 361 | "node_modules/minipass": { 362 | "version": "7.0.4", 363 | "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", 364 | "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", 365 | "dev": true, 366 | "engines": { 367 | "node": ">=16 || 14 >=14.17" 368 | } 369 | }, 370 | "node_modules/path-key": { 371 | "version": "3.1.1", 372 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 373 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 374 | "dev": true, 375 | "engines": { 376 | "node": ">=8" 377 | } 378 | }, 379 | "node_modules/path-scurry": { 380 | "version": "1.10.1", 381 | "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", 382 | "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", 383 | "dev": true, 384 | "dependencies": { 385 | "lru-cache": "^9.1.1 || ^10.0.0", 386 | "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" 387 | }, 388 | "engines": { 389 | "node": ">=16 || 14 >=14.17" 390 | }, 391 | "funding": { 392 | "url": "https://github.com/sponsors/isaacs" 393 | } 394 | }, 395 | "node_modules/rimraf": { 396 | "version": "5.0.5", 397 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz", 398 | "integrity": "sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==", 399 | "dev": true, 400 | "dependencies": { 401 | "glob": "^10.3.7" 402 | }, 403 | "bin": { 404 | "rimraf": "dist/esm/bin.mjs" 405 | }, 406 | "engines": { 407 | "node": ">=14" 408 | }, 409 | "funding": { 410 | "url": "https://github.com/sponsors/isaacs" 411 | } 412 | }, 413 | "node_modules/shebang-command": { 414 | "version": "2.0.0", 415 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 416 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 417 | "dev": true, 418 | "dependencies": { 419 | "shebang-regex": "^3.0.0" 420 | }, 421 | "engines": { 422 | "node": ">=8" 423 | } 424 | }, 425 | "node_modules/shebang-regex": { 426 | "version": "3.0.0", 427 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 428 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 429 | "dev": true, 430 | "engines": { 431 | "node": ">=8" 432 | } 433 | }, 434 | "node_modules/signal-exit": { 435 | "version": "4.1.0", 436 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", 437 | "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", 438 | "dev": true, 439 | "engines": { 440 | "node": ">=14" 441 | }, 442 | "funding": { 443 | "url": "https://github.com/sponsors/isaacs" 444 | } 445 | }, 446 | "node_modules/string-width": { 447 | "version": "5.1.2", 448 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", 449 | "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", 450 | "dev": true, 451 | "dependencies": { 452 | "eastasianwidth": "^0.2.0", 453 | "emoji-regex": "^9.2.2", 454 | "strip-ansi": "^7.0.1" 455 | }, 456 | "engines": { 457 | "node": ">=12" 458 | }, 459 | "funding": { 460 | "url": "https://github.com/sponsors/sindresorhus" 461 | } 462 | }, 463 | "node_modules/string-width-cjs": { 464 | "name": "string-width", 465 | "version": "4.2.3", 466 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 467 | "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 468 | "dev": true, 469 | "dependencies": { 470 | "emoji-regex": "^8.0.0", 471 | "is-fullwidth-code-point": "^3.0.0", 472 | "strip-ansi": "^6.0.1" 473 | }, 474 | "engines": { 475 | "node": ">=8" 476 | } 477 | }, 478 | "node_modules/string-width-cjs/node_modules/ansi-regex": { 479 | "version": "5.0.1", 480 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 481 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 482 | "dev": true, 483 | "engines": { 484 | "node": ">=8" 485 | } 486 | }, 487 | "node_modules/string-width-cjs/node_modules/emoji-regex": { 488 | "version": "8.0.0", 489 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 490 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", 491 | "dev": true 492 | }, 493 | "node_modules/string-width-cjs/node_modules/strip-ansi": { 494 | "version": "6.0.1", 495 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 496 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 497 | "dev": true, 498 | "dependencies": { 499 | "ansi-regex": "^5.0.1" 500 | }, 501 | "engines": { 502 | "node": ">=8" 503 | } 504 | }, 505 | "node_modules/strip-ansi": { 506 | "version": "7.1.0", 507 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", 508 | "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", 509 | "dev": true, 510 | "dependencies": { 511 | "ansi-regex": "^6.0.1" 512 | }, 513 | "engines": { 514 | "node": ">=12" 515 | }, 516 | "funding": { 517 | "url": "https://github.com/chalk/strip-ansi?sponsor=1" 518 | } 519 | }, 520 | "node_modules/strip-ansi-cjs": { 521 | "name": "strip-ansi", 522 | "version": "6.0.1", 523 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 524 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 525 | "dev": true, 526 | "dependencies": { 527 | "ansi-regex": "^5.0.1" 528 | }, 529 | "engines": { 530 | "node": ">=8" 531 | } 532 | }, 533 | "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { 534 | "version": "5.0.1", 535 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 536 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 537 | "dev": true, 538 | "engines": { 539 | "node": ">=8" 540 | } 541 | }, 542 | "node_modules/ts-node": { 543 | "version": "10.9.1", 544 | "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", 545 | "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", 546 | "dev": true, 547 | "dependencies": { 548 | "@cspotcode/source-map-support": "^0.8.0", 549 | "@tsconfig/node10": "^1.0.7", 550 | "@tsconfig/node12": "^1.0.7", 551 | "@tsconfig/node14": "^1.0.0", 552 | "@tsconfig/node16": "^1.0.2", 553 | "acorn": "^8.4.1", 554 | "acorn-walk": "^8.1.1", 555 | "arg": "^4.1.0", 556 | "create-require": "^1.1.0", 557 | "diff": "^4.0.1", 558 | "make-error": "^1.1.1", 559 | "v8-compile-cache-lib": "^3.0.1", 560 | "yn": "3.1.1" 561 | }, 562 | "bin": { 563 | "ts-node": "dist/bin.js", 564 | "ts-node-cwd": "dist/bin-cwd.js", 565 | "ts-node-esm": "dist/bin-esm.js", 566 | "ts-node-script": "dist/bin-script.js", 567 | "ts-node-transpile-only": "dist/bin-transpile.js", 568 | "ts-script": "dist/bin-script-deprecated.js" 569 | }, 570 | "peerDependencies": { 571 | "@swc/core": ">=1.2.50", 572 | "@swc/wasm": ">=1.2.50", 573 | "@types/node": "*", 574 | "typescript": ">=2.7" 575 | }, 576 | "peerDependenciesMeta": { 577 | "@swc/core": { 578 | "optional": true 579 | }, 580 | "@swc/wasm": { 581 | "optional": true 582 | } 583 | } 584 | }, 585 | "node_modules/typescript": { 586 | "version": "5.3.2", 587 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", 588 | "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", 589 | "dev": true, 590 | "bin": { 591 | "tsc": "bin/tsc", 592 | "tsserver": "bin/tsserver" 593 | }, 594 | "engines": { 595 | "node": ">=14.17" 596 | } 597 | }, 598 | "node_modules/undici-types": { 599 | "version": "5.26.5", 600 | "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", 601 | "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", 602 | "dev": true 603 | }, 604 | "node_modules/v8-compile-cache-lib": { 605 | "version": "3.0.1", 606 | "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", 607 | "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", 608 | "dev": true 609 | }, 610 | "node_modules/which": { 611 | "version": "2.0.2", 612 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 613 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 614 | "dev": true, 615 | "dependencies": { 616 | "isexe": "^2.0.0" 617 | }, 618 | "bin": { 619 | "node-which": "bin/node-which" 620 | }, 621 | "engines": { 622 | "node": ">= 8" 623 | } 624 | }, 625 | "node_modules/wrap-ansi": { 626 | "version": "8.1.0", 627 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", 628 | "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", 629 | "dev": true, 630 | "dependencies": { 631 | "ansi-styles": "^6.1.0", 632 | "string-width": "^5.0.1", 633 | "strip-ansi": "^7.0.1" 634 | }, 635 | "engines": { 636 | "node": ">=12" 637 | }, 638 | "funding": { 639 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 640 | } 641 | }, 642 | "node_modules/wrap-ansi-cjs": { 643 | "name": "wrap-ansi", 644 | "version": "7.0.0", 645 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", 646 | "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", 647 | "dev": true, 648 | "dependencies": { 649 | "ansi-styles": "^4.0.0", 650 | "string-width": "^4.1.0", 651 | "strip-ansi": "^6.0.0" 652 | }, 653 | "engines": { 654 | "node": ">=10" 655 | }, 656 | "funding": { 657 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 658 | } 659 | }, 660 | "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { 661 | "version": "5.0.1", 662 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 663 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 664 | "dev": true, 665 | "engines": { 666 | "node": ">=8" 667 | } 668 | }, 669 | "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { 670 | "version": "4.3.0", 671 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 672 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 673 | "dev": true, 674 | "dependencies": { 675 | "color-convert": "^2.0.1" 676 | }, 677 | "engines": { 678 | "node": ">=8" 679 | }, 680 | "funding": { 681 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 682 | } 683 | }, 684 | "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { 685 | "version": "8.0.0", 686 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 687 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", 688 | "dev": true 689 | }, 690 | "node_modules/wrap-ansi-cjs/node_modules/string-width": { 691 | "version": "4.2.3", 692 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 693 | "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 694 | "dev": true, 695 | "dependencies": { 696 | "emoji-regex": "^8.0.0", 697 | "is-fullwidth-code-point": "^3.0.0", 698 | "strip-ansi": "^6.0.1" 699 | }, 700 | "engines": { 701 | "node": ">=8" 702 | } 703 | }, 704 | "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { 705 | "version": "6.0.1", 706 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 707 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 708 | "dev": true, 709 | "dependencies": { 710 | "ansi-regex": "^5.0.1" 711 | }, 712 | "engines": { 713 | "node": ">=8" 714 | } 715 | }, 716 | "node_modules/yn": { 717 | "version": "3.1.1", 718 | "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", 719 | "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", 720 | "dev": true, 721 | "engines": { 722 | "node": ">=6" 723 | } 724 | } 725 | } 726 | } 727 | -------------------------------------------------------------------------------- /installers/nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bjia56/portable-python", 3 | "version": "0.1.52", 4 | "description": "Portable Python", 5 | "main": "./dist/index.js", 6 | "module": "./dist/index.mjs", 7 | "types": "./dist/index.d.ts", 8 | "files": [ 9 | "dist" 10 | ], 11 | "scripts": { 12 | "prebuild": "rimraf README.md && rimraf dist", 13 | "build": "cp ../../README.md . && tsc --outDir dist", 14 | "prepublishOnly": "npm run build", 15 | "test": "echo \"Error: no test specified\" && exit 1" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git+https://github.com/bjia56/portable-python.git" 20 | }, 21 | "keywords": [ 22 | "python" 23 | ], 24 | "author": "Brett Jia", 25 | "license": "Apache-2.0", 26 | "bugs": { 27 | "url": "https://github.com/bjia56/portable-python/issues" 28 | }, 29 | "homepage": "https://github.com/bjia56/portable-python", 30 | "dependencies": { 31 | "adm-zip": "^0.5.10" 32 | }, 33 | "devDependencies": { 34 | "@types/adm-zip": "^0.5.5", 35 | "rimraf": "^5.0.5", 36 | "ts-node": "^10.9.1", 37 | "typescript": "^5.3.2" 38 | }, 39 | "portablePython": { 40 | "versions": [ 41 | "3.12.4", 42 | "3.12.3", 43 | "3.12.2", 44 | "3.11.9", 45 | "3.11.8", 46 | "3.10.14", 47 | "3.10.13", 48 | "3.9.19", 49 | "3.9.18", 50 | "3.9.17", 51 | "3.8.18", 52 | "3.8.17" 53 | ], 54 | "versionBuilds": { 55 | "3.10.13": "v3.10.13-build.6", 56 | "3.9.18": "v3.9.18-build.2", 57 | "3.9.17": "v3.9.17-build.4", 58 | "3.8.18": "v3.8.18-build.0", 59 | "3.8.17": "v3.8.17-build.3", 60 | "3.11.8": "v3.11.8-build.4", 61 | "3.12.2": "v3.12.2-build.3", 62 | "3.9.19": "v3.9.19-build.4", 63 | "3.10.14": "v3.10.14-build.4", 64 | "3.11.9": "v3.11.9-build.3", 65 | "3.12.3": "v3.12.3-build.3", 66 | "3.12.4": "v3.12.4-build.0" 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /installers/nodejs/src/index.ts: -------------------------------------------------------------------------------- 1 | import { createWriteStream, existsSync, rm, rmSync, mkdirSync, chmodSync, symlinkSync, renameSync } from "fs"; 2 | import { join, dirname } from "path"; 3 | import { platform, arch, release } from "os"; 4 | import { Readable } from 'stream'; 5 | import { finished } from 'stream/promises'; 6 | import { ReadableStream } from 'stream/web'; 7 | import AdmZip from "adm-zip"; 8 | 9 | const packageJson = require("../package.json"); 10 | 11 | const DL_PLATFORM = (() => { 12 | if (platform() == "win32") { 13 | return "windows"; 14 | } 15 | if (platform() == "freebsd") { 16 | const releaseName = release(); 17 | const releaseMajor = parseInt(releaseName.split(".")[0]); 18 | return `freebsd${releaseMajor}`; 19 | } 20 | return platform(); 21 | })(); 22 | 23 | const DL_ARCH = (() => { 24 | if (DL_PLATFORM == "darwin") { 25 | return "universal2"; 26 | } 27 | 28 | switch (arch()) { 29 | case "ia32": 30 | return "i386"; 31 | case "x64": 32 | return "x86_64"; 33 | case "arm64": 34 | return "aarch64"; 35 | } 36 | 37 | return arch(); 38 | })(); 39 | 40 | const VERSIONS = packageJson.portablePython.versions; 41 | const VERSION_BUILDS = packageJson.portablePython.versionBuilds; 42 | 43 | function pickVersion(version: string) { 44 | for (let i = 0; i < VERSIONS.length; ++i) { 45 | // TODO: This doesn't handle semver correctly, e.g. 3.8.17 will match 3.8.1 46 | if (VERSIONS[i].startsWith(version)) { 47 | return VERSIONS[i]; 48 | } 49 | } 50 | return null; 51 | } 52 | 53 | async function download(url: string, dest: string) { 54 | const res = await fetch(url); 55 | const file = createWriteStream(dest); 56 | await finished(Readable.fromWeb(res.body as ReadableStream).pipe(file)); 57 | } 58 | 59 | export class PortablePython { 60 | _version: string 61 | installDir = dirname(__dirname); 62 | 63 | constructor(version: string, installDir: string | null = null) { 64 | if (!version) { 65 | throw Error("version must not be empty"); 66 | } 67 | 68 | if (installDir) { 69 | this.installDir = installDir; 70 | } 71 | 72 | this._version = pickVersion(version); 73 | if (!this._version) { 74 | throw Error(`unknown version: ${version}`); 75 | } 76 | if (!this.releaseTag) { 77 | throw Error("no releases available for this version"); 78 | } 79 | } 80 | 81 | /** 82 | * Contains the path to the Python executable. 83 | */ 84 | get executablePath() { 85 | return join(this.installDir, this.pythonDistributionName, "bin", "python" + (platform() === "win32" ? ".exe" : "")); 86 | } 87 | 88 | /** 89 | * Contains the path to the bundled pip executable. 90 | */ 91 | get pipPath() { 92 | if (platform() === "win32") { 93 | return join(this.installDir, this.pythonDistributionName, "Scripts", `pip${this.major}.exe`); 94 | } 95 | return join(this.installDir, this.pythonDistributionName, "bin", `pip${this.major}`); 96 | } 97 | 98 | /** 99 | * Contains the selected Python version. 100 | */ 101 | get version() { 102 | return this._version; 103 | } 104 | 105 | /** 106 | * Contains the major version number. 107 | */ 108 | get major() { 109 | return this.version.split(".")[0]; 110 | } 111 | 112 | /** 113 | * Contains the minor version number. 114 | */ 115 | get minor() { 116 | return this.version.split(".")[1]; 117 | } 118 | 119 | /** 120 | * Contains the patch version number. 121 | */ 122 | get patch() { 123 | return this.version.split(".")[2]; 124 | } 125 | 126 | /** 127 | * Contains the release tag that will be downloaded. 128 | */ 129 | get releaseTag() { 130 | return VERSION_BUILDS[this.version] as string; 131 | } 132 | 133 | /** 134 | * Contains the full name of the Python distribution. 135 | */ 136 | get pythonDistributionName() { 137 | return `python-${this.version}-${DL_PLATFORM}-${DL_ARCH}`; 138 | } 139 | 140 | /** 141 | * Contains the path to the extracted Python distribution folder. 142 | */ 143 | get extractPath() { 144 | return join(this.installDir, this.pythonDistributionName); 145 | } 146 | 147 | /** 148 | * Checks if the selected Python version has been installed on the host platform. 149 | * @returns True if the installation exists, false otherwise. 150 | */ 151 | isInstalled() { 152 | return existsSync(this.extractPath); 153 | } 154 | 155 | /** 156 | * Will download the compressed Python installation and extract it to 157 | * the installation directory. 158 | * @param [zipFile=null] - Install from an existing zip file on the filesystem, instead of downloading. 159 | */ 160 | async install(zipFile: string | null = null) { 161 | if (this.isInstalled()) { 162 | return; 163 | } 164 | 165 | const postProcess = () => { 166 | if (!this.isInstalled()) { 167 | throw Error("something went wrong and the installation failed"); 168 | } 169 | 170 | chmodSync(this.executablePath, 0o777); 171 | if (platform() != "win32") { 172 | // node can't create symlinks over existing files, so we create symlinks with temp names, 173 | // then rename to overwrite existing files 174 | symlinkSync("python", `${this.executablePath}${this.major}_`, "file"); 175 | renameSync(`${this.executablePath}${this.major}_`, `${this.executablePath}${this.major}`); 176 | symlinkSync("python", `${this.executablePath}${this.major}.${this.minor}_`, "file"); 177 | renameSync(`${this.executablePath}${this.major}.${this.minor}_`, `${this.executablePath}${this.major}.${this.minor}`); 178 | 179 | // ensure the pip script is executable 180 | chmodSync(this.pipPath, 0o777); 181 | chmodSync(`${this.pipPath}.${this.minor}`, 0o777); 182 | } 183 | } 184 | 185 | mkdirSync(this.installDir, { recursive: true }); 186 | 187 | if (zipFile) { 188 | const zip = new AdmZip(zipFile); 189 | zip.extractAllTo(this.installDir, true) 190 | postProcess(); 191 | return; 192 | } 193 | 194 | const url = `https://github.com/bjia56/portable-python/releases/download/${this.releaseTag}/${this.pythonDistributionName}.zip` 195 | const downloadPath = join(this.installDir, `${this.pythonDistributionName}.zip`); 196 | 197 | const installDir = this.installDir; 198 | await download(url, downloadPath); 199 | 200 | const zip = new AdmZip(downloadPath); 201 | zip.extractAllTo(installDir, true) 202 | 203 | rmSync(downloadPath); 204 | postProcess(); 205 | } 206 | 207 | /** 208 | * Uninstalls the Python distribution. 209 | */ 210 | async uninstall() { 211 | if (!this.isInstalled()) { 212 | return; 213 | } 214 | await new Promise((resolve, reject) => rm(this.extractPath, { force: true, recursive: true }, (e) => { 215 | if (e) { 216 | reject(e); 217 | } else { 218 | resolve(); 219 | } 220 | })); 221 | } 222 | 223 | } 224 | 225 | -------------------------------------------------------------------------------- /installers/nodejs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "module": "commonjs", 5 | "target": "esnext", 6 | "noImplicitAny": true, 7 | "outDir": "./dist", 8 | "esModuleInterop": true, 9 | "skipLibCheck": true, 10 | "sourceMap": true 11 | }, 12 | "include": [ 13 | "src/**/*" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /scripts/build_freebsd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" 4 | source ${SCRIPT_DIR}/utils.sh 5 | 6 | export CFLAGS="-I${DEPSDIR}/include" 7 | export CPPFLAGS="-I${DEPSDIR}/include" 8 | export CXXFLAGS="${CPPFLAGS}" 9 | export LDFLAGS="-L${DEPSDIR}/lib" 10 | export PKG_CONFIG_PATH="${DEPSDIR}/lib/pkgconfig:${DEPSDIR}/share/pkgconfig" 11 | export AL_OPTS="-I/usr/local/share/aclocal -I${DEPSDIR}/share/aclocal" 12 | mkdir -p ${DEPSDIR}/share/aclocal 13 | 14 | ######## 15 | # zlib # 16 | ######## 17 | echo "::group::zlib" 18 | cd ${BUILDDIR} 19 | 20 | download_verify_extract zlib-1.3.1.tar.gz 21 | cd zlib* 22 | ./configure --prefix=${DEPSDIR} 23 | gmake -j4 24 | gmake install 25 | install_license 26 | 27 | echo "::endgroup::" 28 | ########### 29 | # OpenSSL # 30 | ########### 31 | echo "::group::OpenSSL" 32 | cd ${BUILDDIR} 33 | 34 | download_verify_extract openssl-1.1.1w.tar.gz 35 | cd openssl* 36 | ./Configure BSD-${ARCH} --prefix=${DEPSDIR} --openssldir=${DEPSDIR} 37 | gmake -j4 38 | gmake install_sw 39 | install_license 40 | 41 | echo "::endgroup::" 42 | ########## 43 | # libffi # 44 | ########## 45 | echo "::group::libffi" 46 | cd ${BUILDDIR} 47 | 48 | download_verify_extract libffi-3.4.6.tar.gz 49 | cd libffi* 50 | ./configure --prefix=${DEPSDIR} 51 | gmake -j4 52 | gmake install 53 | install_license 54 | 55 | echo "::endgroup::" 56 | ########### 57 | # sqlite3 # 58 | ########### 59 | echo "::group::sqlite3" 60 | cd ${BUILDDIR} 61 | 62 | download_verify_extract sqlite-autoconf-3450000.tar.gz 63 | cd sqlite* 64 | ./configure --enable-shared --prefix=${DEPSDIR} 65 | gmake -j4 66 | gmake install 67 | 68 | echo "::endgroup::" 69 | ######### 70 | # expat # 71 | ######### 72 | echo "::group::expat" 73 | cd ${BUILDDIR} 74 | 75 | download_verify_extract expat-2.6.2.tar.gz 76 | cd expat* 77 | ./configure --prefix=${DEPSDIR} 78 | gmake -j4 79 | gmake install 80 | install_license 81 | 82 | echo "::endgroup::" 83 | ########### 84 | # ncurses # 85 | ########### 86 | echo "::group::ncurses" 87 | cd ${BUILDDIR} 88 | 89 | download_verify_extract ncurses-6.4.tar.gz 90 | cd ncurses* 91 | ./configure --with-normal --with-shared --without-progs --enable-overwrite --disable-stripping --prefix=${DEPSDIR} 92 | gmake -j4 93 | gmake install.libs 94 | install_license 95 | 96 | echo "::endgroup::" 97 | ############ 98 | # readline # 99 | ############ 100 | echo "::group::readline" 101 | cd ${BUILDDIR} 102 | 103 | download_verify_extract readline-8.2.tar.gz 104 | cd readline* 105 | ./configure --with-curses --host=${CHOST} --prefix=${DEPSDIR} 106 | gmake -j4 107 | gmake install 108 | install_license 109 | 110 | echo "::endgroup::" 111 | ######### 112 | # bzip2 # 113 | ######### 114 | echo "::group::bzip2" 115 | cd ${BUILDDIR} 116 | 117 | wget --no-verbose -O bzip2.tar.gz https://github.com/commontk/bzip2/tarball/master 118 | tar -xf bzip2*.tar.gz 119 | rm *.tar.gz 120 | cd commontk-bzip2* 121 | mkdir build 122 | cd build 123 | cmake -DCMAKE_INSTALL_PREFIX:PATH=${DEPSDIR} .. 124 | make -j4 125 | make install 126 | cd .. 127 | install_license ./LICENSE bzip2-1.0.8 128 | 129 | echo "::endgroup::" 130 | ###### 131 | # xz # 132 | ###### 133 | echo "::group::xz" 134 | cd ${BUILDDIR} 135 | 136 | download_verify_extract xz-5.4.5.tar.gz 137 | cd xz* 138 | mkdir build 139 | cd build 140 | cmake -DCMAKE_INSTALL_PREFIX:PATH=${DEPSDIR} -DBUILD_SHARED_LIBS=ON .. 141 | make -j4 142 | make install 143 | cd .. 144 | install_license 145 | 146 | echo "::endgroup::" 147 | ########## 148 | # Brotli # 149 | ########## 150 | echo "::group::Brotli" 151 | cd ${BUILDDIR} 152 | 153 | download_verify_extract brotli-1.1.0.tar.gz 154 | cd brotli* 155 | mkdir build 156 | cd build 157 | cmake -DCMAKE_INSTALL_PREFIX:PATH=${DEPSDIR} .. 158 | make -j4 159 | make install 160 | cd .. 161 | install_license 162 | 163 | echo "::endgroup::" 164 | ######## 165 | # gdbm # 166 | ######## 167 | echo "::group::gdbm" 168 | cd ${BUILDDIR} 169 | 170 | download_verify_extract gdbm-1.23.tar.gz 171 | cd gdbm* 172 | ./configure --enable-libgdbm-compat --prefix=${DEPSDIR} 173 | gmake -j4 174 | gmake install 175 | install_license 176 | 177 | echo "::endgroup::" 178 | ########### 179 | # libxml2 # 180 | ########### 181 | echo "::group::libxml2" 182 | cd ${BUILDDIR} 183 | 184 | download_verify_extract libxml2-2.12.4.tar.xz 185 | cd libxml2* 186 | ./configure --without-python --prefix=${DEPSDIR} 187 | gmake -j4 188 | gmake install 189 | install_license ./Copyright 190 | 191 | echo "::endgroup::" 192 | ############ 193 | # libpng16 # 194 | ############ 195 | echo "::group::libpng16" 196 | cd ${BUILDDIR} 197 | 198 | download_verify_extract libpng-1.6.41.tar.gz 199 | cd libpng* 200 | ./configure --with-zlib-prefix=${DEPSDIR} --disable-tools --prefix=${DEPSDIR} 201 | gmake -j4 202 | gmake install 203 | 204 | echo "::endgroup::" 205 | ############# 206 | # libgcrypt # 207 | ############# 208 | echo "::group::libgcrypt" 209 | cd ${BUILDDIR} 210 | 211 | download_verify_extract libgpg-error-1.47.tar.bz2 212 | cd libgpg-error* 213 | ./configure --prefix=${DEPSDIR} 214 | gmake -j4 215 | gmake install 216 | install_license ./COPYING.LIB 217 | 218 | cd ${BUILDDIR} 219 | 220 | download_verify_extract libgcrypt-1.10.3.tar.bz2 221 | cd libgcrypt* 222 | ./configure --disable-asm --prefix=${DEPSDIR} 223 | gmake -j4 224 | gmake install 225 | install_license ./COPYING.LIB 226 | 227 | echo "::endgroup::" 228 | ########### 229 | # libxslt # 230 | ########### 231 | echo "::group::libxslt" 232 | cd ${BUILDDIR} 233 | 234 | download_verify_extract libxslt-1.1.39.tar.xz 235 | cd libxslt* 236 | CFLAGS="${CFLAGS} -I${DEPSDIR}/include/libxml2" ./configure --with-libxml-prefix=${DEPSDIR} --without-python --prefix=${DEPSDIR} 237 | gmake -j4 238 | gmake install 239 | install_license 240 | 241 | echo "::endgroup::" 242 | ############ 243 | # freetype # 244 | ############ 245 | echo "::group::freetype" 246 | cd ${BUILDDIR} 247 | 248 | download_verify_extract freetype-2.13.2.tar.gz 249 | cd freetype* 250 | ./configure --prefix=${DEPSDIR} 251 | gmake -j4 252 | gmake install 253 | install_license ./docs/FTL.TXT 254 | 255 | echo "::endgroup::" 256 | ############## 257 | # fontconfig # 258 | ############## 259 | echo "::group::fontconfig" 260 | cd ${BUILDDIR} 261 | 262 | download_verify_extract fontconfig-2.15.0.tar.gz 263 | cd fontconfig* 264 | ./configure --enable-libxml2 --disable-cache-build --prefix=${DEPSDIR} 265 | gmake -j4 266 | gmake install 267 | install_license 268 | 269 | echo "::endgroup::" 270 | ####### 271 | # X11 # 272 | ####### 273 | #echo "::group::X11" 274 | #cd ${BUILDDIR} 275 | 276 | function build_x11_lib_core() { 277 | echo "::group::$1" 278 | cd ${BUILDDIR} 279 | 280 | pkg=$1 281 | ext_flags="$2" 282 | file=$pkg.tar.gz 283 | download_verify_extract $file 284 | cd $pkg 285 | autoreconf -vfi ${AL_OPTS} 286 | ./configure $ext_flags --prefix=${DEPSDIR} 287 | gmake -j4 288 | gmake install 289 | 290 | echo "::endgroup::" 291 | } 292 | 293 | function build_x11_lib () { 294 | build_x11_lib_core "$1" "$2" 295 | install_license 296 | } 297 | 298 | build_x11_lib_core util-macros-1.20.1 299 | build_x11_lib_core xorgproto-2023.2 300 | build_x11_lib xproto-7.0.31 301 | build_x11_lib xextproto-7.3.0 302 | build_x11_lib kbproto-1.0.7 303 | build_x11_lib inputproto-2.3.2 304 | build_x11_lib renderproto-0.11.1 305 | build_x11_lib scrnsaverproto-1.2.2 306 | build_x11_lib xcb-proto-1.16.0 307 | build_x11_lib libpthread-stubs-0.5 308 | build_x11_lib xtrans-1.5.0 309 | build_x11_lib libXau-1.0.11 310 | build_x11_lib libxcb-1.16 311 | build_x11_lib libXdmcp-1.1.2 312 | build_x11_lib libX11-1.8.7 313 | build_x11_lib libXext-1.3.5 314 | build_x11_lib libICE-1.0.7 315 | build_x11_lib libSM-1.2.2 316 | build_x11_lib libXrender-0.9.11 317 | build_x11_lib libXft-2.3.8 318 | build_x11_lib libXScrnSaver-1.2.4 319 | 320 | #echo "::endgroup::" 321 | ####### 322 | # tcl # 323 | ####### 324 | echo "::group::tcl" 325 | cd ${BUILDDIR} 326 | 327 | download_verify_extract tcl8.6.13-src.tar.gz 328 | cd tcl*/unix 329 | ./configure --prefix=${DEPSDIR} 330 | gmake -j4 331 | gmake install 332 | cd .. 333 | install_license ./license.terms 334 | 335 | echo "::endgroup::" 336 | ###### 337 | # tk # 338 | ###### 339 | echo "::group::tk" 340 | cd ${BUILDDIR} 341 | 342 | download_verify_extract tk8.6.13-src.tar.gz 343 | cd tk*/unix 344 | ./configure --prefix=${DEPSDIR} 345 | gmake -j4 346 | gmake install 347 | cd .. 348 | install_license ./license.terms 349 | 350 | echo "::endgroup::" 351 | ########## 352 | # Python # 353 | ########## 354 | echo "::group::Python" 355 | cd ${BUILDDIR} 356 | 357 | ldconfig -i -m -v ${DEPSDIR}/lib 358 | 359 | wget --no-verbose -O portable-python-cmake-buildsystem.tar.gz https://github.com/bjia56/portable-python-cmake-buildsystem/tarball/${CMAKE_BUILDSYSTEM_BRANCH} 360 | tar -xf portable-python-cmake-buildsystem.tar.gz 361 | rm *.tar.gz 362 | mv *portable-python-cmake-buildsystem* portable-python-cmake-buildsystem 363 | mkdir python-build 364 | mkdir python-install 365 | cd python-build 366 | cmake \ 367 | "${cmake_verbose_flags[@]}" \ 368 | -DCMAKE_IGNORE_PATH=/usr/include \ 369 | -DPYTHON_VERSION=${PYTHON_FULL_VER} \ 370 | -DPORTABLE_PYTHON_BUILD=ON \ 371 | -DCMAKE_BUILD_TYPE:STRING=${BUILD_TYPE} \ 372 | -DCMAKE_INSTALL_PREFIX:PATH=${BUILDDIR}/python-install \ 373 | -DBUILD_EXTENSIONS_AS_BUILTIN=ON \ 374 | -DBUILD_LIBPYTHON_SHARED=ON \ 375 | -DUSE_SYSTEM_LIBRARIES=OFF \ 376 | -DBUILD_TESTING=${INSTALL_TEST} \ 377 | -DINSTALL_TEST=${INSTALL_TEST} \ 378 | -DINSTALL_MANUAL=OFF \ 379 | -DOPENSSL_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 380 | -DOPENSSL_LIBRARIES="${DEPSDIR}/lib/libssl.so;${DEPSDIR}/lib/libcrypto.so" \ 381 | -DSQLite3_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 382 | -DSQLite3_LIBRARY:FILEPATH=${DEPSDIR}/lib/libsqlite3.so \ 383 | -DZLIB_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 384 | -DZLIB_LIBRARY:FILEPATH=${DEPSDIR}/lib/libz.so \ 385 | -DLZMA_INCLUDE_PATH:PATH=${DEPSDIR}/include \ 386 | -DLZMA_LIBRARY:FILEPATH=${DEPSDIR}/lib/liblzma.so \ 387 | -DBZIP2_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 388 | -DBZIP2_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libbz2.a \ 389 | -DLibFFI_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 390 | -DLibFFI_LIBRARY:FILEPATH=${DEPSDIR}/lib/libffi.so \ 391 | -DREADLINE_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include/readline/readline.h \ 392 | -DREADLINE_LIBRARY:FILEPATH=${DEPSDIR}/lib/libreadline.so \ 393 | -DCURSES_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libncurses.so \ 394 | -DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanel.so \ 395 | -DGDBM_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include/gdbm.h \ 396 | -DGDBM_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm.so \ 397 | -DGDBM_COMPAT_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm_compat.so \ 398 | -DNDBM_TAG=NDBM \ 399 | -DNDBM_USE=NDBM \ 400 | -DTK_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include/tk.h \ 401 | -DTK_LIBRARY:FILEPATH=${DEPSDIR}/lib/libtk8.6.so \ 402 | -DTCL_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include/tcl.h \ 403 | -DTCL_LIBRARY:FILEPATH=${DEPSDIR}/lib/libtcl8.6.so \ 404 | -DX11_INCLUDE_DIR:PATH=${DEPSDIR}/include/X11 \ 405 | -DX11_LIBRARIES="${DEPSDIR}/lib/libXau.so;${DEPSDIR}/lib/libXdmcp.so;${DEPSDIR}/lib/libX11.so;${DEPSDIR}/lib/libXext.so;${DEPSDIR}/lib/libICE.so;${DEPSDIR}/lib/libSM.so;${DEPSDIR}/lib/libXrender.so;${DEPSDIR}/lib/libXft.so;${DEPSDIR}/lib/libXss.so;${DEPSDIR}/lib/libxcb.so" \ 406 | ../portable-python-cmake-buildsystem 407 | make -j4 408 | make install 409 | 410 | cd ${BUILDDIR} 411 | patchelf \ 412 | --add-needed libfontconfig.so.1 \ 413 | --add-needed libfreetype.so.6 \ 414 | --add-needed libxml2.so.2 \ 415 | --add-needed libpng16.so.16 \ 416 | --add-needed libbrotlidec.so.1 \ 417 | --add-needed libbrotlicommon.so.1 \ 418 | ./python-install/bin/python 419 | cp ${DEPSDIR}/lib/lib*.so* ./python-install/lib 420 | cp -r ${LICENSEDIR} ./python-install 421 | 422 | echo "::endgroup::" 423 | ################################# 424 | # Check executable dependencies # 425 | ################################# 426 | echo "::group::Check executable dependencies" 427 | cd ${BUILDDIR} 428 | 429 | cd python-install 430 | echo "python dependencies" 431 | readelf -d ./bin/python 432 | echo 433 | echo "libpython dependencies" 434 | readelf -d ./lib/libpython${PYTHON_VER}.so 435 | 436 | echo "::endgroup::" 437 | ############### 438 | # Test python # 439 | ############### 440 | echo "::group::Test python" 441 | cd ${BUILDDIR} 442 | 443 | cd python-install 444 | ./bin/python --version 445 | 446 | echo "::endgroup::" 447 | ############### 448 | # Preload pip # 449 | ############### 450 | echo "::group::Preload pip" 451 | cd ${BUILDDIR} 452 | 453 | cd python-install 454 | ./bin/python -m ensurepip 455 | ./bin/python -m pip install -r ${WORKDIR}/baseline/requirements.txt 456 | 457 | python3 ${WORKDIR}/scripts/patch_pip_script.py ./bin/pip3 458 | python3 ${WORKDIR}/scripts/patch_pip_script.py ./bin/pip${PYTHON_VER} 459 | 460 | echo "::endgroup::" 461 | ################### 462 | # Compress output # 463 | ################### 464 | echo "::group::Compress output" 465 | cd ${BUILDDIR} 466 | 467 | python3 -m ensurepip 468 | python3 -m pip install pyclean 469 | python3 -m pyclean -v python-install 470 | mv python-install python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH} 471 | tar -czf ${WORKDIR}/python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH}.tar.gz python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH} 472 | zip ${WORKDIR}/python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH}.zip $(tar tf ${WORKDIR}/python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH}.tar.gz) 473 | 474 | echo "::endgroup::" 475 | -------------------------------------------------------------------------------- /scripts/build_linux_zig.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PLATFORM=linux 4 | SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" 5 | source ${SCRIPT_DIR}/utils.sh 6 | 7 | which zig 8 | zig version 9 | 10 | ######################## 11 | # Install dependencies # 12 | ######################## 13 | echo "::group::Install dependencies" 14 | 15 | export DEBIAN_FRONTEND=noninteractive 16 | sudo apt update 17 | sudo apt -y install \ 18 | wget build-essential pkg-config autoconf git patch \ 19 | python2 python3 python3-pip clang qemu-user-static \ 20 | gettext bison libtool autopoint gperf ncurses-bin xutils-dev 21 | case "$ARCH" in 22 | x86_64) 23 | sudo apt -y install libc6-amd64-cross 24 | sudo ln -s /usr/x86_64-linux-gnu/lib/ld-linux-x86-64.so.2 /lib/ld-linux-x86-64.so.2 25 | ;; 26 | i386) 27 | sudo apt -y install libc6-i386-cross 28 | sudo ln -sf /usr/i686-linux-gnu/lib/ld-linux.so.2 /lib/ld-linux.so.2 29 | ;; 30 | aarch64) 31 | sudo apt -y install libc6-arm64-cross 32 | sudo ln -s /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 /lib/ld-linux-aarch64.so.1 33 | ;; 34 | arm) 35 | sudo apt -y install libc6-armhf-cross 36 | sudo ln -s /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 /lib/ld-linux-armhf.so.3 37 | ;; 38 | riscv64) 39 | sudo apt -y install libc6-riscv64-cross 40 | sudo ln -s /usr/riscv64-linux-gnu/lib/ld-linux-riscv64-lp64d.so.1 /lib/ld-linux-riscv64-lp64d.so.1 41 | # workaround since the Zig compiler always targets ld-linux-riscv64-lp64.so.1 42 | sudo ln -s /usr/riscv64-linux-gnu/lib/ld-linux-riscv64-lp64d.so.1 /lib/ld-linux-riscv64-lp64.so.1 43 | ;; 44 | esac 45 | sudo pip install https://github.com/mesonbuild/meson/archive/2baae24.zip ninja cmake==3.28.4 46 | if [[ "${ARCH}" == "riscv64" ]]; then 47 | sudo pip install patchelf==0.15.0.0 48 | fi 49 | 50 | export ZIG_FLAGS="" 51 | export CFLAGS="-I${DEPSDIR}/include" 52 | export CPPFLAGS="-I${DEPSDIR}/include" 53 | export CXXFLAGS="${CPPFLAGS}" 54 | export LDFLAGS="-L${DEPSDIR}/lib" 55 | export PKG_CONFIG_PATH="${DEPSDIR}/lib/pkgconfig:${DEPSDIR}/share/pkgconfig" 56 | 57 | if [[ "${ARCH}" == "arm" ]]; then 58 | # Python's sysconfig module will retain references to these compiler values, which cause 59 | # problems when sysconfig is used to pick a compiler during binary extension builds. 60 | # Since clang (zig) is a drop-in replacement for gcc, we set these so the final sysconfig 61 | # will work on other platforms. 62 | sudo cp ${WORKDIR}/zigshim/zig_ar /usr/bin/${ARCH}-linux-gnueabihf-gcc-ar 63 | sudo cp ${WORKDIR}/zigshim/zig_cc /usr/bin/${ARCH}-linux-gnueabihf-gcc 64 | sudo cp ${WORKDIR}/zigshim/zig_cxx /usr/bin/${ARCH}-linux-gnueabihf-g++ 65 | export AR="${ARCH}-linux-gnueabihf-gcc-ar" 66 | export CC="${ARCH}-linux-gnueabihf-gcc" 67 | export CXX="${ARCH}-linux-gnueabihf-g++" 68 | export CHOST=${ARCH}-linux-gnueabihf 69 | export ZIG_FLAGS="-target ${ARCH}-linux-gnueabihf.2.17 -mfpu=vfp -mfloat-abi=hard -mcpu=arm1176jzf_s" 70 | elif [[ "${ARCH}" == "i386" ]]; then 71 | # See above comment 72 | sudo cp ${WORKDIR}/zigshim/zig_ar /usr/bin/i686-linux-gnu-gcc-ar 73 | sudo cp ${WORKDIR}/zigshim/zig_cc /usr/bin/i686-linux-gnu-gcc 74 | sudo cp ${WORKDIR}/zigshim/zig_cxx /usr/bin/i686-linux-gnu-g++ 75 | export AR="i686-linux-gnu-gcc-ar" 76 | export CC="i686-linux-gnu-gcc" 77 | export CXX="i686-linux-gnu-g++" 78 | export CHOST=i686-linux-gnu 79 | export ZIG_FLAGS="-target x86-linux-gnu.2.17" 80 | export CFLAGS="-m32 -Wl,--undefined-version ${CFLAGS}" 81 | export CPPFLAGS="-m32 ${CPPFLAGS}" 82 | export CXXFLAGS="-m32 ${CXXFLAGS}" 83 | export LDFLAGS="-m32 ${LDFLAGS}" 84 | else 85 | # See above comment 86 | sudo cp ${WORKDIR}/zigshim/zig_ar /usr/bin/${ARCH}-linux-gnu-gcc-ar 87 | sudo cp ${WORKDIR}/zigshim/zig_cc /usr/bin/${ARCH}-linux-gnu-gcc 88 | sudo cp ${WORKDIR}/zigshim/zig_cxx /usr/bin/${ARCH}-linux-gnu-g++ 89 | export AR="${ARCH}-linux-gnu-gcc-ar" 90 | export CC="${ARCH}-linux-gnu-gcc" 91 | export CXX="${ARCH}-linux-gnu-g++" 92 | if [[ "${ARCH}" == "riscv64" ]]; then 93 | export ZIG_FLAGS="-target riscv64-linux-gnu.2.27" 94 | export CFLAGS="-Wl,--undefined-version ${CFLAGS}" 95 | else 96 | export ZIG_FLAGS="-target ${ARCH}-linux-gnu.2.17" 97 | fi 98 | export CHOST=${ARCH}-linux-gnu 99 | fi 100 | 101 | # apply some zig patches 102 | cd $(dirname $(which zig)) 103 | for patchfile in ${WORKDIR}/zigshim/patches/*.patch; do 104 | patch -p1 < $patchfile 105 | done 106 | cd ${WORKDIR} 107 | 108 | echo "::endgroup::" 109 | ######## 110 | # zlib # 111 | ######## 112 | echo "::group::zlib" 113 | cd ${BUILDDIR} 114 | 115 | download_verify_extract zlib-1.3.1.tar.gz 116 | cd zlib* 117 | ./configure --prefix=${DEPSDIR} 118 | make -j4 119 | make install 120 | install_license 121 | 122 | echo "::endgroup::" 123 | ########### 124 | # OpenSSL # 125 | ########### 126 | echo "::group::OpenSSL" 127 | cd ${BUILDDIR} 128 | 129 | download_verify_extract openssl-1.1.1w.tar.gz 130 | cd openssl* 131 | if [[ "${ARCH}" == "arm" ]]; then 132 | ./Configure linux-generic32 no-shared --prefix=${DEPSDIR} --openssldir=${DEPSDIR} 133 | elif [[ "${ARCH}" == "i386" ]]; then 134 | ./Configure linux-x86 no-shared --prefix=${DEPSDIR} --openssldir=${DEPSDIR} 135 | elif [[ "${ARCH}" == "riscv64" ]]; then 136 | CFLAGS="${CFLAGS} -fgnuc-version=0 -D__STDC_NO_ATOMICS__" ./Configure linux-generic64 no-shared --prefix=${DEPSDIR} --openssldir=${DEPSDIR} 137 | else 138 | ./Configure linux-${ARCH} no-shared --prefix=${DEPSDIR} --openssldir=${DEPSDIR} 139 | fi 140 | make -j4 141 | make install_sw 142 | install_license 143 | 144 | echo "::endgroup::" 145 | ########## 146 | # libffi # 147 | ########## 148 | echo "::group::libffi" 149 | cd ${BUILDDIR} 150 | 151 | download_verify_extract libffi-3.4.6.tar.gz 152 | cd libffi* 153 | CFLAGS="${CFLAGS} -Wl,--undefined-version" ./configure --host=${CHOST} --prefix=${DEPSDIR} 154 | make -j4 155 | make install 156 | install_license 157 | 158 | echo "::endgroup::" 159 | ########### 160 | # sqlite3 # 161 | ########### 162 | echo "::group::sqlite3" 163 | cd ${BUILDDIR} 164 | 165 | download_verify_extract sqlite-autoconf-3450000.tar.gz 166 | cd sqlite* 167 | ./configure --host=${CHOST} --prefix=${DEPSDIR} 168 | make -j4 169 | make install 170 | 171 | echo "::endgroup::" 172 | ######### 173 | # expat # 174 | ######### 175 | echo "::group::expat" 176 | cd ${BUILDDIR} 177 | 178 | download_verify_extract expat-2.6.2.tar.gz 179 | cd expat* 180 | ./configure --host=${CHOST} --disable-shared --prefix=${DEPSDIR} 181 | make -j4 182 | make install 183 | install_license 184 | 185 | echo "::endgroup::" 186 | ########### 187 | # ncurses # 188 | ########### 189 | echo "::group::ncurses" 190 | cd ${BUILDDIR} 191 | 192 | download_verify_extract ncurses-6.4.tar.gz 193 | cd ncurses* 194 | ./configure --host=${CHOST} --with-normal --without-progs --enable-overwrite --disable-stripping --prefix=${DEPSDIR} 195 | make -j4 196 | make install 197 | install_license 198 | 199 | echo "::endgroup::" 200 | ############ 201 | # readline # 202 | ############ 203 | echo "::group::readline" 204 | cd ${BUILDDIR} 205 | 206 | download_verify_extract readline-8.2.tar.gz 207 | cd readline* 208 | ./configure --with-curses --disable-shared --host=${CHOST} --prefix=${DEPSDIR} 209 | make -j4 210 | make install 211 | install_license 212 | 213 | echo "::endgroup::" 214 | ######### 215 | # bzip2 # 216 | ######### 217 | echo "::group::bzip2" 218 | cd ${BUILDDIR} 219 | 220 | wget --no-verbose -O bzip2.tar.gz https://github.com/commontk/bzip2/tarball/master 221 | tar -xf bzip2*.tar.gz 222 | rm *.tar.gz 223 | cd commontk-bzip2* 224 | mkdir build 225 | cd build 226 | cmake -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_INSTALL_PREFIX:PATH=${DEPSDIR} .. 227 | make -j4 228 | make install 229 | cd .. 230 | install_license ./LICENSE bzip2-1.0.8 231 | 232 | echo "::endgroup::" 233 | ###### 234 | # xz # 235 | ###### 236 | echo "::group::xz" 237 | cd ${BUILDDIR} 238 | 239 | download_verify_extract xz-5.4.5.tar.gz 240 | cd xz* 241 | mkdir build 242 | cd build 243 | cmake -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_INSTALL_PREFIX:PATH=${DEPSDIR} .. 244 | make -j4 245 | make install 246 | cd .. 247 | install_license 248 | 249 | echo "::endgroup::" 250 | ########## 251 | # Brotli # 252 | ########## 253 | echo "::group::Brotli" 254 | cd ${BUILDDIR} 255 | 256 | download_verify_extract brotli-1.1.0.tar.gz 257 | cd brotli* 258 | mkdir build 259 | cd build 260 | cmake -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_INSTALL_PREFIX:PATH=${DEPSDIR} .. 261 | make -j4 262 | make install 263 | cd .. 264 | install_license 265 | 266 | echo "::endgroup::" 267 | ######## 268 | # uuid # 269 | ######## 270 | echo "::group::uuid" 271 | cd ${BUILDDIR} 272 | 273 | download_verify_extract util-linux-2.39.3.tar.gz 274 | cd util-linux* 275 | ./autogen.sh 276 | ./configure --host=${CHOST} --disable-all-programs --enable-libuuid --prefix=${DEPSDIR} 277 | make -j4 278 | make install 279 | install_license ./Documentation/licenses/COPYING.BSD-3-Clause libuuid-2.39.3 280 | 281 | echo "::endgroup::" 282 | ######## 283 | # gdbm # 284 | ######## 285 | echo "::group::gdbm" 286 | cd ${BUILDDIR} 287 | 288 | download_verify_extract gdbm-1.23.tar.gz 289 | cd gdbm* 290 | ./configure --host=${CHOST} --enable-libgdbm-compat --prefix=${DEPSDIR} 291 | make -j4 292 | make install 293 | install_license 294 | 295 | echo "::endgroup::" 296 | ########### 297 | # libxml2 # 298 | ########### 299 | echo "::group::libxml2" 300 | cd ${BUILDDIR} 301 | 302 | download_verify_extract libxml2-2.12.4.tar.xz 303 | cd libxml2* 304 | ./configure --host=${CHOST} --enable-static --disable-shared --without-python --prefix=${DEPSDIR} 305 | make -j4 306 | make install 307 | install_license ./Copyright 308 | 309 | echo "::endgroup::" 310 | ############ 311 | # libpng16 # 312 | ############ 313 | echo "::group::libpng16" 314 | cd ${BUILDDIR} 315 | 316 | download_verify_extract libpng-1.6.41.tar.gz 317 | cd libpng* 318 | ./configure --host=${CHOST} --with-zlib-prefix=${DEPSDIR} --disable-tools --prefix=${DEPSDIR} 319 | make -j4 320 | make install 321 | 322 | echo "::endgroup::" 323 | ############# 324 | # libgcrypt # 325 | ############# 326 | echo "::group::libgcrypt" 327 | cd ${BUILDDIR} 328 | 329 | download_verify_extract libgpg-error-1.47.tar.bz2 330 | cd libgpg-error* 331 | ./configure --host=${CHOST} --prefix=${DEPSDIR} 332 | make -j4 333 | make install 334 | install_license ./COPYING.LIB 335 | 336 | cd ${BUILDDIR} 337 | 338 | download_verify_extract libgcrypt-1.10.3.tar.bz2 339 | cd libgcrypt* 340 | LDFLAGS="${LDFLAGS} -Wl,--undefined-version" ./configure --disable-asm --host=${CHOST} --prefix=${DEPSDIR} 341 | make -j4 342 | make install 343 | install_license ./COPYING.LIB 344 | 345 | echo "::endgroup::" 346 | ########### 347 | # libxslt # 348 | ########### 349 | echo "::group::libxslt" 350 | cd ${BUILDDIR} 351 | 352 | download_verify_extract libxslt-1.1.39.tar.xz 353 | cd libxslt* 354 | CFLAGS="${CFLAGS} -I${DEPSDIR}/include/libxml2" ./configure --host=${CHOST} --with-libxml-prefix=${DEPSDIR} --without-python --prefix=${DEPSDIR} 355 | make -j4 356 | make install 357 | install_license 358 | 359 | echo "::endgroup::" 360 | ############ 361 | # freetype # 362 | ############ 363 | echo "::group::freetype" 364 | cd ${BUILDDIR} 365 | 366 | download_verify_extract freetype-2.13.2.tar.gz 367 | cd freetype* 368 | ./configure --host=${CHOST} --prefix=${DEPSDIR} 369 | make -j4 370 | make install 371 | install_license ./docs/FTL.TXT 372 | 373 | echo "::endgroup::" 374 | ############## 375 | # fontconfig # 376 | ############## 377 | echo "::group::fontconfig" 378 | cd ${BUILDDIR} 379 | 380 | download_verify_extract fontconfig-2.15.0.tar.gz 381 | cd fontconfig* 382 | LDFLAGS="${LDFLAGS} -lxml2" ./configure --host=${CHOST} --enable-static --disable-shared --enable-libxml2 --disable-cache-build --prefix=${DEPSDIR} 383 | make -j4 384 | make install 385 | install_license 386 | 387 | echo "::endgroup::" 388 | ####### 389 | # X11 # 390 | ####### 391 | #echo "::group::X11" 392 | #cd ${BUILDDIR} 393 | 394 | function build_x11_lib_core() { 395 | echo "::group::$1" 396 | cd ${BUILDDIR} 397 | 398 | pkg=$1 399 | ext_flags="$2" 400 | file=$pkg.tar.gz 401 | download_verify_extract $file 402 | cd $pkg 403 | autoreconf -vfi 404 | ./configure $ext_flags --host=${CHOST} --prefix=${DEPSDIR} 405 | make -j4 406 | make install 407 | 408 | echo "::endgroup::" 409 | } 410 | 411 | function build_x11_lib () { 412 | build_x11_lib_core "$1" "$2" 413 | install_license 414 | } 415 | 416 | build_x11_lib_core xorgproto-2023.2 417 | build_x11_lib xproto-7.0.31 418 | build_x11_lib xextproto-7.3.0 419 | build_x11_lib kbproto-1.0.7 420 | build_x11_lib inputproto-2.3.2 421 | build_x11_lib renderproto-0.11.1 422 | build_x11_lib scrnsaverproto-1.2.2 423 | build_x11_lib xcb-proto-1.16.0 424 | build_x11_lib libpthread-stubs-0.5 425 | build_x11_lib xtrans-1.5.0 426 | build_x11_lib libXau-1.0.11 427 | build_x11_lib libxcb-1.16 428 | build_x11_lib libXdmcp-1.1.2 429 | build_x11_lib libX11-1.8.7 --enable-malloc0returnsnull 430 | build_x11_lib libXext-1.3.5 --enable-malloc0returnsnull 431 | build_x11_lib libICE-1.0.7 432 | build_x11_lib libSM-1.2.2 433 | build_x11_lib libXrender-0.9.11 --enable-malloc0returnsnull 434 | build_x11_lib libXft-2.3.8 435 | build_x11_lib libXScrnSaver-1.2.4 --enable-malloc0returnsnull 436 | 437 | #echo "::endgroup::" 438 | ####### 439 | # tcl # 440 | ####### 441 | echo "::group::tcl" 442 | cd ${BUILDDIR} 443 | 444 | download_verify_extract tcl8.6.13-src.tar.gz 445 | cd tcl*/unix 446 | LDFLAGS="${LDFLAGS} -lxml2" ./configure --disable-shared --host=${CHOST} --prefix=${DEPSDIR} 447 | make -j4 448 | make install 449 | cd .. 450 | install_license ./license.terms 451 | 452 | echo "::endgroup::" 453 | ###### 454 | # tk # 455 | ###### 456 | echo "::group::tk" 457 | cd ${BUILDDIR} 458 | 459 | download_verify_extract tk8.6.13-src.tar.gz 460 | cd tk*/unix 461 | LDFLAGS="${LDFLAGS} -lxml2" ./configure --disable-shared --host=${CHOST} --prefix=${DEPSDIR} 462 | make -j4 463 | make install 464 | cd .. 465 | install_license ./license.terms 466 | 467 | echo "::endgroup::" 468 | ############# 469 | # mpdecimal # 470 | ############# 471 | if [[ "${ARCH}" == "arm" ]]; then 472 | echo "::group::mpdecimal" 473 | cd ${BUILDDIR} 474 | 475 | download_verify_extract mpdecimal-2.5.0.tar.gz 476 | cd mpdecimal* 477 | ./configure --disable-cxx --host=${CHOST} --prefix=${DEPSDIR} 478 | make -j4 479 | make install 480 | install_license ./LICENSE.txt 481 | 482 | echo "::endgroup::" 483 | fi 484 | ########## 485 | # Python # 486 | ########## 487 | echo "::group::Python" 488 | cd ${BUILDDIR} 489 | 490 | additionalparams=() 491 | if [[ "${ARCH}" == "arm" ]]; then 492 | additionalparams+=(-DUSE_SYSTEM_LIBMPDEC=ON) 493 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${DEPSDIR}/lib 494 | fi 495 | 496 | wget --no-verbose -O portable-python-cmake-buildsystem.tar.gz https://github.com/bjia56/portable-python-cmake-buildsystem/tarball/${CMAKE_BUILDSYSTEM_BRANCH} 497 | tar -xf portable-python-cmake-buildsystem.tar.gz 498 | rm *.tar.gz 499 | mv *portable-python-cmake-buildsystem* portable-python-cmake-buildsystem 500 | mkdir python-build 501 | mkdir python-install 502 | cd python-build 503 | LDFLAGS="${LDFLAGS} -lfontconfig -lfreetype" cmake \ 504 | "${cmake_verbose_flags[@]}" \ 505 | -DCMAKE_SYSTEM_PROCESSOR=${ARCH} \ 506 | -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/scripts/qemu_${ARCH}_interpreter \ 507 | -DCMAKE_IGNORE_PATH=/usr/include \ 508 | -DPYTHON_VERSION=${PYTHON_FULL_VER} \ 509 | -DPORTABLE_PYTHON_BUILD=ON \ 510 | -DCMAKE_BUILD_TYPE:STRING=${BUILD_TYPE} \ 511 | -DCMAKE_INSTALL_PREFIX:PATH=${BUILDDIR}/python-install \ 512 | -DBUILD_EXTENSIONS_AS_BUILTIN=ON \ 513 | -DBUILD_LIBPYTHON_SHARED=ON \ 514 | -DUSE_SYSTEM_LIBRARIES=OFF \ 515 | -DBUILD_TESTING=${INSTALL_TEST} \ 516 | -DINSTALL_TEST=${INSTALL_TEST} \ 517 | -DINSTALL_MANUAL=OFF \ 518 | "${additionalparams[@]}" \ 519 | -DOPENSSL_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 520 | -DOPENSSL_LIBRARIES="${DEPSDIR}/lib/libssl.a;${DEPSDIR}/lib/libcrypto.a" \ 521 | -DSQLite3_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 522 | -DSQLite3_LIBRARY:FILEPATH=${DEPSDIR}/lib/libsqlite3.a \ 523 | -DZLIB_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 524 | -DZLIB_LIBRARY:FILEPATH=${DEPSDIR}/lib/libz.a \ 525 | -DLZMA_INCLUDE_PATH:PATH=${DEPSDIR}/include \ 526 | -DLZMA_LIBRARY:FILEPATH=${DEPSDIR}/lib/liblzma.a \ 527 | -DBZIP2_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 528 | -DBZIP2_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libbz2.a \ 529 | -DLibFFI_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 530 | -DLibFFI_LIBRARY:FILEPATH=${DEPSDIR}/lib/libffi.a \ 531 | -DREADLINE_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include/readline/readline.h \ 532 | -DREADLINE_LIBRARY:FILEPATH=${DEPSDIR}/lib/libreadline.a \ 533 | -DUUID_LIBRARY:FILEPATH=${DEPSDIR}/lib/libuuid.a \ 534 | -DCURSES_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libncurses.a \ 535 | -DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanel.a \ 536 | -DGDBM_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include/gdbm.h \ 537 | -DGDBM_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm.a \ 538 | -DGDBM_COMPAT_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm_compat.a \ 539 | -DNDBM_TAG=NDBM \ 540 | -DNDBM_USE=NDBM \ 541 | -DTK_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include/tk.h \ 542 | -DTK_LIBRARY:FILEPATH=${DEPSDIR}/lib/libtk8.6.a \ 543 | -DTCL_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include/tcl.h \ 544 | -DTCL_LIBRARY:FILEPATH=${DEPSDIR}/lib/libtcl8.6.a \ 545 | -DX11_INCLUDE_DIR:PATH=${DEPSDIR}/include/X11 \ 546 | -DX11_LIBRARIES="${DEPSDIR}/lib/libXau.a;${DEPSDIR}/lib/libXdmcp.a;${DEPSDIR}/lib/libX11.a;${DEPSDIR}/lib/libXext.a;${DEPSDIR}/lib/libICE.a;${DEPSDIR}/lib/libSM.a;${DEPSDIR}/lib/libXrender.a;${DEPSDIR}/lib/libXft.a;${DEPSDIR}/lib/libXss.a;${DEPSDIR}/lib/libxcb.a" \ 547 | ../portable-python-cmake-buildsystem 548 | make -j4 549 | make install 550 | 551 | cd ${BUILDDIR} 552 | cp -r ${DEPSDIR}/lib/tcl8.6 ./python-install/lib 553 | cp -r ${DEPSDIR}/lib/tk8.6 ./python-install/lib 554 | cp -r ${LICENSEDIR} ./python-install 555 | 556 | echo "::endgroup::" 557 | ################################# 558 | # Check executable dependencies # 559 | ################################# 560 | echo "::group::Check executable dependencies" 561 | cd ${BUILDDIR} 562 | 563 | cd python-install 564 | echo "python dependencies" 565 | readelf -d ./bin/python 566 | echo 567 | echo "libpython dependencies" 568 | readelf -d ./lib/libpython${PYTHON_VER}.so 569 | 570 | echo "::endgroup::" 571 | ############### 572 | # Test python # 573 | ############### 574 | echo "::group::Test python" 575 | cd ${BUILDDIR} 576 | 577 | cd python-install 578 | ${WORKDIR}/scripts/qemu_${ARCH}_interpreter ./bin/python --version 579 | 580 | echo "::endgroup::" 581 | ############### 582 | # Preload pip # 583 | ############### 584 | echo "::group::Preload pip" 585 | cd ${BUILDDIR} 586 | 587 | cd python-install 588 | ${WORKDIR}/scripts/qemu_${ARCH}_interpreter ./bin/python -m ensurepip 589 | ${WORKDIR}/scripts/qemu_${ARCH}_interpreter ./bin/python -m pip install -r ${WORKDIR}/baseline/requirements.txt 590 | 591 | python3 ${WORKDIR}/scripts/patch_pip_script.py ./bin/pip3 592 | python3 ${WORKDIR}/scripts/patch_pip_script.py ./bin/pip${PYTHON_VER} 593 | 594 | echo "::endgroup::" 595 | ################### 596 | # Compress output # 597 | ################### 598 | echo "::group::Compress output" 599 | cd ${BUILDDIR} 600 | 601 | python3 -m pip install pyclean 602 | python3 -m pyclean -v python-install 603 | mv python-install python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH} 604 | tar -czf ${WORKDIR}/python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH}.tar.gz python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH} 605 | zip ${WORKDIR}/python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH}.zip $(tar tf ${WORKDIR}/python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH}.tar.gz) 606 | 607 | echo "::endgroup::" 608 | -------------------------------------------------------------------------------- /scripts/build_macos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PLATFORM=darwin 4 | SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" 5 | source ${SCRIPT_DIR}/utils.sh 6 | 7 | NPROC=$(sysctl -n hw.ncpu) 8 | 9 | set -ex 10 | 11 | ############## 12 | # Initialize # 13 | ############## 14 | echo "::group::Initialize" 15 | cd ${BUILDDIR} 16 | 17 | export MACOSX_DEPLOYMENT_TARGET=10.9 18 | export CFLAGS="-I${DEPSDIR}/include" 19 | export CPPFLAGS="-I${DEPSDIR}/include" 20 | export CXXFLAGS="${CPPFLAGS}" 21 | export LDFLAGS="-L${DEPSDIR}/lib" 22 | export PKG_CONFIG_PATH="${DEPSDIR}/lib/pkgconfig:${DEPSDIR}/share/pkgconfig" 23 | 24 | git clone https://github.com/bjia56/portable-python-cmake-buildsystem.git --branch ${CMAKE_BUILDSYSTEM_BRANCH} --single-branch --depth 1 25 | 26 | echo "::endgroup::" 27 | ########### 28 | # ncurses # 29 | ########### 30 | echo "::group::ncurses" 31 | cd ${BUILDDIR} 32 | 33 | download_verify_extract ncurses-6.4.tar.gz 34 | cd ncurses* 35 | CC=clang CXX=clang++ CFLAGS="${CFLAGS} -arch x86_64 -arch arm64" CXXFLAGS="${CXXFLAGS} -arch x86_64 -arch arm64" ./configure --with-normal --without-progs --enable-overwrite --disable-stripping --prefix=${DEPSDIR} 36 | make -j4 37 | make install.libs 38 | install_license 39 | 40 | echo "::endgroup::" 41 | ############ 42 | # readline # 43 | ############ 44 | echo "::group::readline" 45 | cd ${BUILDDIR} 46 | 47 | download_verify_extract readline-8.2.tar.gz 48 | cd readline* 49 | CC=clang CFLAGS="${CFLAGS} -arch x86_64 -arch arm64" ./configure --with-curses --disable-shared --prefix=${DEPSDIR} 50 | make -j4 51 | make install 52 | install_license 53 | 54 | echo "::endgroup::" 55 | ####### 56 | # tcl # 57 | ####### 58 | echo "::group::tcl" 59 | cd ${BUILDDIR} 60 | 61 | download_verify_extract tcl8.6.13-src.tar.gz 62 | cd tcl*/unix 63 | CC=clang CFLAGS="${CFLAGS} -arch x86_64 -arch arm64" ./configure --disable-shared --enable-aqua --prefix=${DEPSDIR} 64 | make -j${NPROC} 65 | make install 66 | cd .. 67 | install_license ./license.terms 68 | 69 | echo "::endgroup::" 70 | ###### 71 | # tk # 72 | ###### 73 | echo "::group::tk" 74 | cd ${BUILDDIR} 75 | 76 | download_verify_extract tk8.6.13-src.tar.gz 77 | cd tk*/unix 78 | CC=clang CFLAGS="${CFLAGS} -arch x86_64 -arch arm64" ./configure --disable-shared --enable-aqua --prefix=${DEPSDIR} 79 | make -j${NPROC} 80 | make install 81 | cd .. 82 | install_license ./license.terms 83 | 84 | echo "::endgroup::" 85 | ########### 86 | # OpenSSL # 87 | ########### 88 | echo "::group::OpenSSL" 89 | cd ${BUILDDIR} 90 | 91 | download_verify_extract openssl-1.1.1w.tar.gz 92 | cd openssl-1.1.1w 93 | CC=${WORKDIR}/scripts/cc ./Configure enable-rc5 zlib no-asm no-shared darwin64-x86_64-cc --prefix=${DEPSDIR} 94 | make -j${NPROC} 95 | make install_sw 96 | install_license 97 | 98 | file ${DEPSDIR}/lib/libcrypto.a 99 | file ${DEPSDIR}/lib/libssl.a 100 | 101 | echo "::endgroup::" 102 | ######### 103 | # bzip2 # 104 | ######### 105 | echo "::group::bzip2" 106 | cd ${BUILDDIR} 107 | 108 | git clone https://github.com/commontk/bzip2.git --branch master --single-branch --depth 1 109 | cd bzip2 110 | mkdir build 111 | cd build 112 | cmake \ 113 | -G "Unix Makefiles" \ 114 | "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" \ 115 | -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \ 116 | -DCMAKE_INSTALL_PREFIX:PATH=${DEPSDIR} \ 117 | .. 118 | make -j${NPROC} 119 | make install 120 | cd .. 121 | install_license 122 | 123 | file ${DEPSDIR}/lib/libbz2.a 124 | 125 | echo "::endgroup::" 126 | ######## 127 | # lzma # 128 | ######## 129 | echo "::group::lzma" 130 | cd ${BUILDDIR} 131 | 132 | download_verify_extract xz-5.4.5.tar.gz 133 | cd xz* 134 | mkdir build 135 | cd build 136 | cmake \ 137 | -G "Unix Makefiles" \ 138 | "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" \ 139 | -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \ 140 | -DCMAKE_INSTALL_PREFIX:PATH=${DEPSDIR} \ 141 | .. 142 | make -j${NPROC} 143 | make install 144 | cd .. 145 | install_license 146 | 147 | file ${DEPSDIR}/lib/liblzma.a 148 | 149 | echo "::endgroup::" 150 | ########### 151 | # sqlite3 # 152 | ########### 153 | echo "::group::sqlite3" 154 | cd ${WORKDIR} 155 | 156 | download_verify_extract sqlite-autoconf-3450000.tar.gz 157 | cd sqlite-autoconf-3450000 158 | CC=clang CFLAGS="${CFLAGS} -arch x86_64 -arch arm64" ./configure --prefix ${DEPSDIR} 159 | make -j${NPROC} 160 | make install 161 | 162 | file ${DEPSDIR}/lib/libsqlite3.a 163 | 164 | echo "::endgroup::" 165 | ######## 166 | # zlib # 167 | ######## 168 | echo "::group::zlib" 169 | cd ${BUILDDIR} 170 | 171 | download_verify_extract zlib-1.3.1.tar.gz 172 | cd zlib-1.3.1 173 | mkdir build 174 | cd build 175 | cmake \ 176 | -G "Unix Makefiles" \ 177 | "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" \ 178 | -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \ 179 | -DCMAKE_INSTALL_PREFIX:PATH=${DEPSDIR} \ 180 | .. 181 | make -j${NPROC} 182 | make install 183 | cd .. 184 | install_license 185 | 186 | file ${DEPSDIR}/lib/libz.a 187 | 188 | echo "::endgroup::" 189 | ######### 190 | # expat # 191 | ######### 192 | echo "::group::expat" 193 | cd ${BUILDDIR} 194 | 195 | download_verify_extract expat-2.6.2.tar.gz 196 | cd expat* 197 | CC=clang CFLAGS="${CFLAGS} -arch x86_64 -arch arm64" ./configure --disable-shared --prefix=${DEPSDIR} 198 | make -j${NPROC} 199 | make install 200 | install_license 201 | 202 | file ${DEPSDIR}/lib/libexpat.a 203 | 204 | echo "::endgroup::" 205 | ######## 206 | # gdbm # 207 | ######## 208 | echo "::group::gdbm" 209 | cd ${BUILDDIR} 210 | 211 | download_verify_extract gdbm-1.23.tar.gz 212 | cd gdbm* 213 | CC=clang CFLAGS="${CFLAGS} -arch x86_64 -arch arm64" ./configure --enable-libgdbm-compat --without-readline --prefix=${DEPSDIR} 214 | make -j${NPROC} 215 | make install 216 | install_license 217 | 218 | echo "::endgroup::" 219 | ########## 220 | # libffi # 221 | ########## 222 | echo "::group::libffi" 223 | cd ${BUILDDIR} 224 | 225 | download_verify_extract libffi-3.4.6.tar.gz 226 | cp -r libffi-3.4.6 libffi-3.4.6-arm64 227 | cd libffi-3.4.6 228 | CC="/usr/bin/cc" ./configure --prefix ${DEPSDIR} 229 | make -j${NPROC} 230 | make install 231 | cd ${BUILDDIR} 232 | mkdir libffi-arm64-out 233 | cd libffi-3.4.6-arm64 234 | CC="/usr/bin/cc" CFLAGS="${CFLAGS} -target arm64-apple-macos11" ./configure --prefix ${BUILDDIR}/libffi-arm64-out --build=aarch64-apple-darwin --host=aarch64 235 | make -j${NPROC} 236 | make install 237 | install_license 238 | 239 | cd ${BUILDDIR} 240 | lipo -create -output libffi.a ${DEPSDIR}/lib/libffi.a ${BUILDDIR}/libffi-arm64-out/lib/libffi.a 241 | mv libffi.a ${DEPSDIR}/lib/libffi.a 242 | 243 | file ${DEPSDIR}/lib/libffi.a 244 | 245 | echo "::endgroup::" 246 | ######## 247 | # uuid # 248 | ######## 249 | echo "::group::uuid" 250 | cd ${BUILDDIR} 251 | 252 | download_verify_extract util-linux-2.39.3.tar.gz 253 | cd util-linux* 254 | ./autogen.sh 255 | CC=clang CFLAGS="${CFLAGS} -arch x86_64 -arch arm64" ./configure --disable-all-programs --enable-libuuid --prefix=${DEPSDIR} 256 | make -j${NPROC} 257 | make install 258 | install_license ./Documentation/licenses/COPYING.BSD-3-Clause libuuid-2.39.3 259 | 260 | echo "::endgroup::" 261 | ######### 262 | # Build # 263 | ######### 264 | echo "::group::Build" 265 | cd ${BUILDDIR} 266 | 267 | mkdir python-build 268 | mkdir python-install 269 | cd python-build 270 | cmake \ 271 | "${cmake_verbose_flags[@]}" \ 272 | -G "Unix Makefiles" \ 273 | "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" \ 274 | -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \ 275 | -DCMAKE_IGNORE_PREFIX_PATH=/Applications \ 276 | -DPYTHON_VERSION=${PYTHON_FULL_VER} \ 277 | -DPORTABLE_PYTHON_BUILD=ON \ 278 | -DCMAKE_BUILD_TYPE:STRING=${BUILD_TYPE} \ 279 | -DCMAKE_INSTALL_PREFIX:PATH=${BUILDDIR}/python-install \ 280 | -DBUILD_EXTENSIONS_AS_BUILTIN=OFF \ 281 | -DBUILD_LIBPYTHON_SHARED=ON \ 282 | -DUSE_SYSTEM_LIBRARIES=OFF \ 283 | -DBUILD_TESTING=${INSTALL_TEST} \ 284 | -DINSTALL_TEST=${INSTALL_TEST} \ 285 | -DINSTALL_MANUAL=OFF \ 286 | -DOPENSSL_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 287 | -DOPENSSL_LIBRARIES="${DEPSDIR}/lib/libssl.a;${DEPSDIR}/lib/libcrypto.a;${DEPSDIR}/lib/libz.a" \ 288 | -DEXPAT_INCLUDE_DIRS:PATH=${DEPSDIR}/include \ 289 | -DEXPAT_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libexpat.a \ 290 | -DSQLite3_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 291 | -DSQLite3_LIBRARY:FILEPATH=${DEPSDIR}/lib/libsqlite3.a \ 292 | -DZLIB_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 293 | -DZLIB_LIBRARY:FILEPATH=${DEPSDIR}/lib/libz.a \ 294 | -DLZMA_INCLUDE_PATH:PATH=${DEPSDIR}/include \ 295 | -DLZMA_LIBRARY:FILEPATH=${DEPSDIR}/lib/liblzma.a \ 296 | -DBZIP2_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 297 | -DBZIP2_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libbz2.a \ 298 | -DLibFFI_INCLUDE_DIR:PATH=${DEPSDIR}/include \ 299 | -DLibFFI_LIBRARY:FILEPATH=${DEPSDIR}/lib/libffi.a \ 300 | -DREADLINE_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include/readline/readline.h \ 301 | -DREADLINE_LIBRARY:FILEPATH=${DEPSDIR}/lib/libreadline.a \ 302 | -DUUID_LIBRARY:FILEPATH=${DEPSDIR}/lib/libuuid.a \ 303 | -DCURSES_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libncurses.a \ 304 | -DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanel.a \ 305 | -DGDBM_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include/gdbm.h \ 306 | -DGDBM_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm.a \ 307 | -DGDBM_COMPAT_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm_compat.a \ 308 | -DNDBM_TAG=NDBM \ 309 | -DNDBM_USE=NDBM \ 310 | -DTK_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include/tk.h \ 311 | -DTK_LIBRARY:FILEPATH=${DEPSDIR}/lib/libtk8.6.a \ 312 | -DTCL_INCLUDE_PATH:FILEPATH=${DEPSDIR}/include/tcl.h \ 313 | -DTCL_LIBRARY:FILEPATH=${DEPSDIR}/lib/libtcl8.6.a \ 314 | ../portable-python-cmake-buildsystem 315 | make -j${NPROC} 316 | make install 317 | cp -r ${LICENSEDIR} ${BUILDDIR}/python-install 318 | cd ${BUILDDIR} 319 | 320 | echo "::endgroup::" 321 | ######################### 322 | # Test and patch python # 323 | ######################### 324 | echo "::group::Test and patch python" 325 | cd ${BUILDDIR} 326 | 327 | ./python-install/bin/python --version 328 | 329 | otool -l ./python-install/bin/python 330 | install_name_tool -add_rpath @executable_path/../lib ./python-install/bin/python 331 | install_name_tool -change ${BUILDDIR}/python-install/lib/libpython${PYTHON_VER}.dylib @rpath/libpython${PYTHON_VER}.dylib ./python-install/bin/python 332 | otool -l ./python-install/bin/python 333 | 334 | ./python-install/bin/python --version 335 | 336 | echo "::endgroup::" 337 | ############### 338 | # Preload pip # 339 | ############### 340 | echo "::group::Preload pip" 341 | cd ${BUILDDIR} 342 | 343 | ./python-install/bin/python -m ensurepip 344 | ./python-install/bin/python -m pip install -r ${WORKDIR}/baseline/requirements.txt 345 | 346 | python3 ${WORKDIR}/scripts/patch_pip_script.py ./python-install/bin/pip3 347 | python3 ${WORKDIR}/scripts/patch_pip_script.py ./python-install/bin/pip${PYTHON_VER} 348 | 349 | ################### 350 | # Compress output # 351 | ################### 352 | echo "::group::Compress output" 353 | cd ${BUILDDIR} 354 | 355 | python3 -m pip install pyclean 356 | python3 -m pyclean -v python-install 357 | mv python-install python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH} 358 | tar -czf ${WORKDIR}/python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH}.tar.gz python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH} 359 | zip ${WORKDIR}/python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH}.zip $(tar tf ${WORKDIR}/python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH}.tar.gz) 360 | 361 | echo "::endgroup::" 362 | -------------------------------------------------------------------------------- /scripts/build_windows.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PLATFORM=windows 4 | SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" 5 | source ${SCRIPT_DIR}/utils.sh 6 | 7 | ############## 8 | # Initialize # 9 | ############## 10 | echo "::group::Initialize" 11 | cd ${BUILDDIR} 12 | 13 | git clone https://github.com/bjia56/portable-python-cmake-buildsystem.git --branch ${CMAKE_BUILDSYSTEM_BRANCH} --single-branch --depth 1 14 | 15 | echo "::endgroup::" 16 | ########### 17 | # OpenSSL # 18 | ########### 19 | echo "::group::OpenSSL" 20 | cd ${BUILDDIR} 21 | 22 | curl -L https://github.com/Slicer/Slicer-OpenSSL/releases/download/1.1.1g/OpenSSL_1_1_1g-install-msvc1900-64-Release.tar.gz --output openssl.tar.gz 23 | tar -xf openssl.tar.gz 24 | mv OpenSSL_1_1_1g-install-msvc1900-64-Release ${DEPSDIR}/openssl 25 | mkdir openssl-1.1.1g 26 | cd openssl-1.1.1g 27 | curl -L https://www.openssl.org/source/license-openssl-ssleay.txt --output LICENSE 28 | install_license 29 | 30 | echo "::endgroup::" 31 | ######### 32 | # bzip2 # 33 | ######### 34 | echo "::group::bzip2" 35 | cd ${BUILDDIR} 36 | 37 | git clone https://github.com/commontk/bzip2.git --branch master --single-branch --depth 1 38 | mkdir ${DEPSDIR}/bzip2 39 | cd bzip2 40 | mkdir build 41 | cd build 42 | cmake \ 43 | -G "Visual Studio 17 2022" -A x64 \ 44 | -DCMAKE_INSTALL_PREFIX:PATH=${DEPSDIR}/bzip2 \ 45 | .. 46 | cmake --build . --config Release -- /property:Configuration=Release 47 | cmake --build . --target INSTALL -- /property:Configuration=Release 48 | cd .. 49 | install_license 50 | 51 | echo "::endgroup::" 52 | ######## 53 | # lzma # 54 | ######## 55 | echo "::group::lzma" 56 | cd ${BUILDDIR} 57 | 58 | download_verify_extract xz-5.4.5.tar.gz 59 | mkdir ${DEPSDIR}/xz 60 | cd xz-5.4.5 61 | mkdir build 62 | cd build 63 | cmake \ 64 | -G "Visual Studio 17 2022" -A x64 \ 65 | -DCMAKE_INSTALL_PREFIX:PATH=${DEPSDIR}/xz \ 66 | .. 67 | cmake --build . --config Release -- /property:Configuration=Release 68 | cmake --build . --target INSTALL -- /property:Configuration=Release 69 | cd .. 70 | install_license 71 | 72 | echo "::endgroup::" 73 | ########### 74 | # sqlite3 # 75 | ########### 76 | echo "::group::sqlite3" 77 | cd ${BUILDDIR} 78 | 79 | download_and_verify sqlite-amalgamation-3430100.zip 80 | unzip -qq sqlite-amalgamation-3430100.zip 81 | mv sqlite-amalgamation-3430100 ${DEPSDIR}/sqlite3 82 | cd ${DEPSDIR}/sqlite3 83 | cl //c sqlite3.c 84 | lib sqlite3.obj 85 | 86 | echo "::endgroup::" 87 | ######## 88 | # zlib # 89 | ######## 90 | echo "::group::zlib" 91 | cd ${BUILDDIR} 92 | 93 | download_verify_extract zlib-1.3.1.tar.gz 94 | mkdir ${DEPSDIR}/zlib 95 | cd zlib-1.3.1 96 | mkdir build 97 | cd build 98 | cmake \ 99 | -G "Visual Studio 17 2022" -A x64 \ 100 | -DCMAKE_INSTALL_PREFIX:PATH=${DEPSDIR}/zlib \ 101 | .. 102 | cmake --build . --config Release -- /property:Configuration=Release 103 | cmake --build . --target INSTALL -- /property:Configuration=Release 104 | cd .. 105 | install_license 106 | 107 | echo "::endgroup::" 108 | ########## 109 | # libffi # 110 | ########## 111 | echo "::group::libffi" 112 | cd ${BUILDDIR} 113 | 114 | curl -L https://github.com/python/cpython-bin-deps/archive/refs/tags/libffi-3.4.4.tar.gz --output cpython-bin-deps-libffi-3.4.4.tar.gz 115 | tar -xf cpython-bin-deps-libffi-3.4.4.tar.gz 116 | cd cpython-bin-deps-libffi-3.4.4 117 | mkdir ${DEPSDIR}/libffi 118 | cp -r amd64/include ${DEPSDIR}/libffi/include 119 | mkdir ${DEPSDIR}/libffi/lib 120 | cp amd64/libffi* ${DEPSDIR}/libffi/lib/ 121 | install_license 122 | 123 | echo "::endgroup::" 124 | ######### 125 | # Build # 126 | ######### 127 | echo "::group::Build" 128 | cd ${BUILDDIR} 129 | 130 | mkdir python-build 131 | mkdir python-install 132 | cd python-build 133 | cmake \ 134 | "${cmake_verbose_flags[@]}" \ 135 | -G "Visual Studio 17 2022" -A x64 \ 136 | -DPYTHON_VERSION=${PYTHON_FULL_VER} \ 137 | -DPORTABLE_PYTHON_BUILD=ON \ 138 | -DCMAKE_BUILD_TYPE:STRING=${BUILD_TYPE} \ 139 | -DCMAKE_INSTALL_PREFIX:PATH=${BUILDDIR}/python-install \ 140 | -DBUILD_EXTENSIONS_AS_BUILTIN=OFF \ 141 | -DBUILD_LIBPYTHON_SHARED=ON \ 142 | -DBUILD_TESTING=${INSTALL_TEST} \ 143 | -DINSTALL_TEST=${INSTALL_TEST} \ 144 | -DINSTALL_MANUAL=OFF \ 145 | -DBUILD_WININST=OFF \ 146 | -DINSTALL_WINDOWS_TRADITIONAL:BOOL=OFF \ 147 | -DOPENSSL_ROOT_DIR:PATH=${DEPSDIR}/openssl \ 148 | -DSQLite3_INCLUDE_DIR:PATH=${DEPSDIR}/sqlite3 \ 149 | -DSQLite3_LIBRARY:FILEPATH=${DEPSDIR}/sqlite3/sqlite3.lib \ 150 | -DZLIB_INCLUDE_DIR:PATH=${DEPSDIR}/zlib/include \ 151 | -DZLIB_LIBRARY:FILEPATH=${DEPSDIR}/zlib/lib/zlibstatic.lib \ 152 | -DLZMA_INCLUDE_PATH:PATH=${DEPSDIR}/xz/include \ 153 | -DLZMA_LIBRARY:FILEPATH=${DEPSDIR}/xz/lib/liblzma.lib \ 154 | -DBZIP2_INCLUDE_DIR:PATH=${DEPSDIR}/bzip2/include \ 155 | -DBZIP2_LIBRARIES:FILEPATH=${DEPSDIR}/bzip2/lib/libbz2.lib \ 156 | -DLibFFI_INCLUDE_DIR:PATH=${DEPSDIR}/libffi/include \ 157 | -DLibFFI_LIBRARY:FILEPATH=${DEPSDIR}/libffi/lib/libffi-8.lib \ 158 | ../portable-python-cmake-buildsystem 159 | cmake --build . --config ${BUILD_TYPE} -- /property:Configuration=${BUILD_TYPE} 160 | cmake --build . --target INSTALL -- /property:Configuration=${BUILD_TYPE} 161 | cp -r ${LICENSEDIR} ${BUILDDIR}/python-install 162 | cd ${BUILDDIR} 163 | 164 | # Need to bundle openssl with the executable 165 | cp ${DEPSDIR}/openssl/bin/*.dll python-install/bin 166 | 167 | # Need to bundle libffi with the executable 168 | cp ${DEPSDIR}/libffi/lib/*.dll python-install/bin 169 | 170 | # Need to bundle vcredist 171 | #cp /c/WINDOWS/SYSTEM32/VCRUNTIME140.dll python-install/bin 172 | 173 | echo "::endgroup::" 174 | ############### 175 | # Test python # 176 | ############### 177 | echo "::group::Test python" 178 | cd ${BUILDDIR} 179 | 180 | ./python-install/bin/python --version 181 | 182 | echo "::endgroup::" 183 | ############### 184 | # Preload pip # 185 | ############### 186 | echo "::group::Preload pip" 187 | cd ${BUILDDIR} 188 | 189 | ./python-install/bin/python -m ensurepip 190 | ./python-install/bin/python -m pip install -r ${WORKDIR}/baseline/requirements.txt 191 | 192 | ################### 193 | # Compress output # 194 | ################### 195 | echo "::group::Compress output" 196 | cd ${BUILDDIR} 197 | 198 | python3 -m pip install pyclean 199 | python3 -m pyclean -v python-install 200 | mv python-install python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH} 201 | tar -czf ${WORKDIR}/python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH}.tar.gz python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH} 202 | 7z.exe a ${WORKDIR}/python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH}.zip python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH} 203 | 204 | echo "::endgroup::" 205 | -------------------------------------------------------------------------------- /scripts/cc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # https://stackoverflow.com/a/75250222 3 | 4 | if [[ $* == *-arch\ x86_64* ]] && ! [[ $* == *-arch\ arm64* ]]; then 5 | echo Forcing compilation with arm64 6 | cc -arch arm64 "$@" 7 | else 8 | cc "$@" 9 | fi -------------------------------------------------------------------------------- /scripts/patch_pip_script.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | # adapted from https://stackoverflow.com/a/57567228 4 | new_shebang = """#!/bin/sh 5 | "true" '''\\' 6 | exec "$(dirname "$0")"/python "$0" "$@" 7 | '''""" 8 | 9 | if __name__ == "__main__": 10 | if len(sys.argv) != 2: 11 | print(f"Usage: {sys.argv[0]} ") 12 | sys.exit(1) 13 | 14 | with open(sys.argv[1], "r") as f: 15 | lines = f.readlines() 16 | 17 | script = "" 18 | for line in lines: 19 | if line.startswith("#!"): 20 | # replace the shebang of the script with a relative path to the python interpreter 21 | script += new_shebang + "\n" 22 | else: 23 | script += line 24 | 25 | with open(sys.argv[1], "w") as f: 26 | f.write(script) 27 | -------------------------------------------------------------------------------- /scripts/pick_semver.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | python_version=$1 4 | beta=$2 5 | print_latest=$3 6 | 7 | 8 | suffix=build 9 | if [[ "$beta" == "true" ]]; then 10 | suffix=beta 11 | fi 12 | 13 | tags=$(git tag | grep "$python_version-$suffix") 14 | 15 | if [[ -z "$tags" ]]; then 16 | if [[ "$print_latest" != "true" ]]; then 17 | echo "v$python_version-$suffix.0" 18 | fi 19 | exit 0 20 | fi 21 | 22 | most_recent=0 23 | while read tag; do 24 | tag_postfix=$(echo $tag | sed "s/^v$python_version-$suffix\.//") 25 | if [ "$tag_postfix" -gt "$most_recent" ]; then 26 | most_recent=$tag_postfix 27 | fi 28 | done <<< "$tags" 29 | 30 | if [[ "$print_latest" == "true" ]]; then 31 | echo "v$python_version-$suffix.$most_recent" 32 | else 33 | echo "v$python_version-$suffix.$(expr $most_recent + 1)" 34 | fi -------------------------------------------------------------------------------- /scripts/qemu_aarch64_interpreter: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # this interpreter shim is used by cmake to run platform 3 | # detection programs 4 | LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib qemu-aarch64-static "$@" -------------------------------------------------------------------------------- /scripts/qemu_arm_interpreter: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # this interpreter shim is used by cmake to run platform 3 | # detection programs 4 | LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib qemu-arm-static "$@" -------------------------------------------------------------------------------- /scripts/qemu_i386_interpreter: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # this interpreter shim is used by cmake to run platform 3 | # detection programs 4 | LD_LIBRARY_PATH=/usr/i686-linux-gnu/lib qemu-i386-static "$@" -------------------------------------------------------------------------------- /scripts/qemu_riscv64_interpreter: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # this interpreter shim is used by cmake to run platform 3 | # detection programs 4 | 5 | has_lp64d=$(readelf -a $1 | grep "Requesting program interpreter" | grep ld-linux-riscv64-lp64d.so.1) 6 | if [[ "${has_lp64d}" == "" ]]; then 7 | patchelf --set-interpreter /lib/ld-linux-riscv64-lp64d.so.1 $1 8 | fi 9 | 10 | has_lp64=$(readelf -d $1 | grep ld-linux-riscv64-lp64.so.1) 11 | if [[ "${has_lp64}" != "" ]]; then 12 | patchelf --replace-needed ld-linux-riscv64-lp64.so.1 ld-linux-riscv64-lp64d.so.1 $1 13 | fi 14 | 15 | has_libpython=$(readelf -d $1 | grep libpython3) 16 | if [[ "${has_libpython}" != "" ]]; then 17 | # this is the main python interpreter - patch libpython in its sibling directory 18 | full_path=$(realpath $1) 19 | prefix_dir=$(dirname $(dirname ${full_path})) 20 | libpython=${prefix_dir}/lib/libpython${PORTABLE_PYTHON_PY_VER}.so 21 | 22 | libpython_has_lp64=$(readelf -d ${libpython} | grep ld-linux-riscv64-lp64.so.1) 23 | if [[ "${libpython_has_lp64}" != "" ]]; then 24 | patchelf --replace-needed ld-linux-riscv64-lp64.so.1 ld-linux-riscv64-lp64d.so.1 ${libpython} 25 | fi 26 | fi 27 | 28 | LD_LIBRARY_PATH=/usr/riscv64-linux-gnu/lib qemu-riscv64-static "$@" -------------------------------------------------------------------------------- /scripts/qemu_x86_64_interpreter: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # this interpreter shim is used by cmake to run platform 3 | # detection programs 4 | LD_LIBRARY_PATH=/usr/x86_64-linux-gnu/lib qemu-x86_64-static "$@" -------------------------------------------------------------------------------- /scripts/test.py: -------------------------------------------------------------------------------- 1 | import multiprocessing 2 | import pkgutil 3 | import sys 4 | 5 | import test_deps 6 | 7 | 8 | RED = '\u001b[31m' 9 | GREEN = '\u001b[32m' 10 | RESET = '\u001b[0m' 11 | 12 | 13 | def failed(msg): 14 | print(f"{RED}{msg}{RESET}") 15 | 16 | 17 | def succeeded(msg): 18 | print(f"{GREEN}{msg}{RESET}") 19 | 20 | 21 | def import_with_timeout(mod_name): 22 | q = multiprocessing.Queue() 23 | p = multiprocessing.Process(target=test_deps.import_module, args=(mod_name, q)) 24 | p.start() 25 | 26 | p.join(10) 27 | if p.is_alive(): 28 | p.terminate() 29 | p.join() 30 | failed(f"Importing {mod_name} timed out after 10 seconds") 31 | else: 32 | result = q.get() 33 | if result: 34 | failed(f"Importing {mod_name} failed with exception:\n{result}") 35 | else: 36 | succeeded(f"Importing {mod_name} succeeded") 37 | 38 | 39 | if __name__ == "__main__": 40 | # Get a list of all available modules 41 | available_modules = set() 42 | for m in pkgutil.iter_modules(): 43 | available_modules.add(m.name) 44 | for m in sys.builtin_module_names: 45 | available_modules.add(m) 46 | available_modules = list(available_modules) 47 | available_modules.sort() 48 | print("Available modules:", [m for m in available_modules]) 49 | 50 | for mod in available_modules: 51 | import_with_timeout(mod) 52 | 53 | # test urllib can use the bundled certifi CAs 54 | import urllib.request 55 | urllib.request.urlopen('https://github.com') -------------------------------------------------------------------------------- /scripts/test_deps.py: -------------------------------------------------------------------------------- 1 | import importlib 2 | import traceback 3 | 4 | def import_module(module_name, queue): 5 | try: 6 | importlib.import_module(module_name) 7 | queue.put(None) 8 | except Exception: 9 | queue.put(traceback.format_exc()) 10 | -------------------------------------------------------------------------------- /scripts/update_installer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from distutils.version import StrictVersion, LooseVersion 4 | import json 5 | import os 6 | import sys 7 | 8 | if __name__ == "__main__": 9 | if len(sys.argv) != 3: 10 | print(f'Usage: {sys.argv[0]} ') 11 | sys.exit(1) 12 | 13 | major_minor = '.'.join(sys.argv[1].split('.')[0:2]) 14 | 15 | base_installer_dir = os.path.join( 16 | os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 17 | "installers", 18 | "nodejs" 19 | ) 20 | base_installer_package_json = os.path.join(base_installer_dir, "package.json") 21 | version_installer_dir = f"{base_installer_dir}-{major_minor}" 22 | version_installer_package_json = os.path.join(version_installer_dir, "package.json") 23 | 24 | ### 25 | # Update @bjia56/portable-python package.json 26 | ### 27 | 28 | with open(base_installer_package_json, 'r') as f: 29 | package_json = json.load(f) 30 | 31 | versions = package_json['portablePython']['versions'] 32 | if sys.argv[1] not in versions: 33 | versions.append(sys.argv[1]) 34 | versions.sort(key=StrictVersion) 35 | versions.reverse() 36 | 37 | version_builds = package_json['portablePython']['versionBuilds'] 38 | version_builds[sys.argv[1]] = sys.argv[2] 39 | 40 | package_version = StrictVersion(package_json["version"]) 41 | package_json["version"] = f"{package_version.version[0]}.{package_version.version[1]}.{package_version.version[2] + 1}" 42 | 43 | with open(base_installer_package_json, 'w') as f: 44 | json.dump(package_json, f, indent=2) 45 | 46 | ### 47 | # Update version-specific package.json 48 | ### 49 | 50 | with open(version_installer_package_json, 'r') as f: 51 | package_json = json.load(f) 52 | 53 | package_version = LooseVersion(package_json["version"]) 54 | package_json["version"] = f"{package_version.version[0]}.{package_version.version[1]}.{int(''.join([str(i) for i in package_version.version[2:]])) + 1}" 55 | 56 | with open(version_installer_package_json, 'w') as f: 57 | json.dump(package_json, f, indent=2) -------------------------------------------------------------------------------- /scripts/utils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CMAKE_BUILDSYSTEM_BRANCH=${PORTABLE_PYTHON_BUILDSYSTEM_BRANCH} 6 | echo "Selected portable-python-cmake-buildsystem branch: ${CMAKE_BUILDSYSTEM_BRANCH}" 7 | 8 | SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" 9 | 10 | if [[ "${PLATFORM}" == "freebsd"* ]]; then 11 | function verify_checksum () { 12 | file="$1" 13 | filename=$(basename $file) 14 | sum=$(cat ${SCRIPT_DIR}/../checksums/$file.sha256 | awk '{print $1}') 15 | sha256 -c $sum $file 16 | } 17 | else 18 | function verify_checksum () { 19 | file="$1" 20 | filename=$(basename $file) 21 | echo "$(cat ${SCRIPT_DIR}/../checksums/$file.sha256)" | sha256sum -c 22 | } 23 | fi 24 | 25 | function download_and_verify () { 26 | file="$1" 27 | curl -s -S -f -L -o $file https://github.com/bjia56/portable-python/releases/download/build-dependencies/$file 28 | verify_checksum $file 29 | } 30 | 31 | function download_verify_extract () { 32 | #set -x 33 | file="$1" 34 | download_and_verify $file 35 | tar -xf $file 36 | rm $file 37 | #set +x 38 | } 39 | 40 | ARCH=$1 41 | PYTHON_FULL_VER=$2 42 | PYTHON_VER=$(echo ${PYTHON_FULL_VER} | cut -d "." -f 1-2) 43 | export PORTABLE_PYTHON_PY_VER=${PYTHON_VER} 44 | 45 | WORKDIR=$(pwd) 46 | BUILDDIR=${WORKDIR}/build 47 | DEPSDIR=${WORKDIR}/deps 48 | LICENSEDIR=${WORKDIR}/licenses 49 | 50 | license_files=$(cat <<-END 51 | LICENSE 52 | COPYING 53 | END 54 | ) 55 | function install_license () { 56 | #set -x 57 | project=$(basename $(pwd)) 58 | file=$1 59 | if [[ "$2" != "" ]]; then 60 | project=$2 61 | fi 62 | if [[ "$file" != "" ]]; then 63 | if test -f $file; then 64 | cp $1 ${LICENSEDIR}/$project.txt 65 | #set +x 66 | return 0 67 | fi 68 | else 69 | while read license_file; do 70 | if test -f $license_file; then 71 | cp $license_file ${LICENSEDIR}/$project.txt 72 | #set +x 73 | return 0 74 | fi 75 | done <<< "$license_files" 76 | fi 77 | >&2 echo "could not find a license file" 78 | #set +x 79 | return 1 80 | } 81 | 82 | if [[ "${RUN_TESTS}" == "true" ]]; then 83 | INSTALL_TEST="ON" 84 | else 85 | INSTALL_TEST="OFF" 86 | fi 87 | 88 | if [[ "${DEBUG_CI}" == "true" ]]; then 89 | BUILD_TYPE=Debug 90 | trap "cd ${BUILDDIR} && tar -czf ${WORKDIR}/build-python-${PYTHON_FULL_VER}-${PLATFORM}-${ARCH}.tar.gz ." EXIT 91 | else 92 | BUILD_TYPE=Release 93 | fi 94 | 95 | cmake_verbose_flags=() 96 | if [[ "${VERBOSE_CI}" == "true" ]]; then 97 | cmake_verbose_flags+=(--trace-expand --debug-find) 98 | fi 99 | 100 | mkdir ${BUILDDIR} 101 | mkdir ${DEPSDIR} 102 | mkdir ${LICENSEDIR} 103 | -------------------------------------------------------------------------------- /zigshim/patches/01-arm-xstatver.h.patch: -------------------------------------------------------------------------------- 1 | diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/xstatver.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/xstatver.h 2 | new file mode 100644 3 | index 0000000000..693b41c3ac 4 | --- /dev/null 5 | +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/xstatver.h 6 | @@ -0,0 +1,13 @@ 7 | +/* Versions of the 'struct stat' data structure used in compatibility xstat 8 | + functions. */ 9 | +#define _STAT_VER_LINUX_OLD 1 10 | +#define _STAT_VER_KERNEL 1 11 | +#define _STAT_VER_SVR4 2 12 | +#define _STAT_VER_LINUX 3 13 | +#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ 14 | + 15 | +/* Versions of the 'xmknod' interface used in compatibility xmknod 16 | + functions. */ 17 | +#define _MKNOD_VER_LINUX 1 18 | +#define _MKNOD_VER_SVR4 2 19 | +#define _MKNOD_VER _MKNOD_VER_LINUX 20 | -------------------------------------------------------------------------------- /zigshim/patches/02-riscv64.patch: -------------------------------------------------------------------------------- 1 | From a1cabc97e9192ce891d970a5b3a51fc00088bef7 Mon Sep 17 00:00:00 2001 2 | From: Tristan Ross 3 | Date: Sat, 3 Feb 2024 21:07:15 -0800 4 | Subject: [PATCH] glibc: add changes to make riscv64-linux-gnu works 5 | 6 | --- 7 | lib/libc/glibc/csu/elf-init-2.33.c | 1 + 8 | lib/libc/glibc/sysdeps/generic/elf-initfini.h | 1 + 9 | lib/libc/glibc/sysdeps/generic/sysdep.h | 6 +++++ 10 | lib/libc/glibc/sysdeps/riscv/start-2.33.S | 2 +- 11 | lib/libc/glibc/sysdeps/riscv/start.S | 2 +- 12 | .../riscv64-linux-gnu/gnu/stubs-lp64d.h | 24 +++++++++++++++++++ 13 | 6 files changed, 34 insertions(+), 2 deletions(-) 14 | create mode 100644 lib/libc/glibc/sysdeps/generic/elf-initfini.h 15 | create mode 100644 lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64d.h 16 | 17 | diff --git a/lib/libc/glibc/csu/elf-init-2.33.c b/lib/libc/glibc/csu/elf-init-2.33.c 18 | index b713c8b0fb50..42ce6583fece 100644 19 | --- a/lib/libc/glibc/csu/elf-init-2.33.c 20 | +++ b/lib/libc/glibc/csu/elf-init-2.33.c 21 | @@ -34,6 +34,7 @@ 22 | . */ 23 | 24 | #include 25 | +#include 26 | 27 | 28 | /* These magic symbols are provided by the linker. */ 29 | diff --git a/lib/libc/glibc/sysdeps/generic/elf-initfini.h b/lib/libc/glibc/sysdeps/generic/elf-initfini.h 30 | new file mode 100644 31 | index 000000000000..6630cc8de92e 32 | --- /dev/null 33 | +++ b/lib/libc/glibc/sysdeps/generic/elf-initfini.h 34 | @@ -0,0 +1 @@ 35 | +#define NO_INITFINI 1 36 | diff --git a/lib/libc/glibc/sysdeps/generic/sysdep.h b/lib/libc/glibc/sysdeps/generic/sysdep.h 37 | index e77be376f7a8..7caa7d76a95c 100644 38 | --- a/lib/libc/glibc/sysdeps/generic/sysdep.h 39 | +++ b/lib/libc/glibc/sysdeps/generic/sysdep.h 40 | @@ -56,6 +56,12 @@ 41 | # define cfi_personality(enc, exp) .cfi_personality enc, exp 42 | # define cfi_lsda(enc, exp) .cfi_lsda enc, exp 43 | 44 | +# ifndef __clang__ 45 | +# define cfi_label(label) .cfi_label label 46 | +# else 47 | +# define cfi_label(label) 48 | +# endif 49 | + 50 | #else /* ! ASSEMBLER */ 51 | 52 | # define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name) 53 | diff --git a/lib/libc/glibc/sysdeps/riscv/start-2.33.S b/lib/libc/glibc/sysdeps/riscv/start-2.33.S 54 | index 09511b1ef823..8057b4d464ae 100644 55 | --- a/lib/libc/glibc/sysdeps/riscv/start-2.33.S 56 | +++ b/lib/libc/glibc/sysdeps/riscv/start-2.33.S 57 | @@ -45,7 +45,7 @@ 58 | ENTRY (ENTRY_POINT) 59 | /* Terminate call stack by noting ra is undefined. Use a dummy 60 | .cfi_label to force starting the FDE. */ 61 | - .cfi_label .Ldummy 62 | + cfi_label (.Ldummy) 63 | cfi_undefined (ra) 64 | call load_gp 65 | mv a5, a0 /* rtld_fini. */ 66 | diff --git a/lib/libc/glibc/sysdeps/riscv/start.S b/lib/libc/glibc/sysdeps/riscv/start.S 67 | index 6dfe65273f2e..837031148630 100644 68 | --- a/lib/libc/glibc/sysdeps/riscv/start.S 69 | +++ b/lib/libc/glibc/sysdeps/riscv/start.S 70 | @@ -45,7 +45,7 @@ 71 | ENTRY (ENTRY_POINT) 72 | /* Terminate call stack by noting ra is undefined. Use a dummy 73 | .cfi_label to force starting the FDE. */ 74 | - .cfi_label .Ldummy 75 | + cfi_label (.Ldummy) 76 | cfi_undefined (ra) 77 | call load_gp 78 | mv a5, a0 /* rtld_fini. */ 79 | diff --git a/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64d.h b/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64d.h 80 | new file mode 100644 81 | index 000000000000..0ba0dd8b5434 82 | --- /dev/null 83 | +++ b/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64d.h 84 | @@ -0,0 +1,24 @@ 85 | +/* This file is automatically generated. 86 | + It defines a symbol `__stub_FUNCTION' for each function 87 | + in the C library which is a stub, meaning it will fail 88 | + every time called, usually setting errno to ENOSYS. */ 89 | + 90 | +#ifdef _LIBC 91 | +# error Applications may not define the macro _LIBC 92 | +#endif 93 | + 94 | +#define __stub___compat_bdflush 95 | +#define __stub___compat_create_module 96 | +#define __stub___compat_get_kernel_syms 97 | +#define __stub___compat_query_module 98 | +#define __stub___compat_uselib 99 | +#define __stub_chflags 100 | +#define __stub_fchflags 101 | +#define __stub_fedisableexcept 102 | +#define __stub_feenableexcept 103 | +#define __stub_fegetexcept 104 | +#define __stub_gtty 105 | +#define __stub_revoke 106 | +#define __stub_setlogin 107 | +#define __stub_sigreturn 108 | +#define __stub_stty 109 | -------------------------------------------------------------------------------- /zigshim/zig_ar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | zig ar "$@" -------------------------------------------------------------------------------- /zigshim/zig_cc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | zig cc $ZIG_FLAGS "$@" -------------------------------------------------------------------------------- /zigshim/zig_cxx: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | zig c++ $ZIG_FLAGS "$@" --------------------------------------------------------------------------------