Giter Club home page Giter Club logo

Comments (14)

behdad avatar behdad commented on July 28, 2024

This might be loading HarfBuzz from your system build or something. Have you tried setting GI_TYPELIB_PATH?

You can see what file is actually loaded this way:

>>> from gi.repository import HarfBuzz as hb
>>> hb
<gi.module.DynamicModule 'HarfBuzz' from '/home/behdad/.local/lib/girepository-1.0/HarfBuzz-0.0.typelib'>

from harfbuzz.

twardoch avatar twardoch commented on July 28, 2024
Python 2.7.9 (default, Dec 19 2014, 06:00:59)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import HarfBuzz as hb
>>> hb
<gi.module.DynamicModule 'HarfBuzz' from '/usr/local/lib/girepository-1.0/HarfBuzz-0.0.typelib'>
>>> dir(hb)
['BUFFER_REPLACEMENT_CODEPOINT_DEFAULT', 'OT_LAYOUT_DEFAULT_LANGUAGE_INDEX', 'OT_LAYOUT_NO_FEATURE_INDEX', 'OT_LAYOUT_NO_SCRIPT_INDEX', 'SET_VALUE_INVALID', 'UNICODE_MAX_DECOMPOSITION_LEN', 'VERSION_MAJOR', 'VERSION_MICRO', 'VERSION_MINOR', 'VERSION_STRING', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__file__', '__format__', '__getattr__', '__getattribute__', '__hash__', '__init__', '__loader__', '__module__', '__name__', '__new__', '__path__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_introspection_module', '_load', '_namespace', '_overrides_module', '_version', 'blob_create_sub_blob', 'blob_get_data', 'blob_get_data_writable', 'blob_get_empty', 'blob_get_length', 'blob_is_immutable', 'blob_make_immutable', 'blob_t', 'buffer_add', 'buffer_add_codepoints', 'buffer_add_latin1', 'buffer_add_utf16', 'buffer_add_utf32', 'buffer_add_utf8', 'buffer_allocation_successful', 'buffer_clear_contents', 'buffer_content_type_t', 'buffer_create', 'buffer_deserialize_glyphs', 'buffer_flags_t', 'buffer_get_content_type', 'buffer_get_direction', 'buffer_get_empty', 'buffer_get_flags', 'buffer_get_language', 'buffer_get_length', 'buffer_get_replacement_codepoint', 'buffer_get_script', 'buffer_get_segment_properties', 'buffer_get_unicode_funcs', 'buffer_guess_segment_properties', 'buffer_normalize_glyphs', 'buffer_pre_allocate', 'buffer_reset', 'buffer_reverse', 'buffer_reverse_clusters', 'buffer_serialize_flags_t', 'buffer_serialize_format_from_string', 'buffer_serialize_format_t', 'buffer_serialize_format_to_string', 'buffer_serialize_glyphs', 'buffer_serialize_list_formats', 'buffer_set_content_type', 'buffer_set_direction', 'buffer_set_flags', 'buffer_set_language', 'buffer_set_length', 'buffer_set_replacement_codepoint', 'buffer_set_script', 'buffer_set_segment_properties', 'buffer_set_unicode_funcs', 'buffer_t', 'direction_from_string', 'direction_t', 'direction_to_string', 'face_create', 'face_create_for_tables', 'face_get_empty', 'face_get_glyph_count', 'face_get_index', 'face_get_upem', 'face_is_immutable', 'face_make_immutable', 'face_reference_blob', 'face_reference_table', 'face_set_glyph_count', 'face_set_index', 'face_set_upem', 'face_t', 'feature_from_string', 'feature_t', 'feature_to_string', 'font_add_glyph_origin_for_direction', 'font_create', 'font_create_sub_font', 'font_funcs_create', 'font_funcs_get_empty', 'font_funcs_is_immutable', 'font_funcs_make_immutable', 'font_funcs_set_glyph_contour_point_func', 'font_funcs_set_glyph_extents_func', 'font_funcs_set_glyph_from_name_func', 'font_funcs_set_glyph_func', 'font_funcs_set_glyph_h_advance_func', 'font_funcs_set_glyph_h_kerning_func', 'font_funcs_set_glyph_h_origin_func', 'font_funcs_set_glyph_name_func', 'font_funcs_set_glyph_v_advance_func', 'font_funcs_set_glyph_v_kerning_func', 'font_funcs_set_glyph_v_origin_func', 'font_funcs_t', 'font_get_empty', 'font_get_face', 'font_get_glyph', 'font_get_glyph_advance_for_direction', 'font_get_glyph_contour_point', 'font_get_glyph_contour_point_for_origin', 'font_get_glyph_extents', 'font_get_glyph_extents_for_origin', 'font_get_glyph_from_name', 'font_get_glyph_h_advance', 'font_get_glyph_h_kerning', 'font_get_glyph_h_origin', 'font_get_glyph_kerning_for_direction', 'font_get_glyph_name', 'font_get_glyph_origin_for_direction', 'font_get_glyph_v_advance', 'font_get_glyph_v_kerning', 'font_get_glyph_v_origin', 'font_get_parent', 'font_get_ppem', 'font_get_scale', 'font_glyph_from_string', 'font_glyph_to_string', 'font_is_immutable', 'font_make_immutable', 'font_set_funcs', 'font_set_funcs_data', 'font_set_ppem', 'font_set_scale', 'font_subtract_glyph_origin_for_direction', 'font_t', 'ft_font_set_funcs', 'glib_blob_create', 'glib_get_unicode_funcs', 'glib_script_from_script', 'glib_script_to_script', 'glyph_extents_t', 'glyph_info_t', 'glyph_position_t', 'language_from_string', 'language_get_default', 'language_t', 'language_to_string', 'memory_mode_t', 'ot_font_set_funcs', 'ot_layout_collect_lookups', 'ot_layout_feature_get_lookups', 'ot_layout_get_attach_points', 'ot_layout_get_glyph_class', 'ot_layout_get_glyphs_in_class', 'ot_layout_get_ligature_carets', 'ot_layout_get_size_params', 'ot_layout_glyph_class_t', 'ot_layout_has_glyph_classes', 'ot_layout_has_positioning', 'ot_layout_has_substitution', 'ot_layout_language_find_feature', 'ot_layout_language_get_feature_indexes', 'ot_layout_language_get_feature_tags', 'ot_layout_language_get_required_feature', 'ot_layout_language_get_required_feature_index', 'ot_layout_lookup_collect_glyphs', 'ot_layout_lookup_substitute_closure', 'ot_layout_lookup_would_substitute', 'ot_layout_script_find_language', 'ot_layout_script_get_language_tags', 'ot_layout_table_choose_script', 'ot_layout_table_find_script', 'ot_layout_table_get_feature_tags', 'ot_layout_table_get_lookup_count', 'ot_layout_table_get_script_tags', 'ot_shape_glyphs_closure', 'ot_shape_plan_collect_lookups', 'ot_tag_from_language', 'ot_tag_to_language', 'ot_tag_to_script', 'ot_tags_from_script', 'script_from_iso15924_tag', 'script_from_string', 'script_get_horizontal_direction', 'script_t', 'script_to_iso15924_tag', 'segment_properties_equal', 'segment_properties_hash', 'segment_properties_t', 'set_add', 'set_add_range', 'set_allocation_successful', 'set_clear', 'set_create', 'set_del', 'set_del_range', 'set_get_empty', 'set_get_max', 'set_get_min', 'set_get_population', 'set_has', 'set_intersect', 'set_invert', 'set_is_empty', 'set_is_equal', 'set_next', 'set_next_range', 'set_set', 'set_subtract', 'set_symmetric_difference', 'set_t', 'set_union', 'shape', 'shape_full', 'shape_list_shapers', 'shape_plan_create', 'shape_plan_create_cached', 'shape_plan_execute', 'shape_plan_get_empty', 'shape_plan_get_shaper', 'shape_plan_t', 'tag_from_string', 'tag_to_string', 'unicode_combining_class', 'unicode_combining_class_t', 'unicode_compose', 'unicode_decompose', 'unicode_decompose_compatibility', 'unicode_eastasian_width', 'unicode_funcs_create', 'unicode_funcs_get_default', 'unicode_funcs_get_empty', 'unicode_funcs_get_parent', 'unicode_funcs_is_immutable', 'unicode_funcs_make_immutable', 'unicode_funcs_set_combining_class_func', 'unicode_funcs_set_compose_func', 'unicode_funcs_set_decompose_compatibility_func', 'unicode_funcs_set_decompose_func', 'unicode_funcs_set_eastasian_width_func', 'unicode_funcs_set_general_category_func', 'unicode_funcs_set_mirroring_func', 'unicode_funcs_set_script_func', 'unicode_funcs_t', 'unicode_general_category', 'unicode_general_category_t', 'unicode_mirroring', 'unicode_script', 'user_data_key_t', 'version', 'version_atleast', 'version_string']
python ~/Developer/vcs/github/behdad/harfbuzz/src/sample.py Lato-Regular.ttf abc
Traceback (most recent call last):
  File "/Users/adam/Developer/vcs/github/behdad/harfbuzz/src/sample.py", line 42, in <module>
    infos = hb.buffer_get_glyph_infos (buf)
  File "/Library/Python/2.7/site-packages/gi/module.py", line 313, in __getattr__
    return getattr(self._introspection_module, name)
  File "/Library/Python/2.7/site-packages/gi/module.py", line 134, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.HarfBuzz' object has no attribute 'buffer_get_glyph_infos'

I just installed HarfBuzz from git and checked: in both /usr/local/lib and /usr/local/lib/girepository-1.0/ I have the newest files. And as you can see from dir(hb), there is lots of stuff, but for some reason no "buffer_get_glyph_infos"...

from harfbuzz.

behdad avatar behdad commented on July 28, 2024

Can you send me the build log?

from harfbuzz.

gilbahat avatar gilbahat commented on July 28, 2024

Same here.
$ python
Python 2.7.9 (default, May 17 2015, 15:04:10)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.49)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
from gi.repository import HarfBuzz as hb
hb
gi.module.DynamicModule 'HarfBuzz' from '/usr/local/Cellar/gobject-introspection/1.44.0/lib/girepository-1.0/HarfBuzz-0.0.typelib'
that location is exactly as expected from my gi repository configuration

I have built harfbuzz using homebrew (http://brew.sh) adding the right switches to enable introspection. I am not sure how to fetch the build logs.

from harfbuzz.

gilbahat avatar gilbahat commented on July 28, 2024

I have managed to get a log. it seems to show failures at the GISCAN stage. here it is:

==> Downloading http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.40.tar.bz2
Already downloaded: /Library/Caches/Homebrew/harfbuzz-0.9.40.tar.bz2
==> Verifying harfbuzz-0.9.40.tar.bz2 checksum
tar xf /Library/Caches/Homebrew/harfbuzz-0.9.40.tar.bz2
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/harfbuzz/0.9.40 --with-icu --enable-freetype=yes --with-gobject=yes --with-introspection=yes --with-cairo=yes
configure: WARNING: unrecognized options: --enable-freetype, --with-introspection
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking whether clang understands -c and -o together... yes
checking dependency style of clang... none
checking for ar... ar
checking the archiver (ar) interface... ar
checking build system type... x86_64-apple-darwin14.3.0
checking host system type... x86_64-apple-darwin14.3.0
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/local/Library/ENV/4.3/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by clang... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin14.3.0 file names to x86_64-apple-darwin14.3.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin14.3.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @file support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm output from clang object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... clang -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if clang supports -fno-rtti -fno-exceptions... yes
checking for clang option to produce PIC... -fno-common -DPIC
checking if clang PIC flag -fno-common -DPIC works... yes
checking if clang static flag -static works... no
checking if clang supports -c -o file.o... yes
checking if clang supports -c -o file.o... (cached) yes
checking whether the clang linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for gcc... (cached) clang
checking whether we are using the GNU C compiler... (cached) yes
checking whether clang accepts -g... (cached) yes
checking for clang option to accept ISO C89... (cached) none needed
checking whether clang understands -c and -o together... (cached) yes
checking dependency style of clang... (cached) none
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking dependency style of clang++... none
checking how to run the C++ preprocessor... clang++ -E
checking for ld used by clang++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking whether the clang++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking for clang++ option to produce PIC... -fno-common -DPIC
checking if clang++ PIC flag -fno-common -DPIC works... yes
checking if clang++ static flag -static works... no
checking if clang++ supports -c -o file.o... yes
checking if clang++ supports -c -o file.o... (cached) yes
checking whether the clang++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking for pkg-config... /usr/local/opt/pkg-config/bin/pkg-config
checking pkg-config is at least version 0.20... yes
checking for gtk-doc... no
configure: WARNING:
You will not be able to create source packages with 'make dist'
because gtk-doc >= 1.15 is not found.
checking for gtkdoc-check... no
checking for gtkdoc-check... no
checking for gtkdoc-rebase... no
checking for gtkdoc-mkpdf... no
checking whether to build gtk-doc documentation... no
checking for GTKDOC_DEPS... yes
checking for atexit... yes
checking for mprotect... yes
checking for sysconf... yes
checking for getpagesize... yes
checking for mmap... yes
checking for isatty... yes
checking for unistd.h... (cached) yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking alignment of struct{char;}... 1
checking for native Win32... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE
checking for PTHREAD_PRIO_INHERIT... yes
checking for GLIB... yes
checking for GOBJECT... yes
checking for gobject-introspection... yes
checking for CAIRO... yes
checking for CAIRO_FT... yes
checking for ICU... yes
checking for FREETYPE... yes
checking for Intel atomic primitives... true
checking for Solaris atomic operations... false
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/hb-version.h
config.status: creating src/hb-ucdn/Makefile
config.status: creating util/Makefile
config.status: creating test/Makefile
config.status: creating test/api/Makefile
config.status: creating test/shaping/Makefile
config.status: creating docs/Makefile
config.status: creating docs/reference/Makefile
config.status: creating docs/reference/version.xml
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure: WARNING: unrecognized options: --enable-freetype, --with-introspection
configure:

Build configuration:

Unicode callbacks (you want at least one):
Glib: true
ICU: true
UCDN: false

Font callbacks (the more the better):
FreeType: true

Tools used for command-line utilities:
Cairo: true

Additional shapers (the more the better):
Graphite2: false

Platform shapers (not normally needed):
CoreText: false
Uniscribe: false

Other features:
Documentation: no
GObject bindings: true
Introspection: true

==> make install
Making install in src
GEN hb-gobject-enums.cc
GEN hb-gobject-enums.h
/Applications/Xcode.app/Contents/Developer/usr/bin/make install-recursive
CXX libharfbuzz_la-hb-blob.lo
CXX libharfbuzz_la-hb-buffer-serialize.lo
CXX libharfbuzz_la-hb-buffer.lo
CXX libharfbuzz_la-hb-common.lo
CXX libharfbuzz_la-hb-face.lo
CXX libharfbuzz_la-hb-font.lo
CXX libharfbuzz_la-hb-ot-tag.lo
CXX libharfbuzz_la-hb-set.lo
CXX libharfbuzz_la-hb-shape.lo
CXX libharfbuzz_la-hb-shape-plan.lo
CXX libharfbuzz_la-hb-shaper.lo
CXX libharfbuzz_la-hb-unicode.lo
CXX libharfbuzz_la-hb-warning.lo
CXX libharfbuzz_la-hb-ot-font.lo
CXX libharfbuzz_la-hb-ot-layout.lo
CXX libharfbuzz_la-hb-ot-map.lo
CXX libharfbuzz_la-hb-ot-shape.lo
CXX libharfbuzz_la-hb-ot-shape-complex-arabic.lo
CXX libharfbuzz_la-hb-ot-shape-complex-default.lo
CXX libharfbuzz_la-hb-ot-shape-complex-hangul.lo
CXX libharfbuzz_la-hb-ot-shape-complex-hebrew.lo
CXX libharfbuzz_la-hb-ot-shape-complex-indic.lo
CXX libharfbuzz_la-hb-ot-shape-complex-indic-table.lo
CXX libharfbuzz_la-hb-ot-shape-complex-myanmar.lo
CXX libharfbuzz_la-hb-ot-shape-complex-sea.lo
CXX libharfbuzz_la-hb-ot-shape-complex-thai.lo
CXX libharfbuzz_la-hb-ot-shape-complex-tibetan.lo
CXX libharfbuzz_la-hb-ot-shape-normalize.lo
CXX libharfbuzz_la-hb-ot-shape-fallback.lo
CXX libharfbuzz_la-hb-fallback-shape.lo
CXX libharfbuzz_la-hb-glib.lo
CXX libharfbuzz_la-hb-ft.lo
CXX libharfbuzz_icu_la-hb-icu.lo
CXX libharfbuzz_gobject_la-hb-gobject-structs.lo
CXX libharfbuzz_gobject_la-hb-gobject-enums.lo
CXX main-main.o
CXX test-test.o
CXX test_buffer_serialize-test-buffer-serialize.o
CXX test_size_params-test-size-params.o
CXX test_would_substitute-test-would-substitute.o
GEN harfbuzz.pc
GEN harfbuzz-icu.pc
GEN harfbuzz-gobject.pc
GEN libharfbuzz.la
CXXLD libharfbuzz-icu.la
CXXLD libharfbuzz-gobject.la
CXXLD test
CXXLD main
CXXLD test-buffer-serialize
CXXLD test-size-params
CXXLD test-would-substitute
GISCAN HarfBuzz-0.0.gir
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/stdint.h:29: syntax error, unexpected identifier, expecting ',' or ';' in 'typedef int8_t int_least8_t;' at 'int_least8_t'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/stdint.h:40: syntax error, unexpected identifier, expecting ',' or ';' in 'typedef int8_t int_fast8_t;' at 'int_fast8_t'
/private/tmp/harfbuzz20150517-90140-z3272t/harfbuzz-0.9.40/src/hb-common.h:85: syntax error, unexpected identifier in ' int8_t i8[4];' at 'int8_t'
/private/tmp/harfbuzz20150517-90140-z3272t/harfbuzz-0.9.40/src/hb-buffer.h:50: syntax error, unexpected identifier in ' hb_var_int_t var1;' at 'hb_var_int_t'
/private/tmp/harfbuzz20150517-90140-z3272t/harfbuzz-0.9.40/src/hb-buffer.h:61: syntax error, unexpected identifier in ' hb_var_int_t var;' at 'hb_var_int_t'
/private/tmp/harfbuzz20150517-90140-z3272t/harfbuzz-0.9.40/src/hb-buffer.h:285: syntax error, unexpected identifier in 'hb_glyph_info_t ' at 'hb_glyph_info_t'
/private/tmp/harfbuzz20150517-90140-z3272t/harfbuzz-0.9.40/src/hb-buffer.h:287: syntax error, unexpected UNSIGNED, expecting identifier or '(' or '
' in ' unsigned int length);' at 'unsigned'
/private/tmp/harfbuzz20150517-90140-z3272t/harfbuzz-0.9.40/src/hb-buffer.h:287: syntax error, unexpected ')', expecting ',' or ';' in ' unsigned int *length);' at ')'
/private/tmp/harfbuzz20150517-90140-z3272t/harfbuzz-0.9.40/src/hb-buffer.h:292: syntax error, unexpected UNSIGNED, expecting identifier or '(' or '
' in ' unsigned int *length);' at 'unsigned'
/private/tmp/harfbuzz20150517-90140-z3272t/harfbuzz-0.9.40/src/hb-buffer.h:292: syntax error, unexpected ')', expecting ',' or ';' in ' unsigned int *length);' at ')'
hb-buffer.cc:662: Warning: HarfBuzz: unknown annotation: xconstructor
hb-face.cc:152: Warning: HarfBuzz: unknown annotation: xconstructor
hb-font.cc:233: Warning: HarfBuzz: unknown annotation: xconstructor
hb-font.cc:841: Warning: HarfBuzz: unknown annotation: xconstructor
hb-set.cc:34: Warning: HarfBuzz: unknown annotation: xconstructor
hb-shape-plan.cc:96: Warning: HarfBuzz: unknown annotation: xconstructor
hb-unicode.cc:147: Warning: HarfBuzz: unknown annotation: xconstructor
hb-ft.cc:336: Warning: HarfBuzz: hb_ft_face_create: argument ft_face: Unresolved type: 'FT_Face'
hb-ft.cc:393: Warning: HarfBuzz: hb_ft_face_create_cached: argument ft_face: Unresolved type: 'FT_Face'
hb-ft.cc:371: Warning: HarfBuzz: hb_ft_face_create_referenced: argument ft_face: Unresolved type: 'FT_Face'
hb-ft.cc:423: Warning: HarfBuzz: hb_ft_font_create: argument ft_face: Unresolved type: 'FT_Face'
hb-ft.cc:456: Warning: HarfBuzz: hb_ft_font_create_referenced: argument ft_face: Unresolved type: 'FT_Face'
hb-ft.h:114: Warning: HarfBuzz: hb_ft_font_get_face: return value: Unresolved type: 'FT_Face'
GICOMP HarfBuzz-0.0.gir
.././install-sh -c -d '/usr/local/Cellar/harfbuzz/0.9.40/lib'
.././install-sh -c -d '/usr/local/Cellar/harfbuzz/0.9.40/share/gir-1.0'
.././install-sh -c -d '/usr/local/Cellar/harfbuzz/0.9.40/include/harfbuzz'
.././install-sh -c -d '/usr/local/Cellar/harfbuzz/0.9.40/lib/pkgconfig'
mkdir: /usr/local/Cellar/harfbuzz/0.9.40/lib: File exists
/bin/sh ../libtool --mode=install /usr/bin/install -c libharfbuzz.la libharfbuzz-icu.la libharfbuzz-gobject.la '/usr/local/Cellar/harfbuzz/0.9.40/lib'
/usr/bin/install -c -m 644 HarfBuzz-0.0.gir '/usr/local/Cellar/harfbuzz/0.9.40/share/gir-1.0'
/usr/bin/install -c -m 644 hb-version.h hb-gobject-enums.h '/usr/local/Cellar/harfbuzz/0.9.40/include/harfbuzz'
/usr/bin/install -c -m 644 harfbuzz.pc harfbuzz-icu.pc harfbuzz-gobject.pc '/usr/local/Cellar/harfbuzz/0.9.40/lib/pkgconfig'
.././install-sh -c -d '/usr/local/Cellar/harfbuzz/0.9.40/include/harfbuzz'
.././install-sh -c -d '/usr/local/Cellar/harfbuzz/0.9.40/lib/girepository-1.0'
/usr/bin/install -c -m 644 hb.h hb-blob.h hb-buffer.h hb-common.h hb-deprecated.h hb-face.h hb-font.h hb-set.h hb-shape.h hb-shape-plan.h hb-unicode.h hb-ot.h hb-ot-font.h hb-ot-layout.h hb-ot-shape.h hb-ot-tag.h hb-glib.h hb-ft.h hb-icu.h hb-gobject.h hb-gobject-structs.h '/usr/local/Cellar/harfbuzz/0.9.40/include/harfbuzz'
/usr/bin/install -c -m 644 HarfBuzz-0.0.typelib '/usr/local/Cellar/harfbuzz/0.9.40/lib/girepository-1.0'
libtool: install: /usr/bin/install -c .libs/libharfbuzz.0.dylib /usr/local/Cellar/harfbuzz/0.9.40/lib/libharfbuzz.0.dylib
libtool: install: (cd /usr/local/Cellar/harfbuzz/0.9.40/lib && { ln -s -f libharfbuzz.0.dylib libharfbuzz.dylib || { rm -f libharfbuzz.dylib && ln -s libharfbuzz.0.dylib libharfbuzz.dylib; }; })
libtool: install: /usr/bin/install -c .libs/libharfbuzz.lai /usr/local/Cellar/harfbuzz/0.9.40/lib/libharfbuzz.la
libtool: install: /usr/bin/install -c .libs/libharfbuzz-icu.0.dylib /usr/local/Cellar/harfbuzz/0.9.40/lib/libharfbuzz-icu.0.dylib
libtool: install: (cd /usr/local/Cellar/harfbuzz/0.9.40/lib && { ln -s -f libharfbuzz-icu.0.dylib libharfbuzz-icu.dylib || { rm -f libharfbuzz-icu.dylib && ln -s libharfbuzz-icu.0.dylib libharfbuzz-icu.dylib; }; })
libtool: install: /usr/bin/install -c .libs/libharfbuzz-icu.lai /usr/local/Cellar/harfbuzz/0.9.40/lib/libharfbuzz-icu.la
libtool: install: /usr/bin/install -c .libs/libharfbuzz-gobject.0.dylib /usr/local/Cellar/harfbuzz/0.9.40/lib/libharfbuzz-gobject.0.dylib
libtool: install: (cd /usr/local/Cellar/harfbuzz/0.9.40/lib && { ln -s -f libharfbuzz-gobject.0.dylib libharfbuzz-gobject.dylib || { rm -f libharfbuzz-gobject.dylib && ln -s libharfbuzz-gobject.0.dylib libharfbuzz-gobject.dylib; }; })
libtool: install: /usr/bin/install -c .libs/libharfbuzz-gobject.lai /usr/local/Cellar/harfbuzz/0.9.40/lib/libharfbuzz-gobject.la
Making install in util
CXX hb-view.o
CXX options.o
CXX ansi-print.o
CXX helper-cairo.o
CXX helper-cairo-ansi.o
CXX view-cairo.o
CXX hb-shape.o
CXX hb-ot-shape-closure.o
CXXLD hb-view
CXXLD hb-shape
CXXLD hb-ot-shape-closure
make[2]: Nothing to be done for install-data-am'. .././install-sh -c -d '/usr/local/Cellar/harfbuzz/0.9.40/bin' /bin/sh ../libtool --mode=install /usr/bin/install -c hb-view hb-shape hb-ot-shape-closure '/usr/local/Cellar/harfbuzz/0.9.40/bin' libtool: install: /usr/bin/install -c .libs/hb-view /usr/local/Cellar/harfbuzz/0.9.40/bin/hb-view libtool: install: /usr/bin/install -c .libs/hb-shape /usr/local/Cellar/harfbuzz/0.9.40/bin/hb-shape libtool: install: /usr/bin/install -c .libs/hb-ot-shape-closure /usr/local/Cellar/harfbuzz/0.9.40/bin/hb-ot-shape-closure Making install in test Making install in api CC test-blob.o CC test-common.o CC test-buffer.o CC test-font.o CC test-object.o CC test-set.o CC test-shape.o CC test_unicode-test-unicode.o CC test-version.o CC test-ot-tag.o CC test_c-test-c.o CXX test_cplusplus-test-cplusplus.o CCLD test-blob CCLD test-buffer CCLD test-common CCLD test-font CCLD test-object CCLD test-set CCLD test-shape CCLD test-unicode CCLD test-version CCLD test-ot-tag CCLD test-c CXXLD test-cplusplus make[3]: Nothing to be done forinstall-exec-am'.
make[3]: Nothing to be done for install-data-am'. Making install in shaping make[3]: Nothing to be done forinstall-exec-am'.
make[3]: Nothing to be done for install-data-am'. make[3]: Nothing to be done forinstall-exec-am'.
make[3]: Nothing to be done for install-data-am'. Making install in docs Making install in reference make[3]: Nothing to be done forinstall-exec-am'.
/usr/bin/install -c -m 644 ./html/annotation-glossary.html
/usr/bin/install -c -m 644 ./html/api-index-full.html
/usr/bin/install -c -m 644 ./html/ch01.html
/usr/bin/install -c -m 644 ./html/deprecated-api-index.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-blob.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-buffer.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-common.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-coretext.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-deprecated.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-face.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-font.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-ft.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-glib.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-gobject.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-graphite2.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-icu.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-ot-layout.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-ot-tag.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-ot.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-set.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-shape-plan.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-shape.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-unicode.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-uniscribe.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb-version.html
/usr/bin/install -c -m 644 ./html/harfbuzz-hb.html
/usr/bin/install -c -m 644 ./html/harfbuzz.devhelp2
/usr/bin/install -c -m 644 ./html/home.png
/usr/bin/install -c -m 644 ./html/index.html
/usr/bin/install -c -m 644 ./html/index.sgml
/usr/bin/install -c -m 644 ./html/left-insensitive.png
/usr/bin/install -c -m 644 ./html/left.png
/usr/bin/install -c -m 644 ./html/object-tree.html
/usr/bin/install -c -m 644 ./html/right-insensitive.png
/usr/bin/install -c -m 644 ./html/right.png
/usr/bin/install -c -m 644 ./html/style.css
/usr/bin/install -c -m 644 ./html/up-insensitive.png
/usr/bin/install -c -m 644 ./html/up.png
make[3]: Nothing to be done for install-exec-am'. make[3]: Nothing to be done forinstall-data-am'.
make[2]: Nothing to be done for install-exec-am'. make[2]: Nothing to be done forinstall-data-am'.
==> Cleaning
rm /usr/local/Cellar/harfbuzz/0.9.40/lib/libharfbuzz-gobject.la
rm /usr/local/Cellar/harfbuzz/0.9.40/lib/libharfbuzz-icu.la
rm /usr/local/Cellar/harfbuzz/0.9.40/lib/libharfbuzz.la
==> Finishing up
ln -s ../Cellar/harfbuzz/0.9.40/bin/hb-ot-shape-closure hb-ot-shape-closure
ln -s ../Cellar/harfbuzz/0.9.40/bin/hb-shape hb-shape
ln -s ../Cellar/harfbuzz/0.9.40/bin/hb-view hb-view
ln -s ../Cellar/harfbuzz/0.9.40/include/harfbuzz harfbuzz
ln -s ../../Cellar/harfbuzz/0.9.40/share/gir-1.0/HarfBuzz-0.0.gir HarfBuzz-0.0.gir
ln -s ../../../Cellar/harfbuzz/0.9.40/share/gtk-doc/html/harfbuzz harfbuzz
ln -s ../../Cellar/harfbuzz/0.9.40/lib/girepository-1.0/HarfBuzz-0.0.typelib HarfBuzz-0.0.typelib
ln -s ../Cellar/harfbuzz/0.9.40/lib/libharfbuzz-gobject.0.dylib libharfbuzz-gobject.0.dylib
ln -s ../Cellar/harfbuzz/0.9.40/lib/libharfbuzz-gobject.dylib libharfbuzz-gobject.dylib
ln -s ../Cellar/harfbuzz/0.9.40/lib/libharfbuzz-icu.0.dylib libharfbuzz-icu.0.dylib
ln -s ../Cellar/harfbuzz/0.9.40/lib/libharfbuzz-icu.dylib libharfbuzz-icu.dylib
ln -s ../Cellar/harfbuzz/0.9.40/lib/libharfbuzz.0.dylib libharfbuzz.0.dylib
ln -s ../Cellar/harfbuzz/0.9.40/lib/libharfbuzz.dylib libharfbuzz.dylib
ln -s ../../Cellar/harfbuzz/0.9.40/lib/pkgconfig/harfbuzz-gobject.pc harfbuzz-gobject.pc
ln -s ../../Cellar/harfbuzz/0.9.40/lib/pkgconfig/harfbuzz-icu.pc harfbuzz-icu.pc
ln -s ../../Cellar/harfbuzz/0.9.40/lib/pkgconfig/harfbuzz.pc harfbuzz.pc
==> Summary
🍺 /usr/local/Cellar/harfbuzz/0.9.40: 79 files, 3.4M, built in 29 seconds

from harfbuzz.

behdad avatar behdad commented on July 28, 2024

I don't have any ideas. I'm trying to build on my Mac with introspection and see...

from harfbuzz.

gilbahat avatar gilbahat commented on July 28, 2024

any luck with your mac build? brew has committed their build now, perhaps this relates to the way they built the introspection libraries?

from harfbuzz.

behdad avatar behdad commented on July 28, 2024

No progress. I'm using ports. I have gobject-introspection installed, but don't have the Python bindings.

from harfbuzz.

anthrotype avatar anthrotype commented on July 28, 2024

the issue seems to be in the gobject-introspection scanner, which fails to parse some typedef declarations in the stdint.h header file. This in turn leads to failing to parse other dependent typedef declarations in hb-common.h and hb-buffer.h.

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/stdint.h:29: syntax error, unexpected identifier, expecting ',' or ';' in 'typedef int8_t int_least8_t;' at 'int_least8_t'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/stdint.h:40: syntax error, unexpected identifier, expecting ',' or ';' in 'typedef int8_t int_fast8_t;' at 'int_fast8_t'
/Users/cosimolupo/Documents/Github/harfbuzz/src/hb-common.h:85: syntax error, unexpected identifier in '  int8_t i8[4];' at 'int8_t'
/Users/cosimolupo/Documents/Github/harfbuzz/src/hb-buffer.h:50: syntax error, unexpected identifier in '  hb_var_int_t var1;' at 'hb_var_int_t'
/Users/cosimolupo/Documents/Github/harfbuzz/src/hb-buffer.h:61: syntax error, unexpected identifier in '  hb_var_int_t var;' at 'hb_var_int_t'
/Users/cosimolupo/Documents/Github/harfbuzz/src/hb-buffer.h:289: syntax error, unexpected identifier in 'hb_glyph_info_t *' at 'hb_glyph_info_t'
/Users/cosimolupo/Documents/Github/harfbuzz/src/hb-buffer.h:291: syntax error, unexpected UNSIGNED, expecting identifier or '(' or '*' in 'unsigned int *length);' at 'unsigned'
/Users/cosimolupo/Documents/Github/harfbuzz/src/hb-buffer.h:291: syntax error, unexpected ')', expecting ',' or ';' in 'unsigned int *length);' at ')'
/Users/cosimolupo/Documents/Github/harfbuzz/src/hb-buffer.h:296: syntax error, unexpected UNSIGNED, expecting identifier or '(' or '*' in 'unsigned int *length);' at 'unsigned'
/Users/cosimolupo/Documents/Github/harfbuzz/src/hb-buffer.h:296: syntax error, unexpected ')', expecting ',' or ';' in 'unsigned int *length);' at ')'

If I don't include the standard header stdint.h but re-define the exact-width integer types in hb-common.h, then the gobject-introspection scanner no longer raises those syntax errors, and the generated python binding contains the missing attribute buffer_get_glyph_infos, and the sample.py script runs without errors.

This is very weird...

diff --git a/src/hb-common.h b/src/hb-common.h
index d160be5..5eda2a9 100644
--- a/src/hb-common.h
+++ b/src/hb-common.h
@@ -61,6 +61,15 @@ typedef __int32 int32_t;
 typedef unsigned __int32 uint32_t;
 typedef __int64 int64_t;
 typedef unsigned __int64 uint64_t;
+#elif defined (HB_DEFINE_STDINT)
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef short int16_t;
+typedef unsigned short uint16_t;
+typedef int int32_t;
+typedef unsigned uint32_t;
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
 #else
 #  include <stdint.h>
 #endif

from harfbuzz.

anthrotype avatar anthrotype commented on July 28, 2024

So, it turns out the problem is in the gobject-introspection giscanner/scannerlexer.l, which does not provide a rule for the keyword __signed. This is used in OS X's stdint.h header (precisely, it's inside sys/_types/_int8_t.h), when defining the int8_t type:

typedef __signed char       int8_t;

If I patch scannerlexer.l like this:

diff --git a/giscanner/scannerlexer.l b/giscanner/scannerlexer.l
index 835b92c..78e2bbd 100644
--- a/giscanner/scannerlexer.l
+++ b/giscanner/scannerlexer.l
@@ -165,6 +165,7 @@ stringtext              ([^\\\"])|(\\.)
 "__inline"             { return INLINE; }
 "__nonnull"                    { if (!parse_ignored_macro()) REJECT; }
 "_Noreturn"                    { /* Ignore */ }
+"__signed"             { return SIGNED; }
 "__signed__"               { return SIGNED; }
 "__restrict"               { return RESTRICT; }
 "__restrict__"             { return RESTRICT; }

then the syntax errors related to int8_t will disappear, and harfbuzz will compile with the correct python bindings.

I have created a homebrew tap formula for harfbuzz, which depends on such patched version of gobject-introspection.
The formulas' sources can be found here and here.

To install them just run:

$ brew tap anthrotype/taps
$ brew install anthrotype/taps/harfbuzz --verbose

My harfbuzz tap also provides a --HEAD option, to clone and compile from the repo's current HEAD.

from harfbuzz.

anthrotype avatar anthrotype commented on July 28, 2024

(I guess we should raise the issue in GNOME bug tracker as well)

from harfbuzz.

behdad avatar behdad commented on July 28, 2024

Upstreamed: https://bugzilla.gnome.org/show_bug.cgi?id=752904

from harfbuzz.

behdad avatar behdad commented on July 28, 2024

Upstreamed: https://bugzilla.gnome.org/show_bug.cgi?id=752904

from harfbuzz.

anthrotype avatar anthrotype commented on July 28, 2024

Fixed in GNOME/gobject-introspection@844b1bc

thanks! 👍

from harfbuzz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.