feat: Implement build state tracking and interactive package specification creation
- Added StateTracker to manage build steps and allow resuming interrupted builds. - Updated post_extract function to utilize StateTracker for patch and command execution. - Introduced makefile.rs to handle building and installing packages via Makefile. - Created interactive.rs for an interactive package specification creator with SHA256 computation for source URLs. - Enhanced checksum verification to support multiple algorithms (SHA256, SHA512, MD5). - Added example configuration files in contrib for system-wide and user-level Depot configurations. - Updated tests to cover new functionality and ensure correctness of state tracking and interactive creation.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
Contrib: example system and user configuration files for Depot
|
||||
|
||||
Place these files on your system to provide sensible defaults and examples
|
||||
for `/etc/depot.toml`, `/etc/depot.d/build.toml`, or user-level configs.
|
||||
|
||||
Recommended installation:
|
||||
|
||||
# System-wide
|
||||
sudo cp contrib/depot.toml /etc/depot.toml
|
||||
sudo mkdir -p /etc/depot.d
|
||||
sudo cp -r contrib/depot.d/* /etc/depot.d/
|
||||
|
||||
# Per-user (example)
|
||||
mkdir -p ~/.config
|
||||
cp contrib/user.depot.toml.example ~/.config/depot.toml
|
||||
|
||||
Notes
|
||||
- These files are examples only. Review and adapt to your distribution and
|
||||
security policies before deploying.
|
||||
- The config loader supports append syntax (e.g. `cflags += ["-g"]`).
|
||||
@@ -0,0 +1,17 @@
|
||||
[flags]
|
||||
# Default build flags applied to all packages via /etc/depot.d/build.toml
|
||||
# Compiler selection
|
||||
cc = "gcc"
|
||||
|
||||
# Default CFLAGS
|
||||
cflags = ["-O2"]
|
||||
cflags += ["-pipe"]
|
||||
|
||||
# Default LDFLAGS
|
||||
ldflags = ["-Wl,-O1"]
|
||||
|
||||
# CARCH short name (can be overridden per-package)
|
||||
carch = "x86_64"
|
||||
|
||||
# Example of appending per-package cflags: (will be exposed as build.cflags appends)
|
||||
# cflags += ["-march=native"]
|
||||
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
# System-wide package overrides. Example: set default provides or package metadata
|
||||
# name = ""
|
||||
|
||||
# Example: provide a virtual runtime package name to satisfy runtime deps
|
||||
# provides = ["filesystem"]
|
||||
@@ -0,0 +1,24 @@
|
||||
# Example /etc/depot.toml - system-wide configuration for Depot
|
||||
|
||||
[build]
|
||||
# Installation prefix for package builds
|
||||
prefix = "/usr"
|
||||
# Default compiler and archiver
|
||||
cc = "gcc"
|
||||
ar = "ar"
|
||||
|
||||
[build.flags]
|
||||
# Basic compiler flags
|
||||
cflags = ["-O2"]
|
||||
# Append additional flags (demonstrates += append support)
|
||||
cflags += ["-g"]
|
||||
|
||||
# Linker flags
|
||||
ldflags = ["-Wl,-O1"]
|
||||
|
||||
# Target architecture short name (CARCH). Defaults to host arch if unset.
|
||||
carch = "x86_64"
|
||||
|
||||
# Target triples (optional)
|
||||
#chost = "x86_64-pc-linux-gnu"
|
||||
#cbuild = "x86_64-pc-linux-gnu"
|
||||
@@ -0,0 +1,10 @@
|
||||
# Example per-user configuration (~/.config/depot.toml)
|
||||
|
||||
[build]
|
||||
prefix = "/usr/local"
|
||||
cc = "clang"
|
||||
|
||||
[build.flags]
|
||||
cflags = ["-O2"]
|
||||
cflags += ["-g"]
|
||||
carch = "x86_64"
|
||||
Reference in New Issue
Block a user