Create shared / fast track for certain packages
This commit is contained in:
253 files changed
+566
-458
No files matched your search
@@ -1,4 +1,4 @@
|
||||
name: Sync AUR Packages
|
||||
name: Sync AUR Packages (Edge)
|
||||
|
||||
on:
|
||||
schedule:
|
||||
@@ -22,12 +22,12 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Sync AUR packages
|
||||
- name: Sync AUR packages (edge tier)
|
||||
run: |
|
||||
if [ -n "$PACKAGES" ]; then
|
||||
./bin/sync-aur $PACKAGES
|
||||
./bin/sync-aur --tier edge $PACKAGES
|
||||
else
|
||||
./bin/sync-aur
|
||||
./bin/sync-aur --tier edge
|
||||
fi
|
||||
env:
|
||||
PACKAGES: ${{ github.event.inputs.packages }}
|
||||
@@ -46,13 +46,13 @@ jobs:
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: 'chore: sync AUR packages'
|
||||
title: 'chore: sync AUR packages'
|
||||
commit-message: 'chore: sync AUR packages (edge)'
|
||||
title: 'chore: sync AUR packages (edge)'
|
||||
body: |
|
||||
Automated AUR package sync.
|
||||
Automated AUR package sync for edge tier.
|
||||
|
||||
Please review the changes before merging.
|
||||
branch: auto/sync-aur
|
||||
branch: auto/sync-aur-edge
|
||||
delete-branch: true
|
||||
labels: automated
|
||||
reviewers: ryanrhughes
|
||||
@@ -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
|
||||
@@ -129,38 +129,81 @@ bin/repo remove <package> # Remove package
|
||||
|
||||
```
|
||||
omarchy-pkgs/
|
||||
├── pkgbuilds/ # Source PKGBUILDs
|
||||
├── build-output/ # Unsigned packages (temporary)
|
||||
│ ├── x86_64/
|
||||
│ └── aarch64/
|
||||
├── pkgs.omarchy.org/ # Signed packages (production)
|
||||
│ ├── x86_64/
|
||||
│ └── aarch64/
|
||||
├── build/ # Build scripts (in container)
|
||||
└── bin/ # CLI tools (on host)
|
||||
├── pkgbuilds/ # Source PKGBUILDs (tiered)
|
||||
│ ├── stable/ # Manual promotion only, builds for stable
|
||||
│ ├── edge/ # Daily sync w/ PR review, builds for edge only
|
||||
│ └── shared/ # 6-hourly sync, auto-merge, builds for BOTH
|
||||
├── build/
|
||||
│ └── packages/
|
||||
│ ├── edge.packages # Package list for daily sync (PR review)
|
||||
│ └── shared.packages # Package list for 6-hourly sync (auto-merge)
|
||||
├── 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
|
||||
|
||||
### From AUR
|
||||
### From AUR (Edge - Daily Sync, PR Review)
|
||||
|
||||
```bash
|
||||
# Add to sync list
|
||||
echo "package-name" >> build/packages/omarchy-aur.packages
|
||||
# Add to edge package list
|
||||
echo "package-name" >> build/packages/edge.packages
|
||||
|
||||
# Sync PKGBUILD
|
||||
bin/sync-aur package-name
|
||||
bin/sync-aur --tier edge package-name
|
||||
|
||||
# Build and release
|
||||
bin/repo release --package package-name
|
||||
```
|
||||
|
||||
#### Local Patches for AUR Packages
|
||||
|
||||
Create `pkgbuilds/package-name/patches/*.patch` to maintain modifications across AUR syncs:
|
||||
### From AUR (Shared - 6-Hourly Sync, Auto-Merge)
|
||||
|
||||
```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
|
||||
git diff > patches/my-fix.patch
|
||||
# Next sync will auto-apply patches
|
||||
@@ -169,7 +212,7 @@ git diff > patches/my-fix.patch
|
||||
### Custom Package
|
||||
|
||||
```bash
|
||||
mkdir pkgbuilds/my-package
|
||||
mkdir pkgbuilds/edge/my-package
|
||||
# Add PKGBUILD and files
|
||||
bin/repo release --package my-package
|
||||
```
|
||||
@@ -218,19 +261,33 @@ Packages are only rebuilt if:
|
||||
|
||||
## 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
|
||||
|
||||
1. **GitHub Action** (6:00 AM UTC): Syncs AUR packages and opens a PR if there are updates
|
||||
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
|
||||
4. **auto-release** (3:00 PM Eastern): If state file exists, runs full release workflow and removes state file on success
|
||||
#### GitHub Workflows
|
||||
|
||||
1. **sync-aur-edge.yml** (Daily at 6:00 AM UTC): Syncs edge packages from AUR, creates PR for review
|
||||
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/`:
|
||||
- `.sync-needed-edge`
|
||||
- `.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
|
||||
|
||||
```bash
|
||||
@@ -241,7 +298,7 @@ cp /root/omarchy-pkgs/systemd/*.service /root/omarchy-pkgs/systemd/*.timer /etc/
|
||||
systemctl daemon-reload
|
||||
|
||||
# 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-stable.timer
|
||||
|
||||
@@ -256,10 +313,12 @@ mkdir -p /root/.state
|
||||
systemctl list-timers omarchy-*
|
||||
|
||||
# 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-stable.service
|
||||
|
||||
# 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-stable.service
|
||||
```
|
||||
@@ -52,12 +52,12 @@ while [[ $# -gt 0 ]]; do
|
||||
echo " --package <names> Build only the specified package(s) (space-separated)"
|
||||
echo " -h, --help Show this help message"
|
||||
echo ""
|
||||
echo "This script builds AUR packages from:"
|
||||
echo " build/packages/omarchy-aur.packages"
|
||||
echo "This script builds packages from pkgbuilds/ directories based on mirror:"
|
||||
echo " --mirror edge: builds from pkgbuilds/edge/ + pkgbuilds/shared/"
|
||||
echo " --mirror stable: builds from pkgbuilds/stable/ + pkgbuilds/shared/"
|
||||
echo ""
|
||||
echo "Or build a single package with --package:"
|
||||
echo " Package can be: AUR package, GitHub repo (owner/repo), or local PKGBUILD"
|
||||
echo " Options can be appended after package name (skip-pgp, install, always-build, etc.)"
|
||||
echo "Or build specific packages with --package:"
|
||||
echo " Package names should match directories in the relevant pkgbuilds/ tier"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " $0 --arch aarch64"
|
||||
@@ -94,14 +94,11 @@ print_info "Cleaning build workspace..."
|
||||
rm -rf "$BUILD_OUTPUT_DIR"/*
|
||||
mkdir -p "$BUILD_OUTPUT_DIR"
|
||||
|
||||
# Check if AUR package list exists (only required if not building specific packages)
|
||||
if [[ -z "$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
|
||||
# Show package info
|
||||
if [[ -n "$PACKAGES" ]]; then
|
||||
print_info "Building packages: $PACKAGES"
|
||||
else
|
||||
print_info "Building all packages for $MIRROR mirror"
|
||||
fi
|
||||
|
||||
# Build/update the Docker image
|
||||
|
||||
@@ -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
|
||||
Executable
+139
@@ -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
@@ -4,38 +4,64 @@ BUILD_ROOT=$(realpath "${BASH_SOURCE[0]%/*}/..")
|
||||
source "$BUILD_ROOT/helpers/message-helpers.sh"
|
||||
source "$BUILD_ROOT/helpers/paths.sh"
|
||||
|
||||
PACKAGES_FILE="$BUILD_ROOT/build/packages/omarchy-aur.packages"
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
|
||||
trap "rm -rf $TEMP_DIR" EXIT
|
||||
|
||||
# Parse arguments
|
||||
# Default tier
|
||||
TIER=""
|
||||
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)
|
||||
echo "Usage: $0 [PACKAGE...]"
|
||||
echo "Usage: $0 --tier <edge|shared> [PACKAGE...]"
|
||||
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 "Arguments:"
|
||||
echo " PACKAGE One or more package names to sync (optional)"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " $0 # Sync all packages from omarchy-aur.packages"
|
||||
echo " $0 yay # Sync only the yay package"
|
||||
echo " $0 yay paru # Sync yay and paru packages"
|
||||
echo " $0 --tier edge # Sync all packages from edge.packages"
|
||||
echo " $0 --tier shared # Sync all packages from shared.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
|
||||
;;
|
||||
*)
|
||||
SPECIFIC_PACKAGES+=("$arg")
|
||||
SPECIFIC_PACKAGES+=("$1")
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
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
|
||||
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
|
||||
# Create target directory if it doesn't exist
|
||||
mkdir -p "$PKGBUILDS_DIR/$package"
|
||||
mkdir -p "$TARGET_DIR/$package"
|
||||
|
||||
# Copy files (not .git directory)
|
||||
cp -r "$package"/* "$PKGBUILDS_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
|
||||
cp -r "$package"/.* "$TARGET_DIR/$package/" 2>/dev/null || true
|
||||
|
||||
# Remove .git from destination
|
||||
rm -rf "$PKGBUILDS_DIR/$package/.git"
|
||||
rm -rf "$TARGET_DIR/$package/.git"
|
||||
|
||||
SYNCED_PACKAGES+=("$package")
|
||||
((SYNCED++))
|
||||
@@ -98,9 +124,9 @@ fi
|
||||
|
||||
# Apply patches only to packages that were actually synced
|
||||
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..."
|
||||
(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
|
||||
print_error "Failed to apply patch: $patch"
|
||||
exit 1
|
||||
@@ -110,6 +136,7 @@ for package in "${SYNCED_PACKAGES[@]}"; do
|
||||
done
|
||||
|
||||
echo ""
|
||||
print_success "Sync complete!"
|
||||
print_success "Sync complete! (tier: $TIER)"
|
||||
echo " Target: $TARGET_DIR"
|
||||
echo " Synced: $SYNCED"
|
||||
echo " Failed: $FAILED"
|
||||
+69
-67
@@ -1,5 +1,7 @@
|
||||
#!/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
|
||||
/build/import-gpg-keys.sh || exit 1
|
||||
@@ -10,6 +12,13 @@ MIRROR=${MIRROR:-edge}
|
||||
BUILD_OUTPUT_DIR="/build-output/$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"
|
||||
|
||||
# Configure Omarchy repositories for dependency resolution
|
||||
@@ -57,6 +66,7 @@ sudo pacman -Sy
|
||||
echo "==> Package Builder"
|
||||
echo "==> Target architecture: $ARCH"
|
||||
echo "==> Mirror: $MIRROR"
|
||||
echo "==> Package directories: $PKGBUILD_DIRS"
|
||||
echo "==> Build workspace: $BUILD_OUTPUT_DIR"
|
||||
echo "==> Final output: $FINAL_OUTPUT_DIR"
|
||||
|
||||
@@ -64,6 +74,18 @@ FAILED_PACKAGES=""
|
||||
SUCCESSFUL_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_local_version() {
|
||||
local pkg="$1"
|
||||
@@ -81,12 +103,13 @@ get_local_version() {
|
||||
should_build_for_arch() {
|
||||
local pkg="$1"
|
||||
local current_arch="$ARCH"
|
||||
local pkgbuild="/pkgbuilds/$pkg/PKGBUILD"
|
||||
local pkgdir=$(find_package_dir "$pkg")
|
||||
local pkgbuild="$pkgdir/PKGBUILD"
|
||||
|
||||
[[ ! -f "$pkgbuild" ]] && return 1
|
||||
|
||||
# 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 [[ "$pkgbuild_archs" == "any" ]]; then
|
||||
@@ -101,9 +124,10 @@ should_build_for_arch() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Build a package from /pkgbuilds/
|
||||
# Build a package
|
||||
build_package() {
|
||||
local pkg="$1"
|
||||
local pkgdir=$(find_package_dir "$pkg")
|
||||
|
||||
echo ""
|
||||
echo " -> Processing: $pkg"
|
||||
@@ -111,14 +135,14 @@ build_package() {
|
||||
# Copy to build directory
|
||||
cd /src
|
||||
rm -rf "$pkg"
|
||||
cp -r "/pkgbuilds/$pkg" "$pkg"
|
||||
cp -r "$pkgdir" "$pkg"
|
||||
cd "/src/$pkg" || return 1
|
||||
|
||||
# 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)
|
||||
|
||||
if [[ -z "$pkgbuild_version" ]]; then
|
||||
echo " ❌ Failed to read PKGBUILD version"
|
||||
echo " Failed to read PKGBUILD version"
|
||||
FAILED_PACKAGES="$FAILED_PACKAGES $pkg"
|
||||
return 1
|
||||
fi
|
||||
@@ -136,7 +160,7 @@ build_package() {
|
||||
echo " Importing package-specific PGP keys..."
|
||||
for keyfile in keys/pgp/*.asc; do
|
||||
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
|
||||
done
|
||||
fi
|
||||
@@ -165,11 +189,11 @@ build_package() {
|
||||
|
||||
cd /src/$pkg
|
||||
|
||||
echo " ✓ Successfully built $pkg"
|
||||
echo " Successfully built $pkg"
|
||||
SUCCESSFUL_PACKAGES="$SUCCESSFUL_PACKAGES $pkg"
|
||||
return 0
|
||||
else
|
||||
echo " ❌ Makepkg failed for $pkg"
|
||||
echo " Makepkg failed for $pkg"
|
||||
echo " DEBUG: Files in build directory:"
|
||||
ls -lah *.pkg.tar.* 2>&1 | head -20 || echo " No package files found"
|
||||
FAILED_PACKAGES="$FAILED_PACKAGES $pkg"
|
||||
@@ -180,7 +204,8 @@ build_package() {
|
||||
# Get package dependencies from PKGBUILD
|
||||
get_package_deps() {
|
||||
local pkg="$1"
|
||||
local pkgbuild="/pkgbuilds/$pkg/PKGBUILD"
|
||||
local pkgdir=$(find_package_dir "$pkg")
|
||||
local pkgbuild="$pkgdir/PKGBUILD"
|
||||
|
||||
if [[ ! -f "$pkgbuild" ]]; then
|
||||
return
|
||||
@@ -193,57 +218,23 @@ get_package_deps() {
|
||||
) | tr ' ' '\n' | while read -r dep; do
|
||||
# Strip version constraints (e.g., 'hyprshade>=1.0' -> 'hyprshade')
|
||||
dep=$(echo "$dep" | sed 's/[<>=].*$//')
|
||||
# Check if this dependency exists in our pkgbuilds
|
||||
if [[ -d "/pkgbuilds/$dep" ]]; then
|
||||
# Check if this dependency exists in our pkgbuilds (any tier)
|
||||
if find_package_dir "$dep" >/dev/null 2>&1; then
|
||||
echo "$dep"
|
||||
fi
|
||||
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_needs_build() {
|
||||
local pkg="$1"
|
||||
local pkgbuild="/pkgbuilds/$pkg/PKGBUILD"
|
||||
local pkgdir=$(find_package_dir "$pkg")
|
||||
local pkgbuild="$pkgdir/PKGBUILD"
|
||||
|
||||
[[ ! -f "$pkgbuild" ]] && return 1
|
||||
|
||||
# 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
|
||||
|
||||
# Check if already built
|
||||
@@ -256,6 +247,20 @@ check_needs_build() {
|
||||
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
|
||||
cd /src
|
||||
|
||||
@@ -270,14 +275,15 @@ PACKAGES_TO_BUILD=()
|
||||
if [[ -n "$PACKAGES" ]]; then
|
||||
echo "==> Checking specified packages: $PACKAGES"
|
||||
for pkg_name in $PACKAGES; do
|
||||
if [[ ! -f "/pkgbuilds/$pkg_name/PKGBUILD" ]]; then
|
||||
echo "==> ERROR: Package '$pkg_name' not found in /pkgbuilds/"
|
||||
pkgdir=$(find_package_dir "$pkg_name")
|
||||
if [[ -z "$pkgdir" || ! -f "$pkgdir/PKGBUILD" ]]; then
|
||||
echo "==> ERROR: Package '$pkg_name' not found in $PKGBUILD_DIRS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if package should be built for this architecture
|
||||
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"
|
||||
continue
|
||||
fi
|
||||
@@ -285,20 +291,16 @@ if [[ -n "$PACKAGES" ]]; then
|
||||
if check_needs_build "$pkg_name"; then
|
||||
PACKAGES_TO_BUILD+=("$pkg_name")
|
||||
else
|
||||
echo " ✓ $pkg_name - already up to date"
|
||||
echo " + $pkg_name - already up to date"
|
||||
SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg_name"
|
||||
fi
|
||||
done
|
||||
else
|
||||
# Build all packages that need updates
|
||||
for pkgdir in /pkgbuilds/*/; do
|
||||
[[ ! -d "$pkgdir" ]] && continue
|
||||
pkg=$(basename "$pkgdir")
|
||||
[[ ! -f "$pkgdir/PKGBUILD" ]] && continue
|
||||
|
||||
# Build all packages that need updates from the relevant directories
|
||||
while IFS= read -r pkg; do
|
||||
# Check if package should be built for this architecture
|
||||
if ! should_build_for_arch "$pkg"; then
|
||||
echo " ⊘ $pkg - not built for $ARCH"
|
||||
echo " - $pkg - not built for $ARCH"
|
||||
SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg"
|
||||
continue
|
||||
fi
|
||||
@@ -306,10 +308,10 @@ else
|
||||
if check_needs_build "$pkg"; then
|
||||
PACKAGES_TO_BUILD+=("$pkg")
|
||||
else
|
||||
echo " ✓ $pkg - already up to date"
|
||||
echo " + $pkg - already up to date"
|
||||
SKIPPED_PACKAGES="$SKIPPED_PACKAGES $pkg"
|
||||
fi
|
||||
done
|
||||
done < <(collect_packages)
|
||||
fi
|
||||
|
||||
if [[ ${#PACKAGES_TO_BUILD[@]} -eq 0 ]]; then
|
||||
@@ -400,9 +402,9 @@ else
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "========================================"
|
||||
echo "==> Build Summary"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "========================================"
|
||||
|
||||
# Count results
|
||||
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)
|
||||
|
||||
echo " Total packages: $TOTAL_COUNT"
|
||||
echo " ✓ Built: $SUCCESS_COUNT"
|
||||
echo " ⏭ Skipped: $SKIPPED_COUNT (already up-to-date)"
|
||||
echo " ❌ Failed: $FAILED_COUNT"
|
||||
echo " Built: $SUCCESS_COUNT"
|
||||
echo " Skipped: $SKIPPED_COUNT (already up-to-date)"
|
||||
echo " Failed: $FAILED_COUNT"
|
||||
|
||||
# List failures if any
|
||||
if [[ -n "$FAILED_PACKAGES" ]]; then
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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.
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.
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
Reference in new issue
Block a user