|
root / devel / mercurial / build.sh
build.sh Bash 22 lines 816 B
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# Build script for Mercurial (CPython application).
# Builds against the `python` zport; installs /usr/local/bin/hg.

set -e
cd "$SRCDIR"

PYTHON="$PREFIX/bin/python3"

# Mercurial's setup.py imports setuptools_scm (only needed for VCS/dev builds);
# a release tarball has __version__ baked in. Patch out the import.
sed -i 's/import setuptools_scm/setuptools_scm = None  # release tarball/' setup.py

# setup.py needs setuptools — Python 3.13's ensurepip ships pip only. pip works
# against the base OpenSSL 3.5, so fetch setuptools from PyPI over HTTPS.
"$PYTHON" -m pip install --quiet setuptools

# Build + install the C extensions and pure-Python modules; hg gets an
# absolute #!$PREFIX/bin/python3 shebang.
"$PYTHON" setup.py build
"$PYTHON" setup.py install --prefix="$PREFIX" --root="$PKGDIR"