Skip to content

Commit

Permalink
[harfbuzz,pango] Remove glib option for harfbuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
vejmartin committed Jan 14, 2021
1 parent bb5e5d1 commit aa3053e
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 77 deletions.
13 changes: 0 additions & 13 deletions ports/harfbuzz/0001-fix-cmake-export.patch

This file was deleted.

26 changes: 0 additions & 26 deletions ports/harfbuzz/0003-remove-broken-test.patch

This file was deleted.

13 changes: 0 additions & 13 deletions ports/harfbuzz/find-package-freetype-2.patch

This file was deleted.

12 changes: 0 additions & 12 deletions ports/harfbuzz/fix_include.patch

This file was deleted.

5 changes: 0 additions & 5 deletions ports/harfbuzz/harfbuzzConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ if ("icu" IN_LIST HARFBUZZ_FEATURES)
target_link_libraries(harfbuzz INTERFACE ICU::uc)
endif()

if ("glib" IN_LIST HARFBUZZ_FEATURES)
find_package(unofficial-glib CONFIG REQUIRED)
target_link_libraries(harfbuzz INTERFACE unofficial::glib::glib)
endif()

foreach(LIB_NAME ${HARFBUZZ_LIBRARIES})
find_library(_LIB ${LIB_NAME})
target_link_libraries(harfbuzz INTERFACE ${_LIB})
Expand Down
6 changes: 1 addition & 5 deletions ports/harfbuzz/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
0002-fix-uwp-build.patch
# This patch is required for propagating the full list of dependencies from glib
glib-cmake.patch
fix_include.patch
icu.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
icu icu
graphite2 graphite
glib glib
)

string(REPLACE "=ON" "=enabled" FEATURE_OPTIONS "${FEATURE_OPTIONS}")
Expand All @@ -25,14 +21,14 @@ vcpkg_configure_meson(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS ${FEATURE_OPTIONS}
-Dfreetype=enabled
-Dglib=disabled
-Dgobject=disabled
-Dcairo=disabled
-Dfontconfig=disabled
-Dintrospection=disabled
-Ddocs=disabled
-Dtests=disabled
-Dbenchmark=disabled
--backend=ninja
)

vcpkg_install_meson()
Expand Down
75 changes: 75 additions & 0 deletions ports/pango/0002-remove-hb-glib.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
diff --git a/pango/pango-ot-buffer.c b/pango/pango-ot-buffer.c
index 142b2f17..334df746 100644
--- a/pango/pango-ot-buffer.c
+++ b/pango/pango-ot-buffer.c
@@ -40,7 +40,6 @@ pango_ot_buffer_new (PangoFcFont *font)
PangoOTBuffer *buffer = g_slice_new (PangoOTBuffer);

buffer->buffer = hb_buffer_create ();
- hb_buffer_set_unicode_funcs (buffer->buffer, hb_glib_get_unicode_funcs ());

return buffer;
}
diff --git a/pango/pango-ot-private.h b/pango/pango-ot-private.h
index 0d803ec1..d9d86644 100644
--- a/pango/pango-ot-private.h
+++ b/pango/pango-ot-private.h
@@ -22,12 +22,12 @@
#ifndef __PANGO_OT_PRIVATE_H__
#define __PANGO_OT_PRIVATE_H__

+#include <glib.h>
#include <glib-object.h>

#include <pango/pango-ot.h>
#include <hb-ot.h>
#include <hb-ft.h>
-#include <hb-glib.h>

#include "pangofc-private.h"

diff --git a/pango/pango-ot-tag.c b/pango/pango-ot-tag.c
index 610b59d7..3bf4eccd 100644
--- a/pango/pango-ot-tag.c
+++ b/pango/pango-ot-tag.c
@@ -47,7 +47,8 @@ PangoOTTag
pango_ot_tag_from_script (PangoScript script)
{
hb_tag_t tag1, tag2;
- hb_ot_tags_from_script (hb_glib_script_to_script (script), &tag1, &tag2);
+ hb_ot_tags_from_script ((hb_script_t) g_unicode_script_to_iso15924 ((GUnicodeScript) script),
+ &tag1, &tag2);
return (PangoOTTag) tag1;
}

@@ -75,7 +76,7 @@ pango_ot_tag_from_script (PangoScript script)
PangoScript
pango_ot_tag_to_script (PangoOTTag script_tag)
{
- return (PangoScript) hb_glib_script_from_script (hb_ot_tag_to_script ((hb_tag_t) script_tag));
+ return (PangoScript) g_unicode_script_from_iso15924 (hb_ot_tag_to_script ((hb_tag_t) script_tag));
}


diff --git a/pango/pangofc-shape.c b/pango/pangofc-shape.c
index 60f829f3..4cb0ae04 100644
--- a/pango/pangofc-shape.c
+++ b/pango/pangofc-shape.c
@@ -28,7 +28,7 @@

#include "pangofc-private.h"
#include <hb-ft.h>
-#include <hb-glib.h>
+#include <glib.h>

/* cache a single hb_buffer_t */
static hb_buffer_t *cached_buffer = NULL; /* MT-safe */
@@ -362,7 +362,7 @@ _pango_fc_shape (PangoFont *font,
/* setup buffer */

hb_buffer_set_direction (hb_buffer, hb_direction);
- hb_buffer_set_script (hb_buffer, hb_glib_script_to_script (analysis->script));
+ hb_buffer_set_script (hb_buffer, (hb_script_t) g_unicode_script_to_iso15924 (analysis->script));
hb_buffer_set_language (hb_buffer, hb_language_from_string (pango_language_to_string (analysis->language), -1));
#if HB_VERSION_ATLEAST(1,0,3)
hb_buffer_set_cluster_level (hb_buffer, HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS);
4 changes: 2 additions & 2 deletions ports/pango/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: pango
Version: 1.40.11
Port-Version: 8
Port-Version: 9
Homepage: https://ftp.gnome.org/pub/GNOME/sources/pango/
Description: Text and font handling library.
Build-Depends: glib, gettext, cairo[gobject], fontconfig, freetype, harfbuzz[glib] (!(windows&static)&!osx)
Build-Depends: glib, gettext, cairo[gobject], fontconfig, freetype, harfbuzz (!(windows&static)&!osx)
4 changes: 3 additions & 1 deletion ports/pango/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${PANGO_VERSION}
PATCHES 0001-fix-static-symbols-export.diff
PATCHES
0001-fix-static-symbols-export.diff
0002-remove-hb-glib.diff
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h.unix DESTINATION ${SOURCE_PATH})
Expand Down

0 comments on commit aa3053e

Please sign in to comment.