From b1874561ceeaf96aabe58d94de3e1946e9633db7 Mon Sep 17 00:00:00 2001 From: sethburkart123 Date: Wed, 13 Nov 2024 20:05:45 +1100 Subject: [PATCH] add homebrew formulae --- .DS_Store | Bin 0 -> 8196 bytes Formula/exo.rb | 18 ++++++++++++++ build.sh | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 .DS_Store create mode 100644 Formula/exo.rb create mode 100755 build.sh diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b6de81776ae4070d2167807baa8d6b4de7cf2fb2 GIT binary patch literal 8196 zcmeHM&2AGh5FWP)*)*bxR1oEWv=!GX^aoW`T+%c>R00kSf&)b%Y0@;XSx3pHX;oTs zMDPy000(Y}C*Tpd@(geT36*cWZsgsh91)^+WzX(ITx zTC(=X{`Q_>`{RIJOr4DnV{DL560y~zV-+``XU4=VwCNDPU^IaUn2i|XZ48kCq6%I*$oyJzKDs*MDkL~NjVwk zX=zXPOF<>*bqkfw6TW*WrB^+>u2dg2>-}=}%DVJ}O4F}*6rfqFLuLDM)33>XLH7Jw zS7A$Ghm&^FY)U^sVm3zg zBAl|Ggs*N?Pi6Q!gL?=54=|rC%qY)pT%R-D)Sp!PGHO-jn5h+7l`5h(5b+E{PDVzX zR8~0`D>2K=rfE41<~Yk+7;^yo$mAG;^Uy?0sXXWWtsp}0T$W8titf=StfWAy_aeq=3Y9k-`q>DztZ1QaA3=S$iQS6(`*KE z16wdlTPy>Xfs4g}NEA!O0%AV= :ventura" + depends_on arch: :arm64 + + binary "#{staged_path}/exo-0.1.0-darwin-arm64/exo" + + postflight do + set_permissions "#{staged_path}/exo-0.1.0-darwin-arm64/exo", "0755" + end +end diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..4bd2591d7 --- /dev/null +++ b/build.sh @@ -0,0 +1,62 @@ +#!/bin/bash +set -e # Exit on any error + +# Configuration +VERSION="0.1.0" # Update this as needed +APP_NAME="exo" +DIST_DIR="dist" +PACKAGE_NAME="${APP_NAME}-${VERSION}-darwin-arm64" + +# 1. Clean previous builds +#echo "Cleaning previous builds..." +#rm -rf build dist + +# 2. Run PyInstaller +#echo "Building with PyInstaller..." +#pyinstaller exo.spec + +# 3. Create a clean distribution directory +echo "Creating distribution package..." +mkdir -p "${DIST_DIR}/${PACKAGE_NAME}" +cp -r "dist/${APP_NAME}/"* "${DIST_DIR}/${PACKAGE_NAME}/" + +# 4. Create ZIP file +echo "Creating ZIP archive..." +cd "${DIST_DIR}" +zip -r "${PACKAGE_NAME}.zip" "${PACKAGE_NAME}" +cd .. + +# 5. Calculate SHA256 +echo "Calculating SHA256..." +SHA256=$(shasum -a 256 "${DIST_DIR}/${PACKAGE_NAME}.zip" | cut -d' ' -f1) + +# 6. Generate Homebrew Cask formula +echo "Generating Homebrew formula..." +cat > Formula/exo.rb << EOL +cask "exo" do + version "${VERSION}" + sha256 "${SHA256}" + + url "https://github.com/YOURUSERNAME/exo/releases/download/v#{version}/exo-#{version}-darwin-arm64.zip" + name "Exo" + desc "MLX-powered AI assistant" + homepage "https://github.com/YOURUSERNAME/exo" + + depends_on macos: ">= :ventura" + depends_on arch: :arm64 + + binary "exo" + + postflight do + set_permissions "#{staged_path}/exo", "0755" + end +end +EOL + +echo "Done! Package created at: ${DIST_DIR}/${PACKAGE_NAME}.zip" +echo "SHA256: ${SHA256}" +echo "" +echo "Next steps:" +echo "1. Upload ${PACKAGE_NAME}.zip to GitHub releases" +echo "2. Update the URL in the formula with your actual GitHub repository" +echo "3. Test the formula locally with: brew install --cask ./Formula/exo.rb" \ No newline at end of file