Add ability to run single builds
This commit is contained in:
1 parent
b5ff57903a
commit
f2e1c227a2
3 files changed
+55
-14
No files matched your search
@@ -42,20 +42,32 @@ while [[ $# -gt 0 ]]; do
|
|||||||
SKIP_SIGNING=true
|
SKIP_SIGNING=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--package)
|
||||||
|
SINGLE_PACKAGE="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
-h | --help)
|
-h | --help)
|
||||||
echo "Usage: $0 [OPTIONS]"
|
echo "Usage: $0 [OPTIONS]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)"
|
echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)"
|
||||||
echo " --skip-signing Build packages without GPG signing"
|
echo " --skip-signing Build packages without GPG signing"
|
||||||
echo " -h, --help Show this help message"
|
echo " --package <name> Build only the specified package (with optional options)"
|
||||||
|
echo " -h, --help Show this help message"
|
||||||
echo ""
|
echo ""
|
||||||
echo "This script builds AUR packages from:"
|
echo "This script builds AUR packages from:"
|
||||||
echo " build/packages/omarchy-aur.packages"
|
echo " build/packages/omarchy-aur.packages"
|
||||||
echo ""
|
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 "Examples:"
|
||||||
echo " $0 --skip-signing"
|
echo " $0 --skip-signing"
|
||||||
echo " $0 --arch aarch64"
|
echo " $0 --arch aarch64"
|
||||||
|
echo " $0 --package yay"
|
||||||
|
echo " $0 --package \"elephant install\""
|
||||||
|
echo " $0 --package \"owner/repo skip-pgp\""
|
||||||
echo ""
|
echo ""
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
@@ -70,10 +82,14 @@ done
|
|||||||
print_info "Target architecture: $ARCH"
|
print_info "Target architecture: $ARCH"
|
||||||
print_info "Output directory: $ARCH_DIR"
|
print_info "Output directory: $ARCH_DIR"
|
||||||
|
|
||||||
# Check if AUR package list exists
|
# Check if AUR package list exists (only required if not building single package)
|
||||||
if [[ ! -f "$BUILD_DIR/packages/omarchy-aur.packages" ]]; then
|
if [[ -z "$SINGLE_PACKAGE" ]]; then
|
||||||
print_error "omarchy-aur.packages not found at $BUILD_DIR/packages/"
|
if [[ ! -f "$BUILD_DIR/packages/omarchy-aur.packages" ]]; then
|
||||||
exit 1
|
print_error "omarchy-aur.packages not found at $BUILD_DIR/packages/"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
print_info "Building single package: $SINGLE_PACKAGE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Handle GPG signing setup
|
# Handle GPG signing setup
|
||||||
@@ -119,6 +135,7 @@ DOCKER_ARGS=(
|
|||||||
-e SKIP_SIGNING
|
-e SKIP_SIGNING
|
||||||
-e GPG_PRIVATE_KEY
|
-e GPG_PRIVATE_KEY
|
||||||
-e GPG_PASSPHRASE
|
-e GPG_PASSPHRASE
|
||||||
|
-e SINGLE_PACKAGE="$SINGLE_PACKAGE"
|
||||||
-v "$BUILD_ROOT/output:/output"
|
-v "$BUILD_ROOT/output:/output"
|
||||||
-v "$SRC_DIR:/src"
|
-v "$SRC_DIR:/src"
|
||||||
-v "$BUILD_DIR:/build:ro"
|
-v "$BUILD_DIR:/build:ro"
|
||||||
|
|||||||
+30
-7
@@ -4,12 +4,26 @@
|
|||||||
# Import GPG keys
|
# Import GPG keys
|
||||||
/build/import-gpg-keys.sh || exit 1
|
/build/import-gpg-keys.sh || exit 1
|
||||||
|
|
||||||
# Sync pacman database
|
# Add Omarchy repository to pacman.conf if database exists
|
||||||
sudo pacman -Sy
|
|
||||||
|
|
||||||
ARCH=${ARCH:-x86_64}
|
ARCH=${ARCH:-x86_64}
|
||||||
OUTPUT_DIR="/output/$ARCH"
|
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 <<EOF
|
||||||
|
|
||||||
|
[omarchy]
|
||||||
|
SigLevel = Optional TrustAll
|
||||||
|
Server = file://$OUTPUT_DIR
|
||||||
|
EOF
|
||||||
|
echo " -> 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 "==> Package Builder (AUR & GitHub)"
|
||||||
echo "==> Target architecture: $ARCH"
|
echo "==> Target architecture: $ARCH"
|
||||||
echo "==> Output directory: $OUTPUT_DIR"
|
echo "==> Output directory: $OUTPUT_DIR"
|
||||||
@@ -323,8 +337,17 @@ build_aur_package() {
|
|||||||
# Main execution
|
# Main execution
|
||||||
cd /src
|
cd /src
|
||||||
|
|
||||||
# Read and process the AUR package file
|
# Determine input source: single package or package file
|
||||||
if [[ -f /build/packages/omarchy-aur.packages ]]; then
|
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
|
TOTAL_COUNT=0
|
||||||
|
|
||||||
while IFS= read -r line || [ -n "$line" ]; do
|
while IFS= read -r line || [ -n "$line" ]; do
|
||||||
@@ -356,7 +379,7 @@ if [[ -f /build/packages/omarchy-aur.packages ]]; then
|
|||||||
# Regular AUR package
|
# Regular AUR package
|
||||||
build_aur_package "$package" "$options"
|
build_aur_package "$package" "$options"
|
||||||
fi
|
fi
|
||||||
done </build/packages/omarchy-aur.packages
|
done <<< "$PACKAGE_INPUT"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
@@ -388,6 +411,6 @@ if [[ -f /build/packages/omarchy-aur.packages ]]; then
|
|||||||
echo "==> All packages processed successfully!"
|
echo "==> All packages processed successfully!"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Error: /build/packages/omarchy-aur.packages not found"
|
echo "Error: No packages to build"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -56,6 +56,7 @@ typora
|
|||||||
tzupdate
|
tzupdate
|
||||||
ufw-docker
|
ufw-docker
|
||||||
walker
|
walker
|
||||||
|
wayfreeze-git source:Jappie3/wayfreeze
|
||||||
yaru-icon-theme
|
yaru-icon-theme
|
||||||
yay
|
yay
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user