Flit-core is the distribution-building parts of Flit (a packaging tool for simple Python modules).
Create the PKGBUILD for the Flit-Core package with the following commands:
mkdir /sources/flit-core
cd /sources/flit-core
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>
pkgname="flit-core"
pkgver="3.11.0"
pkgrel="1"
pkgdesc="Flit-core is the distribution-building parts of Flit (a packaging tool for simple Python modules)."
arch=('any')
url="https://pypi.org/project/flit-core/"
license=('BSD3C')
groups=('core')
depends('python')
optdepends=('pytest'
'testpath')
source=('https://pypi.org/packages/source/f/flit-core/flit_core-3.11.0.tar.gz')
md5sums=('6d677b1acef1769c4c7156c7508e0dbd')
build(){
cd "${pkgname}-${pkgver}"
pip3 wheel -w dist --no-cache-dir --no-build-isolation --no-deps $PWD
}
package(){
cd "${pkgname}-${pkgver}"
pip3 install --root "${pkgdir}" --no-index --find-links dist flit_core
}
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 flit-core-3.11.0-1-any.pkg.tar.xz \
/srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
/srv/pacman/repos/LFS/flit-core-3.11.0-1-any.pkg.tar.xz
Update the local cache and install the Flit-Core package:
pacman -Syu pacman -S flit-core --overwrite \* -dd --noconfirm
Finally, copy the source files into the source repository and clean up the build directory:
mkdir /srv/pacman/source/LFS/flit-core cp PKGBUILD /srv/pacman/source/LFS/flit-core cd /sources rm -rf flit-core
The meaning of the pip3 configuration options and commands:
This command builds the wheel archive for this package.
-w
dist
Instructs pip to put the created wheel into the dist directory.
--no-cache-dir
Prevents pip from copying the created wheel into the
/root/.cache/pip directory.
This command installs the package.
--no-build-isolation, --no-deps, and --no-index
These options prevent fetching files from the online package repository (PyPI). If packages are installed in the correct order, pip won't need to fetch any files in the first place; these options add some safety in case of user error.
--find-links
dist
Instructs pip to search for wheel archives in the
dist directory.