No description
Find a file
2026-06-15 10:41:07 -04:00
.cargo Fixes some issues where some recipes now build 2026-06-15 10:41:07 -04:00
.claude Fixes some issues where some recipes now build 2026-06-15 10:41:07 -04:00
crates Fixes some issues where some recipes now build 2026-06-15 10:41:07 -04:00
.gitignore Add a gitignore 2026-06-01 22:14:56 -04:00
Cargo.lock Fixes some issues where some recipes now build 2026-06-15 10:41:07 -04:00
Cargo.toml Fixes some issues where some recipes now build 2026-06-15 10:41:07 -04:00
README.md Initial code dump 2026-06-01 22:18:09 -04:00

apkg — A Package Manager for w64devkit

apkg is a Rust-based package manager designed to work inside w64devkit. It is inspired by the eopkg binary package format and the ypkg YAML recipe build system.


Architecture

apkg/
├── crates/
│   ├── apkg-core      # Package format, metadata, DB, dependency solver
│   ├── apkg-recipe    # YAML recipe parser and build orchestration
│   ├── apkg-api       # JSON-RPC IPC server + client (named pipe)
│   └── apkg-cli       # Command-line frontend
├── examples/          # Example package.yml recipes
└── docs/              # Documentation

Package Format (.apkg)

Binary packages are ZIP archives containing:

zlib-1.3.1-1-x86_64.apkg  (ZIP)
├── metadata.xml           — Package metadata (name, version, deps, …)
├── files.xml              — File manifest with SHA-256 hashes
└── install.tar.zst        — Zstd-compressed tar of package files

Inspired by eopkg's PiSi format but adapted for Windows/w64devkit: files use forward-slash paths relative to the w64devkit sysroot.

Recipe Format (package.yml)

YAML-powered build recipes inspired by ypkg:

name        : zlib
version     : 1.3.1
release     : 1
source      :
    - https://zlib.net/zlib-1.3.1.tar.gz : 9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23
license     : Zlib
summary     : Lossless data-compression library
description : |
    A massively spiffy yet delicately unobtrusive compression library.
component   : system.libs

builddeps   :
    - cmake

setup       : |
    %cmake_setup -DZLIB_BUILD_EXAMPLES=OFF

build       : |
    %cmake_build

install     : |
    %cmake_install

patterns    :
    - devel :
        - /include
        - /lib/*.a
        - /lib/pkgconfig

IPC API

apkg-api exposes a JSON-RPC 2.0 server over a Windows named pipe (\\.\pipe\apkg). Any language that can open a named pipe can drive apkg:

// Request — install a package
{ "jsonrpc": "2.0", "id": 1, "method": "install",
  "params": { "packages": ["zlib"] } }

// Progress event (server → client)
{ "jsonrpc": "2.0", "method": "progress",
  "params": { "op": "install", "package": "zlib", "pct": 42 } }

// Response
{ "jsonrpc": "2.0", "id": 1,
  "result": { "installed": ["zlib-1.3.1-1-x86_64"] } }

Quick Start

# Build apkg (requires Rust + w64devkit on PATH)
cargo build --release

# Add a repository
apkg repo add main https://your-repo.example.com/apkg

# Refresh repository indexes
apkg repo refresh

# Install a package
apkg install zlib

# Build a package from a recipe
apkg build examples/zlib.yml

# Search
apkg search compress

# Start the background API daemon (for GUI frontends)
apkg daemon

CLI Reference

Command Description
apkg install <pkg>… Install packages
apkg remove <pkg>… Remove packages
apkg upgrade [pkg]… Upgrade packages (all if none specified)
apkg search <query> Search repository
apkg info <pkg> Show package details
apkg list List installed packages
apkg build <recipe.yml> Build a package from a recipe
apkg repo add <name> <url> Add a repository
apkg repo remove <name> Remove a repository
apkg repo refresh Refresh repository indexes
apkg daemon Start the JSON-RPC API daemon

Environment Variables

Variable Default Description
APKG_ROOT $W64DEVKIT_HOME Package installation root
APKG_DB $APKG_ROOT/var/db/apkg Package database directory
APKG_CACHE $APKG_ROOT/var/cache/apkg Download cache
W64DEVKIT_HOME (required for builds) Path to w64devkit installation

License

GPL-3.0-or-later