🔒 Repository is read-only – file editing is disabled.

recipes/utils/python-installer/PAGBUILD.yaml main

34 linii Raw ← Powrót
12345678910111213141516171819202122232425262728293031323334
pkgname: python-installer
pkgver: '1.0.1'
pkgrel: 1
pkgdesc: Low-level library for installing a Python package from a wheel distribution
url: 'https://github.com/pypa/installer'
arch: x86_64
license:
- MIT
depends:
- python
makedepends:
- python
- python-flit-core
source:
- 'https://github.com/pypa/installer/archive/refs/tags/${pkgver}.tar.gz'
sha256sums:
- SKIP
build: |
  cd installer-${pkgver}

  # 1. Build wheel using flit_core directly (avoids python-build circular dependency)
  python3 -m flit_core.wheel

  # 2. Bootstrap install by extracting the wheel into PKGDIR using Python stdlib
  PYVER=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
  SITEPACKAGES="${PKGDIR}/usr/lib/python${PYVER}/site-packages"
  mkdir -p "${SITEPACKAGES}"

  python3 -c "import zipfile, glob; zipfile.ZipFile(glob.glob('dist/*.whl')[0]).extractall('${SITEPACKAGES}')"

  # 3. Cleanup unused artifacts and install license
  find "${PKGDIR}" -type d \( -name vendor -o -name "*.exe" \) -exec rm -rf {} +
  install -Dm 644 LICENSE "${PKGDIR}/usr/share/licenses/${pkgname}/LICENSE"
package: 'true'