The pip package provides a method to easily download, build, install, upgrade, and uninstall Python packages.
Create the PKGBUILD for the Pip package with the following commands:
mkdir /sources/pip
cd /sources/pip
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>
pkgname="pip"
pkgver="25.0.1"
pkgrel="1"
pkgdesc="The Pip package provides a method to easily download, build, install, upgrade, and uninstall Python packages"
arch=('any')
url=("https://pypi.org/project/pip/")
license=('custom'
'MIT')
groups=('core')
depends=('python'
'wheel')
source=('https://github.com/pypa/pip/archive/25.0.1/pip-25.0.1.tar.gz')
md5sums=('5ceb1f1c501c5999e907c5ae853e48bc')
build(){
cd "${pkgname}-${pkgver}"
python3 -m build --wheel --no-isolation
}
package(){
cd "${pkgname}-${pkgver}"
python3 -m installer dist/*.whl
ln -sfv pip3.13 ${pkgdir}/usr/bin/pip3
ln -sfv pip3.13 ${pkgdir}/usr/bin/pip
}
REALEOF
Prepare the build directory for the pacman user and build the package:
chown -R root:pacman . chmod 2775 . chmod 664 PKGBUILD su pacman -c 'makepkg -L --nodeps'
Add the newly created package to the central package repository:
cp pip-25.0.1-1-any.pkg.tar.xz \
/srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
/srv/pacman/repos/LFS/pip-25.0.1-1-any.pkg.tar.xz
Update the local cache and install the Pip package:
pacman -Syu pacman -S pip --overwrite \* -dd --noconfirm
Finally, copy the source files into the source repository and clean up the build directory:
mkdir /srv/pacman/source/LFS/pip cp PKGBUILD /srv/pacman/source/LFS/pip cd /sources rm -rf pip