Steps to Create a VENV in /tmp, Modify pyvenv.cfg, Activate VENV, and Build with Updated PKGBUILD Step 1: Create a Virtual Environment in /tmp
python -m venv /tmp/build_env
Step 2: Modify pyvenv.cfg to Include System Site Packages
sed -i 's/include-system-site-packages = false/include-system-site-packages = true/' /tmp/build_env/pyvenv.cfg
Step 3: Activate the Virtual Environment
source /tmp/build_env/bin/activate
Step 4: Install Necessary Python Packages
pip install --upgrade pip setuptools wheel hatchling scikit-build-core
Step 5: Clone the AUR Package and Update PKGBUILD
Create a new directory for the build and clone the AUR package into it:
mkdir -p /tmp/python-coincurve
cd /tmp/python-coincurve
trizen -G python-coincurve
Update the `PKGBUILD` as shown below and save it:
# Maintainer: Carlos Aznarán <caznaranl@uni.pe>
# Contributor: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: redfish <redfish@galactica.pw>
_base=coincurve
pkgname=python-${_base}
pkgver=20.0.0
pkgrel=1
pkgdesc="Cross-platform Python CFFI bindings for libsecp256k1"
arch=(x86_64)
url="https://github.com/ofek/${_base}"
license=(Apache-2.0 MIT)
depends=(python-asn1crypto python-cffi libsecp256k1)
makedepends=(python-build python-installer python-setuptools python-wheel python-requests python-hatchling python-scikit-build-core)
source=(${_base}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz)
sha512sums=('f956502eb5614be62579b1eeec356e286bdd74c93699f8d21698f5f510d00dbde89258baab92e9bb917c9c2f51898fc0d0dc66a2e98dc54b6996e0262b055d3b')
prepare() {
cd ${_base}-${pkgver}
pip install --upgrade pip
pip install --upgrade setuptools wheel hatchling scikit-build-core
}
build() {
cd ${_base}-${pkgver}
python -m build --wheel --no-isolation
}
package() {
cd ${_base}-${pkgver}
PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python -m installer --destdir="${pkgdir}" dist/*.whl
install -Dm 644 LICENSE-{APACHE,MIT} -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
Step 6: Build and Install the Package
makepkg -si
Full Example Script
Here’s a complete script that includes all the steps:
#!/bin/bash
# Create a virtual environment in /tmp
python -m venv /tmp/build_env
# Modify pyvenv.cfg to include system site packages
sed -i 's/include-system-site-packages = false/include-system-site-packages = true/' /tmp/build_env/pyvenv.cfg
# Activate the virtual environment
source /tmp/build_env/bin/activate
# Install necessary Python packages
pip install --upgrade pip setuptools wheel hatchling scikit-build-core
# Prepare the build directory
mkdir -p /tmp/python-coincurve
cd /tmp/python-coincurve
trizen -G python-coincurve
# Update PKGBUILD as shown above
# Note: You can use an editor to make these changes or use a script to replace the content.
# Build and install the package
makepkg -si
This script ensures that the virtual environment is created and configured correctly, and the package is built and installed using the updated PKGBUILD
.
than install with "sudo pacman -U ... "
Pinned Comments
carlosal1015 commented on 2023-05-20 03:16 (UTC)
18.0.0 is not support with old libsecp256k1