Software Ports and Package manager for the Zygaena operating system.
Coral Package Manager
Coral is the package manager for Zygaena, written in Reef.
Building
Prerequisites
- Reef compiler (
reefc) version 0.9.1 or newer (sys.optparse;sys.args/sys.flagwere removed). - On illumos: source the development environment first
Why 0.8.3 is a hard floor. Before 0.8.3, a bounds-checked string index and
core.str.length()were both O(length) (Reef BUG-147), which madecore.str.split
andencoding.base64quadratic in the size of their input. Coral reads file lists
and a base64-encoded file index that run to megabytes, so on an older compiler
coral listtakes ~30s andcoral owner~227s over a ~120-package database.Coral 0.4.6 shipped private linear reimplementations to work around this. 0.4.7
removed them, so building against an olderreefcwill compile cleanly and then
be unusably slow, with no error to explain why. Note also that 0.8.1 and 0.8.2 were
retired without a public release (0.8.2 carried an FFI regression, BUG-151).
Quick Start
# On illumos - source the environment
source /opt/zygaena-env.sh
# Build coral
cd ~/repos/zygaena/coral
reefc build -l socket -l nsl
# The binary is created at build/coral
./build/coral --help
Build Options
# Basic build (Linux/macOS)
reefc build
# illumos/Solaris (requires socket libraries)
reefc build -l socket -l nsl
# Type-check only (no compilation)
reefc build --check
# Verbose output
reefc build -v
# Keep generated C code for debugging
reefc build --keep-c
Installation
After building, install to your PATH:
# Option 1: Copy to /usr/local/bin (requires root)
sudo cp build/coral /usr/local/bin/
# Option 2: Copy to user bin
mkdir -p ~/bin
cp build/coral ~/bin/
export PATH="$HOME/bin:$PATH"
Usage
coral --help # Show help
coral build <port> # Build a package from port
coral install <pkg> # Install package(s)
coral remove <pkg> # Remove package(s)
coral upgrade [pkg] # Upgrade package(s)
coral info <pkg> # Show package info
coral list # List installed packages
coral files <pkg> # List files owned by package
coral owner <file> # Find which package owns a file
coral search <term> # Search for packages
coral depends <pkg> # Show dependency tree
coral sync # Update ports tree
coral outdated # Show outdated packages
coral db status # Show database status
coral clean status # Show build artifact status
coral ports new cat/name # Scaffold a new port
coral ports cache status # Show ports index status
Project Structure
coral/
├── reef.toml # Project manifest
├── src/
│ ├── main.reef # Entry point, CLI dispatch
│ ├── types.reef # Shared type definitions
│ ├── commands/ # Command implementations
│ │ ├── build.reef
│ │ ├── install.reef
│ │ ├── remove.reef
│ │ └── ...
│ ├── core/ # Core functionality
│ │ ├── port.reef # Port file parsing
│ │ ├── portindex.reef # Ports index (MsgPack cache)
│ │ ├── package.reef # Package operations
│ │ ├── database.reef # Package database
│ │ ├── resolver.reef # Dependency resolution
│ │ └── ...
│ └── util/ # Utilities
│ ├── http.reef # HTTP downloads
│ ├── archive.reef # Archive handling
│ └── ...
├── test/ # Tests
├── build/ # Build output (generated)
└── docs/ # Documentation
Configuration
Coral uses TOML for configuration. See docs/ for details on:
- Port file format (
package.toml) - Repository configuration
- Build scripts (
build.reef)
License
BSD-2-Clause