From b91f6abdb0fbd20d81b8f82e301830cd7a8a6e98 Mon Sep 17 00:00:00 2001 From: nimbold <11913706+nimbold@users.noreply.github.com> Date: Tue, 2 Jun 2026 06:18:38 +0330 Subject: [PATCH] build: bundle aria2c and dependencies via dylibbundler for zero-config distribution --- .github/workflows/release.yml | 3 +++ README.md | 14 ++++++-------- Scripts/create_app_bundle.sh | 16 ++++++++++++++++ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8ff5e6..0e71dfc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,6 +41,9 @@ jobs: uname -a swift --version + - name: Install dependencies + run: brew install aria2 dylibbundler + - name: Build app bundle env: MARKETING_VERSION: ${{ steps.version.outputs.version }} diff --git a/README.md b/README.md index 1c8f217..fef063a 100644 --- a/README.md +++ b/README.md @@ -67,13 +67,11 @@ Firelink leverages `aria2c` under the hood as its core download engine. Unlike s ## 🛠️ Requirements & Setup -### 1. Install Dependencies -Ensure you have **Homebrew** and the **Swift toolchain** installed: -```bash -brew install aria2 -``` -- **OS Support:** macOS 14.0 or newer (built natively for Apple Silicon) -- **Toolchain:** Xcode 15+ / Swift 6.0 toolchain +### 1. Requirements +- **OS Support:** macOS 14.0 or newer (built natively for Apple Silicon). +- **Engine:** `aria2c` is fully packaged and bundled internally for a true Zero-Config experience. No external installations are required. + +*For Developers:* If you are building the project from source, you must have the **Swift 6.0 toolchain** (Xcode 15+) installed. ### 2. Build & Run Run the application directly via the terminal: @@ -103,7 +101,7 @@ git push origin v0.1.0 ## 🗺️ Roadmap - [ ] **Data Persistence:** Store history, column layout preferences, and active queues across restarts. -- [ ] **Zero-Config Setup:** Automatically bundle and configure `aria2c` inside the `.app` bundle. +- [x] **Zero-Config Setup:** Automatically bundle and configure `aria2c` inside the `.app` bundle. - [ ] **Bandwidth Limits:** Add global and per-download speed caps and calendar schedules. - [ ] **Browser Extensions:** Capture links directly from Safari, Chrome, and Firefox. - [ ] **Advanced Transfer Features:** Checksum validation, cookie/header ingestion, and smart mirror failovers. diff --git a/Scripts/create_app_bundle.sh b/Scripts/create_app_bundle.sh index 2fa74eb..9b03dba 100755 --- a/Scripts/create_app_bundle.sh +++ b/Scripts/create_app_bundle.sh @@ -20,6 +20,22 @@ mkdir -p "$MACOS_DIR" "$RESOURCES_DIR" cp ".build/$CONFIGURATION/$APP_NAME" "$MACOS_DIR/$APP_NAME" cp "$ROOT_DIR/Resources/$ICON_NAME.icns" "$RESOURCES_DIR/$ICON_NAME.icns" +ARIA2C_PATH=$(which aria2c || true) +if [[ -n "$ARIA2C_PATH" && -x "$ARIA2C_PATH" ]]; then + echo "Bundling aria2c from $ARIA2C_PATH..." + cp "$ARIA2C_PATH" "$RESOURCES_DIR/aria2c" + + if ! command -v dylibbundler &> /dev/null; then + echo "Installing dylibbundler..." + brew install dylibbundler + fi + + FRAMEWORKS_DIR="$CONTENTS_DIR/Frameworks" + dylibbundler -od -b -x "$RESOURCES_DIR/aria2c" -d "$FRAMEWORKS_DIR" -p "@executable_path/../Frameworks/" +else + echo "WARNING: aria2c not found! It will not be bundled. Please install it first." +fi + cat > "$CONTENTS_DIR/Info.plist" <