diff --git a/gvsbuild/patches/icu/COPYING b/gvsbuild/patches/icu/COPYING new file mode 100644 index 000000000..b59833ded --- /dev/null +++ b/gvsbuild/patches/icu/COPYING @@ -0,0 +1,19 @@ +Copyright (c) 2021 The Meson development team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/gvsbuild/patches/icu/meson.build b/gvsbuild/patches/icu/meson.build new file mode 100644 index 000000000..dd3e6ea71 --- /dev/null +++ b/gvsbuild/patches/icu/meson.build @@ -0,0 +1,67 @@ +project( + 'icu', + 'c', + 'cpp', + version: '76.1', + meson_version: '>=0.57.0', + default_options: 'cpp_std=c++17', +) + +U_ICU_VERSION = meson.project_version() +PACKAGE_ICU_DESCRIPTION = 'International Components for Unicode' +PACKAGE_ICU_URL = 'http://icu-project.org' + +cpp = meson.get_compiler('cpp') +cpp_native = meson.get_compiler('cpp', native: true) + +have_elf_h = cpp.has_header('elf.h') + +if host_machine.system() == 'windows' + add_project_arguments('-DU_PLATFORM_USES_ONLY_WIN32_API', language: 'cpp') + add_project_arguments('-DWIN32', '-DWIN64', '-D_MBCS', language: 'cpp') + add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', language: 'cpp') + add_project_arguments('-DWINVER=0x0601', '-D_WIN32_WINNT=0x0601' , language: 'cpp') + add_project_arguments('-DU_PLATFORM_USES_ONLY_WIN32_API', language: 'c') + add_project_arguments('-DWIN32', '-DWIN64', '-D_MBCS', language: 'c') + add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', language: 'c') + add_project_arguments('-DWINVER=0x0601', '-D_WIN32_WINNT=0x0601' , language: 'c') +endif + +# per icudefs.mk.in: +# "U_ATTRIBUTE_DEPRECATED is defined to hide warnings about deprecated API warnings." +add_project_arguments('-DU_ATTRIBUTE_DEPRECATED=', language: 'cpp') +if meson.version().version_compare('>= 0.62') + dl_dep = dependency('dl', required: false) + dl_native_dep = dependency('dl', required: false, native: true) +else + dl_dep = cpp.find_library('dl', required: false) + dl_native_dep = cpp_native.find_library('dl', required: false, native: true) +endif + +windows = import('windows') +pkg = import('pkgconfig') + +# Compiler flags the users of this library must use. +usage_args = [] + +if get_option('default_library') == 'static' + add_project_arguments('-DU_STATIC_IMPLEMENTATION', language: 'c') + add_project_arguments('-DU_STATIC_IMPLEMENTATION', language: 'cpp') + usage_args = ['-DU_STATIC_IMPLEMENTATION'] + if cpp.get_argument_syntax() == 'msvc' + library_prefix = '' + library_suffix = '' + else + library_prefix = 's' + if get_option('buildtype') == 'debug' + library_suffix = 'd' + else + library_suffix = '' + endif + endif +else + library_prefix = '' + library_suffix = '' +endif + +subdir('source') diff --git a/gvsbuild/patches/icu/pc-files-debug/icu-uc.pc b/gvsbuild/patches/icu/pc-files-debug/icu-uc.pc deleted file mode 100644 index 96a891df1..000000000 --- a/gvsbuild/patches/icu/pc-files-debug/icu-uc.pc +++ /dev/null @@ -1,12 +0,0 @@ -# On windows, the prefix is automagically build from the location of the .pc file -prefix=@prefix@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: icu-uc -Description: International Components for Unicode: Common and Data libraries -Version: @version@ - -Libs: -L${libdir} -licuucd -licudt -Cflags: -I${includedir}/unicode diff --git a/gvsbuild/patches/icu/pc-files/icu-uc.pc b/gvsbuild/patches/icu/pc-files/icu-uc.pc deleted file mode 100644 index d9c9a3a1e..000000000 --- a/gvsbuild/patches/icu/pc-files/icu-uc.pc +++ /dev/null @@ -1,12 +0,0 @@ -# On windows, the prefix is automagically build from the location of the .pc file -prefix=@prefix@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: icu-uc -Description: International Components for Unicode: Common and Data libraries -Version: @version@ - -Libs: -L${libdir} -licuuc -licudt -Cflags: -I${includedir}/unicode diff --git a/gvsbuild/patches/icu/source/common/meson.build b/gvsbuild/patches/icu/source/common/meson.build new file mode 100644 index 000000000..a96609f3d --- /dev/null +++ b/gvsbuild/patches/icu/source/common/meson.build @@ -0,0 +1,168 @@ +fs = import('fs') +sources = fs.read('sources.txt').split() + +if host_machine.system() == 'windows' + sources += windows.compile_resources('common.rc', include_directories: incdir) +endif + +icuuc_name = '@0@icuuc@1@'.format(library_prefix, library_suffix) + +common_lib = library( + icuuc_name, + sources, + include_directories: incdir, + c_args: '-DU_COMMON_IMPLEMENTATION', + cpp_args: '-DU_COMMON_IMPLEMENTATION', + link_with: stubdata_lib, + dependencies: dl_dep, + version: U_ICU_VERSION, + install: true, +) + +if meson.can_run_host_binaries() + common_native_lib = common_lib +else + common_native_lib = library( + '@0@-native'.format(icuuc_name), + sources, + include_directories: incdir, + c_args: '-DU_COMMON_IMPLEMENTATION', + cpp_args: '-DU_COMMON_IMPLEMENTATION', + link_with: stubdata_native_lib, + dependencies: dl_native_dep, + version: U_ICU_VERSION, + native: true, + ) +endif + +icuuc_dep = declare_dependency( + link_with: common_lib, + compile_args: usage_args, + include_directories: incdir, + dependencies: dl_dep, +) + +icuuc_native_dep = declare_dependency( + link_with: common_native_lib, + compile_args: usage_args, + include_directories: incdir, + dependencies: dl_native_dep, +) + +if meson.version().version_compare('>=0.54.0') + meson.override_dependency('icu-uc', icuuc_dep) +endif + +headers = files( + 'unicode/appendable.h', + 'unicode/brkiter.h', + 'unicode/bytestream.h', + 'unicode/bytestrie.h', + 'unicode/bytestriebuilder.h', + 'unicode/caniter.h', + 'unicode/casemap.h', + 'unicode/char16ptr.h', + 'unicode/chariter.h', + 'unicode/dbbi.h', + 'unicode/docmain.h', + 'unicode/dtintrv.h', + 'unicode/edits.h', + 'unicode/enumset.h', + 'unicode/errorcode.h', + 'unicode/filteredbrk.h', + 'unicode/icudataver.h', + 'unicode/icuplug.h', + 'unicode/idna.h', + 'unicode/localebuilder.h', + 'unicode/localematcher.h', + 'unicode/localpointer.h', + 'unicode/locdspnm.h', + 'unicode/locid.h', + 'unicode/messagepattern.h', + 'unicode/normalizer2.h', + 'unicode/normlzr.h', + 'unicode/parseerr.h', + 'unicode/parsepos.h', + 'unicode/platform.h', + 'unicode/ptypes.h', + 'unicode/putil.h', + 'unicode/rbbi.h', + 'unicode/rep.h', + 'unicode/resbund.h', + 'unicode/schriter.h', + 'unicode/simpleformatter.h', + 'unicode/std_string.h', + 'unicode/strenum.h', + 'unicode/stringoptions.h', + 'unicode/stringpiece.h', + 'unicode/stringtriebuilder.h', + 'unicode/symtable.h', + 'unicode/ubidi.h', + 'unicode/ubiditransform.h', + 'unicode/ubrk.h', + 'unicode/ucasemap.h', + 'unicode/ucat.h', + 'unicode/uchar.h', + 'unicode/ucharstrie.h', + 'unicode/ucharstriebuilder.h', + 'unicode/uchriter.h', + 'unicode/uclean.h', + 'unicode/ucnv.h', + 'unicode/ucnv_cb.h', + 'unicode/ucnv_err.h', + 'unicode/ucnvsel.h', + 'unicode/uconfig.h', + 'unicode/ucpmap.h', + 'unicode/ucptrie.h', + 'unicode/ucurr.h', + 'unicode/udata.h', + 'unicode/udisplaycontext.h', + 'unicode/uenum.h', + 'unicode/uidna.h', + 'unicode/uiter.h', + 'unicode/uldnames.h', + 'unicode/uloc.h', + 'unicode/umachine.h', + 'unicode/umisc.h', + 'unicode/umutablecptrie.h', + 'unicode/unifilt.h', + 'unicode/unifunct.h', + 'unicode/unimatch.h', + 'unicode/uniset.h', + 'unicode/unistr.h', + 'unicode/unorm.h', + 'unicode/unorm2.h', + 'unicode/uobject.h', + 'unicode/urename.h', + 'unicode/urep.h', + 'unicode/ures.h', + 'unicode/uscript.h', + 'unicode/uset.h', + 'unicode/usetiter.h', + 'unicode/ushape.h', + 'unicode/usprep.h', + 'unicode/ustring.h', + 'unicode/ustringtrie.h', + 'unicode/utext.h', + 'unicode/utf.h', + 'unicode/utf16.h', + 'unicode/utf32.h', + 'unicode/utf8.h', + 'unicode/utf_old.h', + 'unicode/utrace.h', + 'unicode/utypes.h', + 'unicode/uvernum.h', + 'unicode/uversion.h', +) + +install_headers( + headers, + subdir: 'unicode', +) + +pkg.generate( + common_lib, + name: 'icu-uc', + description: '@0@: Common and Data libraries'.format(PACKAGE_ICU_DESCRIPTION), + url: PACKAGE_ICU_URL, +) diff --git a/gvsbuild/patches/icu/source/data/export_module.py b/gvsbuild/patches/icu/source/data/export_module.py new file mode 100644 index 000000000..95787b55b --- /dev/null +++ b/gvsbuild/patches/icu/source/data/export_module.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: 2022 L. E. Segovia +# SPDX-License-Identifier: MIT + +from argparse import ArgumentParser, FileType +from sys import stdout + +if __name__ == "__main__": + parser = ArgumentParser() + parser.add_argument("symbol", type=str, help="Symbol to export") + parser.add_argument( + "outfile", + nargs="?", + type=FileType("w", encoding="utf-8"), + default=stdout, + help="Module definition file", + ) + args = parser.parse_args() + + with args.outfile as f: + f.write("EXPORTS\n") + f.write(f"\t{args.symbol}\n") diff --git a/gvsbuild/patches/icu/source/data/meson.build b/gvsbuild/patches/icu/source/data/meson.build new file mode 100644 index 000000000..7c7404509 --- /dev/null +++ b/gvsbuild/patches/icu/source/data/meson.build @@ -0,0 +1,88 @@ +U_ICUDATA_NAME = 'icudt@0@'.format(U_ICU_VERSION.split('.')[0]) + +icudata_command = [ + genccode_native_exe, + '-d', + '@OUTDIR@', + '-e', + U_ICUDATA_NAME, + '-f', + U_ICUDATA_NAME, + '@CURRENT_SOURCE_DIR@/in/@0@l.dat'.format(U_ICUDATA_NAME), +] + +if host_machine.system() == 'windows' and get_option('default_library') == 'static' + icudata_command += ['--skip-dll-export'] +endif + +if cpp.get_argument_syntax() == 'msvc' + ## Uncomment if you want to use MASM (>= 0.64), but be aware + ## it is Very Slow to build. + # if add_languages('masm', required: false) + # icudata_asm_output = '@0@.masm'.format(U_ICUDATA_NAME) + # icudata_command += ['-a', 'masm'] + # else + icudata_asm_output = '@0@.c'.format(U_ICUDATA_NAME) + # endif +elif host_machine.system() == 'cygwin' + icudata_asm_output = '@0@.S'.format(U_ICUDATA_NAME) + icudata_command += ['-a', 'gcc-cygwin'] +elif host_machine.system() == 'darwin' + icudata_asm_output = '@0@.S'.format(U_ICUDATA_NAME) + icudata_command += ['-a', 'gcc-darwin'] +elif cpp.get_argument_syntax() == 'gcc' + icudata_asm_output = '@0@.S'.format(U_ICUDATA_NAME) + if host_machine.system() == 'windows' + if host_machine.cpu_family() == 'x86' + icudata_command += ['-a', 'gcc-cygwin'] + else + icudata_command += ['-a', 'gcc-mingw64'] + endif + else + icudata_command += ['-a', 'gcc'] + endif +else + icudata_asm_output = '@0@.c'.format(U_ICUDATA_NAME) +endif + +icudata_asm = custom_target( + 'icudata_asm', + command: icudata_command, + output: icudata_asm_output, +) + +sources = [icudata_asm] + +python_exe = find_program('python3') + +icudata_exports = custom_target( + 'icudata_exports', + command: [python_exe, '@INPUT@', '@0@_dat'.format(U_ICUDATA_NAME), '@OUTDIR@/module.def'], + input: 'export_module.py', + output: 'module.def', +) + +if host_machine.system() == 'windows' + sources += windows.compile_resources('misc/icudata.rc', include_directories: incdir) +endif + +if cpp.get_argument_syntax() != 'msvc' + icudata = library( + icudata_name, + sources, + include_directories: incdir, + version: U_ICU_VERSION, + vs_module_defs: icudata_exports, + install: true, + ) + + icudata_dep = declare_dependency( + link_with: icudata, + include_directories: incdir, + compile_args: usage_args, + ) + + if meson.version().version_compare('>=0.54.0') + meson.override_dependency('icu-data', icudata_dep) + endif +endif diff --git a/gvsbuild/patches/icu/source/i18n/meson.build b/gvsbuild/patches/icu/source/i18n/meson.build new file mode 100644 index 000000000..e3a2f922f --- /dev/null +++ b/gvsbuild/patches/icu/source/i18n/meson.build @@ -0,0 +1,158 @@ +fs = import('fs') +sources = fs.read('sources.txt').split() + +if host_machine.system() == 'windows' + sources += windows.compile_resources('i18n.rc', include_directories: incdir) +endif + +if host_machine.system() == 'windows' + i18n_name = '@0@icuin@1@'.format(library_prefix, library_suffix) +else + i18n_name = '@0@icui18n@1@'.format(library_prefix, library_suffix) +endif + +i18n_lib = library( + i18n_name, + sources, + dependencies: icuuc_dep, + c_args: '-DU_I18N_IMPLEMENTATION', + cpp_args: '-DU_I18N_IMPLEMENTATION', + version: U_ICU_VERSION, + install: true, +) + +if meson.can_run_host_binaries() + i18n_native_lib = i18n_lib +else + i18n_native_lib = library( + '@0@-native'.format(i18n_name), + sources, + dependencies: icuuc_native_dep, + c_args: '-DU_I18N_IMPLEMENTATION', + cpp_args: '-DU_I18N_IMPLEMENTATION', + version: U_ICU_VERSION, + native: true, + ) +endif + +i18ninc = include_directories('.') + +icui18n_dep = declare_dependency( + include_directories: i18ninc, + link_with: i18n_lib, + dependencies: icuuc_dep, +) + +icui18n_native_dep = declare_dependency( + include_directories: i18ninc, + link_with: i18n_native_lib, + dependencies: icuuc_native_dep, +) + +if meson.version().version_compare('>=0.54.0') + meson.override_dependency('icu-i18n', icui18n_dep) +endif + +headers = files( + 'unicode/alphaindex.h', + 'unicode/basictz.h', + 'unicode/calendar.h', + 'unicode/choicfmt.h', + 'unicode/coleitr.h', + 'unicode/coll.h', + 'unicode/compactdecimalformat.h', + 'unicode/curramt.h', + 'unicode/currpinf.h', + 'unicode/currunit.h', + 'unicode/datefmt.h', + 'unicode/dcfmtsym.h', + 'unicode/decimfmt.h', + 'unicode/displayoptions.h', + 'unicode/dtfmtsym.h', + 'unicode/dtitvfmt.h', + 'unicode/dtitvinf.h', + 'unicode/dtptngen.h', + 'unicode/dtrule.h', + 'unicode/fieldpos.h', + 'unicode/fmtable.h', + 'unicode/format.h', + 'unicode/formattedvalue.h', + 'unicode/fpositer.h', + 'unicode/gender.h', + 'unicode/gregocal.h', + 'unicode/listformatter.h', + 'unicode/measfmt.h', + 'unicode/measunit.h', + 'unicode/measure.h', + 'unicode/msgfmt.h', + 'unicode/nounit.h', + 'unicode/numberformatter.h', + 'unicode/numberrangeformatter.h', + 'unicode/numfmt.h', + 'unicode/numsys.h', + 'unicode/plurfmt.h', + 'unicode/plurrule.h', + 'unicode/rbnf.h', + 'unicode/rbtz.h', + 'unicode/regex.h', + 'unicode/region.h', + 'unicode/reldatefmt.h', + 'unicode/scientificnumberformatter.h', + 'unicode/search.h', + 'unicode/selfmt.h', + 'unicode/simpletz.h', + 'unicode/smpdtfmt.h', + 'unicode/sortkey.h', + 'unicode/stsearch.h', + 'unicode/tblcoll.h', + 'unicode/timezone.h', + 'unicode/tmunit.h', + 'unicode/tmutamt.h', + 'unicode/tmutfmt.h', + 'unicode/translit.h', + 'unicode/tzfmt.h', + 'unicode/tznames.h', + 'unicode/tzrule.h', + 'unicode/tztrans.h', + 'unicode/ucal.h', + 'unicode/ucol.h', + 'unicode/ucoleitr.h', + 'unicode/ucsdet.h', + 'unicode/udat.h', + 'unicode/udateintervalformat.h', + 'unicode/udatpg.h', + 'unicode/udisplayoptions.h', + 'unicode/ufieldpositer.h', + 'unicode/uformattable.h', + 'unicode/uformattedvalue.h', + 'unicode/ugender.h', + 'unicode/ulistformatter.h', + 'unicode/ulocdata.h', + 'unicode/umsg.h', + 'unicode/unirepl.h', + 'unicode/unum.h', + 'unicode/unumberformatter.h', + 'unicode/unumberrangeformatter.h', + 'unicode/unumsys.h', + 'unicode/upluralrules.h', + 'unicode/uregex.h', + 'unicode/uregion.h', + 'unicode/ureldatefmt.h', + 'unicode/usearch.h', + 'unicode/uspoof.h', + 'unicode/utmscale.h', + 'unicode/utrans.h', + 'unicode/vtzone.h', +) + +install_headers( + headers, + subdir: 'unicode', +) + +pkg.generate( + i18n_lib, + name: 'icu-i18n', + description: '@0@: Internationalization library'.format(PACKAGE_ICU_DESCRIPTION), + url: PACKAGE_ICU_URL, +) diff --git a/gvsbuild/patches/icu/source/io/meson.build b/gvsbuild/patches/icu/source/io/meson.build new file mode 100644 index 000000000..1dd3435a9 --- /dev/null +++ b/gvsbuild/patches/icu/source/io/meson.build @@ -0,0 +1,32 @@ +fs = import('fs') +sources = fs.read('sources.txt').split() + +if host_machine.system() == 'windows' + sources += windows.compile_resources('io.rc', include_directories: incdir) +endif + +io_lib = library( + 'icuio', + sources, + c_args: '-DU_IO_IMPLEMENTATION', + cpp_args: '-DU_IO_IMPLEMENTATION', + dependencies: icui18n_dep, + version: U_ICU_VERSION, + install: true, +) + +icuio_dep = declare_dependency( + link_with: io_lib, + dependencies: icui18n_dep, +) + +if meson.version().version_compare('>=0.54.0') + meson.override_dependency('icu-io', icuio_dep) +endif + +pkg.generate( + io_lib, + name: 'icu-io', + description: '@0@: Stream and I/O Library'.format(PACKAGE_ICU_DESCRIPTION), + url: PACKAGE_ICU_URL, +) diff --git a/gvsbuild/patches/icu/source/layoutex/meson.build b/gvsbuild/patches/icu/source/layoutex/meson.build new file mode 100644 index 000000000..e78136eec --- /dev/null +++ b/gvsbuild/patches/icu/source/layoutex/meson.build @@ -0,0 +1,34 @@ +fs = import('fs') +sources = fs.read('sources.txt').split() + +if host_machine.system() == 'windows' + sources += windows.compile_resources('layoutex.rc', include_directories: incdir) +endif + +layoutex_name = '@0@lx@1@'.format(library_prefix, library_suffix) + +layoutex_lib = library( + layoutex_name, + sources, + c_args: '-DU_LAYOUTEX_IMPLEMENTATION', + cpp_args: '-DU_LAYOUTEX_IMPLEMENTATION', + dependencies: icuuc_dep, + version: U_ICU_VERSION, + install: true, +) + +layoutex_dep = declare_dependency( + link_with: layoutex_lib, + dependencies: icuuc_dep, +) + +if meson.version().version_compare('>=0.54.0') + meson.override_dependency('icu-lx', layoutex_lib) +endif + +pkg.generate( + layoutex_lib, + name: 'icu-lx', + description: '@0@: Paragraph Layout library @1@'.format(PACKAGE_ICU_DESCRIPTION, ''), + url: PACKAGE_ICU_URL, +) diff --git a/gvsbuild/patches/icu/source/meson.build b/gvsbuild/patches/icu/source/meson.build new file mode 100644 index 000000000..295b581e9 --- /dev/null +++ b/gvsbuild/patches/icu/source/meson.build @@ -0,0 +1,20 @@ +incdir = include_directories('common') + +if host_machine.system() == 'windows' + icudata_name = '@0@icudt@1@'.format(library_prefix, library_suffix) +else + icudata_name = '@0@icudata@1@'.format(library_prefix, library_suffix) +endif + +subdir('stubdata') +subdir('common') +subdir('i18n') +subdir('io') +#subdir('layout') +#subdir('layoutex') + +subdir('tools') + +subdir('data') + +subdir('test') diff --git a/gvsbuild/patches/icu/source/stubdata/meson.build b/gvsbuild/patches/icu/source/stubdata/meson.build new file mode 100644 index 000000000..fea07ce1a --- /dev/null +++ b/gvsbuild/patches/icu/source/stubdata/meson.build @@ -0,0 +1,29 @@ +fs = import('fs') +sources = fs.read('sources.txt').split() + +if host_machine.system() == 'windows' + sources += windows.compile_resources('../data/misc/icudata.rc', include_directories: incdir) +endif + +stubdata_lib = library( + icudata_name, + sources, + c_args: '-DSTUBDATA_BUILD', + cpp_args: '-DSTUBDATA_BUILD', + include_directories: incdir, + version: U_ICU_VERSION, +) + +if meson.can_run_host_binaries() + stubdata_native_lib = stubdata_lib +else + stubdata_native_lib = library( + '@0@-native'.format(icudata_name), + sources, + c_args: '-DSTUBDATA_BUILD', + cpp_args: '-DSTUBDATA_BUILD', + include_directories: incdir, + version: U_ICU_VERSION, + native: true, + ) +endif diff --git a/gvsbuild/patches/icu/source/test/meson.build b/gvsbuild/patches/icu/source/test/meson.build new file mode 100644 index 000000000..7fd278612 --- /dev/null +++ b/gvsbuild/patches/icu/source/test/meson.build @@ -0,0 +1,2 @@ +# I could not make this work properly. Patches welcome. +#subdir('intltest') diff --git a/gvsbuild/patches/icu/source/tools/ctestfw/meson.build b/gvsbuild/patches/icu/source/tools/ctestfw/meson.build new file mode 100644 index 000000000..a29a3f7ba --- /dev/null +++ b/gvsbuild/patches/icu/source/tools/ctestfw/meson.build @@ -0,0 +1,15 @@ +fs = import('fs') +sources = fs.read('sources.txt').split() + +ctestfw = library( + 'ctestfw', + sources, + c_args: '-DT_CTEST_IMPLEMENTATION', + cpp_args: '-DT_CTEST_IMPLEMENTATION', + dependencies: toolutil_dep, +) + +ctestfw_dep = declare_dependency( + link_with: ctestfw, + dependencies: toolutil_dep, +) diff --git a/gvsbuild/patches/icu/source/tools/genbrk/meson.build b/gvsbuild/patches/icu/source/tools/genbrk/meson.build new file mode 100644 index 000000000..e635029b3 --- /dev/null +++ b/gvsbuild/patches/icu/source/tools/genbrk/meson.build @@ -0,0 +1,11 @@ +fs = import('fs') +sources = fs.read('sources.txt').split() + +genbrk_exe = executable( + 'genbrk', + sources, + dependencies: toolutil_dep, + install: true, +) + +meson.override_find_program('genbrk', genbrk_exe) diff --git a/gvsbuild/patches/icu/source/tools/genccode/meson.build b/gvsbuild/patches/icu/source/tools/genccode/meson.build new file mode 100644 index 000000000..878eb8ecd --- /dev/null +++ b/gvsbuild/patches/icu/source/tools/genccode/meson.build @@ -0,0 +1,22 @@ +fs = import('fs') +sources = fs.read('sources.txt').split() + +genccode_exe = executable( + 'genccode', + sources, + dependencies: toolutil_dep, + install: true, +) + +if meson.can_run_host_binaries() + genccode_native_exe = genccode_exe +else + genccode_native_exe = executable( + 'genccode-native', + 'genccode.c', + dependencies: toolutil_native_dep, + native: true, + ) +endif + +meson.override_find_program('genccode', genccode_exe) diff --git a/gvsbuild/patches/icu/source/tools/gencmn/meson.build b/gvsbuild/patches/icu/source/tools/gencmn/meson.build new file mode 100644 index 000000000..68eec6090 --- /dev/null +++ b/gvsbuild/patches/icu/source/tools/gencmn/meson.build @@ -0,0 +1,11 @@ +fs = import('fs') +sources = fs.read('sources.txt').split() + +gencmn_exe = executable( + 'gencmn', + sources, + dependencies: toolutil_dep, + install: true, +) + +meson.override_find_program('gencmn', gencmn_exe) diff --git a/gvsbuild/patches/icu/source/tools/icuinfo/meson.build b/gvsbuild/patches/icu/source/tools/icuinfo/meson.build new file mode 100644 index 000000000..d18909a2c --- /dev/null +++ b/gvsbuild/patches/icu/source/tools/icuinfo/meson.build @@ -0,0 +1,17 @@ +# This is not really needed to run icuinfo and +# there are some complications. If you wish to +# debug it, uncomment and have fun. + +#shared_library('plugin', 'testplug.c', +#dependencies: toolutil_dep, +#) + +fs = import('fs') +sources = fs.read('sources.txt').split() + +executable( + 'icuinfo', + sources, + dependencies: toolutil_dep, + install: true, +) diff --git a/gvsbuild/patches/icu/source/tools/icupkg/meson.build b/gvsbuild/patches/icu/source/tools/icupkg/meson.build new file mode 100644 index 000000000..29031bc14 --- /dev/null +++ b/gvsbuild/patches/icu/source/tools/icupkg/meson.build @@ -0,0 +1,9 @@ +fs = import('fs') +sources = fs.read('sources.txt').split() + +icupkg = executable( + 'icupkg', + sources, + dependencies: toolutil_dep, + install: true, +) diff --git a/gvsbuild/patches/icu/source/tools/meson.build b/gvsbuild/patches/icu/source/tools/meson.build new file mode 100644 index 000000000..3b76bcb31 --- /dev/null +++ b/gvsbuild/patches/icu/source/tools/meson.build @@ -0,0 +1,8 @@ +subdir('toolutil') +subdir('icupkg') +subdir('pkgdata') +subdir('icuinfo') +subdir('ctestfw') +subdir('genbrk') +subdir('genccode') +subdir('gencmn') diff --git a/gvsbuild/patches/icu/source/tools/pkgdata/meson.build b/gvsbuild/patches/icu/source/tools/pkgdata/meson.build new file mode 100644 index 000000000..592a34514 --- /dev/null +++ b/gvsbuild/patches/icu/source/tools/pkgdata/meson.build @@ -0,0 +1,9 @@ +fs = import('fs') +sources = fs.read('sources.txt').split() + +pkgdata = executable( + 'pkgdata', + sources, + dependencies: toolutil_dep, + install: true, +) diff --git a/gvsbuild/patches/icu/source/tools/toolutil/meson.build b/gvsbuild/patches/icu/source/tools/toolutil/meson.build new file mode 100644 index 000000000..8afc576f3 --- /dev/null +++ b/gvsbuild/patches/icu/source/tools/toolutil/meson.build @@ -0,0 +1,45 @@ +fs = import('fs') +sources = fs.read('sources.txt').split() + +toolutil_c_args = ['-DU_TOOLUTIL_IMPLEMENTATION'] +toolutil_cpp_args = ['-DU_TOOLUTIL_IMPLEMENTATION'] + +if have_elf_h + toolutil_c_args += ['-DU_HAVE_ELF_H'] + toolutil_cpp_args += ['-DU_HAVE_ELF_H'] +endif + +toolutil_lib = library( + 'toolutil', + sources, + c_args: toolutil_c_args, + cpp_args: toolutil_cpp_args, + dependencies: icui18n_dep, +) + +if meson.can_run_host_binaries() + toolutil_native_lib = toolutil_lib +else + toolutil_native_lib = library( + 'toolutil-native', + sources, + c_args: toolutil_c_args, + cpp_args: toolutil_cpp_args, + dependencies: icui18n_native_dep, + native: true, + ) +endif + +toolinc = include_directories('.') + +toolutil_dep = declare_dependency( + link_with: toolutil_lib, + dependencies: icui18n_dep, + include_directories: toolinc, +) + +toolutil_native_dep = declare_dependency( + link_with: toolutil_native_lib, + dependencies: icui18n_native_dep, + include_directories: toolinc, +) diff --git a/gvsbuild/projects/icu.py b/gvsbuild/projects/icu.py index 87356251c..ee6096bc8 100644 --- a/gvsbuild/projects/icu.py +++ b/gvsbuild/projects/icu.py @@ -13,49 +13,29 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, see . -import os +from gvsbuild.utils.base_builders import Meson from gvsbuild.utils.base_expanders import Tarball -from gvsbuild.utils.base_project import Project, project_add +from gvsbuild.utils.base_project import project_add @project_add -class Icu(Tarball, Project): +class Icu(Tarball, Meson): def __init__(self): - Project.__init__( + Meson.__init__( self, "icu", repository="https://github.com/unicode-org/icu", - lastversion_major="74", - version="74.2", + version="76.1", archive_url="https://github.com/unicode-org/icu/releases/download/release-{major}-{minor}/icu4c-{major}_{minor}-src.zip", - hash="b22e94977a82aac7ebe269ee00bc2d3164bd4495cafcb9e0b2109ab7fac2a37d", + hash="14a1942185dda2c5a07bd74f20a220954a7d94149fb5ef3cc782b52d9817fb3f", + dependencies=[ + "ninja", + "meson", + "pkgconf", + ], ) def build(self): - bindir = r".\bin" - libdir = r".\lib" - if not self.builder.x86: - bindir += "64" - libdir += "64" - if self.opts.vs_ver != "15": - # Not Vs2017, we change the platform - search, replace = self._msbuild_make_search_replace(141) - self._msbuild_copy_dir( - None, - os.path.join(self.build_dir, "source", "allinone"), - search, - replace, - ) - - self.exec_msbuild(r"source\allinone\allinone.sln /t:cal /t:MakeData") - - if self.builder.opts.configuration == "debug": - self.install_pc_files("pc-files-debug") - else: - self.install_pc_files() - + Meson.build(self) self.install(r".\LICENSE share\doc\icu") - self.install(bindir + r"\* bin") - self.install(libdir + r"\* lib") - self.install(r".\include\* include")