Skip to content
Merged
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
5 changes: 2 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ jobs:
- platform: 'macos-latest' # Apple Silicon (arm64)
args: '--target aarch64-apple-darwin'
rust_targets: 'aarch64-apple-darwin'
- platform: 'macos-13' # Intel (x86_64) — last Intel GitHub runner
args: '--target x86_64-apple-darwin'
rust_targets: 'x86_64-apple-darwin'
- platform: 'ubuntu-24.04' # glibc 2.39 — required by ORT prebuilt binaries
args: ''
rust_targets: ''
Expand Down Expand Up @@ -169,3 +166,5 @@ jobs:
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}


1 change: 1 addition & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ crate-type = ["staticlib", "cdylib", "rlib"]

[build-dependencies]
tauri-build = { version = "2", features = [] }
pkg-config = "0.3"

[dependencies]
tauri = { version = "2", features = ["protocol-asset"] }
Expand Down
22 changes: 22 additions & 0 deletions src-tauri/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
fn main() {
// The macOS `gexiv2_metadata_free` shim in lib.rs calls `g_object_unref`,
// which lives in libgobject-2.0. gexiv2 lists gobject only under
// Requires.private, so pkg-config omits it from the dynamic link line and
// the symbol goes unresolved. Link gobject-2.0 explicitly on macOS.
//
// Gate on the *target* OS (CARGO_CFG_TARGET_OS) rather than a cfg! attribute:
// a build script is compiled for the host, so #[cfg(target_os = ...)] here
// would reflect the host, not what we are building for.
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("macos") {
match pkg_config::Config::new().probe("gobject-2.0") {
Ok(lib) => {
for path in lib.link_paths {
println!("cargo:rustc-link-search=native={}", path.display());
}
}
Err(e) => {
println!("cargo:warning=pkg-config could not locate gobject-2.0: {e}");
}
}
println!("cargo:rustc-link-lib=dylib=gobject-2.0");
}

tauri_build::build()
}
11 changes: 11 additions & 0 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
mod tagger;

// gexiv2 0.16 (Homebrew) removed gexiv2_metadata_free; rexiv2 0.10 still calls it.
// This shim forwards to g_object_unref, which is the correct GObject cleanup path.
#[cfg(target_os = "macos")]
#[no_mangle]
pub unsafe extern "C" fn gexiv2_metadata_free(metadata: *mut std::ffi::c_void) {
extern "C" {
fn g_object_unref(object: *mut std::ffi::c_void);
}
g_object_unref(metadata);
}

use tagger::{
get_folder_depth_analysis, get_image_ai_tags, get_image_data, get_image_metadata,
get_images_in_folder, get_initial_folder, get_recursive_images, get_subfolders, get_thumbnail,
Expand Down
Loading