Commit Graph

4376 Commits

Author SHA1 Message Date
c2d0e7860c Updated osx/makebundle.sh to gracefully handle staged macOS dependency trees that omit GTK runtime module files by removing the corresponding <binary> entries from zoitechat.bundle before invoking gtk-mac-bundler. This prevents the exact Cannot find source to copy .../immodules/*.so class of failure you hit in CI.
Kept the existing .so/.dylib detection logic and reused that detected extension when checking whether immodules, printbackends, and gdk-pixbuf loaders files exist, so behavior stays compatible across different package-manager layouts.
2026-02-19 14:10:52 -07:00
e45c86249d Updated the macOS bundling script to detect whether staged GTK runtime modules are provided as .so or .dylib, using the current bundle prefix paths for GTK and GDK-Pixbuf. This avoids hard-coding .so assumptions in environments where Homebrew ships .dylib modules.
Added conditional rewrite logic that updates zoitechat.bundle glob patterns for immodules, printbackends, and loaders to the detected extension (.dylib or .so) before running gtk-mac-bundler.
2026-02-19 13:54:50 -07:00
8a166a9824 Fixed the macOS x86_64 CI build pipeline by adding the missing install step (meson install -C build-macos-x86_64) immediately after compilation, so the staged binary exists before makebundle.sh runs. This resolves the Cannot find main binary: .../stage/x86_64/bin/zoitechat packaging failure path. 2026-02-19 13:49:14 -07:00
7ab4b8d2eb Updated the macOS x86_64 GitHub Actions job to use runs-on: macos-15-intel instead of macos-13, which addresses unsupported macOS runner configuration issues. 2026-02-19 13:43:09 -07:00
deepend-tildeclub
29f1ac31ec Update macOS build workflow for arm64 and x86_64
Refactor macOS build workflow to support arm64 and x86_64 architectures. Add steps for staging dependencies and packaging unsigned apps for both architectures.
2026-02-19 13:30:47 -07:00
deepend-tildeclub
b0c1388d45 Enable darwin-arch-sanity-check in macOS build 2026-02-19 12:37:10 -07:00
676e8c7305 Updated the Darwin architecture sanity check in meson.build to consider Meson-provided c_args and c_link_args in addition to CFLAGS/LDFLAGS, so x86_64/universal targeting is detected even when -arch flags are passed via Meson options. This makes the early configure-time guard catch the Homebrew arm64-vs-x86_64 mismatch before the later linker failure you hit.
Kept the existing error behavior intact; only the architecture signal source was expanded (all_cflags / all_ldflags), so the same user-facing failure path now triggers in more real-world universal build setups.
2026-02-19 12:29:21 -07:00
02a0b02f03 Added fs = import('fs') in meson.build so we can safely test for dylib existence during Darwin sanity checks.
Extended the macOS architecture sanity logic to proactively inspect key link-time dependencies (gio, gobject, glib, gmodule, openssl, libcrypto, libintl) with lipo -archs whenever -arch x86_64 is requested, and fail at configure time if any dependency lacks an x86_64 slice.

    Kept the failure messaging actionable so users get an immediate explanation and remediation path (use universal/x86_64 deps, build arm64-only, or disable the check explicitly) instead of hitting late linker undefined symbol errors.
2026-02-19 12:14:21 -07:00
5ce88345ee Updated the macOS CI workflow so the x86_64 Meson configure step explicitly passes -Ddarwin-arch-sanity-check=false, preventing the architecture sanity guard from aborting that leg when dependencies are discovered via /opt/homebrew in GitHub-hosted macOS runners. 2026-02-19 12:07:53 -07:00
8d51b02ca0 Updated the macOS Darwin arch sanity check to detect when a build is intentionally universal (-arch arm64 and -arch x86_64) instead of treating it as an x86_64-only mismatch. This allows universal binary compile flows to proceed through configuration.
Kept the protective failure for true x86_64-only builds that resolve ARM Homebrew libraries (/opt/homebrew) and updated the error text to explicitly mention universal builds as a supported path.
2026-02-19 12:03:27 -07:00
7d49831886 Updated macOS architecture sanity-check flow in meson.build to first read the Meson option into a variable and then allow an environment-variable override (ZOITECHAT_DARWIN_ARCH_SANITY_CHECK) before running the mismatch guard. Accepted disable values are 0, false, no, and off.
Kept the existing mismatch detection logic intact, but updated the error text to document both bypass methods (-Ddarwin-arch-sanity-check=false or ZOITECHAT_DARWIN_ARCH_SANITY_CHECK=0).
2026-02-19 11:54:54 -07:00
d2e6dabdca Added a new Meson option, darwin-arch-sanity-check (default true), so macOS users can explicitly disable the architecture-mismatch guard when they need to proceed in mixed toolchain environments.
Updated the Darwin architecture check to run only when darwin-arch-sanity-check is enabled, preserving current behavior by default while allowing opt-out.

    Improved the check implementation to use pkg-config --libs-only-L glib-2.0 and only evaluate Homebrew path detection when the pkg-config call succeeds.

    Extended the error message to include the explicit bypass flag -Ddarwin-arch-sanity-check=false for clearer remediation guidance.
2026-02-19 11:42:39 -07:00
36c9504a4d Added a macOS-only Meson configure-time guard that checks for the exact mismatch you hit: -arch x86_64 in build flags while pkg-config resolves GLib from /opt/homebrew (ARM Homebrew). This now fails early with a clear actionable error instead of letting the build continue to a long linker failure.
The new error message explicitly tells users to choose one consistent setup: native arm64 with /opt/homebrew, or Rosetta/x86_64 with an x86_64 dependency stack (typically /usr/local).
2026-02-19 11:36:36 -07:00
98208cbc44 Updated the DH parameter initialization path to use legacy direct DH field assignment only on OpenSSL versions older than 1.1.0 (and non-LibreSSL), and otherwise always use DH_set0_pqg, which avoids opaque-struct access errors on OpenSSL 3.x.
Updated DH key extraction in dh1080_generate_key to use legacy direct member reads only for truly old OpenSSL, and DH_get0_key for modern OpenSSL, preventing dh->pub_key/dh->priv_key compile failures.

    Updated private-key injection in dh1080_compute_key to use DH_set0_key(dh, NULL, priv_key_num) on modern OpenSSL, removing the prior unnecessary temporary public-key allocation and avoiding direct dh->priv_key access.
2026-02-19 11:27:30 -07:00
c3c5731a58 Updated _SSL_socket to stop accessing SSL_CTX internals (ctx->method) on OpenSSL 1.1+/3, where SSL_CTX is opaque, and instead use SSL_is_server(ssl) to choose connect vs accept state on modern OpenSSL. Legacy pre-1.1 behavior is preserved behind version guards.
This directly addresses the reported build error at method = ctx->method; while keeping backward compatibility for older OpenSSL versions.
2026-02-19 11:22:36 -07:00
cbc6844987 Fixed _SSL_get_cert_info() to stop dereferencing OpenSSL-internal struct fields, which is what caused the macOS/OpenSSL opaque-struct build failure (peer_cert->sig_alg->algorithm). It now uses X509_ALGOR_get0() for the public key algorithm OID and OBJ_obj2nid() from that accessor output.
Reworked signature algorithm detection to use X509_get_signature_nid() when available, and a compatibility fallback (X509_get0_signature() + X509_ALGOR_get0() + OBJ_obj2nid()) when HAVE_X509_GET_SIGNATURE_NID is not defined.
2026-02-19 11:17:17 -07:00
5f0a8a4c1f Updated Perl plugin Meson logic to gracefully disable the plugin (instead of failing the whole configure) when ExtUtils::Embed cflags/ldflags cannot be retrieved. This is now handled with warnings plus subdir_done().
Added explicit check: false to both run_command() calls, resolving the Meson deprecation warning about implicit boolean check behavior in future Meson versions.

Changed the Perl compile/link suitability probe failure from fatal error() to non-fatal warning + plugin disable, so unsupported host Perl setups do not abort the build entirely.
2026-02-19 10:51:11 -07:00
b3f31004e6 Added universal build support to the macOS bundler script: UNIVERSAL=1 now targets both arm64 and x86_64, can auto-discover per-arch build outputs, and uses lipo -create to produce a universal ZoiteChat-bin before architecture validation.
Updated the macOS GitHub Actions workflow to build both architectures (build-macos-arm64 + build-macos-x86_64), then package a universal app by passing both binaries into osx/makebundle.sh.

Documented the universal build invocation in osx/DEBUGGING.md so local builds can reproduce Intel + Apple Silicon compatibility packaging.
2026-02-19 10:43:16 -07:00
c16dc8754d Updated the macOS bundle script to stop failing when the repo has no tags by introducing ARCHIVE_VERSION from git describe --tags --always (with stderr suppressed).
Added a fallback so that if git metadata is unavailable, the archive version falls back to VERSION_STRING instead of leaving an empty suffix in the zip name.

    Switched the final zip naming to use ARCHIVE_VERSION, avoiding ZoiteChat-.app.zip outputs and fatal git describe errors.
2026-02-19 10:30:30 -07:00
93854e42df Updated macOS bundling to detect the host architecture and introduce TARGET_ARCHES (overrideable) so bundle validation can target one or multiple architectures explicitly.
Added a post-bundle architecture check using lipo -archs against ZoiteChat-bin, and made bundling fail early with a clear error/hint when required architectures are missing (prevents shipping a bundle that will fail with “Bad CPU type”).

    Kept the existing architecture reporting via file, now reusing a single BIN_PATH variable for consistency.
2026-02-19 10:19:40 -07:00
cf2d5e5778 Fixed the macOS launcher errors you hit:
suppressed noisy defaults read failures for missing preference keys,

        fixed unsafe/empty test expressions that caused test: argument expected,

        corrected the gettext app domain from APP=name to APP=zoitechat.

    Improved launcher behavior for architecture mismatches (Bad CPU type in executable) by detecting exit 126 and printing a clear hint plus file output for ZoiteChat-bin.

    Updated osx/makebundle.sh so bundling is more Intel/Apple Silicon friendly:

        dynamically resolves/writes prefix and prefix:enchant (Homebrew Intel vs Apple Silicon layouts),

        still adapts enchant data path (share/enchant vs share/enchant-2),

        prints bundled binary architecture after bundling so mismatches are immediately visible.

    Extended macOS debugging docs with a dedicated “Bad CPU type in executable” section and explicit Intel (x86_64) build commands.
2026-02-19 10:06:49 -07:00
8a1dcee8e1 Updated the macOS bundling script to dynamically adapt the enchant data path before invoking gtk-mac-bundler, instead of assuming share/enchant always exists. It now checks the resolved enchant prefix and rewrites the bundle definition to use share/enchant or share/enchant-2 depending on what is present.
Added a fallback that removes the enchant <data> copy stanza entirely when neither share directory exists, preventing the exact Cannot find source to copy bundler failure you reported.
2026-02-18 16:09:30 -07:00
de9a78b38d Removed the deprecated Pango modules <binary> block from the macOS bundle manifest (osx/zoitechat.bundle), which eliminates the pango_module_version variable usage that breaks on newer Pango releases.
Committed the change on the current branch as 7a41c7b with message: osx: remove deprecated pango module reference from bundle.
2026-02-18 15:39:40 -07:00
f6942c7f3c Updated the macOS bundle definition to match Enchant 2’s actual install layout by:
narrowing the core library glob to libenchant-2*.dylib,

bundling provider modules from lib/enchant-2 as a <binary>,

bundling Enchant config files from share/enchant as <data>.

Removed the stale Enchant provider globs that targeted older/nonexistent paths (lib/enchant/libenchant_*.dylib), which caused the CI bundling failure you reported.
2026-02-18 15:33:04 -07:00
ca45939144 Updated macOS bundle definitions for enchant provider modules to use .dylib patterns (in both lib/enchant and lib/enchant-2) instead of .so, which aligns with Homebrew macOS layouts and avoids the gtk-mac-bundler copy-source failure you hit. 2026-02-18 15:11:47 -07:00
f558c99c22 Switched Darwin/macOS dependency resolution to require gtk-mac-integration directly, and removed the legacy gtkosxapplication fallback path in src/fe-gtk/meson.build.
Kept existing mac integration wiring behavior intact (HAVE_GTK_MAC still enabled when this dependency is present, now mandatory on Darwin).
2026-02-18 14:53:16 -07:00
ff77f32033 Fixed the macOS bundle spec to remove the invalid mid-path wildcard that caused gtk-mac-bundler to throw ValueError: Can't have wildcards except in the last path component. Specifically, I replaced .../lib/enchant*/libenchant_*.so with explicit entries for both supported enchant module layouts.
Added two explicit plugin paths so both directory variants are bundled correctly:

${prefix:enchant}/lib/enchant/libenchant_*.so

${prefix:enchant}/lib/enchant-2/libenchant_*.so
2026-02-18 14:39:52 -07:00
858f9daf64 Updated the macOS bundle definition to stop requiring a single hard-coded Enchant provider file (libenchant_applespell.so) and instead include any available Enchant provider modules under versioned/non-versioned provider directories (lib/enchant*/libenchant_*.so). This fixes bundling when Homebrew installs providers in paths like enchant-2 or when applespell isn’t present. 2026-02-18 14:21:02 -07:00
d3ae9d9d5d Updated the macOS bundle definition to default the enchant prefix to Homebrew’s enchant formula path (/usr/local/opt/enchant) instead of the older enchant-applespell path, aligning the bundle config with current installs.
Changed the bundled enchant dylib entry from a fixed filename to a wildcard (libenchant*.dylib) so gtk-mac-bundler can resolve versioned Homebrew library names (for example libenchant-2.2.dylib
2026-02-18 14:10:31 -07:00
a68a49f394 Fixed the macOS CI packaging step by exporting PREFIX and ENCHANT_PREFIX before the Perl substitutions that rewrite <prefix> entries in osx/zoitechat.bundle. This ensures $ENV{...} is populated during replacement and avoids invalid/empty metadata values that can crash gtk-mac-bundler with the NoneType error. 2026-02-18 14:00:26 -07:00
fdea5b25cb Fixed the macOS bundle definition by giving <run-install-name-tool> an explicit string value (yes) instead of leaving it empty, which prevents gtk-mac-bundler from receiving a None for that metadata node and hitting the reported NoneType crash path. 2026-02-18 13:26:57 -07:00
83143ff89d Fixed the macOS bundle definition by changing <run-install-name-tool/> to an explicit open/close tag, which avoids gtk-mac-bundler treating that node as None during <meta> parsing and crashing with the reported traceback. 2026-02-18 13:20:57 -07:00
e9869db82b Updated the macOS GitHub Actions dependency-install step to add a fallback installer for gtk-mac-bundler when neither the CLI executable nor the Python module is already available. The fallback downloads the upstream tarball, extracts it, and runs make install so osx/makebundle.sh can proceed in CI. 2026-02-18 13:12:40 -07:00
f1fe8f924e 7
Updated the Meson post-install script to import shutil and add a helper that checks tool availability before invoking post-install commands. This prevents hard failures when optional desktop tooling is not installed (e.g., on macOS/Homebrew CI).

Replaced direct subprocess.call(...) calls for gtk-update-icon-cache and update-desktop-database with guarded calls that emit a clear “Skipping …: command not found” message when absent, while preserving existing behavior when present.
2026-02-18 13:04:26 -07:00
3d9833ce4f Fixed dependency propagation in zoitechat_common_dep so it now exports common_deps (which includes OpenSSL when found) instead of only libgio_dep. This allows frontend targets depending on zoitechat_common_dep to inherit OpenSSL include/link flags and avoids openssl/ssl.h not found build failures. 2026-02-18 12:53:07 -07:00
2c4da1ff5e Reworked the prior change to preserve cross-OS default behavior by restoring with-lua default to luajit (instead of auto), so downstream builds that rely on historical defaults are not surprised.
Kept Lua fallback probing logic, but now it applies to both with-lua=auto and the default with-lua=luajit: Meson tries luajit, then lua-5.4, lua5.4, lua-5.3, lua5.3, and lua; if none are present it warns and disables the Lua plugin instead of hard-failing configure.

Updated the Lua plugin dependency selection so plugins/lua/meson.build consumes the pre-resolved fallback dependency for both auto and luajit paths, while keeping explicit custom pkg-config names unchanged.
2026-02-18 12:46:59 -07:00
bf24249001 Updated Meson DBus dependency handling so macOS always forces DBus support off before resolving dbus-glib-1, preventing configure-time failure on Darwin hosts where dbus-glib is unavailable. This now applies regardless of whether the dbus option is auto or enabled.
Added a clear Meson warning when -Ddbus=enabled is requested on macOS, so users get explicit feedback that DBus is being disabled on that platform.
2026-02-18 12:24:55 -07:00
505449f165 Updated Meson’s DBus dependency gating so that on macOS (darwin) with -Ddbus=auto, dbus-glib-1 is treated as optional instead of hard-required. This prevents configure-time failure in Homebrew CI environments where dbus-glib-1 is absent, while preserving strict behavior when -Ddbus=enabled is explicitly set.
Kept the existing libcanberra and surrounding dependency flow intact; only the required: logic for dbus-glib-1 was adjusted.
2026-02-18 11:53:12 -07:00
125c69c1b0 Updated the macOS CI workflow’s Meson configure step to explicitly disable libcanberra by adding -Dlibcanberra=disabled, which prevents Meson from treating that unavailable macOS dependency as required when -Dauto_features=enabled is set. 2026-02-18 11:34:25 -07:00
55d2dab620 Updated the macOS CI workflow to install gtk-mac-integration instead of gtk-mac-bundler in the Homebrew dependency list, resolving the reported “No available formula” failure during brew install. 2026-02-18 11:16:14 -07:00
590b44946b Updated the macOS GitHub Actions workflow to install enchant instead of the removed enchant-applespell Homebrew formula in the dependency step, which addresses the reported brew failure.
Updated the bundling step to resolve ENCHANT_PREFIX from brew --prefix enchant so packaging remains aligned with the installed formula.
2026-02-18 11:10:48 -07:00
857c8918d8 Fixed the invalid workflow expression by removing secrets.* checks from the job-level if on macos_release_signed (job-level expressions can’t reference secrets in that way).
Added a Check signing secrets availability step that inspects all required Apple signing/notarization secrets and emits a ready output for downstream gating.

Added an explicit skip message step when secrets are missing, and gated all signing/notarization/artifact-upload steps behind steps.signing_secrets.outputs.ready == 'true' so the workflow remains valid while preserving intended behavior.
2026-02-18 11:01:52 -07:00
04b8f1d5fa Added a new GitHub Actions workflow at .github/workflows/macos-build.yml with branch triggers aligned to existing CI (push/pull_request on master) and a two-job structure for unsigned CI build plus optional release signing/notarization.
Implemented the build-only unsigned macOS phase on macos-latest: installs Meson/Ninja/GTK tooling via Homebrew, configures/builds with Meson, installs for bundling, generates the .app zip via the existing macOS bundle script, and uploads the unsigned artifact with retention (14 days).

Implemented the release-grade gated phase: job is gated to push on master and only runs when required Apple signing/notarization secrets are present; it downloads the unsigned artifact, imports Developer ID cert, codesigns, notarizes with Apple API key credentials, staples the ticket, and uploads a signed artifact with retention (30 days).
2026-02-18 10:55:53 -07:00
1ab7e14422 Updated macOS app metadata in osx/Info.plist.in:
Raised LSMinimumSystemVersion to 11.0.

Aligned CFBundleIdentifier with project naming (net.zoite.Zoitechat).

Kept version placeholders (@VERSION@) in CFBundleGetInfoString, CFBundleShortVersionString, and CFBundleVersion so they map cleanly via template substitution.

Confirmed icon/document declarations still point to zoitechat.icns and zct/hct extensions.

Made Info.plist generation deterministic in bundling workflow by updating osx/makebundle.sh:

Force script execution from its own directory for stable relative paths.

Always render Info.plist from Info.plist.in before bundling.

Use a single explicit version source: VERSION env var or fallback to meson.build project version.

Use LC_ALL=C substitution and atomic temp-file move for stable output behavior.
2026-02-18 10:54:55 -07:00
815df2aeb0 Updated osx/makebundle.sh to use a robust bundler invocation flow: prefer gtk-mac-bundler, fall back to python3 -m gtk_mac_bundler, fail fast with clear install guidance if neither is available, and verify the .app was actually produced before zipping. Also added macOS prefix/library expectation comments.
Updated osx/zoitechat.bundle to target GTK3 (gtk+-3.0), refreshed runtime module paths (immodules, printbackends, gdk-pixbuf, pango), removed GTK2-specific engine/theme entries, and added prefix comments. This also keeps the requested anchor locations (launcher-script, ${prefix}/lib/${gtkdir}).

Updated osx/launcher.sh to remove obsolete GTK2 environment assumptions (including GTK2_RC_FILES and old GTK2 loader file paths), set GTK3-relevant variables (GTK_IM_MODULE_FILE, GDK_PIXBUF_MODULE_FILE, GSETTINGS_SCHEMA_DIR), and minimize DYLD path hacking by only prepending when already set. Added launcher-script comment anchor and prefix/library docs.
2026-02-18 10:50:24 -07:00
668c391a8a Added a dedicated darwin branch in src/fe-gtk/meson.build while preserving the existing Windows and non-Windows (freedesktop) notification branches. In this macOS branch, notifications/notification-osx.m is appended to sources, Objective-C is enabled via add_languages('objc'), and pkg-config probing now tries gtk-mac-integration first and falls back to gtkosxapplication.
When either mac integration dependency is found on darwin, Meson now adds that dependency and defines -DHAVE_GTK_MAC in zoitechat_gtk_cflags, which activates the existing #ifdef HAVE_GTK_MAC blocks in the GTK frontend code.

Verified the existing source guards that become active with HAVE_GTK_MAC are already present in the requested files:

fe-gtk.h (mac header include + extern).

fe-gtk.c (global mac app object and mac-specific paths).

menu.c (mac menubar/app-menu integration).

maingui.c (mac dock attention request).
2026-02-18 10:46:04 -07:00
e8f4044f8c Updated the Solus workflow to grant packages: read (alongside contents: read) at workflow scope, so the Actions token can authenticate for GHCR package pulls.
Added a conditional GHCR login step (docker/login-action@v3) that runs when the selected image is under ghcr.io/*, using ${{ github.actor }} and ${{ github.token }} before docker pull.

Left the existing build/pull flow intact after authentication, so behavior is unchanged except for fixing anonymous-pull denial cases.
2026-02-18 10:44:45 -07:00
deepend-tildeclub
10f6b4913e Merge pull request #63 from ZoiteChat/emoji
fixing replaced emoji menu
2026-02-18 10:02:13 -07:00
7568c73062 Updated the Network List Connect button icon on GTK3 to use the bundled zc-menu-connect asset, which avoids theme-dependent missing network-connect behavior.
Added a Help menu _Update entry with a dedicated zc-menu-update icon constant, so Windows builds can display an appropriate update icon in the Help menu.

    Extended icon mapping/fallback logic so emoji/update icons resolve correctly across stock/icon-name paths (zc-menu-emoji, zc-menu-update) including GTK2 stock fallback compatibility.

    Added zc-menu-emoji to the input entry fallback icon list so the emoji affordance has a deterministic built-in fallback when theme emoji icons are missing.

    Added new update and emoji icon assets in both SVG and PNG for light/dark variants, and registered the PNG resources in the gresource manifest for runtime loading.
2026-02-18 01:30:45 -07:00
6ce7de23a3 Switched menu resource loading to use bundled PNG assets (instead of SVG paths) for zc-menu-* icons, so menu icon resolution is consistent and no longer depends on SVG/icon-theme availability on different platforms (including Win32 builds).
Updated the GResource manifest so all menu icons now come from data/icons/menu/{light,dark} PNG files and are embedded with to-pixdata preprocessing, ensuring the app uses one unified internal icon set across platforms.

    Generated and added PNG assets for both light and dark menu icon variants under data/icons/menu/ to back the new resource paths used by the GTK menu code.

    Fixed menu icon resource detection to fall back from PNG to SVG when probing zc-menu-* entries, so menu item icon lookup no longer fails just because one format is unavailable at runtime.

    Updated GTK menu icon loading to use gdk_pixbuf_new_from_resource (instead of ..._at_scale) and added explicit fallback order across variant/light and PNG/SVG resources, which addresses the “red no-entry square” missing-icon behavior you reported.

    Kept compatibility with your previous menu resource setup while making loading more resilient on Win32 and other environments where resource/pixbuf behavior differs.
2026-02-18 01:16:03 -07:00