Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
85 changes: 85 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: Release
on:
pull_request:
types: [closed]
workflow_dispatch:
inputs:
version:
description: 'Version to build (e.g. 4.19.1)'
required: true
default: '4.19.1'

jobs:
create-release:
Expand Down Expand Up @@ -52,3 +58,82 @@ jobs:
${{ steps.changelog.outputs.changelog }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-macos-dmg:
needs: create-release
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'Release')
runs-on: macos-14

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Get version from meson.build
id: version
run: |
VERSION=$(grep -Po "version:\s*'\K[0-9.]+(?=')" meson.build)
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Install dependencies
run: |
brew update
brew install vala meson ninja gtk4 libadwaita libgee json-glib \
libsoup sqlite libical gtksourceview5 libsecret icu4c gxml \
pango cairo fontconfig librsvg dylibbundler create-dmg \
--cask font-adwaita

- name: Build
run: |
chmod +x scripts/build-macos.sh
./scripts/build-macos.sh

- name: Generate DMG
run: |
chmod +x scripts/build-macos-dmg.sh
./scripts/build-macos-dmg.sh

- name: Upload DMG to release
uses: softprops/action-gh-release@v3
with:
tag_name: v${{ steps.version.outputs.version }}
files: build/Planify.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test-macos-build:
if: github.event_name == 'workflow_dispatch'
runs-on: macos-14

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Install dependencies
run: |
brew update
brew install vala meson ninja gtk4 libadwaita libgee json-glib \
libsoup sqlite libical gtksourceview5 libsecret icu4c gxml \
pango cairo fontconfig librsvg dylibbundler create-dmg \
--cask font-adwaita

- name: Build
run: |
chmod +x scripts/build-macos.sh
./scripts/build-macos.sh

- name: Generate DMG
run: |
chmod +x scripts/build-macos-dmg.sh
./scripts/build-macos-dmg.sh

- name: Verify DMG
run: |
ls -lh build/Planify.dmg
echo "✅ DMG generated successfully"

- name: Upload DMG as artifact
uses: actions/upload-artifact@v4
with:
name: Planify-macOS-test
path: build/Planify.dmg
retention-days: 3
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ planify*txt
.flatpak
.buildconfig
.DS_Store

# Generated GSettings schema cache
data/gschemas.compiled
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,36 @@ sudo ninja install
io.github.alainm23.planify
```

### 🍏 macOS Build (Experimental)
Planify can be built on macOS (tested on Apple Silicon, macOS 14+) using Homebrew’s GTK4/libadwaita stack. Optional components not available on macOS are disabled (Evolution, WebKit, portals, spell check).

1. Install dependencies:
```bash
brew update
brew install vala meson ninja gtk4 libadwaita libgee json-glib \
libsoup sqlite libical gtksourceview5 desktop-file-utils \
libsecret icu4c pango cairo fontconfig
```
2. Make pkg-config find libical/icu:
```bash
export PKG_CONFIG_PATH="/opt/homebrew/opt/libical/lib/pkgconfig:/opt/homebrew/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH"
```
3. Build and run via the helper script:
```bash
chmod +x run-macos.sh
./run-macos.sh
GSETTINGS_SCHEMA_DIR=data ./build/src/io.github.alainm23.planify
```
The script cleans the build dir, configures Meson with macOS-safe flags (`-Devolution=false -Dwebkit=false -Dportal=false -Dspelling=disabled`), compiles, compiles schemas, and launches the app with the needed runtime env vars.

#### DMG Packaging (Experimental)
After building, you can generate a DMG (still relies on Homebrew GTK/libadwaita on the target system; not fully standalone):
```bash
# From repo root, after ./run-macos.sh
./scripts/build-macos-dmg.sh
```
Result: `build/Planify.dmg`.

### 🏗️ Development Setup

**Using GNOME Builder:**
Expand Down
15 changes: 13 additions & 2 deletions core/Services/Database.vala
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ public class Services.Database : GLib.Object {
return _instance;
}

private string get_db_dir () {
// On macOS prefer the standard Application Support location instead of XDG
if (Util.get_default ().is_macos ()) {
return Path.build_filename (Environment.get_home_dir (), "Library", "Application Support", "io.github.alainm23.planify");
}

return Path.build_filename (Environment.get_user_data_dir (), "io.github.alainm23.planify");
}

construct {
table_columns["Attachments"] = new Gee.ArrayList<string> ();
table_columns["Attachments"].add ("id");
Expand Down Expand Up @@ -178,7 +187,9 @@ public class Services.Database : GLib.Object {
}

public void init_database () {
db_path = Environment.get_user_data_dir () + "/io.github.alainm23.planify/database.db";
var db_dir = get_db_dir ();
DirUtils.create_with_parents (db_dir, 0755);
db_path = Path.build_filename (db_dir, "database.db");
Sqlite.Database.open (db_path, out db);

create_tables ();
Expand Down Expand Up @@ -662,7 +673,7 @@ public class Services.Database : GLib.Object {
}

public void clear_database () {
string db_path = Environment.get_user_data_dir () + "/io.github.alainm23.planify/database.db";
string db_path = Path.build_filename (get_db_dir (), "database.db");
File db_file = File.new_for_path (db_path);

if (db_file.query_exists ()) {
Expand Down
23 changes: 19 additions & 4 deletions core/Utils/Util.vala
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,22 @@ public class Util : GLib.Object {
string _css = """
popover,
window {
font-size: %s%;
font-size: %s%%;
}
""";

var provider = new Gtk.CssProvider ();

try {
string scale = (100 * Services.Settings.get_default ().get_double ("font-scale")).to_string ();
var css = _css.printf (scale);
double scale = Services.Settings.get_default ().get_double ("font-scale");

// On macOS, GTK4 uses a smaller base font size than GNOME/Linux.
// Apply 1.2x as default when the user hasn't customized the scale.
if (is_macos () && scale == 1.0) {
scale = 1.1;
}

var css = _css.printf ((100 * scale).to_string ()).strip ();

provider.load_from_string (css);
Gtk.StyleContext.add_provider_for_display (
Expand Down Expand Up @@ -511,7 +518,15 @@ public class Util : GLib.Object {

return false;
}


public bool is_macos () {
#if __APPLE__
return true;
#else
return false;
#endif
}

public List<Gtk.ListBoxRow> get_children (Gtk.ListBox list) {
List<Gtk.ListBoxRow> response = new List<Gtk.ListBoxRow> ();

Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pkgconfig = import('pkgconfig')

add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (application_id), language:'c')
add_project_arguments('-DLIBICAL_GLIB_UNSTABLE_API=1', language: 'c')
add_project_arguments('--vapidir', meson.project_source_root() / 'vapi', language: 'vala')

gio_dep = dependency('gio-2.0')
glib_dep = dependency('glib-2.0')
Expand Down
30 changes: 30 additions & 0 deletions run-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Script to build and run Planify on macOS without optional dependencies

cd "$(dirname "$0")"

# Build
chmod +x scripts/build-macos.sh
./scripts/build-macos.sh

# Run with environment variables for schemas
echo "Running Planify..."
echo ""

# libplanify is built into build/core, required at runtime
export DYLD_LIBRARY_PATH="$(pwd)/build/core:${DYLD_LIBRARY_PATH:-}"

# Configure Pango and Cairo for macOS
export GIO_MODULE_DIR=/opt/homebrew/lib/gio/modules
export FONTCONFIG_PATH=/opt/homebrew/etc/fonts
export FONTCONFIG_FILE=/opt/homebrew/etc/fonts/fonts.conf
export XDG_DATA_DIRS=/opt/homebrew/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}

# Use macOS system fonts as fallback
export PANGO_EMOJI_FONT="Apple Color Emoji"

# Force app to appear in Dock on macOS (GTK4 uses 'macos', not 'quartz')
export GDK_BACKEND=macos

GSETTINGS_SCHEMA_DIR=data ./build/src/io.github.alainm23.planify
Loading