mirror of
https://github.com/Ed94/VEFontCache-Odin.git
synced 2025-08-06 06:52:44 -07:00
Manually adding thirdparty libs
This commit is contained in:
10
thirdparty/harfbuzz/README.md
vendored
Normal file
10
thirdparty/harfbuzz/README.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# harfbuzz-odin
|
||||
|
||||
Harbuzz bindings for odin.
|
||||
|
||||
Its not the full amount, just enough to utilize its base shaping functionality.
|
||||
|
||||
## scripts/build.ps1
|
||||
|
||||
I only have support for building on Windows & Linux. However, Mac and Linux technically can just reference the library from their respective package managers.
|
||||
Will pull the latest source from the harfbuzz repository and build requisite libraries. Adjust the code as needed, by default a custom unity build is done (see `Build-RepoWithoutMeson`).
|
345
thirdparty/harfbuzz/harfbuzz.odin
vendored
Normal file
345
thirdparty/harfbuzz/harfbuzz.odin
vendored
Normal file
@@ -0,0 +1,345 @@
|
||||
/*
|
||||
NOTE(Ed): These bindings are currently partial for usage in a VE Font Cache port.
|
||||
*/
|
||||
package harfbuzz
|
||||
|
||||
import "core:c"
|
||||
|
||||
when ODIN_OS == .Windows {
|
||||
// @(extra_linker_flags="/NODEFAULTLIB:msvcrt")
|
||||
// foreign import harfbuzz "./lib/win64/libharfbuzz-0.dll"
|
||||
foreign import harfbuzz "./lib/win64/harfbuzz.lib"
|
||||
// foreign import harfbuzz "./lib/win64/libharfbuzz.a"
|
||||
}
|
||||
else when ODIN_OS == .Linux {
|
||||
// foreign import harfbuzz "./lib/linux64/libharfbuzz.so"
|
||||
foreign import harfbuzz "system:harfbuzz"
|
||||
}
|
||||
else when ODIN_OS == .Darwin {
|
||||
// foreign import harfbuzz { "./lib/osx/libharfbuzz.so" }
|
||||
foreign import harfbuzz "system:harfbuzz"
|
||||
}
|
||||
|
||||
Buffer :: distinct rawptr // hb_buffer_t*
|
||||
Blob :: distinct rawptr // hb_blob_t*
|
||||
Codepoint :: distinct c.uint32_t // hb_codepoint_t
|
||||
Face :: distinct rawptr // hb_face_t*
|
||||
Font :: distinct rawptr // hb_font_t*
|
||||
Language :: distinct rawptr // hb_language_t*
|
||||
Mask :: distinct c.uint32_t // hb_mask_t
|
||||
Position :: distinct c.uint32_t // hb_position_t
|
||||
Tag :: distinct c.uint32_t // hb_tag_t
|
||||
Unicode_Funcs :: distinct rawptr // hb_unicode_funcs_t*
|
||||
|
||||
hb_var_int_t :: struct #raw_union {
|
||||
u32 : c.uint32_t,
|
||||
i32 : c.int32_t,
|
||||
u16 : [2]c.uint16_t,
|
||||
i16 : [2]c.int16_t,
|
||||
u8 : [4]c.uint8_t,
|
||||
i8 : [4]c.int8_t,
|
||||
}
|
||||
|
||||
Feature :: struct {
|
||||
tag : Tag,
|
||||
value : c.uint32_t,
|
||||
start : c.uint,
|
||||
end : c.uint,
|
||||
}
|
||||
|
||||
Glyph_Info :: struct {
|
||||
codepoint : Codepoint,
|
||||
/*< private >*/
|
||||
mask : Mask,
|
||||
/*< public >*/
|
||||
cluster : c.uint32_t,
|
||||
|
||||
/*< private >*/
|
||||
var1 : hb_var_int_t,
|
||||
var2 : hb_var_int_t,
|
||||
}
|
||||
|
||||
Glyph_Position :: struct {
|
||||
x_advance : Position,
|
||||
y_advance : Position,
|
||||
x_offset : Position,
|
||||
y_offset : Position,
|
||||
|
||||
/*< private >*/
|
||||
var : hb_var_int_t,
|
||||
}
|
||||
|
||||
Segment_Properties :: struct {
|
||||
direction : Direction,
|
||||
script : Script,
|
||||
language : Language,
|
||||
reserved1 : rawptr,
|
||||
reserved2 : rawptr,
|
||||
}
|
||||
|
||||
Buffer_Content_Type :: enum c.uint {
|
||||
INVALID = 0,
|
||||
UNICODE,
|
||||
GLYPHS
|
||||
}
|
||||
|
||||
Direction :: enum c.uint {
|
||||
INVALID = 0,
|
||||
LGR = 4,
|
||||
RTL,
|
||||
TTB,
|
||||
BTT,
|
||||
}
|
||||
|
||||
Script :: enum u32 {
|
||||
// ID = ((hb_tag_t)((((uint32_t)(c1)&0xFF)<<24)|(((uint32_t)(c2)&0xFF)<<16)|(((uint32_t)(c3)&0xFF)<<8)|((uint32_t)(c4)&0xFF))),
|
||||
|
||||
// 1.1
|
||||
COMMON = ( u32('Z') & 0xFF ) << 24 | ( u32('y') & 0xFF ) << 16 | ( u32('y') & 0xFF ) << 8 | ( u32('y') & 0xFF ),
|
||||
INHERITED = ( u32('Z') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('h') & 0xFF ),
|
||||
|
||||
// 5.0
|
||||
UNKNOWN = ( u32('Z') & 0xFF ) << 24 | ( u32('z') & 0xFF ) << 16 | ( u32('z') & 0xFF ) << 8 | ( u32('z') & 0xFF ),
|
||||
|
||||
// 1.1
|
||||
ARABIC = ( u32('A') & 0xFF ) << 24 | ( u32('r') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('b') & 0xFF ),
|
||||
ARMENIAN = ( u32('A') & 0xFF ) << 24 | ( u32('r') & 0xFF ) << 16 | ( u32('m') & 0xFF ) << 8 | ( u32('n') & 0xFF ),
|
||||
BENGALI = ( u32('B') & 0xFF ) << 24 | ( u32('e') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('g') & 0xFF ),
|
||||
CYRILLIC = ( u32('C') & 0xFF ) << 24 | ( u32('y') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('l') & 0xFF ),
|
||||
DEVANAGARI = ( u32('D') & 0xFF ) << 24 | ( u32('e') & 0xFF ) << 16 | ( u32('v') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
GEORGIAN = ( u32('G') & 0xFF ) << 24 | ( u32('e') & 0xFF ) << 16 | ( u32('o') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
GREEK = ( u32('G') & 0xFF ) << 24 | ( u32('r') & 0xFF ) << 16 | ( u32('e') & 0xFF ) << 8 | ( u32('k') & 0xFF ),
|
||||
GUJARATI = ( u32('G') & 0xFF ) << 24 | ( u32('u') & 0xFF ) << 16 | ( u32('j') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
GURMUKHI = ( u32('G') & 0xFF ) << 24 | ( u32('u') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('u') & 0xFF ),
|
||||
HANGUL = ( u32('H') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('g') & 0xFF ),
|
||||
HAN = ( u32('H') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
HEBREW = ( u32('H') & 0xFF ) << 24 | ( u32('e') & 0xFF ) << 16 | ( u32('b') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
HIRAGANA = ( u32('H') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
KANNADA = ( u32('K') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('d') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
KATAKANA = ( u32('K') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
LAO = ( u32('L') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('o') & 0xFF ) << 8 | ( u32('o') & 0xFF ),
|
||||
LATIN = ( u32('L') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('t') & 0xFF ) << 8 | ( u32('n') & 0xFF ),
|
||||
MALAYALAN = ( u32('M') & 0xFF ) << 24 | ( u32('l') & 0xFF ) << 16 | ( u32('y') & 0xFF ) << 8 | ( u32('m') & 0xFF ),
|
||||
ORIYA = ( u32('O') & 0xFF ) << 24 | ( u32('r') & 0xFF ) << 16 | ( u32('y') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
TAMIL = ( u32('T') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('m') & 0xFF ) << 8 | ( u32('l') & 0xFF ),
|
||||
TELUGU = ( u32('T') & 0xFF ) << 24 | ( u32('e') & 0xFF ) << 16 | ( u32('l') & 0xFF ) << 8 | ( u32('u') & 0xFF ),
|
||||
THAI = ( u32('T') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
|
||||
// 2.0
|
||||
TIBETAN = ( u32('T') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('b') & 0xFF ) << 8 | ( u32('t') & 0xFF ),
|
||||
|
||||
// 3.0
|
||||
BOPOMOFO = ( u32('B') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('p') & 0xFF ) << 8 | ( u32('o') & 0xFF ),
|
||||
BRAILLE = ( u32('B') & 0xFF ) << 24 | ( u32('r') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
CANADIAN_SYLLABICS = ( u32('C') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('s') & 0xFF ),
|
||||
CHEROKEE = ( u32('C') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('e') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
ETHIOPIC = ( u32('E') & 0xFF ) << 24 | ( u32('t') & 0xFF ) << 16 | ( u32('h') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
KHMER = ( u32('K') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('m') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
MONGOLIAN = ( u32('M') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('g') & 0xFF ),
|
||||
MYANMAR = ( u32('M') & 0xFF ) << 24 | ( u32('y') & 0xFF ) << 16 | ( u32('m') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
OGHAM = ( u32('O') & 0xFF ) << 24 | ( u32('g') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('n') & 0xFF ),
|
||||
RUNIC = ( u32('R') & 0xFF ) << 24 | ( u32('u') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
SINHALA = ( u32('S') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('h') & 0xFF ),
|
||||
SYRIAC = ( u32('S') & 0xFF ) << 24 | ( u32('y') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('c') & 0xFF ),
|
||||
THAANA = ( u32('T') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
YI = ( u32('Y') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('i') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
|
||||
// 3.1
|
||||
DESERET = ( u32('D') & 0xFF ) << 24 | ( u32('s') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('t') & 0xFF ),
|
||||
GOTHIC = ( u32('G') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('t') & 0xFF ) << 8 | ( u32('h') & 0xFF ),
|
||||
OLD_ITALIC = ( u32('I') & 0xFF ) << 24 | ( u32('t') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('l') & 0xFF ),
|
||||
|
||||
// 3.2
|
||||
BUHID = ( u32('B') & 0xFF ) << 24 | ( u32('u') & 0xFF ) << 16 | ( u32('h') & 0xFF ) << 8 | ( u32('d') & 0xFF ),
|
||||
HANUNOO = ( u32('H') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('o') & 0xFF ),
|
||||
TAGALOG = ( u32('T') & 0xFF ) << 24 | ( u32('g') & 0xFF ) << 16 | ( u32('l') & 0xFF ) << 8 | ( u32('g') & 0xFF ),
|
||||
TAGBANWA = ( u32('T') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('g') & 0xFF ) << 8 | ( u32('b') & 0xFF ),
|
||||
|
||||
// 4.0
|
||||
CYPRIOT = ( u32('C') & 0xFF ) << 24 | ( u32('p') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('t') & 0xFF ),
|
||||
LIMBU = ( u32('L') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('m') & 0xFF ) << 8 | ( u32('b') & 0xFF ),
|
||||
LINEAR_B = ( u32('L') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('i') & 0xFF ) << 8 | ( u32('b') & 0xFF ),
|
||||
OSMANYA = ( u32('O') & 0xFF ) << 24 | ( u32('m') & 0xFF ) << 16 | ( u32('m') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
SHAVIAN = ( u32('S') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('w') & 0xFF ),
|
||||
TAI_LE = ( u32('T') & 0xFF ) << 24 | ( u32('l') & 0xFF ) << 16 | ( u32('l') & 0xFF ) << 8 | ( u32('e') & 0xFF ),
|
||||
UGARITIC = ( u32('U') & 0xFF ) << 24 | ( u32('g') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
|
||||
// 4.1
|
||||
BUGINESE = ( u32('B') & 0xFF ) << 24 | ( u32('u') & 0xFF ) << 16 | ( u32('g') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
COPTIC = ( u32('C') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('p') & 0xFF ) << 8 | ( u32('t') & 0xFF ),
|
||||
GLAGOLITIC = ( u32('G') & 0xFF ) << 24 | ( u32('l') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('g') & 0xFF ),
|
||||
KHAROSHTHI = ( u32('K') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
NEW_TAI_LUE = ( u32('T') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('l') & 0xFF ) << 8 | ( u32('u') & 0xFF ),
|
||||
OLD_PERSIAN = ( u32('X') & 0xFF ) << 24 | ( u32('p') & 0xFF ) << 16 | ( u32('e') & 0xFF ) << 8 | ( u32('o') & 0xFF ),
|
||||
SYLOTI_NAGRI = ( u32('S') & 0xFF ) << 24 | ( u32('y') & 0xFF ) << 16 | ( u32('l') & 0xFF ) << 8 | ( u32('o') & 0xFF ),
|
||||
TIFINAGH = ( u32('T') & 0xFF ) << 24 | ( u32('f') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('g') & 0xFF ),
|
||||
|
||||
// 5.0
|
||||
BALINESE = ( u32('B') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('l') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
CUNEIFORM = ( u32('X') & 0xFF ) << 24 | ( u32('s') & 0xFF ) << 16 | ( u32('u') & 0xFF ) << 8 | ( u32('x') & 0xFF ),
|
||||
NKO = ( u32('N') & 0xFF ) << 24 | ( u32('k') & 0xFF ) << 16 | ( u32('o') & 0xFF ) << 8 | ( u32('o') & 0xFF ),
|
||||
PHAGS_PA = ( u32('P') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('g') & 0xFF ),
|
||||
PHOENICIAN = ( u32('P') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('x') & 0xFF ),
|
||||
|
||||
// 5.1
|
||||
CARIAN = ( u32('C') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
CHAM = ( u32('C') & 0xFF ) << 24 | ( u32('j') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('m') & 0xFF ),
|
||||
KAYAH_LI = ( u32('K') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('l') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
LEPCHA = ( u32('L') & 0xFF ) << 24 | ( u32('e') & 0xFF ) << 16 | ( u32('p') & 0xFF ) << 8 | ( u32('c') & 0xFF ),
|
||||
LYCIAN = ( u32('L') & 0xFF ) << 24 | ( u32('y') & 0xFF ) << 16 | ( u32('c') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
LYDIAN = ( u32('L') & 0xFF ) << 24 | ( u32('y') & 0xFF ) << 16 | ( u32('d') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
OL_CHIKI = ( u32('O') & 0xFF ) << 24 | ( u32('l') & 0xFF ) << 16 | ( u32('c') & 0xFF ) << 8 | ( u32('k') & 0xFF ),
|
||||
REJANG = ( u32('R') & 0xFF ) << 24 | ( u32('n') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('g') & 0xFF ),
|
||||
SAURASHTRA = ( u32('S') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('u') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
SUNDANESE = ( u32('S') & 0xFF ) << 24 | ( u32('u') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('d') & 0xFF ),
|
||||
VAI = ( u32('V') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('i') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
|
||||
// 5.2
|
||||
AVESTAN = ( u32('A') & 0xFF ) << 24 | ( u32('v') & 0xFF ) << 16 | ( u32('s') & 0xFF ) << 8 | ( u32('t') & 0xFF ),
|
||||
BAMUM = ( u32('B') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('m') & 0xFF ) << 8 | ( u32('u') & 0xFF ),
|
||||
EGYPTIAN_HIEROGLYPHS = ( u32('E') & 0xFF ) << 24 | ( u32('g') & 0xFF ) << 16 | ( u32('y') & 0xFF ) << 8 | ( u32('p') & 0xFF ),
|
||||
IMPERIAL_ARAMAIC = ( u32('A') & 0xFF ) << 24 | ( u32('r') & 0xFF ) << 16 | ( u32('m') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
INSCRIPTIONAL_PAHLAVI = ( u32('P') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('l') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
INSCRIPTIONAL_PARTHAIAN = ( u32('P') & 0xFF ) << 24 | ( u32('r') & 0xFF ) << 16 | ( u32('t') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
JAVANESE = ( u32('J') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('v') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
KAITHI = ( u32('K') & 0xFF ) << 24 | ( u32('t') & 0xFF ) << 16 | ( u32('h') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
LISU = ( u32('L') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('s') & 0xFF ) << 8 | ( u32('u') & 0xFF ),
|
||||
MEETEI_MAYEK = ( u32('M') & 0xFF ) << 24 | ( u32('t') & 0xFF ) << 16 | ( u32('e') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
OLD_SOUTH_ARABIAN = ( u32('S') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('b') & 0xFF ),
|
||||
OLD_TURKIC = ( u32('O') & 0xFF ) << 24 | ( u32('r') & 0xFF ) << 16 | ( u32('k') & 0xFF ) << 8 | ( u32('h') & 0xFF ),
|
||||
SAMARITAN = ( u32('S') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('m') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
TAI_THAM = ( u32('L') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
TAI_VIET = ( u32('T') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('v') & 0xFF ) << 8 | ( u32('t') & 0xFF ),
|
||||
|
||||
// 6.0
|
||||
BATAK = ( u32('B') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('t') & 0xFF ) << 8 | ( u32('k') & 0xFF ),
|
||||
BRAHMI = ( u32('B') & 0xFF ) << 24 | ( u32('r') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('h') & 0xFF ),
|
||||
MANDAIC = ( u32('M') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('d') & 0xFF ),
|
||||
|
||||
// 6.1
|
||||
CHAKMA = ( u32('C') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('k') & 0xFF ) << 8 | ( u32('m') & 0xFF ),
|
||||
MEROITIC_CURSIVE = ( u32('M') & 0xFF ) << 24 | ( u32('e') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('c') & 0xFF ),
|
||||
MEROITIC_HIEROGLYPHS = ( u32('M') & 0xFF ) << 24 | ( u32('e') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('o') & 0xFF ),
|
||||
MIAO = ( u32('P') & 0xFF ) << 24 | ( u32('l') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('d') & 0xFF ),
|
||||
SHARADA = ( u32('S') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('d') & 0xFF ),
|
||||
SORA_SOMPENG = ( u32('S') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
TAKRI = ( u32('T') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('k') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
|
||||
// 0.9.30
|
||||
// 7.0
|
||||
BASSA_VAH = ( u32('B') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('s') & 0xFF ) << 8 | ( u32('s') & 0xFF ),
|
||||
CAUCASIAN_ALBANIAN = ( u32('A') & 0xFF ) << 24 | ( u32('g') & 0xFF ) << 16 | ( u32('h') & 0xFF ) << 8 | ( u32('b') & 0xFF ),
|
||||
DUPLOYAN = ( u32('D') & 0xFF ) << 24 | ( u32('u') & 0xFF ) << 16 | ( u32('p') & 0xFF ) << 8 | ( u32('l') & 0xFF ),
|
||||
ELBASAN = ( u32('E') & 0xFF ) << 24 | ( u32('l') & 0xFF ) << 16 | ( u32('b') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
GRANTHA = ( u32('G') & 0xFF ) << 24 | ( u32('r') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('n') & 0xFF ),
|
||||
KHOJKI = ( u32('K') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('o') & 0xFF ) << 8 | ( u32('j') & 0xFF ),
|
||||
KHUDAWADI = ( u32('S') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('d') & 0xFF ),
|
||||
LINEAR_A = ( u32('L') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
MAHAJANI = ( u32('M') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('h') & 0xFF ) << 8 | ( u32('j') & 0xFF ),
|
||||
MANICHAEAN = ( u32('M') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
MENDE_KIKAKUI = ( u32('M') & 0xFF ) << 24 | ( u32('e') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('d') & 0xFF ),
|
||||
MODI = ( u32('M') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('d') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
MRO = ( u32('M') & 0xFF ) << 24 | ( u32('r') & 0xFF ) << 16 | ( u32('o') & 0xFF ) << 8 | ( u32('o') & 0xFF ),
|
||||
NABATAEAN = ( u32('N') & 0xFF ) << 24 | ( u32('b') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('t') & 0xFF ),
|
||||
OLD_NORTH_ARABIAN = ( u32('N') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('b') & 0xFF ),
|
||||
OLD_PERMIC = ( u32('P') & 0xFF ) << 24 | ( u32('e') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('m') & 0xFF ),
|
||||
PAHAWH_HMONG = ( u32('H') & 0xFF ) << 24 | ( u32('m') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('g') & 0xFF ),
|
||||
PALMYRENE = ( u32('P') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('l') & 0xFF ) << 8 | ( u32('m') & 0xFF ),
|
||||
PAU_CIN_HAU = ( u32('P') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('u') & 0xFF ) << 8 | ( u32('c') & 0xFF ),
|
||||
PSALTER_PAHLAVI = ( u32('P') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('l') & 0xFF ) << 8 | ( u32('p') & 0xFF ),
|
||||
SIDDHAM = ( u32('S') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('d') & 0xFF ) << 8 | ( u32('d') & 0xFF ),
|
||||
TIRHUNTA = ( u32('T') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('h') & 0xFF ),
|
||||
WARANG_CITI = ( u32('W') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
|
||||
// 8.0
|
||||
AHOM = ( u32('A') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('o') & 0xFF ) << 8 | ( u32('m') & 0xFF ),
|
||||
ANATOLIAN_HIEROGLYPHS = ( u32('H') & 0xFF ) << 24 | ( u32('l') & 0xFF ) << 16 | ( u32('u') & 0xFF ) << 8 | ( u32('w') & 0xFF ),
|
||||
HATRAN = ( u32('H') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('t') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
MULTANI = ( u32('M') & 0xFF ) << 24 | ( u32('u') & 0xFF ) << 16 | ( u32('l') & 0xFF ) << 8 | ( u32('t') & 0xFF ),
|
||||
OLD_HUNGARIAN = ( u32('H') & 0xFF ) << 24 | ( u32('u') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('g') & 0xFF ),
|
||||
SIGNWRITING = ( u32('S') & 0xFF ) << 24 | ( u32('g') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('w') & 0xFF ),
|
||||
|
||||
// 1.3.0
|
||||
// 9.0
|
||||
ADLAM = ( u32('A') & 0xFF ) << 24 | ( u32('d') & 0xFF ) << 16 | ( u32('l') & 0xFF ) << 8 | ( u32('m') & 0xFF ),
|
||||
BHAIKSUKI = ( u32('B') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('k') & 0xFF ) << 8 | ( u32('s') & 0xFF ),
|
||||
MARCHEN = ( u32('M') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('c') & 0xFF ),
|
||||
OSAGE = ( u32('O') & 0xFF ) << 24 | ( u32('s') & 0xFF ) << 16 | ( u32('g') & 0xFF ) << 8 | ( u32('e') & 0xFF ),
|
||||
TANGUT = ( u32('T') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('g') & 0xFF ),
|
||||
NEWA = ( u32('N') & 0xFF ) << 24 | ( u32('e') & 0xFF ) << 16 | ( u32('w') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
|
||||
// 1.6.0
|
||||
// 10.0
|
||||
MASARAM_GONDI = ( u32('D') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('g') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
NUSHU = ( u32('D') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('g') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
SOYOMBO = ( u32('D') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('g') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
ZANABAZAR_SQUARE = ( u32('D') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('g') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
|
||||
// 1.8.0
|
||||
// 11.0
|
||||
DOGRA = ( u32('D') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('g') & 0xFF ) << 8 | ( u32('r') & 0xFF ),
|
||||
GUNJALA_GONDI = ( u32('G') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('g') & 0xFF ),
|
||||
HANIFI_ROHINGYA = ( u32('R') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('h') & 0xFF ) << 8 | ( u32('g') & 0xFF ),
|
||||
MAKASAR = ( u32('M') & 0xFF ) << 24 | ( u32('k') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('a') & 0xFF ),
|
||||
MEDEFAIDRIN = ( u32('M') & 0xFF ) << 24 | ( u32('e') & 0xFF ) << 16 | ( u32('d') & 0xFF ) << 8 | ( u32('f') & 0xFF ),
|
||||
OLD_SOGDIAN = ( u32('S') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('g') & 0xFF ) << 8 | ( u32('o') & 0xFF ),
|
||||
SOGDIAN = ( u32('S') & 0xFF ) << 24 | ( u32('o') & 0xFF ) << 16 | ( u32('g') & 0xFF ) << 8 | ( u32('d') & 0xFF ),
|
||||
|
||||
// 2.4.0
|
||||
// 12.0
|
||||
ELYMAIC = ( u32('E') & 0xFF ) << 24 | ( u32('l') & 0xFF ) << 16 | ( u32('y') & 0xFF ) << 8 | ( u32('m') & 0xFF ),
|
||||
NANDINAGARI = ( u32('N') & 0xFF ) << 24 | ( u32('a') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('d') & 0xFF ),
|
||||
NYIAKENG_PUACHUE_HMONG = ( u32('H') & 0xFF ) << 24 | ( u32('m') & 0xFF ) << 16 | ( u32('n') & 0xFF ) << 8 | ( u32('p') & 0xFF ),
|
||||
WANCHO = ( u32('W') & 0xFF ) << 24 | ( u32('c') & 0xFF ) << 16 | ( u32('h') & 0xFF ) << 8 | ( u32('o') & 0xFF ),
|
||||
|
||||
// 2.6.7
|
||||
// 13.0
|
||||
CHRASMIAN = ( u32('C') & 0xFF ) << 24 | ( u32('h') & 0xFF ) << 16 | ( u32('r') & 0xFF ) << 8 | ( u32('s') & 0xFF ),
|
||||
DIVES_AKURU = ( u32('D') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('a') & 0xFF ) << 8 | ( u32('k') & 0xFF ),
|
||||
KHITAN_SMALL_SCRIPT = ( u32('K') & 0xFF ) << 24 | ( u32('i') & 0xFF ) << 16 | ( u32('t') & 0xFF ) << 8 | ( u32('s') & 0xFF ),
|
||||
YEZIDI = ( u32('Y') & 0xFF ) << 24 | ( u32('e') & 0xFF ) << 16 | ( u32('z') & 0xFF ) << 8 | ( u32('i') & 0xFF ),
|
||||
|
||||
INVALID= 0,
|
||||
}
|
||||
|
||||
Memory_Mode :: enum c.int {
|
||||
DUPLICATE,
|
||||
READONLY,
|
||||
WRITABLE,
|
||||
READONLY_MAY_MAKE_WRITABLE,
|
||||
}
|
||||
|
||||
Destroy_Func :: proc "c" ( user_data : rawptr )
|
||||
|
||||
@(default_calling_convention="c", link_prefix="hb_")
|
||||
foreign harfbuzz
|
||||
{
|
||||
blob_create :: proc( data : [^]u8, length : c.uint, memory_mode : Memory_Mode, user_data : rawptr, destroy : Destroy_Func ) -> Blob ---
|
||||
blob_destroy :: proc( blob : Blob ) ---
|
||||
|
||||
buffer_create :: proc() -> Buffer ---
|
||||
buffer_destroy :: proc( buffer : Buffer ) ---
|
||||
buffer_add :: proc( buffer : Buffer, codepoint : Codepoint, cluster : c.uint ) ---
|
||||
buffer_clear_contents :: proc( buffer : Buffer ) ---
|
||||
buffer_get_glyph_infos :: proc( buffer : Buffer, length : ^c.uint ) -> [^]Glyph_Info ---
|
||||
buffer_get_glyph_positions :: proc( buffer : Buffer, length : ^c.uint ) -> [^]Glyph_Position ---
|
||||
buffer_set_direction :: proc( buffer : Buffer, direction : Direction ) ---
|
||||
buffer_set_language :: proc( buffer : Buffer, language : Language ) ---
|
||||
buffer_set_script :: proc( buffer : Buffer, script : Script ) ---
|
||||
buffer_set_content_type :: proc( buffer : Buffer, content_type : Buffer_Content_Type ) ---
|
||||
|
||||
face_create :: proc( blob : Blob, index : c.uint ) -> Face ---
|
||||
face_destroy :: proc( face : Face ) ---
|
||||
|
||||
font_create :: proc( face : Face ) -> Font ---
|
||||
font_destroy :: proc( font : Font ) ---
|
||||
|
||||
language_get_default :: proc() -> Language ---
|
||||
|
||||
script_get_horizontal_direction :: proc( script : Script ) -> Direction ---
|
||||
|
||||
shape :: proc( font : Font, buffer : Buffer, features : [^]Feature, num_features : c.uint ) ---
|
||||
|
||||
unicode_funcs_get_default :: proc() -> Unicode_Funcs ---
|
||||
unicode_script :: proc( ufuncs : Unicode_Funcs, unicode : Codepoint ) -> Script ---
|
||||
}
|
BIN
thirdparty/harfbuzz/lib/linux64/libharfbuzz.so
vendored
Normal file
BIN
thirdparty/harfbuzz/lib/linux64/libharfbuzz.so
vendored
Normal file
Binary file not shown.
BIN
thirdparty/harfbuzz/lib/win64/harfbuzz.dll
vendored
Normal file
BIN
thirdparty/harfbuzz/lib/win64/harfbuzz.dll
vendored
Normal file
Binary file not shown.
BIN
thirdparty/harfbuzz/lib/win64/harfbuzz.lib
vendored
Normal file
BIN
thirdparty/harfbuzz/lib/win64/harfbuzz.lib
vendored
Normal file
Binary file not shown.
305
thirdparty/harfbuzz/scripts/build.ps1
vendored
Normal file
305
thirdparty/harfbuzz/scripts/build.ps1
vendored
Normal file
@@ -0,0 +1,305 @@
|
||||
$misc = join-path $PSScriptRoot 'helpers/misc.ps1'
|
||||
. $misc
|
||||
|
||||
$path_root = git rev-parse --show-toplevel
|
||||
$path_lib = join-path $path_root 'lib'
|
||||
$path_win64 = join-path $path_lib 'win64'
|
||||
|
||||
$url_harfbuzz = 'https://github.com/harfbuzz/harfbuzz.git'
|
||||
$path_harfbuzz = join-path $path_root 'harfbuzz'
|
||||
|
||||
function build-repo {
|
||||
verify-path $script:path_lib
|
||||
verify-path $path_win64
|
||||
|
||||
clone-gitrepo $path_harfbuzz $url_harfbuzz
|
||||
|
||||
push-location $path_harfbuzz
|
||||
|
||||
$library_type = "shared"
|
||||
$build_type = "release"
|
||||
|
||||
# Meson configure and build
|
||||
$mesonArgs = @(
|
||||
"build",
|
||||
"--default-library=$library_type",
|
||||
"--buildtype=$build_type",
|
||||
"--wrap-mode=forcefallback",
|
||||
"-Dglib=disabled",
|
||||
"-Dgobject=disabled",
|
||||
"-Dcairo=disabled",
|
||||
"-Dicu=disabled",
|
||||
"-Dgraphite=disabled",
|
||||
"-Dfreetype=disabled",
|
||||
"-Ddirectwrite=disabled",
|
||||
"-Dcoretext=disabled"
|
||||
)
|
||||
& meson $mesonArgs
|
||||
& meson compile -C build
|
||||
|
||||
pop-location
|
||||
|
||||
$path_build = join-path $path_harfbuzz 'build'
|
||||
$path_src = join-path $path_build 'src'
|
||||
$path_dll = join-path $path_src 'harfbuzz.dll'
|
||||
$path_lib = join-path $path_src 'harfbuzz.lib'
|
||||
$path_lib_static = join-path $path_src 'libharfbuzz.a'
|
||||
$path_pdb = join-path $path_src 'harfbuzz.pdb'
|
||||
|
||||
# Copy files based on build type and library type
|
||||
if ($build_type -eq "debug") {
|
||||
copy-item -Path $path_pdb -Destination $path_win64 -Force
|
||||
}
|
||||
|
||||
if ($library_type -eq "static") {
|
||||
copy-item -Path $path_lib_static -Destination (join-path $path_win64 'harfbuzz.lib') -Force
|
||||
}
|
||||
else {
|
||||
copy-item -Path $path_lib -Destination $path_win64 -Force
|
||||
copy-item -Path $path_dll -Destination $path_win64 -Force
|
||||
}
|
||||
|
||||
write-host "Build completed and files copied to $path_win64"
|
||||
}
|
||||
# build-repo
|
||||
|
||||
function Build-RepoWithoutMeson {
|
||||
$devshell = join-path $PSScriptRoot 'helpers/devshell.ps1'
|
||||
& $devshell -arch amd64
|
||||
|
||||
verify-path $script:path_lib
|
||||
verify-path $path_win64
|
||||
|
||||
clone-gitrepo $path_harfbuzz $url_harfbuzz
|
||||
|
||||
$path_harfbuzz_build = join-path $path_harfbuzz 'build'
|
||||
verify-path $path_harfbuzz_build
|
||||
|
||||
$library_type = "shared"
|
||||
$build_type = "release"
|
||||
|
||||
push-location $path_harfbuzz
|
||||
|
||||
$compiler_args = @(
|
||||
"/nologo",
|
||||
"/W3",
|
||||
"/D_CRT_SECURE_NO_WARNINGS",
|
||||
"/DHAVE_FALLBACK=1",
|
||||
"/DHAVE_OT=1",
|
||||
"/DHAVE_SUBSET=1",
|
||||
"/DHB_USE_INTERNAL_PARSER",
|
||||
"/DHB_NO_COLOR",
|
||||
"/DHB_NO_DRAW",
|
||||
"/DHB_NO_PARSE",
|
||||
"/DHB_NO_MT",
|
||||
"/DHB_NO_GRAPHITE2",
|
||||
"/DHB_NO_ICU",
|
||||
"/DHB_NO_DIRECTWRITE",
|
||||
"/I$path_harfbuzz\src",
|
||||
"/I$path_harfbuzz"
|
||||
)
|
||||
|
||||
if ( $library_type -eq "shared" ) {
|
||||
$compiler_args += "/DHAVE_DECLSPEC"
|
||||
$compiler_args += "/DHARFBUZZ_EXPORTS"
|
||||
}
|
||||
|
||||
if ($build_type -eq "debug") {
|
||||
$compiler_args += "/MDd", "/Od", "/Zi"
|
||||
} else {
|
||||
$compiler_args += "/MD", "/O2"
|
||||
}
|
||||
|
||||
$compiler_args = $compiler_args -join " "
|
||||
|
||||
$config_h_content = @"
|
||||
#define HB_VERSION_MAJOR 9
|
||||
#define HB_VERSION_MINOR 0
|
||||
#define HB_VERSION_MICRO 0
|
||||
#define HB_VERSION_STRING "9.0.0"
|
||||
#define HAVE_ROUND 1
|
||||
#define HB_NO_BITMAP 1
|
||||
#define HB_NO_CFF 1
|
||||
#define HB_NO_OT_FONT_CFF 1
|
||||
#define HB_NO_SUBSET_CFF 1
|
||||
#define HB_HAVE_SUBSET 0
|
||||
#define HB_HAVE_OT 0
|
||||
#define HB_USER_DATA_KEY_DEFINE1(_name) extern HB_EXTERN hb_user_data_key_t _name
|
||||
"@
|
||||
set-content -Path (join-path $path_harfbuzz "config.h") -Value $config_h_content
|
||||
|
||||
$unity_content = @"
|
||||
#define HB_EXTERN __declspec(dllexport)
|
||||
|
||||
// base
|
||||
#include "config.h"
|
||||
#include "hb-aat-layout.cc"
|
||||
#include "hb-aat-map.cc"
|
||||
#include "hb-blob.cc"
|
||||
#include "hb-buffer-serialize.cc"
|
||||
#include "hb-buffer-verify.cc"
|
||||
#include "hb-buffer.cc"
|
||||
#include "hb-common.cc"
|
||||
|
||||
//#include "hb-draw.cc"
|
||||
//#include "hb-paint.cc"
|
||||
//#include "hb-paint-extents.cc"
|
||||
|
||||
#include "hb-face.cc"
|
||||
#include "hb-face-builder.cc"
|
||||
#include "hb-fallback-shape.cc"
|
||||
#include "hb-font.cc"
|
||||
#include "hb-map.cc"
|
||||
#include "hb-number.cc"
|
||||
#include "hb-ot-cff1-table.cc"
|
||||
#include "hb-ot-cff2-table.cc"
|
||||
#include "hb-ot-color.cc"
|
||||
#include "hb-ot-face.cc"
|
||||
#include "hb-ot-font.cc"
|
||||
|
||||
#include "hb-outline.cc"
|
||||
#include "OT/Var/VARC/VARC.cc"
|
||||
|
||||
#include "hb-ot-layout.cc"
|
||||
#include "hb-ot-map.cc"
|
||||
#include "hb-ot-math.cc"
|
||||
#include "hb-ot-meta.cc"
|
||||
#include "hb-ot-metrics.cc"
|
||||
#include "hb-ot-name.cc"
|
||||
|
||||
#include "hb-ot-shaper-arabic.cc"
|
||||
#include "hb-ot-shaper-default.cc"
|
||||
#include "hb-ot-shaper-hangul.cc"
|
||||
#include "hb-ot-shaper-hebrew.cc"
|
||||
#include "hb-ot-shaper-indic-table.cc"
|
||||
#include "hb-ot-shaper-indic.cc"
|
||||
#include "hb-ot-shaper-khmer.cc"
|
||||
#include "hb-ot-shaper-myanmar.cc"
|
||||
#include "hb-ot-shaper-syllabic.cc"
|
||||
#include "hb-ot-shaper-thai.cc"
|
||||
#include "hb-ot-shaper-use.cc"
|
||||
#include "hb-ot-shaper-vowel-constraints.cc"
|
||||
|
||||
#include "hb-ot-shape-fallback.cc"
|
||||
#include "hb-ot-shape-normalize.cc"
|
||||
#include "hb-ot-shape.cc"
|
||||
#include "hb-ot-tag.cc"
|
||||
#include "hb-ot-var.cc"
|
||||
|
||||
#include "hb-set.cc"
|
||||
#include "hb-shape-plan.cc"
|
||||
#include "hb-shape.cc"
|
||||
#include "hb-shaper.cc"
|
||||
#include "hb-static.cc"
|
||||
#include "hb-style.cc"
|
||||
#include "hb-ucd.cc"
|
||||
#include "hb-unicode.cc"
|
||||
|
||||
// libharfbuzz-subset
|
||||
//#include "hb-subset-input.cc"
|
||||
//#include "hb-subset-cff-common.cc"
|
||||
//#include "hb-subset-cff1.cc"
|
||||
//#include "hb-subset-cff2.cc"
|
||||
//#include "hb-subset-instancer-iup.cc"
|
||||
//#include "hb-subset-instancer-solver.cc"
|
||||
//#include "hb-subset-plan.cc"
|
||||
//#include "hb-subset-repacker.cc"
|
||||
|
||||
//#include "graph/gsubgpos-context.cc"
|
||||
|
||||
//#include "hb-subset.cc"
|
||||
"@
|
||||
$unity_file = join-path $path_harfbuzz_build "harfbuzz_unity.cc"
|
||||
set-content -Path $unity_file -Value $unity_content
|
||||
|
||||
# Compile unity file
|
||||
$obj_file = "harfbuzz_unity.obj"
|
||||
$command = "cl.exe $compiler_args /c $unity_file /Fo$path_harfbuzz_build\$obj_file"
|
||||
|
||||
write-host "Compiling: $command"
|
||||
invoke-expression $command
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
write-error "Compilation failed for unity build"
|
||||
pop-location
|
||||
return
|
||||
}
|
||||
|
||||
push-location $path_harfbuzz_build
|
||||
|
||||
# Create library
|
||||
if ($library_type -eq "static")
|
||||
{
|
||||
$lib_command = "lib.exe /OUT:harfbuzz.lib $obj_file"
|
||||
|
||||
write-host "Creating static library: $lib_command"
|
||||
invoke-expression $lib_command
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Static library creation failed"
|
||||
pop-location
|
||||
pop-location
|
||||
return
|
||||
}
|
||||
$output_file = "harfbuzz.lib"
|
||||
}
|
||||
else
|
||||
{
|
||||
$linker_args = "/DLL", "/OUT:harfbuzz.dll"
|
||||
|
||||
if ($build_type -eq "debug") {
|
||||
$linker_args += "/DEBUG"
|
||||
}
|
||||
|
||||
$link_command = "link.exe $($linker_args -join ' ') $obj_file"
|
||||
|
||||
write-host "Creating shared library: $link_command"
|
||||
invoke-expression $link_command
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
write-error "Shared library creation failed"
|
||||
pop-location
|
||||
pop-location
|
||||
return
|
||||
}
|
||||
$output_file = "harfbuzz.dll"
|
||||
}
|
||||
|
||||
pop-location # path_harfbuzz_build
|
||||
pop-location # path_harfbuzz
|
||||
|
||||
# Copy files
|
||||
$path_output = join-path $path_harfbuzz_build $output_file
|
||||
|
||||
if (test-path $path_output) {
|
||||
copy-item -Path $path_output -Destination $path_win64 -Force
|
||||
if ($library_type -eq "shared") {
|
||||
$path_lib = join-path $path_harfbuzz_build "harfbuzz.lib"
|
||||
if (test-path $path_lib) {
|
||||
copy-item -Path $path_lib -Destination $path_win64 -Force
|
||||
}
|
||||
}
|
||||
} else {
|
||||
write-warning "Output file not found: $path_output"
|
||||
}
|
||||
|
||||
write-host "Build completed and files copied to $path_win64"
|
||||
}
|
||||
Build-RepoWithoutMeson
|
||||
|
||||
function grab-binaries {
|
||||
verify-path $script:path_lib
|
||||
verify-path $path_win64
|
||||
|
||||
$url_harfbuzz_8_5_0_win64 = 'https://github.com/harfbuzz/harfbuzz/releases/latest/download/harfbuzz-win64-8.5.0.zip'
|
||||
$path_harfbuzz_win64_zip = join-path $path_win64 'harfbuzz-win64-8.5.0.zip'
|
||||
$path_harfbuzz_win64 = join-path $path_win64 'harfbuzz-win64'
|
||||
|
||||
grab-zip $url_harfbuzz_8_5_0_win64 $path_harfbuzz_win64_zip $path_win64
|
||||
get-childitem -path $path_harfbuzz_win64 | move-item -destination $path_win64 -force
|
||||
|
||||
# Clean up the ZIP file and the now empty harfbuzz-win64 directory
|
||||
remove-item $path_harfbuzz_win64_zip -force
|
||||
remove-item $path_harfbuzz_win64 -recurse -force
|
||||
}
|
||||
# grab-binaries
|
284
thirdparty/harfbuzz/scripts/build.sh
vendored
Normal file
284
thirdparty/harfbuzz/scripts/build.sh
vendored
Normal file
@@ -0,0 +1,284 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Source the misc.sh script
|
||||
misc_script="$(dirname "$0")/helpers/misc.sh"
|
||||
chmod +x "$misc_script"
|
||||
source "$misc_script"
|
||||
|
||||
path_root=$(git rev-parse --show-toplevel)
|
||||
path_lib="$path_root/lib"
|
||||
path_osx="$path_lib/osx"
|
||||
path_linux64="$path_lib/linux64"
|
||||
|
||||
OS=$(uname -s)
|
||||
|
||||
# Set the appropriate output directory and file extension
|
||||
case "$OS" in
|
||||
Darwin*)
|
||||
path_output="$path_osx"
|
||||
shared_lib_extension="dylib"
|
||||
;;
|
||||
Linux*)
|
||||
path_output="$path_linux64"
|
||||
shared_lib_extension="so"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported operating system: $OS"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
url_harfbuzz='https://github.com/harfbuzz/harfbuzz.git'
|
||||
path_harfbuzz="$path_root/harfbuzz"
|
||||
|
||||
build_repo() {
|
||||
verify_path "$path_lib"
|
||||
verify_path "$path_output"
|
||||
|
||||
# grab the actual repo
|
||||
clone_gitrepo "$path_harfbuzz" "$url_harfbuzz"
|
||||
|
||||
pushd "$path_harfbuzz" > /dev/null
|
||||
|
||||
library_type="shared"
|
||||
build_type="release"
|
||||
|
||||
# Check if meson is installed
|
||||
if ! command -v meson &> /dev/null; then
|
||||
echo "Meson is not installed. Please install it and try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Meson configure and build
|
||||
meson_args=(
|
||||
"build"
|
||||
"--default-library=$library_type"
|
||||
"--buildtype=$build_type"
|
||||
"--wrap-mode=forcefallback"
|
||||
"-Dglib=disabled"
|
||||
"-Dgobject=disabled"
|
||||
"-Dcairo=disabled"
|
||||
"-Dicu=disabled"
|
||||
"-Dgraphite=disabled"
|
||||
"-Dfreetype=disabled"
|
||||
"-Ddirectwrite=disabled"
|
||||
"-Dcoretext=disabled"
|
||||
)
|
||||
meson "${meson_args[@]}"
|
||||
ninja -C build
|
||||
|
||||
popd > /dev/null
|
||||
|
||||
path_build="$path_harfbuzz/build"
|
||||
path_src="$path_build/src"
|
||||
path_so="$path_src/libharfbuzz.so"
|
||||
path_a="$path_src/libharfbuzz.a"
|
||||
|
||||
# Copy files based on build type and library type
|
||||
if [ "$build_type" = "debug" ]; then
|
||||
# Debug symbols are typically embedded in the .so file on Linux
|
||||
# If there's a separate debug file, you would copy it here
|
||||
:
|
||||
fi
|
||||
|
||||
if [ "$library_type" = "static" ]; then
|
||||
cp "$path_a" "$path_linux64/libharfbuzz.a"
|
||||
else
|
||||
cp "$path_so" "$path_linux64/libharfbuzz.so"
|
||||
fi
|
||||
|
||||
echo "Build completed and files copied to $path_linux64"
|
||||
}
|
||||
|
||||
build_repo_without_meson() {
|
||||
# Detect the operating system
|
||||
OS=$(uname -s)
|
||||
|
||||
echo $url_harfbuzz
|
||||
echo $path_harfbuzz
|
||||
echo $path_lib
|
||||
echo $path_linux64
|
||||
verify_path "$path_lib"
|
||||
verify_path "$path_linux64"
|
||||
|
||||
path_harfbuzz_build="$path_harfbuzz/build"
|
||||
echo $path_harfbuzz_build
|
||||
|
||||
# grab the actual repo
|
||||
clone_gitrepo "$path_harfbuzz" "$url_harfbuzz"
|
||||
|
||||
verify_path "$path_harfbuzz_build"
|
||||
|
||||
library_type="shared"
|
||||
build_type="release"
|
||||
|
||||
pushd "$path_harfbuzz" > /dev/null
|
||||
|
||||
# Determine the latest C++ standard supported by the compiler
|
||||
latest_cpp_standard=$(clang++ -dM -E - < /dev/null | grep __cplusplus | awk '{print $3}')
|
||||
case $latest_cpp_standard in
|
||||
201703L) cpp_flag="-std=c++17" ;;
|
||||
202002L) cpp_flag="-std=c++20" ;;
|
||||
202302L) cpp_flag="-std=c++23" ;;
|
||||
*) cpp_flag="-std=c++14" ;; # Default to C++14 if unable to determine
|
||||
esac
|
||||
echo "Using C++ standard: $cpp_flag"
|
||||
|
||||
compiler_args=(
|
||||
"$cpp_flag"
|
||||
"-Wall"
|
||||
"-Wextra"
|
||||
"-D_REENTRANT"
|
||||
"-DHAVE_FALLBACK=1"
|
||||
"-DHAVE_OT=1"
|
||||
"-DHAVE_SUBSET=1"
|
||||
"-DHB_USE_INTERNAL_PARSER"
|
||||
"-DHB_NO_COLOR"
|
||||
"-DHB_NO_DRAW"
|
||||
"-DHB_NO_PARSE"
|
||||
"-DHB_NO_MT"
|
||||
"-DHB_NO_GRAPHITE2"
|
||||
"-DHB_NO_ICU"
|
||||
"-DHB_NO_DIRECTWRITE"
|
||||
"-I$path_harfbuzz/src"
|
||||
"-I$path_harfbuzz"
|
||||
)
|
||||
|
||||
if [ "$library_type" = "shared" ]; then
|
||||
compiler_args+=("-fPIC")
|
||||
compiler_args+=("-DHAVE_DECLSPEC")
|
||||
compiler_args+=("-DHARFBUZZ_EXPORTS")
|
||||
fi
|
||||
|
||||
if [ "$build_type" = "debug" ]; then
|
||||
compiler_args+=("-g" "-O0")
|
||||
else
|
||||
compiler_args+=("-O2")
|
||||
fi
|
||||
|
||||
compiler_args_str="${compiler_args[*]}"
|
||||
|
||||
# Create config.h
|
||||
cat > "$path_harfbuzz/config.h" << EOL
|
||||
#define HB_VERSION_MAJOR 9
|
||||
#define HB_VERSION_MINOR 0
|
||||
#define HB_VERSION_MICRO 0
|
||||
#define HB_VERSION_STRING "9.0.0"
|
||||
#define HAVE_ROUND 1
|
||||
#define HB_NO_BITMAP 1
|
||||
#define HB_NO_CFF 1
|
||||
#define HB_NO_OT_FONT_CFF 1
|
||||
#define HB_NO_SUBSET_CFF 1
|
||||
#define HB_HAVE_SUBSET 0
|
||||
#define HB_HAVE_OT 0
|
||||
#define HB_USER_DATA_KEY_DEFINE1(_name) extern HB_EXTERN hb_user_data_key_t _name
|
||||
EOL
|
||||
|
||||
# Create unity build file
|
||||
cat > "$path_harfbuzz_build/harfbuzz_unity.cc" << EOL
|
||||
#define HB_EXTERN __attribute__((visibility("default")))
|
||||
|
||||
// base
|
||||
#include "config.h"
|
||||
#include "hb-aat-layout.cc"
|
||||
#include "hb-aat-map.cc"
|
||||
#include "hb-blob.cc"
|
||||
#include "hb-buffer-serialize.cc"
|
||||
#include "hb-buffer-verify.cc"
|
||||
#include "hb-buffer.cc"
|
||||
#include "hb-common.cc"
|
||||
#include "hb-face.cc"
|
||||
#include "hb-face-builder.cc"
|
||||
#include "hb-fallback-shape.cc"
|
||||
#include "hb-font.cc"
|
||||
#include "hb-map.cc"
|
||||
#include "hb-number.cc"
|
||||
#include "hb-ot-cff1-table.cc"
|
||||
#include "hb-ot-cff2-table.cc"
|
||||
#include "hb-ot-color.cc"
|
||||
#include "hb-ot-face.cc"
|
||||
#include "hb-ot-font.cc"
|
||||
#include "hb-outline.cc"
|
||||
#include "OT/Var/VARC/VARC.cc"
|
||||
#include "hb-ot-layout.cc"
|
||||
#include "hb-ot-map.cc"
|
||||
#include "hb-ot-math.cc"
|
||||
#include "hb-ot-meta.cc"
|
||||
#include "hb-ot-metrics.cc"
|
||||
#include "hb-ot-name.cc"
|
||||
#include "hb-ot-shaper-arabic.cc"
|
||||
#include "hb-ot-shaper-default.cc"
|
||||
#include "hb-ot-shaper-hangul.cc"
|
||||
#include "hb-ot-shaper-hebrew.cc"
|
||||
#include "hb-ot-shaper-indic-table.cc"
|
||||
#include "hb-ot-shaper-indic.cc"
|
||||
#include "hb-ot-shaper-khmer.cc"
|
||||
#include "hb-ot-shaper-myanmar.cc"
|
||||
#include "hb-ot-shaper-syllabic.cc"
|
||||
#include "hb-ot-shaper-thai.cc"
|
||||
#include "hb-ot-shaper-use.cc"
|
||||
#include "hb-ot-shaper-vowel-constraints.cc"
|
||||
#include "hb-ot-shape-fallback.cc"
|
||||
#include "hb-ot-shape-normalize.cc"
|
||||
#include "hb-ot-shape.cc"
|
||||
#include "hb-ot-tag.cc"
|
||||
#include "hb-ot-var.cc"
|
||||
#include "hb-set.cc"
|
||||
#include "hb-shape-plan.cc"
|
||||
#include "hb-shape.cc"
|
||||
#include "hb-shaper.cc"
|
||||
#include "hb-static.cc"
|
||||
#include "hb-style.cc"
|
||||
#include "hb-ucd.cc"
|
||||
#include "hb-unicode.cc"
|
||||
EOL
|
||||
|
||||
# Compile unity file
|
||||
pushd "$path_harfbuzz_build" > /dev/null
|
||||
g++ $compiler_args_str -c harfbuzz_unity.cc -o harfbuzz_unity.o
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Compilation failed for unity build"
|
||||
popd > /dev/null
|
||||
popd > /dev/null
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Create library
|
||||
if [ "$library_type" = "static" ]; then
|
||||
ar rcs libharfbuzz.a harfbuzz_unity.o
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Static library creation failed"
|
||||
popd > /dev/null
|
||||
popd > /dev/null
|
||||
return 1
|
||||
fi
|
||||
output_file="libharfbuzz.a"
|
||||
else
|
||||
g++ -shared -o libharfbuzz.so harfbuzz_unity.o
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Shared library creation failed"
|
||||
popd > /dev/null
|
||||
popd > /dev/null
|
||||
return 1
|
||||
fi
|
||||
output_file="libharfbuzz.so"
|
||||
fi
|
||||
|
||||
popd > /dev/null # path_harfbuzz_build
|
||||
popd > /dev/null # path_harfbuzz
|
||||
|
||||
# Copy files
|
||||
cp "$path_harfbuzz_build/$output_file" "$path_linux64/"
|
||||
if [ "$library_type" = "shared" ]; then
|
||||
if [ -f "$path_harfbuzz_build/libharfbuzz.so" ]; then
|
||||
cp "$path_harfbuzz_build/libharfbuzz.so" "$path_linux64/"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Build completed and files copied to $path_linux64"
|
||||
}
|
||||
|
||||
# Uncomment the function you want to use
|
||||
# build_repo
|
||||
build_repo_without_meson
|
28
thirdparty/harfbuzz/scripts/helpers/devshell.ps1
vendored
Normal file
28
thirdparty/harfbuzz/scripts/helpers/devshell.ps1
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
if ($env:VCINSTALLDIR) {
|
||||
return
|
||||
}
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# Use vswhere to find the latest Visual Studio installation
|
||||
$vswhere_out = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
|
||||
if ($null -eq $vswhere_out) {
|
||||
Write-Host "ERROR: Visual Studio installation not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Find Launch-VsDevShell.ps1 in the Visual Studio installation
|
||||
$vs_path = $vswhere_out
|
||||
$vs_devshell = Join-Path $vs_path "\Common7\Tools\Launch-VsDevShell.ps1"
|
||||
|
||||
if ( -not (Test-Path $vs_devshell) ) {
|
||||
Write-Host "ERROR: Launch-VsDevShell.ps1 not found in Visual Studio installation"
|
||||
Write-Host Tested path: $vs_devshell
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Launch the Visual Studio Developer Shell
|
||||
Push-Location
|
||||
write-host @args
|
||||
& $vs_devshell @args
|
||||
Pop-Location
|
72
thirdparty/harfbuzz/scripts/helpers/misc.ps1
vendored
Normal file
72
thirdparty/harfbuzz/scripts/helpers/misc.ps1
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
function Clone-Gitrepo { param( [string] $path, [string] $url )
|
||||
if (test-path $path) {
|
||||
# git -C $path pull
|
||||
}
|
||||
else {
|
||||
Write-Host "Cloning $url ..."
|
||||
git clone $url $path
|
||||
}
|
||||
}
|
||||
|
||||
function Grab-Zip { param( $url, $path_file, $path_dst )
|
||||
Invoke-WebRequest -Uri $url -OutFile $path_file
|
||||
Expand-Archive -Path $path_file -DestinationPath $path_dst -Force
|
||||
}
|
||||
|
||||
function Update-GitRepo
|
||||
{
|
||||
param( [string] $path, [string] $url, [string] $build_command )
|
||||
|
||||
if ( $build_command -eq $null ) {
|
||||
write-host "Attempted to call Update-GitRepo without build_command specified"
|
||||
return
|
||||
}
|
||||
|
||||
$repo_name = $url.Split('/')[-1].Replace('.git', '')
|
||||
|
||||
$last_built_commit = join-path $path_build "last_built_commit_$repo_name.txt"
|
||||
if ( -not(test-path -Path $path))
|
||||
{
|
||||
write-host "Cloining repo from $url to $path"
|
||||
git clone $url $path
|
||||
|
||||
write-host "Building $url"
|
||||
push-location $path
|
||||
& "$build_command"
|
||||
pop-location
|
||||
|
||||
git -C $path rev-parse HEAD | out-file $last_built_commit
|
||||
$script:binaries_dirty = $true
|
||||
write-host
|
||||
return
|
||||
}
|
||||
|
||||
git -C $path fetch
|
||||
$latest_commit_hash = git -C $path rev-parse '@{u}'
|
||||
$last_built_hash = if (Test-Path $last_built_commit) { Get-Content $last_built_commit } else { "" }
|
||||
|
||||
if ( $latest_commit_hash -eq $last_built_hash ) {
|
||||
write-host
|
||||
return
|
||||
}
|
||||
|
||||
write-host "Build out of date for: $path, updating"
|
||||
write-host 'Pulling...'
|
||||
git -C $path pull
|
||||
|
||||
write-host "Building $url"
|
||||
push-location $path
|
||||
& $build_command
|
||||
pop-location
|
||||
|
||||
$latest_commit_hash | out-file $last_built_commit
|
||||
$script:binaries_dirty = $true
|
||||
write-host
|
||||
}
|
||||
|
||||
function Verify-Path { param( $path )
|
||||
if (test-path $path) {return $true}
|
||||
|
||||
new-item -ItemType Directory -Path $path
|
||||
return $false
|
||||
}
|
111
thirdparty/harfbuzz/scripts/helpers/misc.sh
vendored
Normal file
111
thirdparty/harfbuzz/scripts/helpers/misc.sh
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
#!/bin/bash
|
||||
|
||||
clone_gitrepo() {
|
||||
local path="$1"
|
||||
local url="$2"
|
||||
|
||||
if [ -d "$path" ]; then
|
||||
# git -C "$path" pull
|
||||
:
|
||||
else
|
||||
echo "Cloning $url ..."
|
||||
git clone "$url" "$path"
|
||||
fi
|
||||
}
|
||||
|
||||
get_ini_content() {
|
||||
local path_file="$1"
|
||||
declare -A ini
|
||||
|
||||
local current_section=""
|
||||
while IFS= read -r line; do
|
||||
if [[ $line =~ ^\[(.+)\]$ ]]; then
|
||||
current_section="${BASH_REMATCH[1]}"
|
||||
ini["$current_section"]=""
|
||||
elif [[ $line =~ ^([^=]+)=(.*)$ ]]; then
|
||||
local key="${BASH_REMATCH[1]}"
|
||||
local value="${BASH_REMATCH[2]}"
|
||||
if [ -n "$current_section" ]; then
|
||||
ini["$current_section,$key"]="$value"
|
||||
fi
|
||||
fi
|
||||
done < "$path_file"
|
||||
|
||||
# To use this function, you would need to pass the result by reference
|
||||
# and then access it in the calling function
|
||||
}
|
||||
|
||||
invoke_with_color_coded_output() {
|
||||
local command="$1"
|
||||
eval "$command" 2>&1 | while IFS= read -r line; do
|
||||
if [[ "$line" =~ [Ee]rror ]]; then
|
||||
echo -e "\033[0;31m\t$line\033[0m" # Red for errors
|
||||
elif [[ "$line" =~ [Ww]arning ]]; then
|
||||
echo -e "\033[0;33m\t$line\033[0m" # Yellow for warnings
|
||||
else
|
||||
echo -e "\033[0;37m\t$line\033[0m" # White for other output
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
update_git_repo() {
|
||||
local path="$1"
|
||||
local url="$2"
|
||||
local build_command="$3"
|
||||
|
||||
if [ -z "$build_command" ]; then
|
||||
echo "Attempted to call update_git_repo without build_command specified"
|
||||
return
|
||||
fi
|
||||
|
||||
local repo_name=$(basename "$url" .git)
|
||||
|
||||
local last_built_commit="$path_build/last_built_commit_$repo_name.txt"
|
||||
if [ ! -d "$path" ]; then
|
||||
echo "Cloning repo from $url to $path"
|
||||
git clone "$url" "$path"
|
||||
|
||||
echo "Building $url"
|
||||
pushd "$path" > /dev/null
|
||||
eval "$build_command"
|
||||
popd > /dev/null
|
||||
|
||||
git -C "$path" rev-parse HEAD > "$last_built_commit"
|
||||
binaries_dirty=true
|
||||
echo
|
||||
return
|
||||
fi
|
||||
|
||||
git -C "$path" fetch
|
||||
local latest_commit_hash=$(git -C "$path" rev-parse '@{u}')
|
||||
local last_built_hash=""
|
||||
[ -f "$last_built_commit" ] && last_built_hash=$(cat "$last_built_commit")
|
||||
|
||||
if [ "$latest_commit_hash" = "$last_built_hash" ]; then
|
||||
echo
|
||||
return
|
||||
fi
|
||||
|
||||
echo "Build out of date for: $path, updating"
|
||||
echo 'Pulling...'
|
||||
git -C "$path" pull
|
||||
|
||||
echo "Building $url"
|
||||
pushd "$path" > /dev/null
|
||||
eval "$build_command"
|
||||
popd > /dev/null
|
||||
|
||||
echo "$latest_commit_hash" > "$last_built_commit"
|
||||
binaries_dirty=true
|
||||
echo
|
||||
}
|
||||
|
||||
verify_path() {
|
||||
local path="$1"
|
||||
if [ -d "$path" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
mkdir -p "$path"
|
||||
return 1
|
||||
}
|
Reference in New Issue
Block a user