8.63. pip-25.0.1

The pip package provides a method to easily download, build, install, upgrade, and uninstall Python packages.

Approximate build time: 0.1 SBU
Required disk space: 1.0 MB

8.63.1. Installation of Pip

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

8.63.2. Contents of Pip

Installed Programs: /usr/bin/pip3.13
Installed Directories: /usr/lib/python3.13/site-packages/pip{,-25.0.1-py3.13.egg-info}

Short Descriptions

pip3.13

The package installer for Python. You can use pip to install packages from Python Package Index and other indexes