diff --git a/CMakeLists.txt b/CMakeLists.txt index 429f65d..e1eb544 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,7 +154,7 @@ if(NO_CONAN_BUILD) find_package(PNG REQUIRED) find_package(ZLIB REQUIRED) else() - find_package(skia) + find_package(skia-infinipaint REQUIRED) endif() if(NOT EMSCRIPTEN) @@ -307,7 +307,7 @@ if(NO_CONAN_BUILD) target_include_directories(infinipaint PRIVATE ${SKIA_INCLUDE}) target_link_libraries(infinipaint SDL3::SDL3 ICU::uc Fontconfig::Fontconfig Freetype::Freetype PNG::PNG ZLIB::ZLIB) else() - target_link_libraries(infinipaint skia::skia sdl::sdl icu::icu) + target_link_libraries(infinipaint skia-infinipaint::skia-infinipaint sdl::sdl icu-infinipaint::icu-infinipaint) endif() if(NOT EMSCRIPTEN) diff --git a/conan/conan-skia/recipes/skia/all/conanfile.py b/conan/conan-skia/recipes/skia/all/conanfile.py index 2d26502..928a0a5 100644 --- a/conan/conan-skia/recipes/skia/all/conanfile.py +++ b/conan/conan-skia/recipes/skia/all/conanfile.py @@ -16,7 +16,7 @@ import re import json class ConanSkia(ConanFile): - name = "skia" + name = "skia-infinipaint" package_type = "library" # Optional metadata @@ -431,7 +431,7 @@ class ConanSkia(ConanFile): self.requires("expat/[>=2.5.0]") if self.options.use_icu and self.options.use_system_icu and self.options.use_conan_icu: - self.requires("icu/77.1") + self.requires("icu-infinipaint/77.1") if (self.options.use_libpng_decode or self.options.use_libpng_encode) and self.options.use_system_libpng and self.options.use_conan_libpng: self.requires("libpng/[>=1.6.32]") @@ -543,7 +543,7 @@ class ConanSkia(ConanFile): if self.options.use_icu and self.options.use_system_icu and self.options.use_conan_icu: replace_in_file(self, join(self.source_folder, "third_party", "icu", "BUILD.gn"), # icu-data must come after other components, otherwise it leaves an undefined symbol in shared library. - "libs = [ \"icuuc\" ]", f"libs = {json.dumps(self._link_libs('icu', components=['icu-uc']))}", # 'icu-data' removed + "libs = [ \"icuuc\" ]", f"libs = {json.dumps(self._link_libs('icu-infinipaint', components=['icu-uc']))}", # 'icu-data' removed strict=False) if (self.options.use_libjpeg_turbo_encode or self.options.use_libjpeg_turbo_decode) and self.options.use_system_libjpeg_turbo and self.options.use_conan_libjpeg_turbo: diff --git a/conan/export_libs.bat b/conan/export_libs.bat index c89d030..0beca74 100755 --- a/conan/export_libs.bat +++ b/conan/export_libs.bat @@ -2,3 +2,4 @@ conan export %0/../libjuice/all/conanfile.py --version=1.6.1 conan export %0/../libdatachannel/all/conanfile.py --version=0.23.1 conan export %0/../conan-skia/recipes/skia/all/conanfile.py --version=143.20251028.0 conan export %0/../sdl3/3.x/conanfile.py --version=3.2.26 +conan export %0/../icu/all/conanfile.py --version=77.1 diff --git a/conan/export_libs.sh b/conan/export_libs.sh index 94df4db..38d2d43 100755 --- a/conan/export_libs.sh +++ b/conan/export_libs.sh @@ -7,5 +7,6 @@ conan export "$(dirname "$0")/libdatachannel/all/conanfile.py" --version=0.23.1 conan export "$(dirname "$0")/mpg123/all/conanfile.py" --version=1.32.10 conan export "$(dirname "$0")/conan-skia/recipes/skia/all/conanfile.py" --version=143.20251028.0 conan export "$(dirname "$0")/sdl3/3.x/conanfile.py" --version=3.2.26 +conan export "$(dirname "$0")/icu/all/conanfile.py" --version=77.1 #conan create . -o use_system_expat=False -o use_system_freetype=False -o use_system_harfbuzz=False -o use_system_icu=False -o use_system_libjpeg_turbo=False -o use_system_libpng=False -o use_system_libwebp=False -o use_system_zlib=False --build=missing --version=134.20250327.0 #cd ../../../.. diff --git a/conan/icu/all/conandata.yml b/conan/icu/all/conandata.yml new file mode 100644 index 0000000..3ae9346 --- /dev/null +++ b/conan/icu/all/conandata.yml @@ -0,0 +1,76 @@ +sources: + "77.1": + url: "https://github.com/unicode-org/icu/releases/download/release-77-1/icu4c-77_1-src.tgz" + sha256: "588e431f77327c39031ffbb8843c0e3bc122c211374485fa87dc5f3faff24061" + "76.1": + url: "https://github.com/unicode-org/icu/releases/download/release-76-1/icu4c-76_1-src.tgz" + sha256: "dfacb46bfe4747410472ce3e1144bf28a102feeaa4e3875bac9b4c6cf30f4f3e" + "75.1": + url: "https://github.com/unicode-org/icu/releases/download/release-75-1/icu4c-75_1-src.tgz" + sha256: "cb968df3e4d2e87e8b11c49a5d01c787bd13b9545280fc6642f826527618caef" + "74.2": + url: "https://github.com/unicode-org/icu/releases/download/release-74-2/icu4c-74_2-src.tgz" + sha256: "68db082212a96d6f53e35d60f47d38b962e9f9d207a74cfac78029ae8ff5e08c" + "74.1": + url: "https://github.com/unicode-org/icu/releases/download/release-74-1/icu4c-74_1-src.tgz" + sha256: "86ce8e60681972e60e4dcb2490c697463fcec60dd400a5f9bffba26d0b52b8d0" + "73.2": + url: "https://github.com/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-src.tgz" + sha256: "818a80712ed3caacd9b652305e01afc7fa167e6f2e94996da44b90c2ab604ce1" + "73.1": + url: "https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz" + sha256: "a457431de164b4aa7eca00ed134d00dfbf88a77c6986a10ae7774fc076bb8c45" +patches: + "77.1": + - patch_file: "patches/0001-76.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + - patch_file: "patches/0002-76.1-fix-emscripten.patch" + patch_description: "Add config file for wasm-emscripten platform" + patch_type: "portability" + "76.1": + - patch_file: "patches/0001-76.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + - patch_file: "patches/0002-76.1-fix-emscripten.patch" + patch_description: "Add config file for wasm-emscripten platform" + patch_type: "portability" + "75.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + - patch_file: "patches/0002-75.1-fix-emscripten.patch" + patch_description: "Add config file for wasm-emscripten platform" + patch_type: "portability" + "74.2": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + - patch_file: "patches/0002-74.2-fix-emscripten.patch" + patch_description: "Add config file for wasm-emscripten platform" + patch_type: "portability" + patch_source: "https://gerrit.libreoffice.org/c/core/+/111130/9/external/icu/icu4c-emscripten-cross.patch.1" + "74.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + - patch_file: "patches/0002-74.2-fix-emscripten.patch" + patch_description: "Add config file for wasm-emscripten platform" + patch_type: "portability" + patch_source: "https://gerrit.libreoffice.org/c/core/+/111130/9/external/icu/icu4c-emscripten-cross.patch.1" + "73.2": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + - patch_file: "patches/0002-74.2-fix-emscripten.patch" + patch_description: "Add config file for wasm-emscripten platform" + patch_type: "portability" + patch_source: "https://gerrit.libreoffice.org/c/core/+/111130/9/external/icu/icu4c-emscripten-cross.patch.1" + "73.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + - patch_file: "patches/0002-74.2-fix-emscripten.patch" + patch_description: "Add config file for wasm-emscripten platform" + patch_type: "portability" + patch_source: "https://gerrit.libreoffice.org/c/core/+/111130/9/external/icu/icu4c-emscripten-cross.patch.1" diff --git a/conan/icu/all/conanfile.py b/conan/icu/all/conanfile.py new file mode 100644 index 0000000..f55283e --- /dev/null +++ b/conan/icu/all/conanfile.py @@ -0,0 +1,362 @@ +import glob +import hashlib +import os +import shutil + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building, stdcpp_library, check_min_cppstd +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +from conan.tools.scm import Version + +required_conan_version = ">=1.57.0" + + +class ICUConan(ConanFile): + name = "icu-infinipaint" + homepage = "http://site.icu-project.org" + license = "ICU" + description = "ICU is a mature, widely used set of C/C++ and Java libraries " \ + "providing Unicode and Globalization support for software applications." + url = "https://github.com/conan-io/conan-center-index" + topics = ("icu4c", "i see you", "unicode") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "data_packaging": ["files", "archive", "library", "static"], + "with_dyload": [True, False], + "dat_package_file": [None, "ANY"], + "with_icuio": [True, False], + "with_extras": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "data_packaging": "archive", + "with_dyload": True, + "dat_package_file": None, + "with_icuio": True, + "with_extras": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _enable_icu_tools(self): + return self.settings.os not in ["iOS", "tvOS", "watchOS", "Emscripten"] + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if Version(self.version) >= "74.1": + self.license = "Unicode-3.0" + + def validate(self): + if self.options.dat_package_file: + if not os.path.exists(str(self.options.dat_package_file)): + raise ConanInvalidConfiguration("Non-existent dat_package_file specified") + if Version(self.version) >= "75.1": + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def layout(self): + basic_layout(self, src_folder="src") + + @staticmethod + def _sha256sum(file_path): + m = hashlib.sha256() + with open(file_path, "rb") as fh: + for data in iter(lambda: fh.read(8192), b""): + m.update(data) + return m.hexdigest() + + def package_id(self): + if self.info.options.dat_package_file: + self.info.options.dat_package_file = self._sha256sum(str(self.info.options.dat_package_file)) + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + if cross_building(self) and hasattr(self, "settings_build"): + self.tool_requires(str(self.ref)) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + if Version(self.version) >= "75.1" and not self.settings.compiler.cppstd and is_msvc(self): + tc.extra_cxxflags.append(f"-std:c++{self._min_cppstd}") + if not self.options.shared: + tc.extra_defines.append("U_STATIC_IMPLEMENTATION") + if is_apple_os(self): + tc.extra_defines.append("_DARWIN_C_SOURCE") + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + "--datarootdir=${prefix}/lib", # do not use share + f"--enable-release={yes_no(self.settings.build_type != 'Debug')}", + f"--enable-debug={yes_no(self.settings.build_type == 'Debug')}", + f"--enable-dyload={yes_no(self.options.with_dyload)}", + f"--enable-extras={yes_no(self.options.with_extras)}", + f"--enable-icuio={yes_no(self.options.with_icuio)}", + "--disable-layoutex", + "--disable-layout", + f"--enable-tools={yes_no(self._enable_icu_tools)}", + "--disable-tests", + "--disable-samples", + ]) + if cross_building(self): + base_path = unix_path(self, self.dependencies.build["icu"].package_folder) + tc.configure_args.append(f"--with-cross-build={base_path}") + if self.settings.os in ["iOS", "tvOS", "watchOS"]: + # ICU build scripts interpret all Apple platforms as 'darwin'. + # Since this can coincide with the `build` triple, we need to tweak + # the build triple to avoid the collision and ensure the scripts + # know we are cross-building. + host_triplet = f"{str(self.settings.arch)}-apple-darwin" + build_triplet = f"{str(self._settings_build.arch)}-apple" + tc.update_configure_args({"--host": host_triplet, + "--build": build_triplet}) + else: + arch64 = ["x86_64", "sparcv9", "ppc64", "ppc64le", "armv8", "armv8.3", "mips64"] + bits = "64" if self.settings.arch in arch64 else "32" + tc.configure_args.append(f"--with-library-bits={bits}") + tc.configure_args.append(f"--with-data-packaging={self.options.data_packaging}") + tc.generate() + + if is_msvc(self): + env = Environment() + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + if cross_building(self): + env.define("icu_cv_host_frag", "mh-msys-msvc") + env.vars(self).save_script("conanbuild_icu_msvc") + + def _patch_sources(self): + apply_conandata_patches(self) + + replace_in_file( + self, + os.path.join(self.source_folder, "source", "configure"), + "if test -z \"$PYTHON\"", + "if true", + ) + + if self._settings_build.os == "Windows": + # https://unicode-org.atlassian.net/projects/ICU/issues/ICU-20545 + makeconv_cpp = os.path.join(self.source_folder, "source", "tools", "makeconv", "makeconv.cpp") + replace_in_file(self, makeconv_cpp, + "pathBuf.appendPathPart(arg, localError);", + "pathBuf.append(\"/\", localError); pathBuf.append(arg, localError);") + + # relocatable shared libs on macOS + mh_darwin = os.path.join(self.source_folder, "source", "config", "mh-darwin") + replace_in_file(self, mh_darwin, "-install_name $(libdir)/$(notdir", "-install_name @rpath/$(notdir") + replace_in_file(self, + mh_darwin, + "-install_name $(notdir $(MIDDLE_SO_TARGET)) $(PKGDATA_TRAILING_SPACE)", + "-install_name @rpath/$(notdir $(MIDDLE_SO_TARGET))", + ) + + # workaround for https://unicode-org.atlassian.net/browse/ICU-20531 + mkdir(self, os.path.join(self.build_folder, "data", "out", "tmp")) + + # workaround for "No rule to make target 'out/tmp/dirs.timestamp'" + save(self, os.path.join(self.build_folder, "data", "out", "tmp", "dirs.timestamp"), "") + + def build(self): + self._patch_sources() + + if self.options.dat_package_file: + dat_package_file = glob.glob(os.path.join(self.source_folder, "source", "data", "in", "*.dat")) + if dat_package_file: + shutil.copy(str(self.options.dat_package_file), dat_package_file[0]) + + autotools = Autotools(self) + autotools.configure(build_script_folder=os.path.join(self.source_folder, "source")) + autotools.make() + + @property + def _data_filename(self): + vtag = Version(self.version).major + return f"icudt{vtag}l.dat" + + @property + def _data_path(self): + data_dir_name = "icu" + if self.settings.os == "Windows" and self.settings.build_type == "Debug": + data_dir_name += "d" + data_dir = os.path.join(self.package_folder, "lib", data_dir_name, str(self.version)) + return os.path.join(data_dir, self._data_filename) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + + dll_files = glob.glob(os.path.join(self.package_folder, "lib", "*.dll")) + if dll_files: + bin_dir = os.path.join(self.package_folder, "bin") + mkdir(self, bin_dir) + for dll in dll_files: + dll_name = os.path.basename(dll) + rm(self, dll_name, bin_dir) + rename(self, src=dll, dst=os.path.join(bin_dir, dll_name)) + + if self.settings.os != "Windows" and self.options.data_packaging in ["files", "archive"]: + mkdir(self, os.path.join(self.package_folder, "res")) + rename(self, src=self._data_path, dst=os.path.join(self.package_folder, "res", self._data_filename)) + + # Copy some files required for cross-compiling + config_dir = os.path.join(self.package_folder, "config") + copy(self, "icucross.mk", src=os.path.join(self.build_folder, "config"), dst=config_dir) + copy(self, "icucross.inc", src=os.path.join(self.build_folder, "config"), dst=config_dir) + + rmdir(self, os.path.join(self.package_folder, "lib", "icu")) + rmdir(self, os.path.join(self.package_folder, "lib", "man")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "ICU") + + prefix = "s" if self.settings.os == "Windows" and not self.options.shared else "" + suffix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" + + # icudata + self.cpp_info.components["icu-data"].set_property("cmake_target_name", "ICU::data") + icudata_libname = "icudt" if self.settings.os == "Windows" else "icudata" + self.cpp_info.components["icu-data"].libs = [f"{prefix}{icudata_libname}{suffix}"] + if not self.options.shared: + self.cpp_info.components["icu-data"].defines.append("U_STATIC_IMPLEMENTATION") + # icu uses c++, so add the c++ runtime + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["icu-data"].system_libs.append(libcxx) + + # Alias of data CMake component + self.cpp_info.components["icu-data-alias"].set_property("cmake_target_name", "ICU::dt") + self.cpp_info.components["icu-data-alias"].requires = ["icu-data"] + + # icuuc + self.cpp_info.components["icu-uc"].set_property("cmake_target_name", "ICU::uc") + self.cpp_info.components["icu-uc"].set_property("pkg_config_name", "icu-uc") + self.cpp_info.components["icu-uc"].libs = [f"{prefix}icuuc{suffix}"] + self.cpp_info.components["icu-uc"].requires = ["icu-data"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["icu-uc"].system_libs = ["m", "pthread"] + if self.options.with_dyload: + self.cpp_info.components["icu-uc"].system_libs.append("dl") + elif self.settings.os == "Windows": + self.cpp_info.components["icu-uc"].system_libs = ["advapi32"] + + # icui18n + self.cpp_info.components["icu-i18n"].set_property("cmake_target_name", "ICU::i18n") + self.cpp_info.components["icu-i18n"].set_property("pkg_config_name", "icu-i18n") + icui18n_libname = "icuin" if self.settings.os == "Windows" else "icui18n" + self.cpp_info.components["icu-i18n"].libs = [f"{prefix}{icui18n_libname}{suffix}"] + self.cpp_info.components["icu-i18n"].requires = ["icu-uc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["icu-i18n"].system_libs = ["m"] + + # Alias of i18n CMake component + self.cpp_info.components["icu-i18n-alias"].set_property("cmake_target_name", "ICU::in") + self.cpp_info.components["icu-i18n-alias"].requires = ["icu-i18n"] + + # icuio + if self.options.with_icuio: + self.cpp_info.components["icu-io"].set_property("cmake_target_name", "ICU::io") + self.cpp_info.components["icu-io"].set_property("pkg_config_name", "icu-io") + self.cpp_info.components["icu-io"].libs = [f"{prefix}icuio{suffix}"] + self.cpp_info.components["icu-io"].requires = ["icu-i18n", "icu-uc"] + + if self.settings.os != "Windows" and self.options.data_packaging in ["files", "archive"]: + self.cpp_info.components["icu-data"].resdirs = ["res"] + data_path = os.path.join(self.package_folder, "res", self._data_filename).replace("\\", "/") + self.runenv_info.prepend_path("ICU_DATA", data_path) + if self._enable_icu_tools or self.options.with_extras: + self.buildenv_info.prepend_path("ICU_DATA", data_path) + + if self._enable_icu_tools: + # icutu + self.cpp_info.components["icu-tu"].set_property("cmake_target_name", "ICU::tu") + self.cpp_info.components["icu-tu"].libs = [f"{prefix}icutu{suffix}"] + self.cpp_info.components["icu-tu"].requires = ["icu-i18n", "icu-uc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["icu-tu"].system_libs = ["pthread"] + + # icutest + self.cpp_info.components["icu-test"].set_property("cmake_target_name", "ICU::test") + self.cpp_info.components["icu-test"].libs = [f"{prefix}icutest{suffix}"] + self.cpp_info.components["icu-test"].requires = ["icu-tu", "icu-uc"] + + # TODO: to remove after conan v2 + self.cpp_info.names["cmake_find_package"] = "ICU" + self.cpp_info.names["cmake_find_package_multi"] = "ICU" + self.cpp_info.components["icu-data"].names["cmake_find_package"] = "data" + self.cpp_info.components["icu-data"].names["cmake_find_package_multi"] = "data" + self.cpp_info.components["icu-data-alias"].names["cmake_find_package"] = "dt" + self.cpp_info.components["icu-data-alias"].names["cmake_find_package_multi"] = "dt" + self.cpp_info.components["icu-uc"].names["cmake_find_package"] = "uc" + self.cpp_info.components["icu-uc"].names["cmake_find_package_multi"] = "uc" + self.cpp_info.components["icu-i18n"].names["cmake_find_package"] = "i18n" + self.cpp_info.components["icu-i18n"].names["cmake_find_package_multi"] = "i18n" + self.cpp_info.components["icu-i18n-alias"].names["cmake_find_package"] = "in" + self.cpp_info.components["icu-i18n-alias"].names["cmake_find_package_multi"] = "in" + if self.options.with_icuio: + self.cpp_info.components["icu-io"].names["cmake_find_package"] = "io" + self.cpp_info.components["icu-io"].names["cmake_find_package_multi"] = "io" + if self.settings.os != "Windows" and self.options.data_packaging in ["files", "archive"]: + self.env_info.ICU_DATA.append(data_path) + if self._enable_icu_tools: + self.cpp_info.components["icu-tu"].names["cmake_find_package"] = "tu" + self.cpp_info.components["icu-tu"].names["cmake_find_package_multi"] = "tu" + self.cpp_info.components["icu-test"].names["cmake_find_package"] = "test" + self.cpp_info.components["icu-test"].names["cmake_find_package_multi"] = "test" + if self._enable_icu_tools or self.options.with_extras: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/conan/icu/all/patches/0001-69.1-fix-mingw.patch b/conan/icu/all/patches/0001-69.1-fix-mingw.patch new file mode 100644 index 0000000..61d3b8f --- /dev/null +++ b/conan/icu/all/patches/0001-69.1-fix-mingw.patch @@ -0,0 +1,43 @@ +--- source/config/mh-mingw64 ++++ source/config/mh-mingw64 +@@ -94,7 +94,7 @@ + # This is also for backwards compatibility. + DATA_STUBNAME = dt + I18N_STUBNAME = in +-LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) ++#LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) + + #SH### copied from Makefile.inc + #SH## for icu-config to test with +@@ -102,13 +102,13 @@ + #SH#ICULIBS_COMMON_LIB_NAME_A="${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A}" + + #SH#ICULIBS_DATA="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_LX="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_CTESTFW="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_TOOLUTIL="-l$(ICUPREFIX)tu$(ICULIBSUFFIX)" ++#ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)"" ++#ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_LX="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_CTESTFW="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_TOOLUTIL="-l$(ICUPREFIX)tu$(ICULIBSUFFIX)" + #SH# + #SH## ICULIBS is the set of libraries your application should link + #SH## with usually. Many applications will want to add ${ICULIBS_I18N} as well. +--- source/data/Makefile.in ++++ source/data/Makefile.in +@@ -207,7 +207,7 @@ + ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) + # For MinGW, do we want the DLL to go in the bin location? + ifeq ($(MINGW_MOVEDLLSTOBINDIR),YES) +- $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(DESTDIR)$(bindir) ++ $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + else + $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + endif diff --git a/conan/icu/all/patches/0001-76.1-fix-mingw.patch b/conan/icu/all/patches/0001-76.1-fix-mingw.patch new file mode 100644 index 0000000..f7169b0 --- /dev/null +++ b/conan/icu/all/patches/0001-76.1-fix-mingw.patch @@ -0,0 +1,47 @@ +diff --git a/source/config/mh-mingw64 b/source/config/mh-mingw64 +index fb64c56..ff8922c 100644 +--- a/source/config/mh-mingw64 ++++ b/source/config/mh-mingw64 +@@ -94,7 +94,7 @@ LIBPREFIX= + # This is also for backwards compatibility. + DATA_STUBNAME = dt + I18N_STUBNAME = in +-LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) ++#LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) + + #SH### copied from Makefile.inc + #SH## for icu-config to test with +@@ -102,13 +102,13 @@ LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) + #SH#ICULIBS_COMMON_LIB_NAME_A="${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A}" + + #SH#ICULIBS_DATA="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_LX="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_CTESTFW="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_TOOLUTIL="-l$(ICUPREFIX)tu$(ICULIBSUFFIX)" ++#ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_LX="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_CTESTFW="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_TOOLUTIL="-l$(ICUPREFIX)tu$(ICULIBSUFFIX)" + #SH# + #SH## ICULIBS is the set of libraries your application should link + #SH## with usually. Many applications will want to add ${ICULIBS_I18N} as well. +diff --git a/source/data/Makefile.in b/source/data/Makefile.in +index 266ad7a..8e3be4f 100644 +--- a/source/data/Makefile.in ++++ b/source/data/Makefile.in +@@ -193,7 +193,7 @@ endif + ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) + # For MinGW, do we want the DLL to go in the bin location? + ifeq ($(MINGW_MOVEDLLSTOBINDIR),YES) +- $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(DESTDIR)$(bindir) ++ $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + else + $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + endif diff --git a/conan/icu/all/patches/0002-74.2-fix-emscripten.patch b/conan/icu/all/patches/0002-74.2-fix-emscripten.patch new file mode 100644 index 0000000..9c7748f --- /dev/null +++ b/conan/icu/all/patches/0002-74.2-fix-emscripten.patch @@ -0,0 +1,109 @@ +--- a/source/acinclude.m4 ++++ b/source/acinclude.m4 +@@ -85,6 +85,7 @@ powerpc*-apple-darwin*) icu_cv_host_frag=mh-darwin-ppc ;; + *-dec-osf*) icu_cv_host_frag=mh-alpha-osf ;; + *-*-nto*) icu_cv_host_frag=mh-qnx ;; + *-ncr-*) icu_cv_host_frag=mh-mpras ;; ++wasm*-*-emscripten*) icu_cv_host_frag=mh-emscripten ;; + *) icu_cv_host_frag=mh-unknown ;; + esac + ] +--- /dev/null ++++ b/source/config/mh-emscripten +@@ -0,0 +1,86 @@ ++## Emscripten-specific setup ++## Copyright (c) 1999-2013, International Business Machines Corporation and ++## others. All Rights Reserved. ++## Commands to generate dependency files ++GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) ++GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS) ++ ++## Flags for position independent code ++SHAREDLIBCFLAGS = -fPIC ++SHAREDLIBCXXFLAGS = -fPIC ++SHAREDLIBCPPFLAGS = -DPIC ++ ++## Additional flags when building libraries and with threads ++THREADSCPPFLAGS = -D_REENTRANT ++LIBCPPFLAGS = ++ ++## Compiler switch to embed a runtime search path ++LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN ++LD_RPATH_PRE = -Wl,-rpath, ++ ++## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH: ++ENABLE_RPATH=YES ++RPATHLDFLAGS=${LD_RPATH_PRE}'$$ORIGIN' ++ ++## These are the library specific LDFLAGS ++#LDFLAGSICUDT=-nodefaultlibs -nostdlib ++# Debian change: linking icudata as data only causes too many problems. ++LDFLAGSICUDT= ++ ++## Compiler switch to embed a library name ++# The initial tab in the next line is to prevent icu-config from reading it. ++ LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET)) ++#SH# # We can't depend on MIDDLE_SO_TARGET being set. ++#SH# LD_SONAME= ++ ++## Shared library options ++LD_SOOPTIONS= -Wl,-Bsymbolic-functions ++ ++## Shared object suffix ++SO = so ++## Non-shared intermediate object suffix ++STATIC_O = o ++ ++## Compilation rules ++# WASM needs -pthread for atomics support ++%.$(STATIC_O): $(srcdir)/%.c ++ $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -pthread -o $@ $<) ++ ++%.$(STATIC_O): $(srcdir)/%.cpp ++ $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -pthread -o $@ $<) ++ ++ ++## Dependency rules ++%.d: $(srcdir)/%.c ++ $(call ICU_MSG,(deps)) $< ++ @$(SHELL) -ec '$(GEN_DEPS.c) $< \ ++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++%.d: $(srcdir)/%.cpp ++ $(call ICU_MSG,(deps)) $< ++ @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ ++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++## Versioned libraries rules ++ ++%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) ++ $(RM) $@ && ln -s ${ $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++%.d: $(srcdir)/%.cpp ++ $(call ICU_MSG,(deps)) $< ++ @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ ++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++## Versioned libraries rules ++ ++%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) ++ $(RM) $@ && ln -s ${ $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++%.d: $(srcdir)/%.cpp ++ $(call ICU_MSG,(deps)) $< ++ @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ ++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++## Versioned libraries rules ++ ++%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) ++ $(RM) $@ && ln -s ${ +#define U_DEFINE_FALSE_AND_TRUE 1 +#include "unicode/utypes.h" +#include "unicode/uchar.h" +#include "unicode/locid.h" +#include "unicode/ustring.h" +#include "unicode/ucnv.h" +#include "unicode/unistr.h" + +#ifndef UPRV_LENGTHOF +#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) +#endif + +// helper functions -------------------------------------------------------- *** + +// default converter for the platform encoding +static UConverter *cnv=NULL; + +using namespace icu; + +static void +printUString(const char *announce, const UChar *s, int32_t length) { + static char out[200]; + UChar32 c; + int32_t i; + UErrorCode errorCode=U_ZERO_ERROR; + + /* + * Convert to the "platform encoding". See notes in printUnicodeString(). + * ucnv_fromUChars(), like most ICU APIs understands length==-1 + * to mean that the string is NUL-terminated. + */ + ucnv_fromUChars(cnv, out, sizeof(out), s, length, &errorCode); + if(U_FAILURE(errorCode) || errorCode==U_STRING_NOT_TERMINATED_WARNING) { + printf("%sproblem converting string from Unicode: %s\n", announce, u_errorName(errorCode)); + return; + } + + printf("%s%s {", announce, out); + + /* output the code points (not code units) */ + if(length>=0) { + /* s is not NUL-terminated */ + for(i=0; i0; /* U16_PREV pre-decrements */) { + U16_PREV(input, 0, i, c); + /* Iterating backwards + Codepoint at offset 5: U+0062 + Codepoint at offset 3: U+10ffff + Codepoint at offset 2: U+dc00 -- unpaired surrogate because lead surr. overwritten + Codepoint at offset 1: U+0062 -- by this BMP code point + Codepoint at offset 0: U+0061 + */ + printf("Codepoint at offset %d: U+%04x\n", i, c); + } +} + +// sample code for Unicode strings in C ------------------------------------ *** + +static void demo_C_Unicode_strings() { + printf("\n* demo_C_Unicode_strings() --------- ***\n\n"); + + static const UChar text[]={ 0x41, 0x42, 0x43, 0 }; /* "ABC" */ + static const UChar appendText[]={ 0x61, 0x62, 0x63, 0 }; /* "abc" */ + static const UChar cmpText[]={ 0x61, 0x53, 0x73, 0x43, 0 }; /* "aSsC" */ + UChar buffer[32]; + int32_t compare; + int32_t length=u_strlen(text); /* length=3 */ + + /* simple ANSI C-style functions */ + buffer[0]=0; /* empty, NUL-terminated string */ + u_strncat(buffer, text, 1); /* append just n=1 character ('A') */ + u_strcat(buffer, appendText); /* buffer=="Aabc" */ + length=u_strlen(buffer); /* length=4 */ + printUString("should be \"Aabc\": ", buffer, -1); + + /* bitwise comparing buffer with text */ + compare=u_strcmp(buffer, text); + if(compare<=0) { + printf("String comparison error, expected \"Aabc\" > \"ABC\"\n"); + } + + /* Build "AC" in the buffer... */ + u_strcpy(buffer, text); + buffer[1]=0xdf; /* sharp s, case-compares equal to "ss" */ + printUString("should be \"AC\": ", buffer, -1); + + /* Compare two strings case-insensitively using full case folding */ + compare=u_strcasecmp(buffer, cmpText, U_FOLD_CASE_DEFAULT); + if(compare!=0) { + printf("String case insensitive comparison error, expected \"AbC\" to be equal to \"ABC\"\n"); + } +} + +// sample code for case mappings with C APIs -------------------------------- *** + +static void demoCaseMapInC() { + /* + * input= + * "aB" + * "iI " + * " " + * "" + */ + static const UChar input[]={ + 0x61, 0x42, 0x3a3, + 0x69, 0x49, 0x131, 0x130, 0x20, + 0xdf, 0x20, 0xfb03, + 0x3c2, 0x3c3, 0x3a3, 0 + }; + UChar buffer[32]; + + UErrorCode errorCode; + UChar32 c; + int32_t i, j, length; + UBool isError; + + printf("\n* demoCaseMapInC() ----------------- ***\n\n"); + + /* + * First, use simple case mapping functions which provide + * 1:1 code point mappings without context/locale ID. + * + * Note that some mappings will not be "right" because some "real" + * case mappings require context, depend on the locale ID, + * and/or result in a change in the number of code points. + */ + printUString("input string: ", input, -1); + + /* uppercase */ + isError=FALSE; + for(i=j=0; j" + * "iI " + * " " + * "" + */ + static const UChar input[]={ + 0x61, 0x42, 0x3a3, + 0x69, 0x49, 0x131, 0x130, 0x20, + 0xdf, 0x20, 0xfb03, + 0x3c2, 0x3c3, 0x3a3, 0 + }; + + printf("\n* demoCaseMapInCPlusPlus() --------- ***\n\n"); + + UnicodeString s(input), t; + const Locale &en=Locale::getEnglish(); + Locale tr("tr"); + + /* + * Full case mappings as in demoCaseMapInC(), using UnicodeString functions. + * These functions modify the string object itself. + * Since we want to keep the input string around, we copy it each time + * and case-map the copy. + */ + printUnicodeString("input string: ", s); + + /* lowercase/English */ + printUnicodeString("full-lowercased/en: ", (t=s).toLower(en)); + /* lowercase/Turkish */ + printUnicodeString("full-lowercased/tr: ", (t=s).toLower(tr)); + /* uppercase/English */ + printUnicodeString("full-uppercased/en: ", (t=s).toUpper(en)); + /* uppercase/Turkish */ + printUnicodeString("full-uppercased/tr: ", (t=s).toUpper(tr)); + /* titlecase/English */ + printUnicodeString("full-titlecased/en: ", (t=s).toTitle(NULL, en)); + /* titlecase/Turkish */ + printUnicodeString("full-titlecased/tr: ", (t=s).toTitle(NULL, tr)); + /* case-folde/default */ + printUnicodeString("full-case-folded/default: ", (t=s).foldCase(U_FOLD_CASE_DEFAULT)); + /* case-folde/Turkic */ + printUnicodeString("full-case-folded/Turkic: ", (t=s).foldCase(U_FOLD_CASE_EXCLUDE_SPECIAL_I)); +} + +// sample code for UnicodeString storage models ----------------------------- *** + +static const UChar readonly[]={ + 0x61, 0x31, 0x20ac +}; +static UChar writeable[]={ + 0x62, 0x32, 0xdbc0, 0xdc01 // includes a surrogate pair for a supplementary code point +}; +static char out[100]; + +static void +demoUnicodeStringStorage() { + // These sample code lines illustrate how to use UnicodeString, and the + // comments tell what happens internally. There are no APIs to observe + // most of this programmatically, except for stepping into the code + // with a debugger. + // This is by design to hide such details from the user. + int32_t i; + + printf("\n* demoUnicodeStringStorage() ------- ***\n\n"); + + // * UnicodeString with internally stored contents + // instantiate a UnicodeString from a single code point + // the few (2) UChars will be stored in the object itself + UnicodeString one((UChar32)0x24001); + // this copies the few UChars into the "two" object + UnicodeString two=one; + printf("length of short string copy: %d\n", two.length()); + // set "one" to contain the 3 UChars from readonly + // this setTo() variant copies the characters + one.setTo(readonly, UPRV_LENGTHOF(readonly)); + + // * UnicodeString with allocated contents + // build a longer string that will not fit into the object's buffer + one+=UnicodeString(writeable, UPRV_LENGTHOF(writeable)); + one+=one; + one+=one; + printf("length of longer string: %d\n", one.length()); + // copying will use the same allocated buffer and increment the reference + // counter + two=one; + printf("length of longer string copy: %d\n", two.length()); + + // * UnicodeString using readonly-alias to a const UChar array + // construct a string that aliases a readonly buffer + UnicodeString three(FALSE, readonly, UPRV_LENGTHOF(readonly)); + printUnicodeString("readonly-alias string: ", three); + // copy-on-write: any modification to the string results in + // a copy to either the internal buffer or to a newly allocated one + three.setCharAt(1, 0x39); + printUnicodeString("readonly-aliasing string after modification: ", three); + // the aliased array is not modified + for(i=0; i UChar * -> char * with only " + "invariant characters: \"%s\"\n", + cs2); + + // initialize a UnicodeString from a string literal that contains + // escape sequences written with invariant characters + // do not forget to duplicate the backslashes for ICU to see them + // then, count each double backslash only once! + UnicodeString german=UNICODE_STRING( + "Sch\\u00f6nes Auto: \\u20ac 11240.\\fPrivates Zeichen: \\U00102345\\n", 64). + unescape(); + printUnicodeString("german UnicodeString from unescaping:\n ", german); + + /* + * C: convert and unescape a char * string with only invariant + * characters to fill a UChar * string + */ + UChar buffer[200]; + int32_t length; + length=u_unescape( + "Sch\\u00f6nes Auto: \\u20ac 11240.\\fPrivates Zeichen: \\U00102345\\n", + buffer, UPRV_LENGTHOF(buffer)); + printf("german C Unicode string from char * unescaping: (length %d)\n ", length); + printUnicodeString("", UnicodeString(buffer)); +} + +extern int +main(int argc, const char *argv[]) { + UErrorCode errorCode=U_ZERO_ERROR; + + // Note: Using a global variable for any object is not exactly thread-safe... + + // You can change this call to e.g. ucnv_open("UTF-8", &errorCode) if you pipe + // the output to a file and look at it with a Unicode-capable editor. + // This will currently affect only the printUString() function, see the code above. + // printUnicodeString() could use this, too, by changing to an extract() overload + // that takes a UConverter argument. + cnv=ucnv_open(NULL, &errorCode); + if(U_FAILURE(errorCode)) { + fprintf(stderr, "error %s opening the default converter\n", u_errorName(errorCode)); + return errorCode; + } + + ucnv_setFromUCallBack(cnv, UCNV_FROM_U_CALLBACK_ESCAPE, UCNV_ESCAPE_C, NULL, NULL, &errorCode); + if(U_FAILURE(errorCode)) { + fprintf(stderr, "error %s setting the escape callback in the default converter\n", u_errorName(errorCode)); + ucnv_close(cnv); + return errorCode; + } + + demo_utf_h_macros(); + demo_C_Unicode_strings(); + demoCaseMapInC(); + demoCaseMapInCPlusPlus(); + demoUnicodeStringStorage(); + demoUnicodeStringInit(); + + ucnv_close(cnv); + return 0; +} diff --git a/conan/icu/config.yml b/conan/icu/config.yml new file mode 100644 index 0000000..f0ac72f --- /dev/null +++ b/conan/icu/config.yml @@ -0,0 +1,15 @@ +versions: + "77.1": + folder: all + "76.1": + folder: all + "75.1": + folder: all + "74.2": + folder: all + "74.1": + folder: all + "73.2": + folder: all + "73.1": + folder: all diff --git a/conanfile.py b/conanfile.py index cc1f6e8..ca479dc 100644 --- a/conanfile.py +++ b/conanfile.py @@ -7,7 +7,7 @@ class CompressorRecipe(ConanFile): def requirements(self): if self.settings.os == "Emscripten": - self.requires("skia/143.20251028.0", options = { + self.requires("skia-infinipaint/143.20251028.0", options = { "enable_svg": True, "use_freetype": True, "use_system_freetype": True, @@ -34,7 +34,7 @@ class CompressorRecipe(ConanFile): "use_conan_libwebp": False }) elif self.settings.os == "Windows": - self.requires("skia/143.20251028.0", options = { + self.requires("skia-infinipaint/143.20251028.0", options = { "use_system_expat": False, "use_freetype": False, "use_system_harfbuzz": True, @@ -50,7 +50,7 @@ class CompressorRecipe(ConanFile): "enable_bentleyottmann": True # for some reason, setting this to False results in an error when creating the project }) else: - self.requires("skia/143.20251028.0", options = { + self.requires("skia-infinipaint/143.20251028.0", options = { "use_system_expat": False, "use_freetype": True, "use_system_freetype": True, @@ -92,7 +92,7 @@ class CompressorRecipe(ConanFile): self.requires("libcurl/8.16.0") self.requires("zstd/1.5.7") - self.requires("icu/77.1") + self.requires("icu-infinipaint/77.1") def build_requirements(self): self.tool_requires("cmake/3.27.0")