Create shared / fast track for certain packages

This commit is contained in:
Ryan Hughes committed 2026-01-10 20:18:35 -05:00
1 parent 1dfa83863d
commit 45a356eb70
253 files changed
+566 -458

No files matched your search

@@ -1,4 +1,4 @@
name: Sync AUR Packages name: Sync AUR Packages (Edge)
on: on:
schedule: schedule:
@@ -22,12 +22,12 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Sync AUR packages - name: Sync AUR packages (edge tier)
run: | run: |
if [ -n "$PACKAGES" ]; then if [ -n "$PACKAGES" ]; then
./bin/sync-aur $PACKAGES ./bin/sync-aur --tier edge $PACKAGES
else else
./bin/sync-aur ./bin/sync-aur --tier edge
fi fi
env: env:
PACKAGES: ${{ github.event.inputs.packages }} PACKAGES: ${{ github.event.inputs.packages }}
@@ -46,13 +46,13 @@ jobs:
uses: peter-evans/create-pull-request@v7 uses: peter-evans/create-pull-request@v7
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore: sync AUR packages' commit-message: 'chore: sync AUR packages (edge)'
title: 'chore: sync AUR packages' title: 'chore: sync AUR packages (edge)'
body: | body: |
Automated AUR package sync. Automated AUR package sync for edge tier.
Please review the changes before merging. Please review the changes before merging.
branch: auto/sync-aur branch: auto/sync-aur-edge
delete-branch: true delete-branch: true
labels: automated labels: automated
reviewers: ryanrhughes reviewers: ryanrhughes
+50
View File
@@ -0,0 +1,50 @@
name: Sync AUR Packages (Shared)
on:
schedule:
# Every 6 hours
- cron: '0 */6 * * *'
workflow_dispatch:
inputs:
packages:
description: 'Specific packages to sync (space-separated, leave empty for all)'
required: false
default: ''
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Sync AUR packages (shared tier)
run: |
if [ -n "$PACKAGES" ]; then
./bin/sync-aur --tier shared $PACKAGES
else
./bin/sync-aur --tier shared
fi
env:
PACKAGES: ${{ github.event.inputs.packages }}
- name: Check for changes
id: changes
run: |
if git diff --quiet; then
echo "has_changes=false" >> "$GITHUB_OUTPUT"
else
echo "has_changes=true" >> "$GITHUB_OUTPUT"
fi
- name: Commit and push changes
if: steps.changes.outputs.has_changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "chore: sync AUR packages (shared)"
git push
+85 -26
View File
@@ -129,38 +129,81 @@ bin/repo remove <package> # Remove package
``` ```
omarchy-pkgs/ omarchy-pkgs/
├── pkgbuilds/ # Source PKGBUILDs ├── pkgbuilds/ # Source PKGBUILDs (tiered)
├── build-output/ # Unsigned packages (temporary) │ ├── stable/ # Manual promotion only, builds for stable
│ ├── x86_64/ │ ├── edge/ # Daily sync w/ PR review, builds for edge only
│ └── aarch64/ │ └── shared/ # 6-hourly sync, auto-merge, builds for BOTH
├── pkgs.omarchy.org/ # Signed packages (production) ├── build/
│ ├── x86_64/ │ └── packages/
│ └── aarch64/ │ ├── edge.packages # Package list for daily sync (PR review)
├── build/ # Build scripts (in container) │ └── shared.packages # Package list for 6-hourly sync (auto-merge)
└── bin/ # CLI tools (on host) ├── build-output/ # Unsigned packages (temporary)
│ ├── edge/
│ │ ├── x86_64/
│ │ └── aarch64/
│ └── stable/
│ ├── x86_64/
│ └── aarch64/
├── pkgs.omarchy.org/ # Signed packages (production)
│ ├── edge/
│ │ ├── x86_64/
│ │ └── aarch64/
│ └── stable/
│ ├── x86_64/
│ └── aarch64/
└── bin/ # CLI tools (on host)
``` ```
## Package Tiers
Packages are organized into three tiers based on their release cadence:
| Tier | Directory | Sync Frequency | Review | Builds To |
|------|-----------|----------------|--------|-----------|
| **Stable** | `pkgbuilds/stable/` | Manual | N/A | stable only |
| **Edge** | `pkgbuilds/edge/` | Daily | PR required | edge only |
| **Shared** | `pkgbuilds/shared/` | Every 6 hours | Auto-merge | edge AND stable |
### Build Matrix
- **Edge builds** (`--mirror edge`): `pkgbuilds/edge/*` + `pkgbuilds/shared/*`
- **Stable builds** (`--mirror stable`): `pkgbuilds/stable/*` + `pkgbuilds/shared/*`
## Adding Packages ## Adding Packages
### From AUR ### From AUR (Edge - Daily Sync, PR Review)
```bash ```bash
# Add to sync list # Add to edge package list
echo "package-name" >> build/packages/omarchy-aur.packages echo "package-name" >> build/packages/edge.packages
# Sync PKGBUILD # Sync PKGBUILD
bin/sync-aur package-name bin/sync-aur --tier edge package-name
# Build and release # Build and release
bin/repo release --package package-name bin/repo release --package package-name
``` ```
#### Local Patches for AUR Packages ### From AUR (Shared - 6-Hourly Sync, Auto-Merge)
Create `pkgbuilds/package-name/patches/*.patch` to maintain modifications across AUR syncs:
```bash ```bash
cd pkgbuilds/package-name # Add to shared package list
echo "package-name" >> build/packages/shared.packages
# Sync PKGBUILD
bin/sync-aur --tier shared package-name
# Build and release (will publish to both edge and stable)
bin/repo release --package package-name
bin/repo release --mirror stable --package package-name
```
### Local Patches for AUR Packages
Create `pkgbuilds/<tier>/package-name/patches/*.patch` to maintain modifications across AUR syncs:
```bash
cd pkgbuilds/edge/package-name
# Make changes # Make changes
git diff > patches/my-fix.patch git diff > patches/my-fix.patch
# Next sync will auto-apply patches # Next sync will auto-apply patches
@@ -169,7 +212,7 @@ git diff > patches/my-fix.patch
### Custom Package ### Custom Package
```bash ```bash
mkdir pkgbuilds/my-package mkdir pkgbuilds/edge/my-package
# Add PKGBUILD and files # Add PKGBUILD and files
bin/repo release --package my-package bin/repo release --package my-package
``` ```
@@ -218,19 +261,33 @@ Packages are only rebuilt if:
## Automated Releases ## Automated Releases
The repository includes a GitHub workflow and systemd services for automated daily releases. The repository includes GitHub workflows and systemd services for automated releases.
### How It Works ### How It Works
1. **GitHub Action** (6:00 AM UTC): Syncs AUR packages and opens a PR if there are updates #### GitHub Workflows
2. **Merge PR**: Review and merge the PR to trigger the release pipeline
3. **check-upstream** (2:00 PM Eastern): Detects the merged changes, pulls them, creates state files 1. **sync-aur-edge.yml** (Daily at 6:00 AM UTC): Syncs edge packages from AUR, creates PR for review
4. **auto-release** (3:00 PM Eastern): If state file exists, runs full release workflow and removes state file on success 2. **sync-aur-shared.yml** (Every 6 hours): Syncs shared packages from AUR, auto-commits to master
#### Systemd Services
1. **check-versions** (Every 6 hours at :30): Compares PKGBUILD versions to published versions, creates state files if builds are needed
2. **auto-release-edge** (Every 6 hours at +1:00): If state file exists, builds edge packages
3. **auto-release-stable** (Every 6 hours at +1:30): If state file exists, builds stable packages
State files are stored in `/root/.state/`: State files are stored in `/root/.state/`:
- `.sync-needed-edge` - `.sync-needed-edge`
- `.sync-needed-stable` - `.sync-needed-stable`
### Schedule (America/New_York)
| Time | Action |
|------|--------|
| 00:30, 06:30, 12:30, 18:30 | check-versions (creates state files) |
| 01:00, 07:00, 13:00, 19:00 | auto-release-edge |
| 01:30, 07:30, 13:30, 19:30 | auto-release-stable |
### Installation ### Installation
```bash ```bash
@@ -241,7 +298,7 @@ cp /root/omarchy-pkgs/systemd/*.service /root/omarchy-pkgs/systemd/*.timer /etc/
systemctl daemon-reload systemctl daemon-reload
# Enable and start timers # Enable and start timers
systemctl enable --now omarchy-check-upstream.timer systemctl enable --now omarchy-check-versions.timer
systemctl enable --now omarchy-auto-release-edge.timer systemctl enable --now omarchy-auto-release-edge.timer
systemctl enable --now omarchy-auto-release-stable.timer systemctl enable --now omarchy-auto-release-stable.timer
@@ -256,10 +313,12 @@ mkdir -p /root/.state
systemctl list-timers omarchy-* systemctl list-timers omarchy-*
# Manual trigger # Manual trigger
systemctl start omarchy-check-upstream.service systemctl start omarchy-check-versions.service
systemctl start omarchy-auto-release-edge.service systemctl start omarchy-auto-release-edge.service
systemctl start omarchy-auto-release-stable.service
# View logs # View logs
journalctl -u omarchy-check-upstream.service journalctl -u omarchy-check-versions.service
journalctl -u omarchy-auto-release-edge.service journalctl -u omarchy-auto-release-edge.service
journalctl -u omarchy-auto-release-stable.service
``` ```
+9 -12
View File
@@ -52,12 +52,12 @@ while [[ $# -gt 0 ]]; do
echo " --package <names> Build only the specified package(s) (space-separated)" echo " --package <names> Build only the specified package(s) (space-separated)"
echo " -h, --help Show this help message" echo " -h, --help Show this help message"
echo "" echo ""
echo "This script builds AUR packages from:" echo "This script builds packages from pkgbuilds/ directories based on mirror:"
echo " build/packages/omarchy-aur.packages" echo " --mirror edge: builds from pkgbuilds/edge/ + pkgbuilds/shared/"
echo " --mirror stable: builds from pkgbuilds/stable/ + pkgbuilds/shared/"
echo "" echo ""
echo "Or build a single package with --package:" echo "Or build specific packages with --package:"
echo " Package can be: AUR package, GitHub repo (owner/repo), or local PKGBUILD" echo " Package names should match directories in the relevant pkgbuilds/ tier"
echo " Options can be appended after package name (skip-pgp, install, always-build, etc.)"
echo "" echo ""
echo "Examples:" echo "Examples:"
echo " $0 --arch aarch64" echo " $0 --arch aarch64"
@@ -94,14 +94,11 @@ print_info "Cleaning build workspace..."
rm -rf "$BUILD_OUTPUT_DIR"/* rm -rf "$BUILD_OUTPUT_DIR"/*
mkdir -p "$BUILD_OUTPUT_DIR" mkdir -p "$BUILD_OUTPUT_DIR"
# Check if AUR package list exists (only required if not building specific packages) # Show package info
if [[ -z "$PACKAGES" ]]; then if [[ -n "$PACKAGES" ]]; then
if [[ ! -f "$BUILD_DIR/packages/omarchy-aur.packages" ]]; then
print_error "omarchy-aur.packages not found at $BUILD_DIR/packages/"
exit 1
fi
else
print_info "Building packages: $PACKAGES" print_info "Building packages: $PACKAGES"
else
print_info "Building all packages for $MIRROR mirror"
fi fi
# Build/update the Docker image # Build/update the Docker image
-16
View File
@@ -1,16 +0,0 @@
#!/bin/bash
# Check for upstream changes and create state files if updates were pulled
set -e
REPO_DIR=/root/omarchy-pkgs
STATE_DIR=/root/.state
mkdir -p "$STATE_DIR"
cd "$REPO_DIR"
git fetch origin master --quiet
if [[ $(git rev-parse HEAD) != $(git rev-parse origin/master) ]]; then
git pull --ff-only origin master
touch "$STATE_DIR/.sync-needed-edge"
fi
+139
View File
@@ -0,0 +1,139 @@
#!/bin/bash
# Check PKGBUILD versions against published repo versions
# Creates state files for edge and/or stable if any packages need building
set -e
BUILD_ROOT=$(realpath "${BASH_SOURCE[0]%/*}/..")
source "$BUILD_ROOT/helpers/message-helpers.sh"
source "$BUILD_ROOT/helpers/paths.sh"
STATE_DIR="${OMARCHY_STATE_DIR:-/root/.state}"
ARCH="${ARCH:-x86_64}"
# Ensure state directory exists
mkdir -p "$STATE_DIR"
print_header "Package Version Check"
# Get version from repo database
get_repo_version() {
local pkg="$1"
local mirror="$2"
local repo_db="$BUILD_ROOT/pkgs.omarchy.org/$mirror/$ARCH/omarchy.db.tar.zst"
if [[ -f "$repo_db" ]]; then
local desc_file=$(tar -tf "$repo_db" 2>/dev/null | grep "^${pkg}-[0-9r].*/desc$" | head -1)
if [[ -n "$desc_file" ]]; then
tar -xOf "$repo_db" "$desc_file" 2>/dev/null | awk '/%VERSION%/{getline; print; exit}'
fi
fi
}
# Get version from PKGBUILD
get_pkgbuild_version() {
local pkgdir="$1"
if [[ -f "$pkgdir/PKGBUILD" ]]; then
(cd "$pkgdir" && bash -c 'source PKGBUILD 2>/dev/null; if [[ -n "$epoch" ]]; then echo "${epoch}:${pkgver}-${pkgrel}"; else echo "${pkgver}-${pkgrel}"; fi')
fi
}
# Check if package needs building for a mirror
check_package() {
local pkg="$1"
local pkgdir="$2"
local mirror="$3"
local pkgbuild_version=$(get_pkgbuild_version "$pkgdir")
local repo_version=$(get_repo_version "$pkg" "$mirror")
if [[ -z "$pkgbuild_version" ]]; then
return 1 # Can't read version, skip
fi
if [[ "$pkgbuild_version" != "$repo_version" ]]; then
return 0 # Needs building
fi
return 1 # Up to date
}
edge_needs_build=false
stable_needs_build=false
edge_packages=()
stable_packages=()
print_info "Checking edge packages..."
# Check edge/ packages -> only affects edge
for pkgdir in "$BUILD_ROOT/pkgbuilds/edge"/*/; do
[[ ! -d "$pkgdir" ]] && continue
pkg=$(basename "$pkgdir")
[[ ! -f "$pkgdir/PKGBUILD" ]] && continue
if check_package "$pkg" "$pkgdir" "edge"; then
edge_needs_build=true
edge_packages+=("$pkg")
fi
done
print_info "Checking stable packages..."
# Check stable/ packages -> only affects stable
for pkgdir in "$BUILD_ROOT/pkgbuilds/stable"/*/; do
[[ ! -d "$pkgdir" ]] && continue
pkg=$(basename "$pkgdir")
[[ ! -f "$pkgdir/PKGBUILD" ]] && continue
if check_package "$pkg" "$pkgdir" "stable"; then
stable_needs_build=true
stable_packages+=("$pkg")
fi
done
print_info "Checking shared packages..."
# Check shared/ packages -> affects BOTH edge and stable
for pkgdir in "$BUILD_ROOT/pkgbuilds/shared"/*/; do
[[ ! -d "$pkgdir" ]] && continue
pkg=$(basename "$pkgdir")
[[ ! -f "$pkgdir/PKGBUILD" ]] && continue
# Check against edge
if check_package "$pkg" "$pkgdir" "edge"; then
edge_needs_build=true
edge_packages+=("$pkg")
fi
# Check against stable
if check_package "$pkg" "$pkgdir" "stable"; then
stable_needs_build=true
stable_packages+=("$pkg")
fi
done
echo ""
# Drop state files as needed
if [[ "$edge_needs_build" == true ]]; then
touch "$STATE_DIR/.sync-needed-edge"
print_success "Edge needs building (${#edge_packages[@]} packages)"
print_info "Packages: ${edge_packages[*]}"
print_info "State file created: $STATE_DIR/.sync-needed-edge"
else
print_info "Edge is up to date"
fi
echo ""
if [[ "$stable_needs_build" == true ]]; then
touch "$STATE_DIR/.sync-needed-stable"
print_success "Stable needs building (${#stable_packages[@]} packages)"
print_info "Packages: ${stable_packages[*]}"
print_info "State file created: $STATE_DIR/.sync-needed-stable"
else
print_info "Stable is up to date"
fi
echo ""
print_success "Version check complete!"
+46 -19
View File
@@ -4,38 +4,64 @@ BUILD_ROOT=$(realpath "${BASH_SOURCE[0]%/*}/..")
source "$BUILD_ROOT/helpers/message-helpers.sh" source "$BUILD_ROOT/helpers/message-helpers.sh"
source "$BUILD_ROOT/helpers/paths.sh" source "$BUILD_ROOT/helpers/paths.sh"
PACKAGES_FILE="$BUILD_ROOT/build/packages/omarchy-aur.packages"
TEMP_DIR=$(mktemp -d) TEMP_DIR=$(mktemp -d)
trap "rm -rf $TEMP_DIR" EXIT trap "rm -rf $TEMP_DIR" EXIT
# Parse arguments # Default tier
TIER=""
SPECIFIC_PACKAGES=() SPECIFIC_PACKAGES=()
for arg in "$@"; do
case "$arg" in # Parse arguments
while [[ $# -gt 0 ]]; do
case "$1" in
--tier)
TIER="$2"
if [[ "$TIER" != "edge" && "$TIER" != "shared" ]]; then
print_error "Invalid tier: $TIER (must be 'edge' or 'shared')"
exit 1
fi
shift 2
;;
-h|--help) -h|--help)
echo "Usage: $0 [PACKAGE...]" echo "Usage: $0 --tier <edge|shared> [PACKAGE...]"
echo "" echo ""
echo "Sync AUR packages to pkgbuilds/ directory" echo "Sync AUR packages to pkgbuilds/<tier>/ directory"
echo ""
echo "Options:"
echo " --tier <tier> Target tier: edge or shared (required)"
echo "" echo ""
echo "Arguments:" echo "Arguments:"
echo " PACKAGE One or more package names to sync (optional)" echo " PACKAGE One or more package names to sync (optional)"
echo "" echo ""
echo "Examples:" echo "Examples:"
echo " $0 # Sync all packages from omarchy-aur.packages" echo " $0 --tier edge # Sync all packages from edge.packages"
echo " $0 yay # Sync only the yay package" echo " $0 --tier shared # Sync all packages from shared.packages"
echo " $0 yay paru # Sync yay and paru packages" echo " $0 --tier edge yay # Sync only the yay package to edge/"
echo " $0 --tier shared cursor-bin # Sync only cursor-bin to shared/"
exit 0 exit 0
;; ;;
*) *)
SPECIFIC_PACKAGES+=("$arg") SPECIFIC_PACKAGES+=("$1")
shift
;; ;;
esac esac
done done
print_header "AUR Package Sync" # Require tier
if [[ -z "$TIER" ]]; then
print_error "Missing required --tier argument"
echo "Usage: $0 --tier <edge|shared> [PACKAGE...]"
exit 1
fi
mkdir -p "$PKGBUILDS_DIR" # Set paths based on tier
PACKAGES_FILE="$BUILD_ROOT/build/packages/${TIER}.packages"
TARGET_DIR="$PKGBUILDS_DIR/$TIER"
print_header "AUR Package Sync (tier: $TIER)"
mkdir -p "$TARGET_DIR"
if [[ ! -f "$PACKAGES_FILE" ]]; then if [[ ! -f "$PACKAGES_FILE" ]]; then
print_error "Package list not found: $PACKAGES_FILE" print_error "Package list not found: $PACKAGES_FILE"
@@ -57,14 +83,14 @@ sync_package() {
if git clone "https://aur.archlinux.org/${package}.git" 2>/dev/null; then if git clone "https://aur.archlinux.org/${package}.git" 2>/dev/null; then
# Create target directory if it doesn't exist # Create target directory if it doesn't exist
mkdir -p "$PKGBUILDS_DIR/$package" mkdir -p "$TARGET_DIR/$package"
# Copy files (not .git directory) # Copy files (not .git directory)
cp -r "$package"/* "$PKGBUILDS_DIR/$package/" 2>/dev/null || true cp -r "$package"/* "$TARGET_DIR/$package/" 2>/dev/null || true
cp -r "$package"/.* "$PKGBUILDS_DIR/$package/" 2>/dev/null || true cp -r "$package"/.* "$TARGET_DIR/$package/" 2>/dev/null || true
# Remove .git from destination # Remove .git from destination
rm -rf "$PKGBUILDS_DIR/$package/.git" rm -rf "$TARGET_DIR/$package/.git"
SYNCED_PACKAGES+=("$package") SYNCED_PACKAGES+=("$package")
((SYNCED++)) ((SYNCED++))
@@ -98,9 +124,9 @@ fi
# Apply patches only to packages that were actually synced # Apply patches only to packages that were actually synced
for package in "${SYNCED_PACKAGES[@]}"; do for package in "${SYNCED_PACKAGES[@]}"; do
if [[ -d "$PKGBUILDS_DIR/$package/patches" ]]; then if [[ -d "$TARGET_DIR/$package/patches" ]]; then
print_info "Applying patches for $package..." print_info "Applying patches for $package..."
(cd "$PKGBUILDS_DIR/$package" && shopt -s nullglob && for patch in patches/*.patch; do (cd "$TARGET_DIR/$package" && shopt -s nullglob && for patch in patches/*.patch; do
if ! patch -p1 --no-backup-if-mismatch < "$patch"; then if ! patch -p1 --no-backup-if-mismatch < "$patch"; then
print_error "Failed to apply patch: $patch" print_error "Failed to apply patch: $patch"
exit 1 exit 1
@@ -110,6 +136,7 @@ for package in "${SYNCED_PACKAGES[@]}"; do
done done
echo "" echo ""
print_success "Sync complete!" print_success "Sync complete! (tier: $TIER)"
echo " Target: $TARGET_DIR"
echo " Synced: $SYNCED" echo " Synced: $SYNCED"
echo " Failed: $FAILED" echo " Failed: $FAILED"
+69 -67
View File
@@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
# Simplified build script - builds all packages in /pkgbuilds/ # Build script - builds packages based on mirror tier
# Edge builds: /pkgbuilds/edge/* + /pkgbuilds/shared/*
# Stable builds: /pkgbuilds/stable/* + /pkgbuilds/shared/*
# Import GPG keys # Import GPG keys
/build/import-gpg-keys.sh || exit 1 /build/import-gpg-keys.sh || exit 1
@@ -10,6 +12,13 @@ MIRROR=${MIRROR:-edge}
BUILD_OUTPUT_DIR="/build-output/$MIRROR/$ARCH" BUILD_OUTPUT_DIR="/build-output/$MIRROR/$ARCH"
FINAL_OUTPUT_DIR="/pkgs.omarchy.org/$MIRROR/$ARCH" FINAL_OUTPUT_DIR="/pkgs.omarchy.org/$MIRROR/$ARCH"
# Determine which package directories to use based on mirror
if [[ "$MIRROR" == "stable" ]]; then
PKGBUILD_DIRS="/pkgbuilds/stable /pkgbuilds/shared"
else
PKGBUILD_DIRS="/pkgbuilds/edge /pkgbuilds/shared"
fi
mkdir -p "$BUILD_OUTPUT_DIR" "$FINAL_OUTPUT_DIR" mkdir -p "$BUILD_OUTPUT_DIR" "$FINAL_OUTPUT_DIR"
# Configure Omarchy repositories for dependency resolution # Configure Omarchy repositories for dependency resolution
@@ -57,6 +66,7 @@ sudo pacman -Sy
echo "==> Package Builder" echo "==> Package Builder"
echo "==> Target architecture: $ARCH" echo "==> Target architecture: $ARCH"
echo "==> Mirror: $MIRROR" echo "==> Mirror: $MIRROR"
echo "==> Package directories: $PKGBUILD_DIRS"
echo "==> Build workspace: $BUILD_OUTPUT_DIR" echo "==> Build workspace: $BUILD_OUTPUT_DIR"
echo "==> Final output: $FINAL_OUTPUT_DIR" echo "==> Final output: $FINAL_OUTPUT_DIR"
@@ -64,6 +74,18 @@ FAILED_PACKAGES=""
SUCCESSFUL_PACKAGES="" SUCCESSFUL_PACKAGES=""
SKIPPED_PACKAGES="" SKIPPED_PACKAGES=""
# Find package directory - searches through PKGBUILD_DIRS
find_package_dir() {
local pkg="$1"
for dir in $PKGBUILD_DIRS; do
if [[ -d "$dir/$pkg" ]]; then
echo "$dir/$pkg"
return 0
fi
done
return 1
}
# Get version from final output (production packages) # Get version from final output (production packages)
get_local_version() { get_local_version() {
local pkg="$1" local pkg="$1"
@@ -81,12 +103,13 @@ get_local_version() {
should_build_for_arch() { should_build_for_arch() {
local pkg="$1" local pkg="$1"
local current_arch="$ARCH" local current_arch="$ARCH"
local pkgbuild="/pkgbuilds/$pkg/PKGBUILD" local pkgdir=$(find_package_dir "$pkg")
local pkgbuild="$pkgdir/PKGBUILD"
[[ ! -f "$pkgbuild" ]] && return 1 [[ ! -f "$pkgbuild" ]] && return 1
# Check PKGBUILD arch=() array # Check PKGBUILD arch=() array
local pkgbuild_archs=$(cd "/pkgbuilds/$pkg" && bash -c 'source PKGBUILD 2>/dev/null; echo "${arch[@]}"') local pkgbuild_archs=$(cd "$pkgdir" && bash -c 'source PKGBUILD 2>/dev/null; echo "${arch[@]}"')
# If arch=('any'), build for all architectures # If arch=('any'), build for all architectures
if [[ "$pkgbuild_archs" == "any" ]]; then if [[ "$pkgbuild_archs" == "any" ]]; then
@@ -101,9 +124,10 @@ should_build_for_arch() {
fi fi
} }
# Build a package from /pkgbuilds/ # Build a package
build_package() { build_package() {
local pkg="$1" local pkg="$1"
local pkgdir=$(find_package_dir "$pkg")
echo "" echo ""
echo " -> Processing: $pkg" echo " -> Processing: $pkg"
@@ -111,14 +135,14 @@ build_package() {
# Copy to build directory # Copy to build directory
cd /src cd /src
rm -rf "$pkg" rm -rf "$pkg"
cp -r "/pkgbuilds/$pkg" "$pkg" cp -r "$pkgdir" "$pkg"
cd "/src/$pkg" || return 1 cd "/src/$pkg" || return 1
# Get PKGBUILD version (including epoch if present) # Get PKGBUILD version (including epoch if present)
local pkgbuild_version=$(bash -c 'source PKGBUILD; if [[ -n "$epoch" ]]; then echo "${epoch}:${pkgver}-${pkgrel}"; else echo "${pkgver}-${pkgrel}"; fi' 2>/dev/null) local pkgbuild_version=$(bash -c 'source PKGBUILD; if [[ -n "$epoch" ]]; then echo "${epoch}:${pkgver}-${pkgrel}"; else echo "${pkgver}-${pkgrel}"; fi' 2>/dev/null)
if [[ -z "$pkgbuild_version" ]]; then if [[ -z "$pkgbuild_version" ]]; then
echo " ❌ Failed to read PKGBUILD version" echo " Failed to read PKGBUILD version"
FAILED_PACKAGES="$FAILED_PACKAGES $pkg" FAILED_PACKAGES="$FAILED_PACKAGES $pkg"
return 1 return 1
fi fi
@@ -136,7 +160,7 @@ build_package() {
echo " Importing package-specific PGP keys..." echo " Importing package-specific PGP keys..."
for keyfile in keys/pgp/*.asc; do for keyfile in keys/pgp/*.asc; do
if [[ -f "$keyfile" ]]; then if [[ -f "$keyfile" ]]; then
gpg --import "$keyfile" 2>/dev/null && echo " ✓ Imported $(basename "$keyfile")" || echo " ⚠ Failed to import $(basename "$keyfile")" gpg --import "$keyfile" 2>/dev/null && echo " Imported $(basename "$keyfile")" || echo " Failed to import $(basename "$keyfile")"
fi fi
done done
fi fi
@@ -165,11 +189,11 @@ build_package() {
cd /src/$pkg cd /src/$pkg
echo " ✓ Successfully built $pkg" echo " Successfully built $pkg"
SUCCESSFUL_PACKAGES="$SUCCESSFUL_PACKAGES $pkg" SUCCESSFUL_PACKAGES="$SUCCESSFUL_PACKAGES $pkg"
return 0 return 0
else else
echo " ❌ Makepkg failed for $pkg" echo " Makepkg failed for $pkg"
echo " DEBUG: Files in build directory:" echo " DEBUG: Files in build directory:"
ls -lah *.pkg.tar.* 2>&1 | head -20 || echo " No package files found" ls -lah *.pkg.tar.* 2>&1 | head -20 || echo " No package files found"
FAILED_PACKAGES="$FAILED_PACKAGES $pkg" FAILED_PACKAGES="$FAILED_PACKAGES $pkg"
@@ -180,7 +204,8 @@ build_package() {
# Get package dependencies from PKGBUILD # Get package dependencies from PKGBUILD
get_package_deps() { get_package_deps() {
local pkg="$1" local pkg="$1"
local pkgbuild="/pkgbuilds/$pkg/PKGBUILD" local pkgdir=$(find_package_dir "$pkg")
local pkgbuild="$pkgdir/PKGBUILD"
if [[ ! -f "$pkgbuild" ]]; then if [[ ! -f "$pkgbuild" ]]; then
return return
@@ -193,57 +218,23 @@ get_package_deps() {
) | tr ' ' '\n' | while read -r dep; do ) | tr ' ' '\n' | while read -r dep; do
# Strip version constraints (e.g., 'hyprshade>=1.0' -> 'hyprshade') # Strip version constraints (e.g., 'hyprshade>=1.0' -> 'hyprshade')
dep=$(echo "$dep" | sed 's/[<>=].*$//') dep=$(echo "$dep" | sed 's/[<>=].*$//')
# Check if this dependency exists in our pkgbuilds # Check if this dependency exists in our pkgbuilds (any tier)
if [[ -d "/pkgbuilds/$dep" ]]; then if find_package_dir "$dep" >/dev/null 2>&1; then
echo "$dep" echo "$dep"
fi fi
done done
} }
# Simple dependency-aware build order
# Build packages with no internal deps first, then those that depend on them
build_order() {
local -a all_packages=()
local -a result=()
local -A package_deps_count=()
# Collect all packages
for pkgdir in /pkgbuilds/*/; do
[[ ! -d "$pkgdir" ]] && continue
local pkg=$(basename "$pkgdir")
[[ ! -f "$pkgdir/PKGBUILD" ]] && continue
all_packages+=("$pkg")
# Count internal dependencies
local dep_count=0
while read -r dep; do
((dep_count++))
done < <(get_package_deps "$pkg")
package_deps_count[$pkg]=$dep_count
done
# Sort: packages with fewer deps first
while IFS= read -r pkg; do
result+=("$pkg")
done < <(
for pkg in "${all_packages[@]}"; do
echo "${package_deps_count[$pkg]} $pkg"
done | sort -n | cut -d' ' -f2-
)
# Output in build order
printf '%s\n' "${result[@]}"
}
# Check which packages need building (version check only) # Check which packages need building (version check only)
check_needs_build() { check_needs_build() {
local pkg="$1" local pkg="$1"
local pkgbuild="/pkgbuilds/$pkg/PKGBUILD" local pkgdir=$(find_package_dir "$pkg")
local pkgbuild="$pkgdir/PKGBUILD"
[[ ! -f "$pkgbuild" ]] && return 1 [[ ! -f "$pkgbuild" ]] && return 1
# Get PKGBUILD version (including epoch if present) # Get PKGBUILD version (including epoch if present)
local pkgbuild_version=$(cd "/pkgbuilds/$pkg" && bash -c 'source PKGBUILD; if [[ -n "$epoch" ]]; then echo "${epoch}:${pkgver}-${pkgrel}"; else echo "${pkgver}-${pkgrel}"; fi' 2>/dev/null) local pkgbuild_version=$(cd "$pkgdir" && bash -c 'source PKGBUILD; if [[ -n "$epoch" ]]; then echo "${epoch}:${pkgver}-${pkgrel}"; else echo "${pkgver}-${pkgrel}"; fi' 2>/dev/null)
[[ -z "$pkgbuild_version" ]] && return 1 [[ -z "$pkgbuild_version" ]] && return 1
# Check if already built # Check if already built
@@ -256,6 +247,20 @@ check_needs_build() {
fi fi
} }
# Collect all packages from the relevant directories
collect_packages() {
for dir in $PKGBUILD_DIRS; do
if [[ -d "$dir" ]]; then
for pkgdir in "$dir"/*/; do
[[ ! -d "$pkgdir" ]] && continue
local pkg=$(basename "$pkgdir")
[[ ! -f "$pkgdir/PKGBUILD" ]] && continue
echo "$pkg"
done
fi
done
}
# Main execution # Main execution
cd /src cd /src
@@ -270,14 +275,15 @@ PACKAGES_TO_BUILD=()
if [[ -n "$PACKAGES" ]]; then if [[ -n "$PACKAGES" ]]; then
echo "==> Checking specified packages: $PACKAGES" echo "==> Checking specified packages: $PACKAGES"
for pkg_name in $PACKAGES; do for pkg_name in $PACKAGES; do
if [[ ! -f "/pkgbuilds/$pkg_name/PKGBUILD" ]]; then pkgdir=$(find_package_dir "$pkg_name")
echo "==> ERROR: Package '$pkg_name' not found in /pkgbuilds/" if [[ -z "$pkgdir" || ! -f "$pkgdir/PKGBUILD" ]]; then
echo "==> ERROR: Package '$pkg_name' not found in $PKGBUILD_DIRS"
exit 1 exit 1
fi fi
# Check if package should be built for this architecture # Check if package should be built for this architecture
if ! should_build_for_arch "$pkg_name"; then if ! should_build_for_arch "$pkg_name"; then
echo " ⊘ $pkg_name - not built for $ARCH" echo " - $pkg_name - not built for $ARCH"
SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg_name" SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg_name"
continue continue
fi fi
@@ -285,20 +291,16 @@ if [[ -n "$PACKAGES" ]]; then
if check_needs_build "$pkg_name"; then if check_needs_build "$pkg_name"; then
PACKAGES_TO_BUILD+=("$pkg_name") PACKAGES_TO_BUILD+=("$pkg_name")
else else
echo " ✓ $pkg_name - already up to date" echo " + $pkg_name - already up to date"
SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg_name" SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg_name"
fi fi
done done
else else
# Build all packages that need updates # Build all packages that need updates from the relevant directories
for pkgdir in /pkgbuilds/*/; do while IFS= read -r pkg; do
[[ ! -d "$pkgdir" ]] && continue
pkg=$(basename "$pkgdir")
[[ ! -f "$pkgdir/PKGBUILD" ]] && continue
# Check if package should be built for this architecture # Check if package should be built for this architecture
if ! should_build_for_arch "$pkg"; then if ! should_build_for_arch "$pkg"; then
echo " ⊘ $pkg - not built for $ARCH" echo " - $pkg - not built for $ARCH"
SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg" SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg"
continue continue
fi fi
@@ -306,10 +308,10 @@ else
if check_needs_build "$pkg"; then if check_needs_build "$pkg"; then
PACKAGES_TO_BUILD+=("$pkg") PACKAGES_TO_BUILD+=("$pkg")
else else
echo " ✓ $pkg - already up to date" echo " + $pkg - already up to date"
SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg" SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg"
fi fi
done done < <(collect_packages)
fi fi
if [[ ${#PACKAGES_TO_BUILD[@]} -eq 0 ]]; then if [[ ${#PACKAGES_TO_BUILD[@]} -eq 0 ]]; then
@@ -400,9 +402,9 @@ else
fi fi
echo "" echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "========================================"
echo "==> Build Summary" echo "==> Build Summary"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "========================================"
# Count results # Count results
SUCCESS_COUNT=$(echo $SUCCESSFUL_PACKAGES | wc -w) SUCCESS_COUNT=$(echo $SUCCESSFUL_PACKAGES | wc -w)
@@ -410,9 +412,9 @@ SKIPPED_COUNT=$(echo $SKIPPED_PACKAGES | wc -w)
FAILED_COUNT=$(echo $FAILED_PACKAGES | wc -w) FAILED_COUNT=$(echo $FAILED_PACKAGES | wc -w)
echo " Total packages: $TOTAL_COUNT" echo " Total packages: $TOTAL_COUNT"
echo " ✓ Built: $SUCCESS_COUNT" echo " Built: $SUCCESS_COUNT"
echo " ⏭ Skipped: $SKIPPED_COUNT (already up-to-date)" echo " Skipped: $SKIPPED_COUNT (already up-to-date)"
echo " ❌ Failed: $FAILED_COUNT" echo " Failed: $FAILED_COUNT"
# List failures if any # List failures if any
if [[ -n "$FAILED_PACKAGES" ]]; then if [[ -n "$FAILED_PACKAGES" ]]; then
+35
View File
@@ -0,0 +1,35 @@
# Edge packages - sync daily, PR review required, built for edge only
# Core
elephant install
elephant-archlinuxpkgs
elephant-bluetooth
elephant-calc
elephant-clipboard
elephant-desktopapplications
elephant-files
elephant-menus
elephant-providerlist
elephant-runner
elephant-symbols
elephant-todo
elephant-unicode
elephant-websearch
gpu-screen-recorder
limine-mkinitcpio-hook
limine-snapper-sync
macbook12-spi-driver-dkms
pinta
python-terminaltexteffects
ttf-ia-writer
typora
tzupdate
ufw-docker
walker
xdg-terminal-exec
yaru-icon-theme
yay
# Drivers
nvidia-580xx-utils
lib32-nvidia-580xx-utils
-60
View File
@@ -1,60 +0,0 @@
# AUR Sync List - Packages to sync from AUR with bin/aur-sync
#Core Install
1password-beta
1password-cli
aether
elephant install
elephant-archlinuxpkgs
elephant-bluetooth
elephant-calc
elephant-clipboard
elephant-desktopapplications
elephant-files
elephant-menus
elephant-providerlist
elephant-runner
elephant-symbols
elephant-todo
elephant-unicode
elephant-websearch
gpu-screen-recorder
hyprshade # aether dependency
limine-mkinitcpio-hook
limine-snapper-sync
localsend
localsend-bin
macbook12-spi-driver-dkms
omarchy-chromium-bin
pinta
python-terminaltexteffects
spotify
ttf-ia-writer
typora
tzupdate
ufw-docker
walker
xdg-terminal-exec
yaru-icon-theme
yay
# Extras
visual-studio-code-bin
cursor-bin
cursor-cli
claude-code
lmstudio
crush-bin
bun-bin # for opencode
github-copilot-cli
opencode
minecraft-launcher
sublime-text-4
symfony-cli
dropbox
dropbox-cli
nautilus-dropbox
openai-codex-bin
nvidia-580xx-utils # also builds nvidia-580xx-dkms and opencl-nvidia-580xx
lib32-nvidia-580xx-utils
voxtype-bin
+28
View File
@@ -0,0 +1,28 @@
# Shared packages - sync every 6 hours, auto-merge, built for BOTH edge and stable
# These packages mirror AUR as closely as possible
1password-beta
1password-cli
aether
bun-bin
claude-code
crush-bin
cursor-bin
cursor-cli
dropbox
dropbox-cli
github-copilot-cli
hyprshade
lmstudio
localsend
localsend-bin
minecraft-launcher
nautilus-dropbox
omarchy-chromium-bin
openai-codex-bin
opencode
spotify
sublime-text-4
symfony-cli
visual-studio-code-bin
voxtype-bin
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 253 files, more files were not shown because too many files have changed in this diff. Show more