Skip to content

Repository files navigation

xpkg

Package builder for the X
Build, lint, sign, and publish .xp packages — the developer companion to xpm.

LicenseRustPlatformVersionCI


Overview

xpkg reads build recipes (XBUILD or PKGBUILD files), fetches sources, compiles software in an isolated environment, and produces .xp packages ready for installation with xpm. Think of it as the makepkg + repo-add + namcap equivalent for the X ecosystem — written entirely in Rust.

Highlights

FeatureDescription
Pure RustZero C dependencies — consistent with the xpm ecosystem
XBUILD formatDeclarative TOML-based recipes as a modern alternative to PKGBUILD
PKGBUILD compatSeamlessly build from Arch Linux PKGBUILD files
Fakeroot buildsIsolated packaging without real root privileges (unshare / fakeroot / tar-rewrite)
Package signingOpenPGP detached signatures via sequoia-openpgp (pure Rust)
LintingAutomated quality checks: dependencies, permissions, paths, metadata, ELF analysis
Repository toolsCreate and manage ALPM-compatible package databases for xpm
Source managementHTTP download with retries, SHA-256/512 verification, Git clone, local cache

Quick Start

# 1. Install xpkg
git clone https://github.com/xscriptor/xpkg.git
cd xpkg
cargo build --release
sudo install -Dm755 target/release/xpkg /usr/local/bin/xpkg
# 2. Create a new package recipe
xpkg new hello
cd hello
# Edit the XBUILD file with your package details# 3. Build the package
xpkg build
# 4. Inspect the result
xpkg info hello-1.0.0-1-x86_64.xp
xpkg info hello-1.0.0-1-x86_64.xp --files
# 5. Lint for quality issues
xpkg lint hello-1.0.0-1-x86_64.xp
# 6. Install with xpm
sudo xpm install hello-1.0.0-1-x86_64.xp

Commands

CommandDescription
xpkg buildBuild a .xp package from an XBUILD or PKGBUILD recipe
xpkg lint <pkg>Run quality checks on a built package
xpkg info <pkg>Display package metadata (supports --files and --json)
xpkg verify <pkg>Verify package integrity and OpenPGP signature
xpkg new <name>Generate a new XBUILD template
xpkg srcinfoGenerate .SRCINFO-style output from an XBUILD
xpkg repo-add <db> <pkg>Add a package to a repository database
xpkg repo-remove <db> <name>Remove a package from a repository database

Global Flags

FlagDescription
-c, --config <PATH>Custom configuration file
-v, --verboseIncrease verbosity (-v, -vv, -vvv)
--no-confirmSkip confirmation prompts
--no-colorDisable colored output

See the CLI Reference for full details on every command and flag.

XBUILD Format

XBUILD is a TOML-based build recipe — structured, type-safe, and easy to parse:

[package]
name = "hello"version = "2.12"release = 1description = "GNU Hello — the friendly greeter"url = "https://www.gnu.org/software/hello/"license = ["GPL-3.0-or-later"]
arch = ["x86_64"]
[dependencies]
depends = ["glibc"]
makedepends = ["gcc", "make"]
[source]
urls = ["https://ftp.gnu.org/gnu/hello/hello-2.12.tar.gz"]
sha256sums = ["cf04af86dc085268c5f4470fbae49b18afbc221b78096aab842d934a76bad0ab"]
[build]
build = """cd hello-2.12./configure --prefix=/usrmake"""package = """cd hello-2.12make DESTDIR=$PKGDIR install"""

See the full XBUILD Specification.

Configuration

Configuration file: ~/.config/xpkg/xpkg.conf (TOML). See etc/xpkg.conf.example for all options.

[options]
builddir = "/tmp/xpkg-build"outdir = "."strip_binaries = truecompress = "zstd"# zstd | gzip | xzcompress_level = 19
[environment]
makeflags = "-j$(nproc)"cflags = "-march=x86-64 -O2 -pipe"cxxflags = "-march=x86-64 -O2 -pipe"

Documentation

DocumentDescription
Installation GuideBuild from source, requirements, setup
Packaging GuideStep-by-step tutorial to create your first package
CLI ReferenceComplete command and flag reference
XBUILD SpecificationThe TOML recipe format in detail
Source ManagementDownload, verify, extract, and cache sources
Package SigningKey generation, signing, and verification
Repository ManagementCreate and host package repositories
Linting RulesAll lint checks and their severity levels

Project Structure

xpkg/
├── crates/
│ ├── xpkg/ # Binary crate — CLI frontend
│ │ └── src/
│ │ ├── main.rs # Entry point, dispatch
│ │ └── cli.rs # clap CLI definitions
│ └── xpkg-core/ # Library crate — core logic
│ └── src/
│ ├── config.rs # Configuration parser
│ ├── error.rs # Error types (thiserror)
│ ├── recipe/ # XBUILD + PKGBUILD parsers
│ ├── source/ # Download, checksum, extraction, cache
│ ├── builder/ # Build pipeline + fakeroot
│ ├── metadata/ # .PKGINFO, .BUILDINFO, .MTREE, .INSTALL
│ ├── archive/ # .xp archive creation + ELF stripping
│ ├── lint/ # Linting framework + rules
│ ├── signing/ # OpenPGP signing (sequoia-openpgp)
│ └── repo/ # Repository database management
├── docs/ # User documentation
├── etc/ # Example configuration
└── ROADMAP.md # Development roadmap

Relationship with xpm

ToolRoleAnalogy
xpmPackage manager — install, remove, upgrade, resolve depspacman
xpkgPackage builder — compile, package, lint, manage reposmakepkg + repo-add + namcap

xpkg produces .xp packages that xpm installs. They share the same package format and metadata structures but are independent binaries.

Roadmap

See ROADMAP.md for the full development plan.

VersionMilestone
v0.1.0CLI with configuration
v0.3.0Recipe parsing and source management
v0.5.0Build engine, metadata, and archives
v0.7.0Package linting
v0.9.0Repository tooling, signing, and integration
v1.0.0Benchmarked, tested, production-ready

License

GPL-3.0-or-later — see LICENSE.

About

X packer for xpm

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages