diff --git a/bin/build b/bin/build index fa49009..46e9827 100755 --- a/bin/build +++ b/bin/build @@ -42,20 +42,32 @@ while [[ $# -gt 0 ]]; do SKIP_SIGNING=true shift ;; + --package) + SINGLE_PACKAGE="$2" + shift 2 + ;; -h | --help) echo "Usage: $0 [OPTIONS]" echo "" echo "Options:" - echo " --arch Target architecture (x86_64 or aarch64, default: x86_64)" - echo " --skip-signing Build packages without GPG signing" - echo " -h, --help Show this help message" + echo " --arch Target architecture (x86_64 or aarch64, default: x86_64)" + echo " --skip-signing Build packages without GPG signing" + echo " --package Build only the specified package (with optional options)" + echo " -h, --help Show this help message" echo "" echo "This script builds AUR packages from:" echo " build/packages/omarchy-aur.packages" 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 "" echo "Examples:" echo " $0 --skip-signing" echo " $0 --arch aarch64" + echo " $0 --package yay" + echo " $0 --package \"elephant install\"" + echo " $0 --package \"owner/repo skip-pgp\"" echo "" exit 0 ;; @@ -70,10 +82,14 @@ done print_info "Target architecture: $ARCH" print_info "Output directory: $ARCH_DIR" -# Check if AUR package list exists -if [[ ! -f "$BUILD_DIR/packages/omarchy-aur.packages" ]]; then - print_error "omarchy-aur.packages not found at $BUILD_DIR/packages/" - exit 1 +# Check if AUR package list exists (only required if not building single package) +if [[ -z "$SINGLE_PACKAGE" ]]; 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 single package: $SINGLE_PACKAGE" fi # Handle GPG signing setup @@ -119,6 +135,7 @@ DOCKER_ARGS=( -e SKIP_SIGNING -e GPG_PRIVATE_KEY -e GPG_PASSPHRASE + -e SINGLE_PACKAGE="$SINGLE_PACKAGE" -v "$BUILD_ROOT/output:/output" -v "$SRC_DIR:/src" -v "$BUILD_DIR:/build:ro" diff --git a/build/build.sh b/build/build.sh index 62a44e4..a042165 100755 --- a/build/build.sh +++ b/build/build.sh @@ -4,12 +4,26 @@ # Import GPG keys /build/import-gpg-keys.sh || exit 1 -# Sync pacman database -sudo pacman -Sy - +# Add Omarchy repository to pacman.conf if database exists ARCH=${ARCH:-x86_64} OUTPUT_DIR="/output/$ARCH" +if [[ -f "$OUTPUT_DIR/omarchy.db.tar.zst" ]]; then + echo "==> Configuring Omarchy repository for dependency resolution..." + sudo tee -a /etc/pacman.conf > /dev/null < Omarchy repository added to pacman.conf" +else + echo "==> No Omarchy repository database found (this is normal for first build)" +fi + +# Sync pacman database +sudo pacman -Sy + echo "==> Package Builder (AUR & GitHub)" echo "==> Target architecture: $ARCH" echo "==> Output directory: $OUTPUT_DIR" @@ -323,8 +337,17 @@ build_aur_package() { # Main execution cd /src -# Read and process the AUR package file -if [[ -f /build/packages/omarchy-aur.packages ]]; then +# Determine input source: single package or package file +if [[ -n "$SINGLE_PACKAGE" ]]; then + echo "==> Single Package Build Mode: $SINGLE_PACKAGE" + PACKAGE_INPUT=$(echo "$SINGLE_PACKAGE") +else + echo "==> Processing omarchy-aur.packages" + PACKAGE_INPUT=$(cat /build/packages/omarchy-aur.packages) +fi + +# Read and process packages +if [[ -n "$PACKAGE_INPUT" ]]; then TOTAL_COUNT=0 while IFS= read -r line || [ -n "$line" ]; do @@ -356,7 +379,7 @@ if [[ -f /build/packages/omarchy-aur.packages ]]; then # Regular AUR package build_aur_package "$package" "$options" fi - done All packages processed successfully!" fi else - echo "Error: /build/packages/omarchy-aur.packages not found" + echo "Error: No packages to build" exit 1 fi diff --git a/build/packages/omarchy-aur.packages b/build/packages/omarchy-aur.packages index 54176cb..be51af8 100644 --- a/build/packages/omarchy-aur.packages +++ b/build/packages/omarchy-aur.packages @@ -56,6 +56,7 @@ typora tzupdate ufw-docker walker +wayfreeze-git source:Jappie3/wayfreeze yaru-icon-theme yay