Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7b2699c
Implement persistent store for documents (#75)
jsparber May 24, 2025
01cfd35
Add build script
cafca May 25, 2025
412db3d
Update .gitignore to include Aardvark.app directory
cafca May 25, 2025
74093eb
build.sh flags
cafca May 25, 2025
3362ef2
Add macOS get_or_create_identity() variant
cafca May 25, 2025
fff2e45
Typo
cafca May 26, 2025
d997a23
Fix macos implementation
cafca May 26, 2025
0080ee6
Update .gitignore
cafca May 26, 2025
cb8774d
Update build script
cafca May 26, 2025
d2a4b6e
Update Github Action
cafca May 26, 2025
cfea64f
TEMP: Remove flatpak job
cafca May 26, 2025
0a48e1d
Add matrix names
cafca May 26, 2025
8a75aef
TEMP: Debug resources
cafca May 26, 2025
3e91ebf
Clean up resource paths
cafca May 29, 2025
735c451
Revert "TEMP: Remove flatpak job"
cafca May 29, 2025
c74de1f
Tweak GH action
cafca May 29, 2025
fd4062c
Update GitHub Actions to use upload-artifact@v4
cafca May 29, 2025
5cf5da3
Remove branch from GitHub Actions workflow
cafca May 29, 2025
fd22ab3
Add Homebrew environment variable export
cafca May 29, 2025
25c4930
Revert "Remove branch from GitHub Actions workflow"
cafca May 29, 2025
67dc3af
Update GitHub Actions workflow to use nightly Rust channel
cafca May 29, 2025
bcae410
TEMP: debug x86 brew path
cafca May 29, 2025
f77754d
Fix missing symbol
cafca May 29, 2025
9306f1c
Restrict Homebrew caching to arm
cafca May 29, 2025
a9a0648
Remove base64 decode error
cafca May 29, 2025
a7a189b
TEMP: Force linking python
cafca May 29, 2025
2a3739e
Clean up
cafca May 29, 2025
d0e0d78
TEMP: Debug x86 build
cafca May 29, 2025
e4705ea
Use TARGET_ARCH
cafca May 29, 2025
f6255fc
Try using cross-compile file
cafca May 29, 2025
e462b78
Another try cross-compiling
cafca May 29, 2025
36ddf38
Homebrew eval
cafca May 29, 2025
d7a0c8f
Add Rust compiler configuration for x86_64-darwin cross-compilation
cafca May 29, 2025
cc69729
Change x86_64-darwin cross-compilation configuration
cafca May 29, 2025
be9bc4e
Clean up
cafca May 29, 2025
aca0a1e
Add back c and cpp cross-compilation
cafca Jun 3, 2025
1a5f17a
Use default clock format on mac
cafca Jun 3, 2025
e140aa9
Don't install Rust nightly in build script
cafca Jun 3, 2025
dd17660
Only link ashpd on linux
cafca Jun 3, 2025
b46c711
Add back missing trait import
cafca Jun 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 26 additions & 137 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: Build

on:
push:
branches:
- main
- pv/mac
pull_request:
branches:
- main
types:
- ready_for_review
workflow_dispatch:

jobs:
flatpak:
Expand Down Expand Up @@ -50,7 +55,7 @@ jobs:
# flatpak run org.p2panda.aardvark

macos:
name: macOS
name: macOS (${{ matrix.arch }})
runs-on: macos-latest
strategy:
fail-fast: false
Expand All @@ -63,6 +68,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
with:
targets: ${{ matrix.target }}
channel: nightly
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -72,8 +80,9 @@ jobs:
path: |
~/Library/Caches/Homebrew
/usr/local/Homebrew
/opt/homebrew
key: ${{ runner.os }}-${{ matrix.arch }}-brew-${{ hashFiles('.github/workflows/build.yml') }}
# FIXME: Cache action is not allowed to cache x86_64 Homebrew directory
# /opt/homebrew
key: ${{ runner.os }}-${{ matrix.arch }}-brew-${{ hashFiles('**/Brewfile', '.github/workflows/build.yml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.arch }}-brew-

Expand All @@ -84,150 +93,30 @@ jobs:
sudo mkdir -p /usr/local
sudo chown -R $(whoami) /usr/local
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/usr/local/bin/brew shellenv)"
echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/opt/pango/lib/pkgconfig:/usr/local/opt/cairo/lib/pkgconfig:/usr/local/opt/gdk-pixbuf/lib/pkgconfig:/usr/local/opt/graphene/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/gtk4/lib/pkgconfig:/usr/local/opt/libadwaita/lib/pkgconfig" >> $GITHUB_ENV

- name: Install pkg-config (x86_64)
if: matrix.arch == 'x86_64'
run: arch -x86_64 /usr/local/bin/brew install pkg-config || echo ERROR

- name: Install GDK-Pixbuf (x86_64)
if: matrix.arch == 'x86_64'
run: arch -x86_64 /usr/local/bin/brew install gdk-pixbuf || echo ERROR

- name: Install Cairo (x86_64)
if: matrix.arch == 'x86_64'
run: arch -x86_64 /usr/local/bin/brew install cairo || echo ERROR

- name: Install Pango (x86_64)
if: matrix.arch == 'x86_64'
run: arch -x86_64 /usr/local/bin/brew install pango || echo ERROR

- name: Install AT-SPI2-Core (x86_64)
if: matrix.arch == 'x86_64'
run: arch -x86_64 /usr/local/bin/brew install at-spi2-core || echo ERROR

- name: Install Graphene (x86_64)
if: matrix.arch == 'x86_64'
run: arch -x86_64 /usr/local/bin/brew install graphene || echo ERROR

- name: Install GTK4 (x86_64)
if: matrix.arch == 'x86_64'
run: arch -x86_64 /usr/local/bin/brew install gtk4 || echo ERROR

- name: Install GtkSourceView5 (x86_64)
if: matrix.arch == 'x86_64'
run: arch -x86_64 /usr/local/bin/brew install gtksourceview5 || echo ERROR

- name: Install Libadwaita (x86_64)
if: matrix.arch == 'x86_64'
run: arch -x86_64 /usr/local/bin/brew install -v libadwaita

- name: Install dylibbundler (x86_64)
if: matrix.arch == 'x86_64'
run: arch -x86_64 /usr/local/bin/brew install -v dylibbundler

- name: Install dylibbundler ARM64
if: matrix.arch == 'arm64'
run: brew install -v dylibbundler

- name: Verify and link x86_64 packages
if: matrix.arch == 'x86_64'
run: |
# Verify installations
arch -x86_64 /usr/local/bin/brew list pango
arch -x86_64 /usr/local/bin/brew list cairo
arch -x86_64 /usr/local/bin/brew list gdk-pixbuf
arch -x86_64 /usr/local/bin/brew list gtk4
arch -x86_64 /usr/local/bin/brew list gtksourceview5
arch -x86_64 /usr/local/bin/brew list libadwaita

# Link packages individually with error handling
for package in pango cairo gdk-pixbuf gtk4 gtksourceview5 libadwaita; do
arch -x86_64 /usr/local/bin/brew link --force $package || true
done

- name: Install ARM64 dependencies
if: matrix.arch == 'arm64'
run: |
brew install pkg-config gtk4 pango cairo gdk-pixbuf at-spi2-core graphene libadwaita gtksourceview5 || true
brew upgrade pkg-config gtk4 pango cairo gdk-pixbuf at-spi2-core graphene libadwaita gtksourceview5 || true

- name: Finalize ARM64 setup
if: matrix.arch == 'arm64'
- name: Run macOS Build Script
run: |
echo "PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig" >> $GITHUB_ENV
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
- name: Add target ${{ matrix.target }}
run: rustup target add ${{ matrix.target }}
- name: Build
if [ "${{ matrix.arch }}" = "x86_64" ]; then
eval "$(/usr/local/bin/brew shellenv)"
echo "Homebrew prefix: $HOMEBREW_PREFIX"
export PKG_CONFIG_PATH="$HOMEBREW_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH"
chmod +x scripts/build_macos.sh
./scripts/build_macos.sh --release --app-bundle --dmg --arch x86_64
else
chmod +x scripts/build_macos.sh
./scripts/build_macos.sh --release --app-bundle --dmg
fi
env:
PKG_CONFIG_ALLOW_CROSS: "1"
CFLAGS: "-I/usr/local/include -I/usr/local/include/gtk-4.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include"
LDFLAGS: "-L/usr/local/lib -framework Cocoa -framework Security"
MACOSX_DEPLOYMENT_TARGET: "10.15"
PKG_CONFIG_SYSROOT_DIR: ""
PKG_CONFIG_PATH: "${{ env.PKG_CONFIG_PATH }}"
run: cargo build --release --target ${{ matrix.target }}
- name: Install glib-compile-resources
if: matrix.arch == 'x86_64'
run: arch -x86_64 /usr/local/bin/brew install glib || echo ERROR

- name: Install glib-compile-resources ARM64
if: matrix.arch == 'arm64'
run: brew install glib || echo ERROR

- name: Compile GResource
run: |
mkdir -p target/${{ matrix.target }}/release/
glib-compile-resources --sourcedir aardvark-app/src --target target/${{ matrix.target }}/release/aardvark.gresource aardvark-app/src/aardvark.gresource.xml

- name: Create App Bundle
run: |
mkdir -p Aardvark.app/Contents/{MacOS,Resources}/share/aardvark
cp target/${{ matrix.target }}/release/aardvark Aardvark.app/Contents/MacOS/
cp target/${{ matrix.target }}/release/aardvark.gresource Aardvark.app/Contents/Resources/share/aardvark/

# Create Info.plist
cat > Aardvark.app/Contents/Info.plist << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>aardvark</string>
<key>CFBundleIdentifier</key>
<string>org.p2panda.aardvark</string>
<key>CFBundleName</key>
<string>Aardvark</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.15</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
</dict>
</plist>
EOF

# Bundle dependencies
- name: Bundle dependencies
run: |
dylibbundler -od -b -x Aardvark.app/Contents/MacOS/aardvark \
-d Aardvark.app/Contents/Frameworks/ \
-p @executable_path/../Frameworks/
# Create DMG
- name: Create DMG
run: hdiutil create -volname "Aardvark" -srcfolder Aardvark.app -ov -format UDZO aardvark-${{ matrix.arch }}.dmg
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
# Build script creates artifacts in the current directory
name: aardvark-macos-${{ matrix.arch }}
path: aardvark-${{ matrix.arch }}.dmg

- name: Smoke test the artifact
env:
RUST_BACKTRACE: "full"
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
target
.flatpak-builder
aardvark-app/src/config.rs

# Build artifacts
Aardvark.app/
install/
aardvark*.dmg
31 changes: 31 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Build tools
brew "meson"
brew "ninja"
brew "pkg-config"

# Rust toolchain (if not already installed)
brew "rustup-init"

# Core GTK4 and GNOME dependencies
brew "gtk4"
brew "libadwaita"
brew "gtksourceview5"
brew "glib"

# Graphics and text rendering
brew "cairo"
brew "pango"
brew "gdk-pixbuf"
brew "graphene"

# Accessibility
brew "at-spi2-core"

# Desktop file utilities (for update-desktop-database)
brew "desktop-file-utils"

# App bundling for macOS
brew "dylibbundler"

# Optional: For creating DMG files
brew "create-dmg"
Loading
Loading