name: slint-packaging description: SlackBuild/SLKBUILD maintenance for the Slint slackbuilds repo. Use for converting SlackBuilds to SLKBUILD, updating package versions and checksums, adjusting build steps or deps, cleaning redundant files, enforcing slackdesc line-length rules, and preparing package changes for commit.
Slint Packaging
Overview
Use this skill to standardize Slint package maintenance tasks, especially SlackBuild -> SLKBUILD conversions and version updates.
First-use notes
On first use in a session, explicitly mention:
convert_slackbuild.pyis a best-effort scaffold and requires manual review.convert_slackbuild.py --applynow keeps legacy SlackBuild files in place if conversion gates fail; cleanup is only safe after review.- Current
slkbuildbehavior arounddotnewis subtler thanman 5 slkbuildsuggests: ifdotnew=()is unset, regular files under/etcare auto-added; ifdotnew=()is set, you must cover all relevant/etcfiles yourself. bump_version.pyupdates checksums only when sums arrays exist and sources are URL-based.- If latest version is uncertain, ask the user to confirm (Arch is usually current).
Workflow
- Inspect the package directory
- List files and read
README,*.info,slack-desc,doinst.sh, patches, and the build script. - Note upstream URLs, versioning, and any custom steps (git clone, meson, cmake, etc.).
- If a similar package already uses SLKBUILD, use it as a pattern.
- Confirm naming and headers are consistent across the directory name,
pkgname,slackdesc, README, and packager header.
- Decide the task
- Conversion: SlackBuild -> SLKBUILD
- Update: version bump, source checksums, deps, build flags
- Build and dependency generation defaults
- Prefer
fakeroot slkbuild -Xfor local build+clean validation. Runningslkbuild -Xas a non-root user fails by design. - Generate package dependency metadata only from the built package artifact, never from a source directory.
- For conversions that keep the same in-tree version, require validation against the baseline package artifact from the Slint repos after the new package builds.
SlackBuild -> SLKBUILD conversion
- Use
scripts/convert_slackbuild.pyfor a best-effort scaffold, then review. - Run
scripts/check_conversion_gates.py <pkgdir>before treating the conversion as finished. Add--shellcheckwhen you changed bash logic. - If the package already exists in-tree, keep the current in-tree version when converting (do not bump to a newer upstream/Arch version unless the user explicitly asks for an update).
- Preserve the build logic exactly (configure/meson flags, install steps, docs).
- Fold simple source-tree documentation installs into
docs=()when the old SlackBuild just copies or finds static doc files into/usr/docor/usr/share/doc; keep manual build logic for generated docs or subdir layouts thatdocs=()would not preserve. - Fold the stock package-tree ELF stripping stanza into
slkbuild's default strip pass when the old SlackBuild just does a genericfind ... | file | grep ELF | xargs strip --strip-unneededover$PKG; keep custom/narrow strip logic inbuild()and addoptions=("nostrip")manually when a package must not be stripped. - Drop redundant
CFLAGS/CXXFLAGS="$SLKCFLAGS"wrappers andexport CFLAGS/CXXFLAGS="$SLKCFLAGS"lines during conversion, becauseslkbuildalready exports those defaults. Keep explicit--libdir,LIB_SUFFIX, and similar build-system arguments when the upstream build needs them;slkbuildprovidesLIBDIRSUFFIX, but it does not infer install-path flags for you. - Inline
slack-descintoslackdesc=(...)and keep the handy ruler line. - Inline
doinst.shintodoinst(). - Prefer
dotnew=()for config files and keepdoinst()only for non-dotnew post-install behavior. - When converting old
doinst.shconfig handling:- move common
config etc/foo.newordotnew etc/foocases intodotnew=(). - if you set
dotnew=(), include every relevant regular file shipped under/etc, because currentslkbuildonly auto-discovers/etcfiles whendotnew=()is completely unset.
- move common
- Do not create placeholder dependency metadata during conversion.
- Dependency metadata must be generated after building the package, from
the produced package artifact (
*.txz/*.t?z) usingdepfinder. - Keep the generated package-style dep filename:
<pkgname>-<pkgver>-<arch>-<pkgrel>.dep. - Python packages: use
depfinder -p -f -3 <package>.txz. Due to adepfinderoption parsing bug, keep-3as the final option. - Non-Python packages: use
depfinder -f <package>.txz. - Do not run
depfinder -f .in the package directory; it can emit malformed output filenames (for example..dep). - Treat detected
python2dependencies as potentially valid in this repo. Some packages still legitimately depend on Python 2, so do not auto-rewritepython2deps topython3without package-specific verification. .depcontent is comma-separated with no spaces.
- Dependency metadata must be generated after building the package, from
the produced package artifact (
- For restricted/containerized environments, avoid adding
unshare -nin Python wheel bootstrap steps unless explicitly required and verified. - Keep necessary helper files (patches, scripts, extra data files) and add to
source=()when required by the build. - After the converted package builds, run validation with baseline manifest
comparison:
bash .codex/skills/slkbuild-validation/scripts/validate_pkg.sh --require-baseline <category>/<pkg> - The manifest comparison lives in the validation skill, not here. This skill only treats passing baseline validation as part of conversion completion.
- Treat the following as blocking conversion gates until manually resolved:
- leftover PKGBUILD/APKBUILD markers such as
prepare(),package(),pkgdesc=,subpackages=, checksum arrays,validpgpkeys=, orgit+https://source syntax. - raw SlackBuild variables and tempdir scaffolding such as
$PKGNAM,$VERSION,$CWD,$TMP, or$OUTPUTleft in the generatedbuild(). - references to
srcdir,pkgdir,builddir, orstartdir. - network fetches inside
build()such asgit clone,curl, orwget. - local helper files referenced by the build but missing from
source=(). - partial
dotnew=()coverage for packages that install regular files under/etc; explicitdotnew=()disables slkbuild's fallback auto-discovery of/etcfiles.
- leftover PKGBUILD/APKBUILD markers such as
- Remove redundant files after conversion only after the gates pass:
*.SlackBuild,slack-desc,doinst.sh, and.infowhen it is no longer used.
- Keep
.url,.news,.sha256sum, and similar files unless you are sure they are obsolete. - If the
dotnewbehavior is unclear, generatebuild-<pkgname>.shfrom a known-goodSLKBUILDand inspect the emittedsetup_dotnew()/setup_doinst()blocks. When the manpage and generated behavior disagree, prefer the current/usr/bin/slkbuildimplementation.
Updates
- If unsure of the latest version, ask the user to confirm (Arch usually tracks latest).
- Update
pkgver,source, and any checksums. - Use
scripts/bump_version.pywhen possible to updatepkgverand sums. - Sync
docs=()with what the build installs. - If runtime dependencies change, rebuild and regenerate the package
.depfrom the produced package artifact withdepfinderin the same commit. - Preserve existing build flags unless the update requires changes.
- For linux-firmware based packages in this repo, preserve the paired
date/commit versioning (
<date>_<commit>) used by Slint and verify the checkout/tag resolves to the expected commit before packaging.
Kernel and firmware conventions in this repo
- Keep
a/kernel-firmwareina/; do not move it tok/unless explicitly requested. - Keep AMD microcode authoritative in
k/amd-microcode; avoid duplicate AMD microcode package generation ina/kernel-firmware. - Treat kernel outputs as split packages:
k/kernel,k/kernel-headers,k/kernel-source, andk/modules-installer. - Keep
k/modules-installertied to built kernel artifacts (explicitKERNEL_PKGoverride or deterministic local detection), not legacy../../packagesassumptions. - For
k/dkms(3.3.x+), keep legacy helper scripts in/usr/lib/dkms/(dkms_autoinstaller,common.postinst) for existing Slint/Slackware-style local hook compatibility. - Runtime kernel upgrade flow in this repo is dracut-based: wrappers use
dracut --no-early-microcodethenupdate-grub. If installing kernels with plainupgradepkg, run those steps manually.
Debugging build failures
- Always preserve generated build scripts before reruns (
build-<pkg>.sh). - When
set -eis active, verify failing function return status, not only stderr output. - Inspect slkbuild-generated helper functions (
gzip_man_and_info_pages, post-checks, create_package) early when build() seems to pass. - Start diagnostics narrowly in the suspected block; widen only if the first pass is inconclusive.
- Keep diagnostics reversible and remove them in a dedicated cleanup commit after success.
- If a generated tail uses test-and-and patterns (for example
[ -a file ] && rm file) underset -e, account for non-zero test returns so successful builds do not abort.
Quality checks
slackdesclines should be <= 70 chars (URLs can be longer if needed).slackdescshould be <= 10 lines.bash -n SLKBUILDmust pass before attempting build validation.- Converted
SLKBUILDs should start with either#!/bin/bashor a# shellcheck shell=bash ...directive so shell tooling treats them as bash. - For converted/updated packages, ensure dependency metadata comes from
depfinderrun on the built package artifact and is saved as the generated package-style.depfilename (<pkgfull>.dep). - For same-version conversions, baseline manifest validation against the
original Slint package should pass, with only allowlisted additions such as
usr/src/<pkg>-<ver>/.... - Placeholder dependency files named
<pkgname>.depare a sign of an incomplete conversion unless that exact filename was generated from the built package artifact for repo-specific reasons. - In
SLKBUILD, use plain URL sources (for examplehttps://...). Do not use Arch-stylegit+https://...source syntax. Tag-based git sources are fine as plain URLs, for examplehttps://example.org/repo.git#tag=v1.2.3. - Prefer simple, explicit
source=()URLs over bash substring expansion expressions such as${name::1}insidesource; someslkbuild -Xgenerations can mis-handle those and produce badcdpaths. - If you edit a bash script, run
shellcheckand fix reported issues.
Resources
scripts/
check_slackdesc_len.py: Validate slackdesc line length and line count.check_conversion_gates.py: Check converted package dirs for leftover foreign packaging markers, legacy files, placeholder deps, andbash -nfailures.convert_slackbuild.py: Best-effort SlackBuild -> SLKBUILD scaffold.bump_version.py: Updatepkgverand refresh checksums if present.sync_dep_files.py: Legacy helper for<pkgname>.depfromdepends=(); do not use for package dependency metadata in this repo workflow.
manpages
man 5 slkbuild: documentation of the slkbuild format.man 8 slkbuild: documentation for the slkbuild utility itselfman 1 depfinder: documentation of depfinder