From 6cac2a1ae0f3ac8b7fdf513f08f39c61385ffe8e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 4 Mar 2025 02:43:11 -0700 Subject: [PATCH] [fontations] Ouch --- src/fontations/meson.build | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/fontations/meson.build diff --git a/src/fontations/meson.build b/src/fontations/meson.build new file mode 100644 index 000000000..da07bb3e9 --- /dev/null +++ b/src/fontations/meson.build @@ -0,0 +1,34 @@ +rust = import('unstable-rust') + +hb_rs = rust.bindgen( + input : '../hb.h', + output : 'hb.rs', + include_directories: incsrc, + args : ['--allowlist-function=hb_.*', '--allowlist-type=hb_.*'], + #args : ['--no-rustfmt-bindings'], +) + +cargo = find_program('cargo') + +libharfbuzz_fontations = custom_target( + 'harfbuzz_fontations', + input: ['lib.rs'], + output: ['libharfbuzz_fontations.so'], + depends: [hb_rs], + env: ['OUT_DIR=' + meson.current_build_dir()], + command: [ + cargo, 'build', + '--release', + '--lib', + '--target-dir', meson.current_build_dir(), + '-Z', 'unstable-options', + '--artifact-dir', meson.current_build_dir(), + '--manifest-path', meson.current_source_dir() / 'Cargo.toml' + ], + install: true, + install_dir: join_paths(get_option('prefix'), 'lib'), +) + +harfbuzz_fontations_dep = declare_dependency( + link_with: libharfbuzz_fontations, +)