A Lua-based hybrid package manager for the NULL GNU/Linux distribution.
- Hybrid Build System: Supports both binary and source packages
- Lua Manifests: Packages are defined as executable Lua scripts
- Dependency Resolution: Automatic dependency handling
- Option Tables: Per-package build options (like Portage USE flags)
- Package Masking: Prevent installation of specific packages
- Bootstrap Mode: Install packages to alternate root directories
- Modular Architecture: Each module serves one purpose
- Build Tool Integration: Helpers for make, cmake, ninja, configure
Generate documentation:
make docs
Install documentation:
make install_docs
make installDefault installation:
- Binary:
/usr/bin/pkglet - Modules:
/usr/lib/pkglet/*.lua - Config:
/etc/pkglet/
Edit /etc/pkglet/repos.conf:
main /var/db/pkglet/repos/main
overlay /var/db/pkglet/repos/overlay
testing /var/db/pkglet/repos/testing
Edit /etc/pkglet/make.lua:
MAKEOPTS = {
jobs = 8,
load = 9,
}Edit /etc/pkglet/package.opts/<package-name>:
org.kernel.linux menuconfig no_modules
Edit /etc/pkglet/package.mask:
org.kernel.linux
bad.package.foo
Edit /etc/pkglet/package.lock:
org.kernel.linux 6.17.5
org.gnu.gcc 11.2.0
pkglet i org.kernel.linux
pkglet i org.kernel.linux --source
pkglet i org.kernel.linux --menuconfig
pkglet i org.kernel.linux --with-optional
pkglet i org.kernel.linux --to 6.17.5Optional Dependencies:
Use --with-optional to install optional dependencies that enhance functionality but aren't required for core operation.
pkglet U org.kernel.linux
pkglet upgrade org.kernel.linux --pinpkglet d org.kernel.linux --to 6.15.0
pkglet downgrade org.kernel.linux --to v6.15.0
pkglet d org.kernel.linux --to a1b2c3d4
pkglet downgrade org.kernel.linux --to 6.15.0 --pinpkglet pin org.kernel.linux 6.17.5
pkglet pin org.kernel.linux
pkglet unpin org.kernel.linuxpkglet u org.kernel.linuxpkglet i org.kernel.linux --force
pkglet install org.kernel.linux --forcepkglet s linuxpkglet I org.kernel.linuxpkglet SInstall to alternate root (useful for cross-compilation or system bootstrapping):
pkglet I gcc --bootstrap-to /mnt/bootstrapAll files will be installed to /mnt/bootstrap instead of /.
Package manifests are Lua files that define package metadata and build instructions.
pkg = {
name = "org.example.package",
version = "1.0.0",
description = "Example package",
maintainer = "You <you@example.com>",
license = "MIT",
homepage = "https://example.com",
depends = {
"org.deps.foo>=1.0.0",
{ name = "org.deps.bar", constraint = "^2.0.0" }
},
build_depends = {
"org.build.meson>=0.50.0"
},
optional_depends = {
"org.crypto.openssl>=1.1.0",
"org.compression.zlib>=1.2.0"
},
conflicts = { "org.package.conflicting" },
replaces = { "org.package.legacy" },
provides = { "virtual-service" },
conflicts = {},
provides = { "example" },
sources = {
binary = {
type = "tar",
url = "https://example.com/package-1.0.0.tar.gz"
},
source = {
type = "git",
url = "https://github.com/example/package",
commit = "v1.0.0"
}
},
options = {
feature_x = {
type = "boolean",
default = false,
description = "Enable feature X"
},
},
}function pkg.source()
return function(hook)
hook("prepare")(function()
-- Preparation steps
end)
hook("build")(function()
configure({"--prefix=/usr"})
make()
end)
hook("install")(function()
make({"install"})
end)
hook("post_install")(function()
-- Post-install steps
end)
end
endfunction pkg.binary()
return function(hook)
hook("pre_install")(function()
-- Pre-install steps
end)
hook("install")(function()
-- Installation handled by pkglet
end)
hook("post_install")(function()
-- Post-install steps
end)
end
endfunction pkg.uninstall()
return function(hook)
hook("pre_uninstall")(function()
-- Cleanup before uninstall
end)
hook("post_uninstall")(function()
-- Cleanup after uninstall
end)
end
endAvailable in hook functions:
make(args, is_build, destvar)- Run make with configured options.cmake(args)- Run cmakeconfigure(args)- Run ./configureninja(args)- Run ninja with configured optionsexec(command)- An alias to Lua'sos.executeOPTIONS- Table of enabled package options
tar: Downloads and extracts tar archives (gz, bz2, xz, zip)git: Clones git repositoriesfile: Downloads single files
Dependencies support semantic versioning constraints:
depends = {
"org.package.name>=1.0.0", -- Minimum version
"org.package.name<=2.0.0", -- Maximum version
"org.package.name==1.5.0", -- Exact version
"org.package.name!=1.0.0", -- Exclude version
"org.package.name^1.0.0", -- Caret range (>=1.0.0 <2.0.0)
"org.package.name~1.5.0", -- Tilde range (>=1.5.0 <1.6.0)
{ name = "org.package.name", constraint = ">=2.0.0" }
}Build-time dependencies are only required during compilation:
build_depends = {
"org.build.meson>=0.50.0",
"org.build.ninja"
}Optional dependencies enhance functionality but are not required:
optional_depends = {
"org.openssl.libssl>=1.1.0",
{ name = "net.zlib", constraint = ">=1.2.0" },
}Each module serves a single purpose:
cli.lua- Command-line argument parsingconfig.lua- Configuration and settings managementloader.lua- Package manifest loading and validationresolver.lua- Dependency resolutionfetcher.lua- Source downloading and extractionbuilder.lua- Build process orchestrationinstaller.lua- Installation and uninstallationsearch.lua- Package searchingsync.lua- Repository synchronizationversion.lua- Version comparison and sorting
- Installed packages database:
/var/lib/pkglet/ - Build cache:
~/.cache/pkglet/build/ - Downloaded sources:
~/.cache/pkglet/distfiles/
pkglet is licensed under the MIT License.