From e208d6957508dd387df15d48b454421d102cf059 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Wed, 15 Mar 2023 17:52:06 +0100 Subject: [PATCH 01/15] harfbuzz: list typelibs This ensure it depends on gobject-introspection and it's built with introspection Part-of: --- recipes/harfbuzz.recipe | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/harfbuzz.recipe b/recipes/harfbuzz.recipe index a8ae3d7de..5ba9b96c3 100644 --- a/recipes/harfbuzz.recipe +++ b/recipes/harfbuzz.recipe @@ -24,6 +24,7 @@ class Recipe(recipe.Recipe): files_bins = ['hb-ot-shape-closure', 'hb-view', 'hb-shape'] files_libs = ['libharfbuzz', 'libharfbuzz-icu'] files_devel = ['include/harfbuzz/*.h', '%(libdir)s/pkgconfig/harfbuzz.pc'] + files_typelibs = ['HarfBuzz-0.0'] def prepare(self): # Disable werror from pragmas. Currently fails building on macOS 12.3 From 7773c4cdf2359d6d6c2b6612a3c63520d920f595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Brzezi=C5=84ski?= Date: Wed, 23 Oct 2024 16:10:11 +0200 Subject: [PATCH 02/15] harfbuzz: Add CXXFLAGS to fix broken build on iOS Part-of: --- recipes/harfbuzz.recipe | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/harfbuzz.recipe b/recipes/harfbuzz.recipe index 5ba9b96c3..1268ebfe7 100644 --- a/recipes/harfbuzz.recipe +++ b/recipes/harfbuzz.recipe @@ -30,6 +30,7 @@ class Recipe(recipe.Recipe): # Disable werror from pragmas. Currently fails building on macOS 12.3 # and should actually be controlled by the build system. self.append_env('CFLAGS', '-DHB_NO_PRAGMA_GCC_DIAGNOSTIC_ERROR') + self.append_env('CXXFLAGS', '-DHB_NO_PRAGMA_GCC_DIAGNOSTIC_ERROR') if self.config.target_platform == Platform.DARWIN: self.meson_options['coretext'] = 'enabled' From 71c462f78c4cb8798ee35dc9f40040ad20cd7399 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 26 Oct 2024 21:39:54 +0530 Subject: [PATCH 03/15] harfbuzz.recipe: Fix missing files warnings introspection files were expected, but introspection wasn't enabled. introspection also needs gobject support, and the subset library is not used by gstreamer. Part-of: --- recipes/harfbuzz.recipe | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/recipes/harfbuzz.recipe b/recipes/harfbuzz.recipe index 1268ebfe7..bcf741215 100644 --- a/recipes/harfbuzz.recipe +++ b/recipes/harfbuzz.recipe @@ -14,16 +14,18 @@ class Recipe(recipe.Recipe): meson_options = {'icu': 'enabled', 'glib': 'enabled', 'cairo': 'enabled', # Is this needed? Is it only used for cmd line utils? - 'gobject': 'disabled', + 'gobject': 'enabled', 'icu_builtin': 'false', - 'introspection': 'disabled', 'tests': 'disabled'} - patches = [] - files_bins = ['hb-ot-shape-closure', 'hb-view', 'hb-shape'] - files_libs = ['libharfbuzz', 'libharfbuzz-icu'] - files_devel = ['include/harfbuzz/*.h', '%(libdir)s/pkgconfig/harfbuzz.pc'] + files_libs = ['libharfbuzz', 'libharfbuzz-icu', 'libharfbuzz-gobject'] + files_devel = [ + 'include/harfbuzz/*.h', + '%(libdir)s/pkgconfig/harfbuzz.pc', + '%(libdir)s/pkgconfig/harfbuzz-icu.pc', + '%(libdir)s/pkgconfig/harfbuzz-gobject.pc', + ] files_typelibs = ['HarfBuzz-0.0'] def prepare(self): @@ -40,7 +42,7 @@ class Recipe(recipe.Recipe): LibtoolLibrary('harfbuzz', None, None, None, self.config.libdir, self.config.target_platform, deps=['glib-2.0', 'freetype', 'fontconfig']).save() - LibtoolLibrary('harfbuzz-subset', None, None, None, + LibtoolLibrary('harfbuzz-gobject', None, None, None, self.config.libdir, self.config.target_platform, - deps=['harfbuzz']).save() + deps=['gobject-2.0', 'harfbuzz']).save() super().post_install() From 83e2d46ed0cd08a34205b9277193cd634951575d Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Fri, 14 Mar 2025 00:02:07 +0000 Subject: [PATCH 04/15] harfbuzz: update to 10.4.0 The macOS/iOS build error is now addressed upstream, see https://github.com/harfbuzz/harfbuzz/commit/60c6b7786d9f4651ae2803bfc4ff4435b38a5bc6 Fixes #516 Part-of: --- recipes/harfbuzz.recipe | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/recipes/harfbuzz.recipe b/recipes/harfbuzz.recipe index bcf741215..131bb1ed4 100644 --- a/recipes/harfbuzz.recipe +++ b/recipes/harfbuzz.recipe @@ -4,16 +4,16 @@ from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): name = 'harfbuzz' - version = '8.3.0' + version = '10.4.0' stype = SourceType.TARBALL btype = BuildType.MESON url = 'https://github.com/%(name)s/%(name)s/releases/download/%(version)s/%(name)s-%(version)s.tar.xz' - tarball_checksum = '109501eaeb8bde3eadb25fab4164e993fbace29c3d775bcaa1c1e58e2f15f847' + tarball_checksum = '480b6d25014169300669aa1fc39fb356c142d5028324ea52b3a27648b9beaad8' licenses = [{License.BSD_like: ['COPYING']}] deps = ['fontconfig', 'cairo', 'glib', 'icu'] meson_options = {'icu': 'enabled', 'glib': 'enabled', - 'cairo': 'enabled', # Is this needed? Is it only used for cmd line utils? + 'cairo': 'enabled', # needed for hb-view 'gobject': 'enabled', 'icu_builtin': 'false', 'tests': 'disabled'} @@ -29,11 +29,6 @@ class Recipe(recipe.Recipe): files_typelibs = ['HarfBuzz-0.0'] def prepare(self): - # Disable werror from pragmas. Currently fails building on macOS 12.3 - # and should actually be controlled by the build system. - self.append_env('CFLAGS', '-DHB_NO_PRAGMA_GCC_DIAGNOSTIC_ERROR') - self.append_env('CXXFLAGS', '-DHB_NO_PRAGMA_GCC_DIAGNOSTIC_ERROR') - if self.config.target_platform == Platform.DARWIN: self.meson_options['coretext'] = 'enabled' From fcdf64bd9c0a7e4475f8448a3b880fa4b78d082f Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Wed, 21 Feb 2024 11:37:04 -0300 Subject: [PATCH 05/15] libxml2: Update to 2.11.6 and port to Meson Part-of: --- recipes/libxml2.recipe | 37 +- recipes/libxml2/0001-Add-Meson-build.patch | 537 ++++++++++++++++++ ...001-Enable-windows-cross-compilation.patch | 85 --- .../0002-makefiles-disable-tests.patch | 32 -- ...0003-configure-fix-python-dir-prefix.patch | 24 - 5 files changed, 555 insertions(+), 160 deletions(-) create mode 100644 recipes/libxml2/0001-Add-Meson-build.patch delete mode 100644 recipes/libxml2/0001-Enable-windows-cross-compilation.patch delete mode 100644 recipes/libxml2/0002-makefiles-disable-tests.patch delete mode 100644 recipes/libxml2/0003-configure-fix-python-dir-prefix.patch diff --git a/recipes/libxml2.recipe b/recipes/libxml2.recipe index b3a39920c..5dfd3cc2b 100644 --- a/recipes/libxml2.recipe +++ b/recipes/libxml2.recipe @@ -1,28 +1,27 @@ # -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python - +from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): name = 'libxml2' - version = '2.9.9' + version = '2.11.6' stype = SourceType.TARBALL - # Upstream still has a broken SSL certificate, use our mirror - #url = 'https://xmlsoft.org/sources/libxml2-%(version)s.tar.gz' - url = 'https://gstreamer.freedesktop.org/src/mirror/libxml2-%(version)s.tar.gz' - tarball_checksum = '94fb70890143e3c6549f265cee93ec064c80a84c42ad0f23e85ee1fd6540a871' - licenses = [{License.MIT: ['COPYING']}] - configure_options = '--with-python=no' + btype = BuildType.MESON + url = 'gnome://' + tarball_checksum = 'c90eee7506764abbe07bb616b82da452529609815aefef423d66ef080eb0c300' + licenses = [{License.MIT: ['Copyright']}] deps = [ 'zlib' ] - files_libs = ['libxml2'] - files_devel = ['include/libxml2', '%(libdir)s/xml2Conf.sh', 'bin/xml2-config', - '%(libdir)s/pkgconfig/libxml-2.0.pc', 'bin/xmllint%(bext)s'] + patches = [ + f'{name}/0001-Add-Meson-build.patch', + ] - def prepare(self): - if self.config.target_platform == Platform.WINDOWS: - self.configure_options += ' --without-threads' - elif self.config.target_platform == Platform.ANDROID: - v = DistroVersion.get_android_api_version(self.config.target_distro_version) - if v < 21: - self.append_env('CFLAGS', '-D_FILE_OFFSET_BITS=32') - self.append_env('CPPFLAGS', '-D_FILE_OFFSET_BITS=32') + files_libs = ['libxml2'] + files_devel = ['include/libxml2', '%(libdir)s/pkgconfig/libxml-2.0.pc', 'bin/xmllint%(bext)s'] + + def post_install(self): + LibtoolLibrary(self.name, 2, 11, 6, + self.config.libdir, self.config.target_platform, + deps=['z'], + static_only=self.library_type == LibraryType.STATIC).save() + super().post_install() diff --git a/recipes/libxml2/0001-Add-Meson-build.patch b/recipes/libxml2/0001-Add-Meson-build.patch new file mode 100644 index 000000000..dcde568c8 --- /dev/null +++ b/recipes/libxml2/0001-Add-Meson-build.patch @@ -0,0 +1,537 @@ +From 089ef2cf86b2f7b5266a07b6b538799c82e89abe Mon Sep 17 00:00:00 2001 +From: "L. E. Segovia" +Date: Wed, 21 Feb 2024 11:02:25 -0300 +Subject: [PATCH 1/1] Add Meson build + +Source: https://wrapdb.mesonbuild.com/v2/libxml2_2.11.6-3/libxml2.wrap +--- + LICENSE.build | 19 ++ + include/libxml/meson.build | 55 +++++ + meson.build | 397 +++++++++++++++++++++++++++++++++++++ + meson_options.txt | 1 + + win32/meson.build | 13 ++ + 5 files changed, 485 insertions(+) + create mode 100644 LICENSE.build + create mode 100644 include/libxml/meson.build + create mode 100644 meson.build + create mode 100644 meson_options.txt + create mode 100644 win32/meson.build + +diff --git a/LICENSE.build b/LICENSE.build +new file mode 100644 +index 0000000..b59833d +--- /dev/null ++++ b/LICENSE.build +@@ -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/include/libxml/meson.build b/include/libxml/meson.build +new file mode 100644 +index 0000000..22e5637 +--- /dev/null ++++ b/include/libxml/meson.build +@@ -0,0 +1,55 @@ ++configure_file( ++ input: 'xmlversion.h.in', ++ output: 'xmlversion.h', ++ configuration: withcdata, ++ install_dir: get_option('includedir') / 'libxml2' / 'libxml', ++) ++ ++libxml_headers = files( ++ 'HTMLparser.h', ++ 'HTMLtree.h', ++ 'SAX.h', ++ 'SAX2.h', ++ 'c14n.h', ++ 'catalog.h', ++ 'chvalid.h', ++ 'debugXML.h', ++ 'dict.h', ++ 'encoding.h', ++ 'entities.h', ++ 'globals.h', ++ 'hash.h', ++ 'list.h', ++ 'nanoftp.h', ++ 'nanohttp.h', ++ 'parser.h', ++ 'parserInternals.h', ++ 'pattern.h', ++ 'relaxng.h', ++ 'schemasInternals.h', ++ 'schematron.h', ++ 'threads.h', ++ 'tree.h', ++ 'uri.h', ++ 'valid.h', ++ 'xinclude.h', ++ 'xlink.h', ++ 'xmlIO.h', ++ 'xmlautomata.h', ++ 'xmlerror.h', ++ 'xmlexports.h', ++ 'xmlmemory.h', ++ 'xmlmodule.h', ++ 'xmlreader.h', ++ 'xmlregexp.h', ++ 'xmlsave.h', ++ 'xmlschemas.h', ++ 'xmlschemastypes.h', ++ 'xmlstring.h', ++ 'xmlunicode.h', ++ 'xmlwriter.h', ++ 'xpath.h', ++ 'xpathInternals.h', ++ 'xpointer.h', ++) ++install_headers(libxml_headers, subdir: 'libxml2/libxml') +diff --git a/meson.build b/meson.build +new file mode 100644 +index 0000000..99b7cfe +--- /dev/null ++++ b/meson.build +@@ -0,0 +1,397 @@ ++project( ++ 'libxml2', ++ 'c', ++ version: '2.11.6', ++ meson_version: '>=0.54.1', ++ license: 'MIT', ++) ++ ++add_project_arguments('-D_GNU_SOURCE', language: 'c') ++ ++cc = meson.get_compiler('c') ++if host_machine.system() == 'windows' ++ if cc.get_argument_syntax() == 'gcc' ++ #hack to get rand_r working on windows ++ add_project_arguments('-D_POSIX_THREAD_SAFE_FUNCTIONS', language: 'c') ++ else ++ add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', cc.get_supported_arguments('-Wno-deprecated-declarations'), language: 'c') ++ endif ++endif ++ ++cdata = configuration_data() ++ ++cdata.set('PACKAGE', meson.project_name()) ++cdata.set('PACKAGE_NAME', meson.project_name()) ++cdata.set('PACKAGE_TARNAME', meson.project_name()) ++cdata.set('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), meson.project_version())) ++cdata.set('PACKAGE_URL', 'https://gitlab.gnome.org/GNOME/libxml2') ++cdata.set('PACKAGE_BUGREPORT', 'xml@gnome.org') ++cdata.set('PACKAGE_VERSION', meson.project_version()) ++cdata.set('VERSION', meson.project_version()) ++ ++if cc.has_function_attribute('destructor') ++ cdata.set('ATTRIBUTE_DESTRUCTOR', '__attribute__((destructor))') ++endif ++ ++if cc.has_header_symbol('sys/socket.h', 'AF_INET6') or cc.has_header_symbol('winsock2.h', 'AF_INET6') ++ cdata.set('SUPPORT_IP6', 1) ++endif ++ ++if cc.compiles('#include void a(va_list*) {}int main(){va_list ap1,ap2;a(&ap1);ap2=(va_list)ap1;return 0;}') ++ cdata.set('VA_LIST_IS_ARRAY', 1) ++endif ++ ++if cc.compiles('#include int main(){send(1,(const char*)"",1,1);}') or cc.compiles('#include int main(){send(1,(const char*)"",1,1);}') ++ cdata.set('SEND_ARG2_CAST', '/**/') ++else ++ cdata.set('SEND_ARG2_CAST', '(char *)') ++endif ++ ++if cc.compiles('#include int main(){gethostbyname((const char*)"");}') or cc.compiles('#include int main(){gethostbyname((const char*)"");}') ++ cdata.set('GETHOSTBYNAME_ARG_CAST', '/**/') ++else ++ cdata.set('GETHOSTBYNAME_ARG_CAST', '(char *)') ++endif ++ ++if cc.has_header_symbol('stdlib.h', 'rand_r', args: '-D_POSIX_THREAD_SAFE_FUNCTIONS') ++ cdata.set('HAVE_RAND_R', 1) ++endif ++ ++if cc.has_header_symbol('stdarg.h', 'va_copy') ++ cdata.set('HAVE_VA_COPY', 1) ++endif ++ ++if cc.has_header_symbol('stdarg.h', '__va_copy') ++ cdata.set('HAVE___VA_COPY', 1) ++endif ++ ++deps = [] ++ ++if meson.version().version_compare('>= 0.62') ++ dl_lib = dependency('dl', disabler: true, required: false) ++else ++ dl_lib = cc.find_library('dl', disabler: true, required: false) ++endif ++if dl_lib.found() ++ cdata.set('HAVE_DLOPEN', 1) ++ cdata.set('HAVE_DLFCN_H', 1) ++ deps += dl_lib ++endif ++ ++math_lib = cc.find_library('m', required: false) ++if math_lib.found() ++ deps += math_lib ++endif ++ ++if meson.version().version_compare('>= 0.60') ++ iconv_lib = dependency('iconv', required: get_option('iconv')) ++else ++ if get_option('iconv').disabled() ++ iconv_lib = dependency('', required: false) ++ else ++ iconv_check = ''' ++ #include ++ int main() { ++ iconv_open("", ""); ++ } ++ ''' ++ if cc.links(iconv_check, name: 'iconv_open') ++ iconv_lib = declare_dependency() ++ else ++ iconv_lib = cc.find_library('iconv', required: false) ++ if not cc.links(iconv_check, name: 'iconv_open in libiconv', dependencies: iconv_lib) ++ iconv_lib = dependency('', required: false) ++ if get_option('iconv').enabled() ++ error('iconv enabled and not found') ++ endif ++ endif ++ endif ++ endif ++endif ++if iconv_lib.found() ++ deps += iconv_lib ++endif ++ ++if host_machine.system() == 'windows' ++ pthread_dep = disabler() ++ with_threads = true ++else ++ pthread_dep = dependency('threads', disabler: true, required: false) ++ with_threads = pthread_dep.found() ++ if with_threads ++ deps += pthread_dep ++ endif ++endif ++ ++lzma_dep = dependency('liblzma', required: false) ++if lzma_dep.found() ++ cdata.set('HAVE_LIBLZMA', 1) ++ deps += lzma_dep ++endif ++ ++zlib_dep = dependency('zlib', disabler: true, required: false) ++if zlib_dep.found() ++ cdata.set('HAVE_LIBZ', 1) ++ cdata.set('HAVE_ZLIB_H', 1) ++ deps += zlib_dep ++endif ++ ++readline_lib = cc.find_library('readline', required: false) ++if cc.has_header('readline/readline.h', dependencies: readline_lib) ++ cdata.set('HAVE_LIBREADLINE', 1) ++ deps += readline_lib ++endif ++ ++history_lib = cc.find_library('history', required: false) ++if cc.has_header('readline/history.h', dependencies: history_lib) ++ cdata.set('HAVE_LIBHISTORY', 1) ++ deps += history_lib ++endif ++ ++ws2_dep = cc.find_library('ws2_32', required: host_machine.system() == 'windows') ++if ws2_dep.found() ++ deps += ws2_dep ++endif ++ ++foreach t : ['socklen_t', 'size_t', 'int'] ++ if cc.compiles('#include int main(){getsockopt(1,1,1,0,(@0@*)0);}'.format(t)) ++ cdata.set('XML_SOCKLEN_T', t) ++ break ++ endif ++ if cc.compiles('#include int main(){getsockopt(1,1,1,0,(@0@*)0);}'.format(t), dependencies: ws2_dep) ++ cdata.set('XML_SOCKLEN_T', t) ++ break ++ endif ++endforeach ++ ++checked_headers = { ++ 'arpa/inet.h': [], ++ 'arpa/nameser.h': [], ++ 'dl.h': [], ++ 'fcntl.h': [], ++ 'float.h': [], ++ 'inttypes.h': [], ++ 'netdb.h': [], ++ 'netinet/in.h': [], ++ 'poll.h': [], ++ 'pthread.h': pthread_dep, ++ 'resolv.h': [], ++ 'stdint.h': [], ++ 'sys/mman.h': [], ++ 'sys/select.h': [], ++ 'sys/socket.h': [], ++ 'sys/stat.h': [], ++ 'sys/time.h': [], ++ 'sys/timeb.h': [], ++ 'sys/types.h': [], ++ 'unistd.h': [], ++} ++ ++foreach h, d : checked_headers ++ if cc.has_header(h, dependencies: d) ++ cdata.set('HAVE_@0@'.format(h.underscorify().to_upper()), 1) ++ endif ++endforeach ++ ++checked_funcs = { ++ 'ftime': [], ++ 'getaddrinfo': ws2_dep, ++ 'gettimeofday': [], ++ 'isascii': [], ++ 'mmap': [], ++ 'munmap': [], ++ 'putenv': [], ++ 'stat': [], ++} ++ ++foreach f, d : checked_funcs ++ if cc.has_function(f, dependencies: d) ++ cdata.set('HAVE_@0@'.format(f.underscorify().to_upper()), 1) ++ endif ++endforeach ++ ++cdata.set('LT_OBJDIR', '.libs/') ++ ++configure_file( ++ input: 'config.h.cmake.in', ++ output: 'config.h', ++ format: 'cmake@', ++ configuration: cdata, ++) ++ ++withcdata = configuration_data() ++withcdata.set10('HAVE_LIBLZMA', lzma_dep.found()) ++version = meson.project_version() ++version_array = version.split('.') ++major = version_array[0].to_int() ++minor = version_array[1].to_int() ++micro = version_array[2].to_int() ++version_number = major * 10000 + minor * 100 + micro ++withcdata.set('VERSION', version) ++withcdata.set('LIBXML_VERSION_NUMBER', version_number) ++withcdata.set('LIBXML_VERSION_STRING', '@0@'.format(version_number)) ++withcdata.set('LIBXML_VERSION_EXTRA', '') ++ ++need_trio = false ++foreach f : ['printf', 'sprintf', 'fprintf', 'snprintf', 'vfprintf', 'vsprintf', 'vsnprintf', 'sscanf'] ++ if not cc.has_function(f, prefix: '#include ') ++ need_trio = true ++ break ++ endif ++endforeach ++withcdata.set10('WITH_TRIO', need_trio) ++ ++withcdata.set10('WITH_THREADS', with_threads) ++withcdata.set10('WITH_THREAD_ALLOC', false) ++withcdata.set10('WITH_TREE', true) ++withcdata.set10('WITH_OUTPUT', true) ++withcdata.set10('WITH_PUSH', true) ++withcdata.set10('WITH_READER', true) ++withcdata.set10('WITH_PATTERN', true) ++withcdata.set10('WITH_WRITER', true) ++withcdata.set10('WITH_SAX1', true) ++withcdata.set10('WITH_FTP', false) ++withcdata.set10('WITH_HTTP', true) ++withcdata.set10('WITH_VALID', true) ++withcdata.set10('WITH_HTML', true) ++withcdata.set10('WITH_LEGACY', false) ++withcdata.set10('WITH_C14N', true) ++withcdata.set10('WITH_CATALOG', true) ++withcdata.set10('WITH_DOCB', true) ++withcdata.set10('WITH_XPATH', true) ++withcdata.set10('WITH_XPTR', true) ++withcdata.set10('WITH_XPTR_LOCS', false) ++withcdata.set10('WITH_XINCLUDE', true) ++withcdata.set10('WITH_ICONV', iconv_lib.found()) ++withcdata.set10('WITH_ICU', false) ++withcdata.set10('WITH_ISO8859X', true) ++withcdata.set10('WITH_DEBUG', true) ++withcdata.set10('WITH_MEM_DEBUG', false) ++withcdata.set10('WITH_RUN_DEBUG', false) ++withcdata.set10('WITH_REGEXPS', true) ++withcdata.set10('WITH_SCHEMAS', true) ++withcdata.set10('WITH_SCHEMATRON', true) ++withcdata.set10('WITH_MODULES', dl_lib.found()) ++ ++system = target_machine.system() ++if system == 'cygwin' ++ module_ext = '.cygdll' ++elif system == 'darwin' ++ module_ext = '.bundle' ++elif system == 'windows' ++ module_ext = '.dll' ++else ++ module_ext = '.so' ++endif ++ ++withcdata.set('MODULE_EXTENSION', module_ext) ++ ++withcdata.set10('WITH_ZLIB', zlib_dep.found()) ++withcdata.set10('WITH_LZMA', lzma_dep.found()) ++ ++subdir('include/libxml') ++ ++sources = files( ++ 'HTMLparser.c', ++ 'HTMLtree.c', ++ 'SAX.c', ++ 'SAX2.c', ++ 'buf.c', ++ 'c14n.c', ++ 'catalog.c', ++ 'chvalid.c', ++ 'debugXML.c', ++ 'dict.c', ++ 'encoding.c', ++ 'entities.c', ++ 'error.c', ++ 'globals.c', ++ 'hash.c', ++ 'legacy.c', ++ 'list.c', ++ 'nanoftp.c', ++ 'nanohttp.c', ++ 'parser.c', ++ 'parserInternals.c', ++ 'pattern.c', ++ 'relaxng.c', ++ 'schematron.c', ++ 'threads.c', ++ 'tree.c', ++ 'uri.c', ++ 'valid.c', ++ 'xinclude.c', ++ 'xlink.c', ++ 'xmlIO.c', ++ 'xmlmemory.c', ++ 'xmlmodule.c', ++ 'xmlreader.c', ++ 'xmlregexp.c', ++ 'xmlsave.c', ++ 'xmlschemas.c', ++ 'xmlschemastypes.c', ++ 'xmlstring.c', ++ 'xmlunicode.c', ++ 'xmlwriter.c', ++ 'xpath.c', ++ 'xpointer.c', ++ 'xzlib.c', ++) ++ ++if need_trio ++ sources += files('trio.c', 'trionan.c', 'triostr.c') ++endif ++ ++if host_machine.system() == 'windows' ++ subdir('win32') ++endif ++ ++cargs = with_threads ? ['-D_REENTRANT'] : [] ++cargs += get_option('default_library') == 'static' ? '-DLIBXML_STATIC' : [] ++ ++link_args = cc.get_supported_link_arguments( ++ [ ++ # lld 16 defaults to --no-undefined-version but the version script ++ # can contain symbols disabled by configuration options. ++ '-Wl,--undefined-version', ++ '-Wl,--version-script=@0@'.format(meson.current_source_dir() / 'libxml2.syms') ++ ] ++) ++ ++incdir = include_directories('include') ++xml2lib = library( ++ 'xml2', ++ sources, ++ c_args: cargs, ++ link_args: link_args, ++ include_directories: incdir, ++ dependencies: deps, ++ version: meson.project_version(), ++ gnu_symbol_visibility: 'default', ++ install: true, ++) ++ ++libxml2_dep = declare_dependency( ++ link_with: xml2lib, ++ include_directories: incdir, ++ dependencies: deps, ++ variables: 'modules=@0@'.format(withcdata.get('WITH_MODULES')), ++ compile_args: get_option('default_library') == 'static' ? '-DLIBXML_STATIC' : [], ++) ++ ++pkg = import('pkgconfig') ++pkg.generate( ++ xml2lib, ++ name: 'libXML', ++ description: 'libXML library version2.', ++ filebase: 'libxml-2.0', ++ subdirs: 'libxml2', ++ variables: 'modules=@0@'.format(withcdata.get('WITH_MODULES')), ++ extra_cflags: get_option('default_library') == 'static' ? '-DLIBXML_STATIC' : [], ++) ++ ++executable('xmllint', 'xmllint.c', dependencies: libxml2_dep, install: true) ++ ++dictexe = executable('testdict', 'testdict.c', dependencies: libxml2_dep) ++ ++test('dict', dictexe) +diff --git a/meson_options.txt b/meson_options.txt +new file mode 100644 +index 0000000..4545f8e +--- /dev/null ++++ b/meson_options.txt +@@ -0,0 +1 @@ ++option('iconv', type: 'feature', description: 'Build with iconv support') +diff --git a/win32/meson.build b/win32/meson.build +new file mode 100644 +index 0000000..db16c9f +--- /dev/null ++++ b/win32/meson.build +@@ -0,0 +1,13 @@ ++rcvdata = configuration_data() ++rcvdata.set('LIBXML_MAJOR_VERSION', major) ++rcvdata.set('LIBXML_MINOR_VERSION', minor) ++rcvdata.set('LIBXML_MICRO_VERSION', micro) ++rcvdata.set_quoted('LIBXML_DOTTED_VERSION', meson.project_version()) ++configure_file( ++ output: 'rcVersion.h', ++ configuration: rcvdata, ++) ++ ++rcfile = configure_file(input: 'libxml2.rc', output: 'libxml2.rc', copy: true) ++windows = import('windows') ++sources += windows.compile_resources(rcfile) +-- +2.42.0.windows.2 + diff --git a/recipes/libxml2/0001-Enable-windows-cross-compilation.patch b/recipes/libxml2/0001-Enable-windows-cross-compilation.patch deleted file mode 100644 index 9bd33cac3..000000000 --- a/recipes/libxml2/0001-Enable-windows-cross-compilation.patch +++ /dev/null @@ -1,85 +0,0 @@ -From ff87370625a68b73d0e1351bc735ef510c26d051 Mon Sep 17 00:00:00 2001 -From: Andoni Morales Alastruey -Date: Fri, 9 Mar 2012 18:18:48 +0100 -Subject: [PATCH 1/5] Enable windows cross-compilation - ---- - configure.ac | 21 ++++++++++++++++++++- - python/Makefile.am | 1 + - 2 files changed, 21 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 14ac0a8..c3985f2 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -811,6 +811,21 @@ dnl - dnl check for python - dnl - -+case "$host" in -+ *-*-mingw*|*-*-cygwin*) -+ platform_win32=yes -+ ;; -+ *) -+ platform_win32=no -+ ;; -+esac -+ -+if test "x$platform_win32" = "xyes" ; then -+AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "") -+pythondir=$am_cv_python_pythondir -+PYTHON_SUBDIR=python -+PYTHON=`which python` -+else - PYTHON_VERSION= - PYTHON_INCLUDES= - PYTHON_SITE_PACKAGES= -@@ -905,6 +920,7 @@ then - else - PYTHON_SUBDIR= - fi -+fi - AC_SUBST(pythondir) - AC_SUBST(PYTHON_SUBDIR) - AC_SUBST(PYTHON_LIBS) -@@ -1574,6 +1590,7 @@ WIN32_EXTRA_LDFLAGS= - CYGWIN_EXTRA_LDFLAGS= - CYGWIN_EXTRA_PYTHON_LIBADD= - WIN32_EXTRA_PYTHON_LIBADD= -+WIN32_EXTRA_PYTHON_CFLAGS= - case "$host" in - *-*-mingw*) - CPPFLAGS="$CPPFLAGS -DWIN32" -@@ -1582,7 +1599,8 @@ case "$host" in - AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation]) - if test "${PYTHON}" != "" - then -- WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)" -+ WIN32_EXTRA_PYTHON_LIBADD="${PYTHON_LIBS}" -+ WIN32_EXTRA_PYTHON_CFLAGS="${PYTHON_INCLUDES}" - fi - ;; - *-*-cygwin*) -@@ -1596,6 +1614,7 @@ esac - AC_SUBST(WIN32_EXTRA_LIBADD) - AC_SUBST(WIN32_EXTRA_LDFLAGS) - AC_SUBST(WIN32_EXTRA_PYTHON_LIBADD) -+AC_SUBST(WIN32_EXTRA_PYTHON_CFLAGS) - AC_SUBST(CYGWIN_EXTRA_LDFLAGS) - AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD) - -diff --git a/python/Makefile.am b/python/Makefile.am -index 34aed96..8744cc7 100644 ---- a/python/Makefile.am -+++ b/python/Makefile.am -@@ -24,6 +24,7 @@ AM_CPPFLAGS = \ - python_LTLIBRARIES = libxml2mod.la - - libxml2mod_la_SOURCES = libxml.c libxml_wrap.h libxml2-py.h libxml2-py.c types.c -+libxml2mod_la_CFLAGS = $(WIN32_EXTRA_PYTHON_CFLAGS) - libxml2mod_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) -module -avoid-version \ - $(top_builddir)/libxml2.la $(CYGWIN_EXTRA_PYTHON_LIBADD) $(WIN32_EXTRA_PYTHON_LIBADD) $(PYTHON_LIBS) - --- -2.1.0 - diff --git a/recipes/libxml2/0002-makefiles-disable-tests.patch b/recipes/libxml2/0002-makefiles-disable-tests.patch deleted file mode 100644 index 7738c59fa..000000000 --- a/recipes/libxml2/0002-makefiles-disable-tests.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b67767a901ec31a0ddc1e2dff5c4f5d21241661f Mon Sep 17 00:00:00 2001 -From: Andoni Morales Alastruey -Date: Mon, 28 Oct 2013 18:05:43 +0100 -Subject: [PATCH 2/5] makefiles: disable tests - ---- - Makefile.am | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 70720f3..a2881a3 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -10,10 +10,11 @@ AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include - - AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS) - --noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \ -- testThreads testC14N testAutomata testRegexp \ -- testReader testapi testModule runtest runsuite testchar \ -- testdict runxmlconf testrecurse testlimits -+noinst_PROGRAMS= -+#noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \ -+# testThreads testC14N testAutomata testRegexp \ -+# testReader testapi testModule runtest runsuite testchar \ -+# testdict runxmlconf testrecurse testlimits - - bin_PROGRAMS = xmllint xmlcatalog - --- -2.1.0 - diff --git a/recipes/libxml2/0003-configure-fix-python-dir-prefix.patch b/recipes/libxml2/0003-configure-fix-python-dir-prefix.patch deleted file mode 100644 index d12f0af71..000000000 --- a/recipes/libxml2/0003-configure-fix-python-dir-prefix.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 5a75153014bd1c0669415bda1ee899c0ae9c3aad Mon Sep 17 00:00:00 2001 -From: Andoni Morales Alastruey -Date: Mon, 28 Oct 2013 18:07:07 +0100 -Subject: [PATCH 3/5] configure: fix python dir prefix - ---- - configure.ac | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/configure.ac b/configure.ac -index c3985f2..e5dbc15 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -908,6 +908,7 @@ if test "$with_python" != "no" ; then - fi - fi - fi -+ PYTHON_SITE_PACKAGES='$(prefix)/lib/python$(PYTHON_VERSION)/site-packages' - pythondir='$(PYTHON_SITE_PACKAGES)' - PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags` - else --- -2.1.0 - From 53dd1f02298718115be616709b04691f079e63fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 10 Aug 2024 13:06:30 +0100 Subject: [PATCH 06/15] libxml: update to 2.13.3 and move meson build from wrapdb to new upstream version Co-authored-by: L. E. Segovia Part-of: --- recipes/libxml2.recipe | 13 +- recipes/libxml2/0001-Add-Meson-build.patch | 537 ------------------ .../0001-meson-Make-tests-optional.patch | 62 ++ ...irs-missing-in-the-pkg-config-module.patch | 24 + 4 files changed, 95 insertions(+), 541 deletions(-) delete mode 100644 recipes/libxml2/0001-Add-Meson-build.patch create mode 100644 recipes/libxml2/0001-meson-Make-tests-optional.patch create mode 100644 recipes/libxml2/0002-meson-Fix-subdirs-missing-in-the-pkg-config-module.patch diff --git a/recipes/libxml2.recipe b/recipes/libxml2.recipe index 5dfd3cc2b..242808883 100644 --- a/recipes/libxml2.recipe +++ b/recipes/libxml2.recipe @@ -3,24 +3,29 @@ from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): name = 'libxml2' - version = '2.11.6' + version = '2.13.3' stype = SourceType.TARBALL btype = BuildType.MESON url = 'gnome://' - tarball_checksum = 'c90eee7506764abbe07bb616b82da452529609815aefef423d66ef080eb0c300' + tarball_checksum = '0805d7c180cf09caad71666c7a458a74f041561a532902454da5047d83948138' licenses = [{License.MIT: ['Copyright']}] + # Note: Many options were converted to feature options post-2.13.1 + # Tests require API level 28 on Android + meson_options = {'python': 'false', 'zlib': 'enabled', 'tests': 'false'} + deps = [ 'zlib' ] patches = [ - f'{name}/0001-Add-Meson-build.patch', + f'{name}/0001-meson-Make-tests-optional.patch', + f'{name}/0002-meson-Fix-subdirs-missing-in-the-pkg-config-module.patch', ] files_libs = ['libxml2'] files_devel = ['include/libxml2', '%(libdir)s/pkgconfig/libxml-2.0.pc', 'bin/xmllint%(bext)s'] def post_install(self): - LibtoolLibrary(self.name, 2, 11, 6, + LibtoolLibrary(self.name, None, None, None, self.config.libdir, self.config.target_platform, deps=['z'], static_only=self.library_type == LibraryType.STATIC).save() diff --git a/recipes/libxml2/0001-Add-Meson-build.patch b/recipes/libxml2/0001-Add-Meson-build.patch deleted file mode 100644 index dcde568c8..000000000 --- a/recipes/libxml2/0001-Add-Meson-build.patch +++ /dev/null @@ -1,537 +0,0 @@ -From 089ef2cf86b2f7b5266a07b6b538799c82e89abe Mon Sep 17 00:00:00 2001 -From: "L. E. Segovia" -Date: Wed, 21 Feb 2024 11:02:25 -0300 -Subject: [PATCH 1/1] Add Meson build - -Source: https://wrapdb.mesonbuild.com/v2/libxml2_2.11.6-3/libxml2.wrap ---- - LICENSE.build | 19 ++ - include/libxml/meson.build | 55 +++++ - meson.build | 397 +++++++++++++++++++++++++++++++++++++ - meson_options.txt | 1 + - win32/meson.build | 13 ++ - 5 files changed, 485 insertions(+) - create mode 100644 LICENSE.build - create mode 100644 include/libxml/meson.build - create mode 100644 meson.build - create mode 100644 meson_options.txt - create mode 100644 win32/meson.build - -diff --git a/LICENSE.build b/LICENSE.build -new file mode 100644 -index 0000000..b59833d ---- /dev/null -+++ b/LICENSE.build -@@ -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/include/libxml/meson.build b/include/libxml/meson.build -new file mode 100644 -index 0000000..22e5637 ---- /dev/null -+++ b/include/libxml/meson.build -@@ -0,0 +1,55 @@ -+configure_file( -+ input: 'xmlversion.h.in', -+ output: 'xmlversion.h', -+ configuration: withcdata, -+ install_dir: get_option('includedir') / 'libxml2' / 'libxml', -+) -+ -+libxml_headers = files( -+ 'HTMLparser.h', -+ 'HTMLtree.h', -+ 'SAX.h', -+ 'SAX2.h', -+ 'c14n.h', -+ 'catalog.h', -+ 'chvalid.h', -+ 'debugXML.h', -+ 'dict.h', -+ 'encoding.h', -+ 'entities.h', -+ 'globals.h', -+ 'hash.h', -+ 'list.h', -+ 'nanoftp.h', -+ 'nanohttp.h', -+ 'parser.h', -+ 'parserInternals.h', -+ 'pattern.h', -+ 'relaxng.h', -+ 'schemasInternals.h', -+ 'schematron.h', -+ 'threads.h', -+ 'tree.h', -+ 'uri.h', -+ 'valid.h', -+ 'xinclude.h', -+ 'xlink.h', -+ 'xmlIO.h', -+ 'xmlautomata.h', -+ 'xmlerror.h', -+ 'xmlexports.h', -+ 'xmlmemory.h', -+ 'xmlmodule.h', -+ 'xmlreader.h', -+ 'xmlregexp.h', -+ 'xmlsave.h', -+ 'xmlschemas.h', -+ 'xmlschemastypes.h', -+ 'xmlstring.h', -+ 'xmlunicode.h', -+ 'xmlwriter.h', -+ 'xpath.h', -+ 'xpathInternals.h', -+ 'xpointer.h', -+) -+install_headers(libxml_headers, subdir: 'libxml2/libxml') -diff --git a/meson.build b/meson.build -new file mode 100644 -index 0000000..99b7cfe ---- /dev/null -+++ b/meson.build -@@ -0,0 +1,397 @@ -+project( -+ 'libxml2', -+ 'c', -+ version: '2.11.6', -+ meson_version: '>=0.54.1', -+ license: 'MIT', -+) -+ -+add_project_arguments('-D_GNU_SOURCE', language: 'c') -+ -+cc = meson.get_compiler('c') -+if host_machine.system() == 'windows' -+ if cc.get_argument_syntax() == 'gcc' -+ #hack to get rand_r working on windows -+ add_project_arguments('-D_POSIX_THREAD_SAFE_FUNCTIONS', language: 'c') -+ else -+ add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', cc.get_supported_arguments('-Wno-deprecated-declarations'), language: 'c') -+ endif -+endif -+ -+cdata = configuration_data() -+ -+cdata.set('PACKAGE', meson.project_name()) -+cdata.set('PACKAGE_NAME', meson.project_name()) -+cdata.set('PACKAGE_TARNAME', meson.project_name()) -+cdata.set('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), meson.project_version())) -+cdata.set('PACKAGE_URL', 'https://gitlab.gnome.org/GNOME/libxml2') -+cdata.set('PACKAGE_BUGREPORT', 'xml@gnome.org') -+cdata.set('PACKAGE_VERSION', meson.project_version()) -+cdata.set('VERSION', meson.project_version()) -+ -+if cc.has_function_attribute('destructor') -+ cdata.set('ATTRIBUTE_DESTRUCTOR', '__attribute__((destructor))') -+endif -+ -+if cc.has_header_symbol('sys/socket.h', 'AF_INET6') or cc.has_header_symbol('winsock2.h', 'AF_INET6') -+ cdata.set('SUPPORT_IP6', 1) -+endif -+ -+if cc.compiles('#include void a(va_list*) {}int main(){va_list ap1,ap2;a(&ap1);ap2=(va_list)ap1;return 0;}') -+ cdata.set('VA_LIST_IS_ARRAY', 1) -+endif -+ -+if cc.compiles('#include int main(){send(1,(const char*)"",1,1);}') or cc.compiles('#include int main(){send(1,(const char*)"",1,1);}') -+ cdata.set('SEND_ARG2_CAST', '/**/') -+else -+ cdata.set('SEND_ARG2_CAST', '(char *)') -+endif -+ -+if cc.compiles('#include int main(){gethostbyname((const char*)"");}') or cc.compiles('#include int main(){gethostbyname((const char*)"");}') -+ cdata.set('GETHOSTBYNAME_ARG_CAST', '/**/') -+else -+ cdata.set('GETHOSTBYNAME_ARG_CAST', '(char *)') -+endif -+ -+if cc.has_header_symbol('stdlib.h', 'rand_r', args: '-D_POSIX_THREAD_SAFE_FUNCTIONS') -+ cdata.set('HAVE_RAND_R', 1) -+endif -+ -+if cc.has_header_symbol('stdarg.h', 'va_copy') -+ cdata.set('HAVE_VA_COPY', 1) -+endif -+ -+if cc.has_header_symbol('stdarg.h', '__va_copy') -+ cdata.set('HAVE___VA_COPY', 1) -+endif -+ -+deps = [] -+ -+if meson.version().version_compare('>= 0.62') -+ dl_lib = dependency('dl', disabler: true, required: false) -+else -+ dl_lib = cc.find_library('dl', disabler: true, required: false) -+endif -+if dl_lib.found() -+ cdata.set('HAVE_DLOPEN', 1) -+ cdata.set('HAVE_DLFCN_H', 1) -+ deps += dl_lib -+endif -+ -+math_lib = cc.find_library('m', required: false) -+if math_lib.found() -+ deps += math_lib -+endif -+ -+if meson.version().version_compare('>= 0.60') -+ iconv_lib = dependency('iconv', required: get_option('iconv')) -+else -+ if get_option('iconv').disabled() -+ iconv_lib = dependency('', required: false) -+ else -+ iconv_check = ''' -+ #include -+ int main() { -+ iconv_open("", ""); -+ } -+ ''' -+ if cc.links(iconv_check, name: 'iconv_open') -+ iconv_lib = declare_dependency() -+ else -+ iconv_lib = cc.find_library('iconv', required: false) -+ if not cc.links(iconv_check, name: 'iconv_open in libiconv', dependencies: iconv_lib) -+ iconv_lib = dependency('', required: false) -+ if get_option('iconv').enabled() -+ error('iconv enabled and not found') -+ endif -+ endif -+ endif -+ endif -+endif -+if iconv_lib.found() -+ deps += iconv_lib -+endif -+ -+if host_machine.system() == 'windows' -+ pthread_dep = disabler() -+ with_threads = true -+else -+ pthread_dep = dependency('threads', disabler: true, required: false) -+ with_threads = pthread_dep.found() -+ if with_threads -+ deps += pthread_dep -+ endif -+endif -+ -+lzma_dep = dependency('liblzma', required: false) -+if lzma_dep.found() -+ cdata.set('HAVE_LIBLZMA', 1) -+ deps += lzma_dep -+endif -+ -+zlib_dep = dependency('zlib', disabler: true, required: false) -+if zlib_dep.found() -+ cdata.set('HAVE_LIBZ', 1) -+ cdata.set('HAVE_ZLIB_H', 1) -+ deps += zlib_dep -+endif -+ -+readline_lib = cc.find_library('readline', required: false) -+if cc.has_header('readline/readline.h', dependencies: readline_lib) -+ cdata.set('HAVE_LIBREADLINE', 1) -+ deps += readline_lib -+endif -+ -+history_lib = cc.find_library('history', required: false) -+if cc.has_header('readline/history.h', dependencies: history_lib) -+ cdata.set('HAVE_LIBHISTORY', 1) -+ deps += history_lib -+endif -+ -+ws2_dep = cc.find_library('ws2_32', required: host_machine.system() == 'windows') -+if ws2_dep.found() -+ deps += ws2_dep -+endif -+ -+foreach t : ['socklen_t', 'size_t', 'int'] -+ if cc.compiles('#include int main(){getsockopt(1,1,1,0,(@0@*)0);}'.format(t)) -+ cdata.set('XML_SOCKLEN_T', t) -+ break -+ endif -+ if cc.compiles('#include int main(){getsockopt(1,1,1,0,(@0@*)0);}'.format(t), dependencies: ws2_dep) -+ cdata.set('XML_SOCKLEN_T', t) -+ break -+ endif -+endforeach -+ -+checked_headers = { -+ 'arpa/inet.h': [], -+ 'arpa/nameser.h': [], -+ 'dl.h': [], -+ 'fcntl.h': [], -+ 'float.h': [], -+ 'inttypes.h': [], -+ 'netdb.h': [], -+ 'netinet/in.h': [], -+ 'poll.h': [], -+ 'pthread.h': pthread_dep, -+ 'resolv.h': [], -+ 'stdint.h': [], -+ 'sys/mman.h': [], -+ 'sys/select.h': [], -+ 'sys/socket.h': [], -+ 'sys/stat.h': [], -+ 'sys/time.h': [], -+ 'sys/timeb.h': [], -+ 'sys/types.h': [], -+ 'unistd.h': [], -+} -+ -+foreach h, d : checked_headers -+ if cc.has_header(h, dependencies: d) -+ cdata.set('HAVE_@0@'.format(h.underscorify().to_upper()), 1) -+ endif -+endforeach -+ -+checked_funcs = { -+ 'ftime': [], -+ 'getaddrinfo': ws2_dep, -+ 'gettimeofday': [], -+ 'isascii': [], -+ 'mmap': [], -+ 'munmap': [], -+ 'putenv': [], -+ 'stat': [], -+} -+ -+foreach f, d : checked_funcs -+ if cc.has_function(f, dependencies: d) -+ cdata.set('HAVE_@0@'.format(f.underscorify().to_upper()), 1) -+ endif -+endforeach -+ -+cdata.set('LT_OBJDIR', '.libs/') -+ -+configure_file( -+ input: 'config.h.cmake.in', -+ output: 'config.h', -+ format: 'cmake@', -+ configuration: cdata, -+) -+ -+withcdata = configuration_data() -+withcdata.set10('HAVE_LIBLZMA', lzma_dep.found()) -+version = meson.project_version() -+version_array = version.split('.') -+major = version_array[0].to_int() -+minor = version_array[1].to_int() -+micro = version_array[2].to_int() -+version_number = major * 10000 + minor * 100 + micro -+withcdata.set('VERSION', version) -+withcdata.set('LIBXML_VERSION_NUMBER', version_number) -+withcdata.set('LIBXML_VERSION_STRING', '@0@'.format(version_number)) -+withcdata.set('LIBXML_VERSION_EXTRA', '') -+ -+need_trio = false -+foreach f : ['printf', 'sprintf', 'fprintf', 'snprintf', 'vfprintf', 'vsprintf', 'vsnprintf', 'sscanf'] -+ if not cc.has_function(f, prefix: '#include ') -+ need_trio = true -+ break -+ endif -+endforeach -+withcdata.set10('WITH_TRIO', need_trio) -+ -+withcdata.set10('WITH_THREADS', with_threads) -+withcdata.set10('WITH_THREAD_ALLOC', false) -+withcdata.set10('WITH_TREE', true) -+withcdata.set10('WITH_OUTPUT', true) -+withcdata.set10('WITH_PUSH', true) -+withcdata.set10('WITH_READER', true) -+withcdata.set10('WITH_PATTERN', true) -+withcdata.set10('WITH_WRITER', true) -+withcdata.set10('WITH_SAX1', true) -+withcdata.set10('WITH_FTP', false) -+withcdata.set10('WITH_HTTP', true) -+withcdata.set10('WITH_VALID', true) -+withcdata.set10('WITH_HTML', true) -+withcdata.set10('WITH_LEGACY', false) -+withcdata.set10('WITH_C14N', true) -+withcdata.set10('WITH_CATALOG', true) -+withcdata.set10('WITH_DOCB', true) -+withcdata.set10('WITH_XPATH', true) -+withcdata.set10('WITH_XPTR', true) -+withcdata.set10('WITH_XPTR_LOCS', false) -+withcdata.set10('WITH_XINCLUDE', true) -+withcdata.set10('WITH_ICONV', iconv_lib.found()) -+withcdata.set10('WITH_ICU', false) -+withcdata.set10('WITH_ISO8859X', true) -+withcdata.set10('WITH_DEBUG', true) -+withcdata.set10('WITH_MEM_DEBUG', false) -+withcdata.set10('WITH_RUN_DEBUG', false) -+withcdata.set10('WITH_REGEXPS', true) -+withcdata.set10('WITH_SCHEMAS', true) -+withcdata.set10('WITH_SCHEMATRON', true) -+withcdata.set10('WITH_MODULES', dl_lib.found()) -+ -+system = target_machine.system() -+if system == 'cygwin' -+ module_ext = '.cygdll' -+elif system == 'darwin' -+ module_ext = '.bundle' -+elif system == 'windows' -+ module_ext = '.dll' -+else -+ module_ext = '.so' -+endif -+ -+withcdata.set('MODULE_EXTENSION', module_ext) -+ -+withcdata.set10('WITH_ZLIB', zlib_dep.found()) -+withcdata.set10('WITH_LZMA', lzma_dep.found()) -+ -+subdir('include/libxml') -+ -+sources = files( -+ 'HTMLparser.c', -+ 'HTMLtree.c', -+ 'SAX.c', -+ 'SAX2.c', -+ 'buf.c', -+ 'c14n.c', -+ 'catalog.c', -+ 'chvalid.c', -+ 'debugXML.c', -+ 'dict.c', -+ 'encoding.c', -+ 'entities.c', -+ 'error.c', -+ 'globals.c', -+ 'hash.c', -+ 'legacy.c', -+ 'list.c', -+ 'nanoftp.c', -+ 'nanohttp.c', -+ 'parser.c', -+ 'parserInternals.c', -+ 'pattern.c', -+ 'relaxng.c', -+ 'schematron.c', -+ 'threads.c', -+ 'tree.c', -+ 'uri.c', -+ 'valid.c', -+ 'xinclude.c', -+ 'xlink.c', -+ 'xmlIO.c', -+ 'xmlmemory.c', -+ 'xmlmodule.c', -+ 'xmlreader.c', -+ 'xmlregexp.c', -+ 'xmlsave.c', -+ 'xmlschemas.c', -+ 'xmlschemastypes.c', -+ 'xmlstring.c', -+ 'xmlunicode.c', -+ 'xmlwriter.c', -+ 'xpath.c', -+ 'xpointer.c', -+ 'xzlib.c', -+) -+ -+if need_trio -+ sources += files('trio.c', 'trionan.c', 'triostr.c') -+endif -+ -+if host_machine.system() == 'windows' -+ subdir('win32') -+endif -+ -+cargs = with_threads ? ['-D_REENTRANT'] : [] -+cargs += get_option('default_library') == 'static' ? '-DLIBXML_STATIC' : [] -+ -+link_args = cc.get_supported_link_arguments( -+ [ -+ # lld 16 defaults to --no-undefined-version but the version script -+ # can contain symbols disabled by configuration options. -+ '-Wl,--undefined-version', -+ '-Wl,--version-script=@0@'.format(meson.current_source_dir() / 'libxml2.syms') -+ ] -+) -+ -+incdir = include_directories('include') -+xml2lib = library( -+ 'xml2', -+ sources, -+ c_args: cargs, -+ link_args: link_args, -+ include_directories: incdir, -+ dependencies: deps, -+ version: meson.project_version(), -+ gnu_symbol_visibility: 'default', -+ install: true, -+) -+ -+libxml2_dep = declare_dependency( -+ link_with: xml2lib, -+ include_directories: incdir, -+ dependencies: deps, -+ variables: 'modules=@0@'.format(withcdata.get('WITH_MODULES')), -+ compile_args: get_option('default_library') == 'static' ? '-DLIBXML_STATIC' : [], -+) -+ -+pkg = import('pkgconfig') -+pkg.generate( -+ xml2lib, -+ name: 'libXML', -+ description: 'libXML library version2.', -+ filebase: 'libxml-2.0', -+ subdirs: 'libxml2', -+ variables: 'modules=@0@'.format(withcdata.get('WITH_MODULES')), -+ extra_cflags: get_option('default_library') == 'static' ? '-DLIBXML_STATIC' : [], -+) -+ -+executable('xmllint', 'xmllint.c', dependencies: libxml2_dep, install: true) -+ -+dictexe = executable('testdict', 'testdict.c', dependencies: libxml2_dep) -+ -+test('dict', dictexe) -diff --git a/meson_options.txt b/meson_options.txt -new file mode 100644 -index 0000000..4545f8e ---- /dev/null -+++ b/meson_options.txt -@@ -0,0 +1 @@ -+option('iconv', type: 'feature', description: 'Build with iconv support') -diff --git a/win32/meson.build b/win32/meson.build -new file mode 100644 -index 0000000..db16c9f ---- /dev/null -+++ b/win32/meson.build -@@ -0,0 +1,13 @@ -+rcvdata = configuration_data() -+rcvdata.set('LIBXML_MAJOR_VERSION', major) -+rcvdata.set('LIBXML_MINOR_VERSION', minor) -+rcvdata.set('LIBXML_MICRO_VERSION', micro) -+rcvdata.set_quoted('LIBXML_DOTTED_VERSION', meson.project_version()) -+configure_file( -+ output: 'rcVersion.h', -+ configuration: rcvdata, -+) -+ -+rcfile = configure_file(input: 'libxml2.rc', output: 'libxml2.rc', copy: true) -+windows = import('windows') -+sources += windows.compile_resources(rcfile) --- -2.42.0.windows.2 - diff --git a/recipes/libxml2/0001-meson-Make-tests-optional.patch b/recipes/libxml2/0001-meson-Make-tests-optional.patch new file mode 100644 index 000000000..bdcbc4fd9 --- /dev/null +++ b/recipes/libxml2/0001-meson-Make-tests-optional.patch @@ -0,0 +1,62 @@ +From aa11bb42e8ad33522a429fbf8154da0292bf2709 Mon Sep 17 00:00:00 2001 +From: "L. E. Segovia" +Date: Tue, 13 Aug 2024 17:28:13 +0000 +Subject: [PATCH 1/2] meson: Make tests optional + +--- + meson.build | 24 +++++++++++++----------- + meson_options.txt | 6 ++++++ + 2 files changed, 19 insertions(+), 11 deletions(-) + +diff --git a/meson.build b/meson.build +index 37ea80c..9536840 100644 +--- a/meson.build ++++ b/meson.build +@@ -735,17 +735,19 @@ checks = [ + 'testrecurse', + ] + +-foreach check : checks +- exe = executable( +- check, +- files(check + '.c'), +- dependencies: [threads_dep, xml_dep], +- include_directories: config_dir, +- ) +- if check != 'testlimits' +- test(check, exe, timeout: 0, workdir: meson.current_source_dir()) +- endif +-endforeach ++if get_option('tests') ++ foreach check : checks ++ exe = executable( ++ check, ++ files(check + '.c'), ++ dependencies: [threads_dep, xml_dep], ++ include_directories: config_dir, ++ ) ++ if check != 'testlimits' ++ test(check, exe, timeout: 0, workdir: meson.current_source_dir()) ++ endif ++ endforeach ++endif + + subdir('example') + subdir('doc') +diff --git a/meson_options.txt b/meson_options.txt +index 4d61f3d..22262be 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -251,3 +251,9 @@ option('minimum', + value: false, + description: 'build a minimally sized library (default=false)' + ) ++ ++option('tests', ++ type: 'boolean', ++ value: false, ++ description: 'build tests' ++) +-- +2.46.0 + diff --git a/recipes/libxml2/0002-meson-Fix-subdirs-missing-in-the-pkg-config-module.patch b/recipes/libxml2/0002-meson-Fix-subdirs-missing-in-the-pkg-config-module.patch new file mode 100644 index 000000000..7168ace92 --- /dev/null +++ b/recipes/libxml2/0002-meson-Fix-subdirs-missing-in-the-pkg-config-module.patch @@ -0,0 +1,24 @@ +From b967580e759cfa79295e09845a5e4cd18d991bf0 Mon Sep 17 00:00:00 2001 +From: "L. E. Segovia" +Date: Tue, 13 Aug 2024 18:08:38 +0000 +Subject: [PATCH 2/2] meson: Fix subdirs missing in the pkg-config module + +--- + meson.build | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/meson.build b/meson.build +index 9536840..bef1eb3 100644 +--- a/meson.build ++++ b/meson.build +@@ -765,6 +765,7 @@ pkgmod.generate( + description: 'libXML library version2.', + filebase: 'libxml-2.0', + name: 'libXML', ++ subdirs: meson.project_name(), + variables: 'modules=' + dl_dep.found().to_string('1', '0'), + ) + +-- +2.46.0 + From 0f8bee517dd6411e3e737dee6b9cf0ae5a6b13af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 19 Sep 2024 11:06:56 +0200 Subject: [PATCH 07/15] libxml2: update to 2.13.4 Part-of: --- recipes/libxml2.recipe | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/libxml2.recipe b/recipes/libxml2.recipe index 242808883..55296c179 100644 --- a/recipes/libxml2.recipe +++ b/recipes/libxml2.recipe @@ -3,11 +3,11 @@ from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): name = 'libxml2' - version = '2.13.3' + version = '2.13.4' stype = SourceType.TARBALL btype = BuildType.MESON url = 'gnome://' - tarball_checksum = '0805d7c180cf09caad71666c7a458a74f041561a532902454da5047d83948138' + tarball_checksum = '65d042e1c8010243e617efb02afda20b85c2160acdbfbcb5b26b80cec6515650' licenses = [{License.MIT: ['Copyright']}] # Note: Many options were converted to feature options post-2.13.1 From 520b12e64bacc83183992fa389156b90df5d5be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 16 Feb 2025 16:54:37 +0000 Subject: [PATCH 08/15] libxml2: update to 2.13.5 Part-of: --- recipes/libxml2.recipe | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/libxml2.recipe b/recipes/libxml2.recipe index 55296c179..ddaacbc5c 100644 --- a/recipes/libxml2.recipe +++ b/recipes/libxml2.recipe @@ -3,11 +3,11 @@ from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): name = 'libxml2' - version = '2.13.4' + version = '2.13.5' stype = SourceType.TARBALL btype = BuildType.MESON url = 'gnome://' - tarball_checksum = '65d042e1c8010243e617efb02afda20b85c2160acdbfbcb5b26b80cec6515650' + tarball_checksum = '74fc163217a3964257d3be39af943e08861263c4231f9ef5b496b6f6d4c7b2b6' licenses = [{License.MIT: ['Copyright']}] # Note: Many options were converted to feature options post-2.13.1 From e41e76373b86b414940d71ef6f6da892873cb08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 20 Feb 2025 10:13:10 +0000 Subject: [PATCH 09/15] libxml2: update to v2.13.6 Part-of: --- recipes/libxml2.recipe | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/libxml2.recipe b/recipes/libxml2.recipe index ddaacbc5c..891be6128 100644 --- a/recipes/libxml2.recipe +++ b/recipes/libxml2.recipe @@ -3,11 +3,11 @@ from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): name = 'libxml2' - version = '2.13.5' + version = '2.13.6' stype = SourceType.TARBALL btype = BuildType.MESON url = 'gnome://' - tarball_checksum = '74fc163217a3964257d3be39af943e08861263c4231f9ef5b496b6f6d4c7b2b6' + tarball_checksum = 'f453480307524968f7a04ec65e64f2a83a825973bcd260a2e7691be82ae70c96' licenses = [{License.MIT: ['Copyright']}] # Note: Many options were converted to feature options post-2.13.1 From f6579f2856911eb60a5dd0c390aa9206ffa8a8e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 12 Apr 2025 18:53:53 +0100 Subject: [PATCH 10/15] libxml2: update to 2.14.1 Part-of: --- recipes/libxml2.recipe | 13 ++-- .../0001-meson-Make-tests-optional.patch | 63 ++++++++----------- ...irs-missing-in-the-pkg-config-module.patch | 24 ------- 3 files changed, 34 insertions(+), 66 deletions(-) delete mode 100644 recipes/libxml2/0002-meson-Fix-subdirs-missing-in-the-pkg-config-module.patch diff --git a/recipes/libxml2.recipe b/recipes/libxml2.recipe index 891be6128..477847760 100644 --- a/recipes/libxml2.recipe +++ b/recipes/libxml2.recipe @@ -3,22 +3,25 @@ from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): name = 'libxml2' - version = '2.13.6' + version = '2.14.1' stype = SourceType.TARBALL btype = BuildType.MESON url = 'gnome://' - tarball_checksum = 'f453480307524968f7a04ec65e64f2a83a825973bcd260a2e7691be82ae70c96' + tarball_checksum = '310df85878b65fa717e5e28e0d9e8f6205fd29d883929303a70a4f2fc4f6f1f2' licenses = [{License.MIT: ['Copyright']}] - # Note: Many options were converted to feature options post-2.13.1 # Tests require API level 28 on Android - meson_options = {'python': 'false', 'zlib': 'enabled', 'tests': 'false'} + meson_options = { + 'python': 'disabled', + 'zlib': 'enabled', + 'iconv': 'disabled', + 'tests': 'false' + } deps = [ 'zlib' ] patches = [ f'{name}/0001-meson-Make-tests-optional.patch', - f'{name}/0002-meson-Fix-subdirs-missing-in-the-pkg-config-module.patch', ] files_libs = ['libxml2'] diff --git a/recipes/libxml2/0001-meson-Make-tests-optional.patch b/recipes/libxml2/0001-meson-Make-tests-optional.patch index bdcbc4fd9..8ea2dd34f 100644 --- a/recipes/libxml2/0001-meson-Make-tests-optional.patch +++ b/recipes/libxml2/0001-meson-Make-tests-optional.patch @@ -1,55 +1,44 @@ -From aa11bb42e8ad33522a429fbf8154da0292bf2709 Mon Sep 17 00:00:00 2001 +From a1c3a1aa10e6477fbe97a5b1bf4c63c13c8d7901 Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Tue, 13 Aug 2024 17:28:13 +0000 -Subject: [PATCH 1/2] meson: Make tests optional +Subject: [PATCH] meson: Make tests optional --- - meson.build | 24 +++++++++++++----------- - meson_options.txt | 6 ++++++ - 2 files changed, 19 insertions(+), 11 deletions(-) + meson.build | 6 ++++-- + meson_options.txt | 6 ++++++ + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build -index 37ea80c..9536840 100644 +index 988d7ec..5cea50b 100644 --- a/meson.build +++ b/meson.build -@@ -735,17 +735,19 @@ checks = [ - 'testrecurse', - ] +@@ -542,7 +542,8 @@ checks = { + 'testrecurse': [], + } --foreach check : checks -- exe = executable( -- check, -- files(check + '.c'), -- dependencies: [threads_dep, xml_dep], -- include_directories: config_dir, -- ) -- if check != 'testlimits' -- test(check, exe, timeout: 0, workdir: meson.current_source_dir()) -- endif --endforeach +-foreach check, deps : checks +if get_option('tests') -+ foreach check : checks -+ exe = executable( -+ check, -+ files(check + '.c'), -+ dependencies: [threads_dep, xml_dep], -+ include_directories: config_dir, -+ ) -+ if check != 'testlimits' -+ test(check, exe, timeout: 0, workdir: meson.current_source_dir()) -+ endif -+ endforeach ++ foreach check, deps : checks + exe = executable( + check, + files(check + '.c'), +@@ -552,7 +553,8 @@ foreach check, deps : checks + if check != 'testlimits' + test(check, exe, timeout: 0, workdir: meson.current_source_dir()) + endif +-endforeach ++ endforeach +endif - subdir('example') - subdir('doc') + sh = find_program('sh', required: false) + diff --git a/meson_options.txt b/meson_options.txt -index 4d61f3d..22262be 100644 +index 0bfbebb..e8feb0a 100644 --- a/meson_options.txt +++ b/meson_options.txt -@@ -251,3 +251,9 @@ option('minimum', +@@ -204,3 +204,9 @@ option('minimum', value: false, - description: 'build a minimally sized library (default=false)' + description: 'build a minimally sized library' ) + +option('tests', @@ -58,5 +47,5 @@ index 4d61f3d..22262be 100644 + description: 'build tests' +) -- -2.46.0 +2.49.0 diff --git a/recipes/libxml2/0002-meson-Fix-subdirs-missing-in-the-pkg-config-module.patch b/recipes/libxml2/0002-meson-Fix-subdirs-missing-in-the-pkg-config-module.patch deleted file mode 100644 index 7168ace92..000000000 --- a/recipes/libxml2/0002-meson-Fix-subdirs-missing-in-the-pkg-config-module.patch +++ /dev/null @@ -1,24 +0,0 @@ -From b967580e759cfa79295e09845a5e4cd18d991bf0 Mon Sep 17 00:00:00 2001 -From: "L. E. Segovia" -Date: Tue, 13 Aug 2024 18:08:38 +0000 -Subject: [PATCH 2/2] meson: Fix subdirs missing in the pkg-config module - ---- - meson.build | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/meson.build b/meson.build -index 9536840..bef1eb3 100644 ---- a/meson.build -+++ b/meson.build -@@ -765,6 +765,7 @@ pkgmod.generate( - description: 'libXML library version2.', - filebase: 'libxml-2.0', - name: 'libXML', -+ subdirs: meson.project_name(), - variables: 'modules=' + dl_dep.found().to_string('1', '0'), - ) - --- -2.46.0 - From 2e3f6547c060c02b3bcb89076fa93f93673f94da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 19 Apr 2025 13:24:50 +0100 Subject: [PATCH 11/15] libxml2: update to 2.14.2 Part-of: --- recipes/libxml2.recipe | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/libxml2.recipe b/recipes/libxml2.recipe index 477847760..25f497bac 100644 --- a/recipes/libxml2.recipe +++ b/recipes/libxml2.recipe @@ -3,11 +3,11 @@ from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): name = 'libxml2' - version = '2.14.1' + version = '2.14.2' stype = SourceType.TARBALL btype = BuildType.MESON url = 'gnome://' - tarball_checksum = '310df85878b65fa717e5e28e0d9e8f6205fd29d883929303a70a4f2fc4f6f1f2' + tarball_checksum = '353f3c83535d4224a4e5f1e88c90b5d4563ea8fec11f6407df640fd28fc8b8c6' licenses = [{License.MIT: ['Copyright']}] # Tests require API level 28 on Android From 0cf2fa8beabc230a61c07d71ea8fb73b1ba15105 Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Mon, 26 May 2025 11:38:58 +0300 Subject: [PATCH 12/15] libxslt: Update to version 1.1.42 --- recipes/libxslt.recipe | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/recipes/libxslt.recipe b/recipes/libxslt.recipe index b96c764d9..ae5faac1f 100644 --- a/recipes/libxslt.recipe +++ b/recipes/libxslt.recipe @@ -2,11 +2,10 @@ class Recipe(recipe.Recipe): name = 'libxslt' - version = 'v1.1.34' + version = '1.1.42' stype = SourceType.TARBALL - url = 'https://gitlab.gnome.org/GNOME/libxslt/-/archive/{0}/libxslt-{0}.tar.gz'.format(version) - tarball_checksum = 'c61af4c898a93c2862f3f06bba8e5de5e352463febc94a2642d732f21e5d5641' - autoreconf = True + url = f'https://download.gnome.org/sources/libxslt/1.1/libxslt-{version}.tar.xz' + tarball_checksum = '85ca62cac0d41fc77d3f6033da9df6fd73d20ea2fc18b0a3609ffb4110e1baeb' configure_options = '--without-python --without-crypto' deps = ['libxml2'] From 48e65652c68b2d5f0c650e4676b9b2884a2bb22e Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Mon, 26 May 2025 18:13:40 +0300 Subject: [PATCH 13/15] android: Disable building librsvg Only gst-plugins-bad requires librsvg, but the corresponding element is not needed by WebKit (it has its own internal SVG support), hence it may be disabled. --- packages/base-system-1.0.package | 2 ++ recipes/gst-plugins-bad-1.0.recipe | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/base-system-1.0.package b/packages/base-system-1.0.package index d794a86e6..f9801954a 100644 --- a/packages/base-system-1.0.package +++ b/packages/base-system-1.0.package @@ -36,3 +36,5 @@ class Package(custom.GStreamer, package.Package): 'glib:libs:lang:schemas', 'orc:libs', 'bzip2:libs', 'json-glib:libs', ] + elif self.config.target_platform == Platform.ANDROID: + self.files.remove('librsvg:libs') diff --git a/recipes/gst-plugins-bad-1.0.recipe b/recipes/gst-plugins-bad-1.0.recipe index d5eaf7747..3939b4166 100644 --- a/recipes/gst-plugins-bad-1.0.recipe +++ b/recipes/gst-plugins-bad-1.0.recipe @@ -626,6 +626,8 @@ class Recipe(custom.GStreamer): self.disable_plugin('amfcodec', 'codecs') self.disable_plugin('nvcodec', 'codecs') self.disable_plugin('qsv', 'codecs') + elif self.config.target_platform == Platform.ANDROID: + self.disable_plugin('rsvg', 'codecs', dep='librsvg') if self.meson_options['nvcodec'] == 'enabled': self.files_libs += ['libgstcuda-1.0'] From 8d6a70cb9be66d4f3f30df382f67ac2b3c198499 Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Fri, 23 May 2025 23:22:46 +0300 Subject: [PATCH 14/15] icu: Update to version 70.1 ICU version 70.1 is required by WPE WebKit 2.48.x --- recipes/build-tools/icu-tools.recipe | 6 +++--- recipes/icu.recipe | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/recipes/build-tools/icu-tools.recipe b/recipes/build-tools/icu-tools.recipe index 71f8361d4..a378d1527 100644 --- a/recipes/build-tools/icu-tools.recipe +++ b/recipes/build-tools/icu-tools.recipe @@ -25,9 +25,9 @@ class Recipe(recipe.Recipe): name = 'icu-tools' - version = '68.2' - url = 'https://github.com/unicode-org/icu/releases/download/release-68-2/icu4c-68_2-src.tgz' - tarball_checksum = 'c79193dee3907a2199b8296a93b52c5cb74332c26f3d167269487680d479d625' + version = '70.1' + url = 'https://github.com/unicode-org/icu/releases/download/release-70-1/icu4c-70_1-src.tgz' + tarball_checksum = '8d205428c17bf13bb535300669ed28b338a157b1c01ae66d31d0d3e2d47c3fd5' stype = SourceType.TARBALL tarball_dirname = 'icu' srcdir = 'source' diff --git a/recipes/icu.recipe b/recipes/icu.recipe index 189700084..366df34e9 100644 --- a/recipes/icu.recipe +++ b/recipes/icu.recipe @@ -31,12 +31,11 @@ from pathlib import Path class Recipe(recipe.Recipe): name = 'icu' - version = '68.2' + version = '70.1' (major_ver, minor_ver) = version.split('.') - url = 'https://github.com/unicode-org/icu/releases/download/release-68-2/icu4c-68_2-src.tgz' - tarball_checksum = 'c79193dee3907a2199b8296a93b52c5cb74332c26f3d167269487680d479d625' + url = f'https://github.com/unicode-org/icu/releases/download/release-{major_ver}-{minor_ver}/icu4c-{major_ver}_{minor_ver}-src.tgz' + tarball_checksum = '8d205428c17bf13bb535300669ed28b338a157b1c01ae66d31d0d3e2d47c3fd5' stype = SourceType.TARBALL - autoreconf = True tarball_dirname = 'icu' srcdir = 'source' configure_options = '\ From dadf54592b1ca3263f72005241dac731cf0be21f Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Fri, 23 May 2025 22:39:33 +0300 Subject: [PATCH 15/15] wpewebkit: Update to version 2.48.2 The following changes were needed: - Pass -DENABLE_SPEECH_SYNTHESIS=OFF, given that we do not have either the FLite or Spiel package needed by this feature. - Adapt to the inspector resources now being shipped as a .gresource data file. - Remove setting LDFLAGS, CFLAGS, and CXXFLAGS tweaks which are no longer needed. - Drop existing patches, given they are included in 2.48.2 as backports. - Add a patch with a revert to workaround a fdsan runtime crash. --- packages/wpewebkit-core.package | 3 +- packages/wpewebkit.package | 2 +- recipes/wpewebkit.recipe | 32 +- ...UnixFileDescriptor-noncopyable-again.patch | 94 ----- ...ileDescriptor-in-IPC-and-ProcessLaun.patch | 365 ++++++++++++++++++ ...ASharedMemory-when-targeting-Android.patch | 243 ------------ ...ROID-to-simplify-preprocessor-guards.patch | 82 ---- ...Android-Build-WebDriver-as-a-library.patch | 76 ---- ...namespace-when-building-WebDriver-as.patch | 44 --- ...-build-WebDriver-as-a-shared-library.patch | 30 -- ...jected-bundle-and-inspector-lib-path.patch | 50 --- 11 files changed, 384 insertions(+), 637 deletions(-) delete mode 100644 recipes/wpewebkit/0001-Make-UnixFileDescriptor-noncopyable-again.patch create mode 100644 recipes/wpewebkit/0001-Revert-Use-UnixFileDescriptor-in-IPC-and-ProcessLaun.patch delete mode 100644 recipes/wpewebkit/0002-WPE-Use-ASharedMemory-when-targeting-Android.patch delete mode 100644 recipes/wpewebkit/0003-Introduce-OS-ANDROID-to-simplify-preprocessor-guards.patch delete mode 100644 recipes/wpewebkit/0004-Android-Build-WebDriver-as-a-library.patch delete mode 100644 recipes/wpewebkit/0005-Android-Declare-namespace-when-building-WebDriver-as.patch delete mode 100644 recipes/wpewebkit/0006-WPE-Android-build-WebDriver-as-a-shared-library.patch delete mode 100644 recipes/wpewebkit/0007-Allow-setting-injected-bundle-and-inspector-lib-path.patch diff --git a/packages/wpewebkit-core.package b/packages/wpewebkit-core.package index fdfce4479..d519d0183 100644 --- a/packages/wpewebkit-core.package +++ b/packages/wpewebkit-core.package @@ -2,7 +2,7 @@ class Package(package.Package): name = 'wpewebkit-core' - version = '2.46.7' + version = '2.48.2' shortdesc = 'Web Platform for Embedded' longdesc = 'WPE WebKit allows embedders to create simple and performant \ systems based on Web platform technologies. It is a WebKit port designed \ @@ -19,6 +19,7 @@ class Package(package.Package): '.scenario', '.conf', '.py', + '.gresource', 'gst-env', 'gst-shell', 'gst-validate-launcher', diff --git a/packages/wpewebkit.package b/packages/wpewebkit.package index ccbc3ce4b..3e97bf8a1 100644 --- a/packages/wpewebkit.package +++ b/packages/wpewebkit.package @@ -2,7 +2,7 @@ class SDKPackage(package.SDKPackage): name = 'wpewebkit' - version = '2.46.7' + version = '2.48.2' shortdesc = 'Web Platform for Embedded' longdesc = 'WPE WebKit allows embedders to create simple and performant \ systems based on Web platform technologies. It is a WebKit port designed \ diff --git a/recipes/wpewebkit.recipe b/recipes/wpewebkit.recipe index ef2ac5418..511f38bc6 100644 --- a/recipes/wpewebkit.recipe +++ b/recipes/wpewebkit.recipe @@ -2,11 +2,11 @@ class Recipe(recipe.Recipe): name = 'wpewebkit' - version = '2.46.7' + version = '2.48.2' stype = SourceType.TARBALL btype = BuildType.CMAKE url = 'https://wpewebkit.org/releases/wpewebkit-{0}.tar.xz'.format(version) - tarball_checksum = 'cf3e47638595d86de96abdb94db69a836c8aa509fc063be714f52c5a24bb5cd5' + tarball_checksum = '539c6c19b4be1630341a9e9582c25378a1e64eaab7818772ef6c09648ad9584c' deps = [ 'icu', 'cairo', @@ -37,6 +37,7 @@ class Recipe(recipe.Recipe): -DENABLE_INTROSPECTION=OFF \ -DENABLE_JOURNALD_LOG=OFF \ -DENABLE_BUBBLEWRAP_SANDBOX=OFF \ + -DENABLE_SPEECH_SYNTHESIS=OFF \ -DUSE_ATK=OFF \ -DUSE_LCMS=OFF \ -DUSE_AVIF=OFF \ @@ -44,6 +45,7 @@ class Recipe(recipe.Recipe): -DUSE_LIBDRM=OFF \ -DUSE_JPEGXL=OFF \ -DUSE_LIBBACKTRACE=OFF \ + -DUSE_SKIA_OPENTYPE_SVG=OFF \ -DUSE_SYSPROF_CAPTURE=OFF \ -DENABLE_WEBDRIVER=ON \ -DENABLE_WPE_PLATFORM=OFF \ @@ -57,10 +59,13 @@ class Recipe(recipe.Recipe): ] files_misc = [ - 'lib/wpe-webkit-2.0/libWPEWebInspectorResources.so', 'lib/wpe-webkit-2.0/injected-bundle/libWPEInjectedBundle.so' ] + files_shared = [ + 'share/wpe-webkit-2.0/inspector.gresource', + ] + files_devel = [ 'include/wpe-webkit-2.0/jsc/JSCClass.h', 'include/wpe-webkit-2.0/jsc/JSCContext.h', @@ -159,13 +164,21 @@ class Recipe(recipe.Recipe): 'libexec/wpe-webkit-2.0/WPEWebProcess', ] + patches = [ + 'wpewebkit/0001-Revert-Use-UnixFileDescriptor-in-IPC-and-ProcessLaun.patch', + ] + def prepare(self): + from os import path + glib_compile_resources_path = \ + path.join(self.config.build_tools_prefix, 'bin', 'glib-compile-resources') self.configure_options += f' \ -DICU_ROOT={self.config.prefix} \ -DZLIB_ROOT={self.config.prefix} \ -DFREETYPE_LIBRARY={self.config.prefix}/lib/libfreetype.so \ -DFREETYPE_INCLUDE_DIR_ft2build={self.config.prefix}/include/freetype2 \ -DFREETYPE_INCLUDE_DIR_freetype2={self.config.prefix}/include/freetype2 \ + -DGLIB_COMPILE_RESOURCES_EXECUTABLE={glib_compile_resources_path} \ -DJPEG_LIBRARY={self.config.prefix}/lib/libjpeg.so \ -DJPEG_INCLUDE_DIR={self.config.prefix}/include \ -DPNG_LIBRARY={self.config.prefix}/lib/libpng.so \ @@ -177,24 +190,11 @@ class Recipe(recipe.Recipe): arch_src_name = 'arm' self.configure_options += ' -DCMAKE_SYSTEM_PROCESSOR=' + arch_src_name self.configure_options += ' -DANDROID=1' - self.append_env('LDFLAGS', '-landroid -llog -lm -lintl -lc++_shared -O2') # Android libc does not have bcmp() self.append_env('CXXFLAGS', ' -Dbcmp=memcmp ') self.append_env('CFLAGS', ' -Dbcmp=memcmp ') - # XXX: CMake fails to check for this properly - self.append_env('CXXFLAGS', ' -DHAVE_MISSING_STD_FILESYSTEM_PATH_CONSTRUCTOR=1') - self.append_env('CXXFLAGS', ' -DWPE_ENABLE_PROCESS=1 -Dis_android=1 -DLOG_DISABLED=1 -D__ANDROID__=1 -DANDROID=1') # Placeholder to allow enabling debug externally self.append_env('WEBKIT_DEBUG', '') - self.patches += [ - 'wpewebkit/0001-Make-UnixFileDescriptor-noncopyable-again.patch', - 'wpewebkit/0002-WPE-Use-ASharedMemory-when-targeting-Android.patch', - 'wpewebkit/0003-Introduce-OS-ANDROID-to-simplify-preprocessor-guards.patch', - 'wpewebkit/0004-Android-Build-WebDriver-as-a-library.patch', - 'wpewebkit/0005-Android-Declare-namespace-when-building-WebDriver-as.patch', - 'wpewebkit/0006-WPE-Android-build-WebDriver-as-a-shared-library.patch', - 'wpewebkit/0007-Allow-setting-injected-bundle-and-inspector-lib-path.patch', - ] else: self.append_env('LDFLAGS', '-lrt') self.configure_options += ' -DCMAKE_SYSTEM_PROCESSOR=' + self.config.target_arch diff --git a/recipes/wpewebkit/0001-Make-UnixFileDescriptor-noncopyable-again.patch b/recipes/wpewebkit/0001-Make-UnixFileDescriptor-noncopyable-again.patch deleted file mode 100644 index ec2bd0914..000000000 --- a/recipes/wpewebkit/0001-Make-UnixFileDescriptor-noncopyable-again.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 51ba4d545f1bda0d4e5b06adca2f9ff1d1ed121a Mon Sep 17 00:00:00 2001 -From: Michael Catanzaro -Date: Thu, 17 Oct 2024 07:42:35 -0700 -Subject: [PATCH 1/7] Make UnixFileDescriptor noncopyable again - https://bugs.webkit.org/show_bug.cgi?id=281609 - -Reviewed by Carlos Garcia Campos. - -Make UnixFileDescriptor noncopyable again. Otherwise, it's very -difficult to use the class without accidentally duping the underlying -file descriptor. - -This is a partial revert of 272365@main. We can manually duplicate the -file descriptor in the SharedMemoryHandle copy constructor, since we -really do want a copy there. - -This un-reverts 261281@main. - -* Source/WTF/wtf/unix/UnixFileDescriptor.h: -* Source/WebCore/platform/SharedMemory.h: -* Source/WebCore/platform/unix/SharedMemoryUnix.cpp: -(WebCore::SharedMemoryHandle::SharedMemoryHandle): - -Canonical link: https://commits.webkit.org/285336@main ---- - Source/WTF/wtf/unix/UnixFileDescriptor.h | 10 ++++------ - Source/WebCore/platform/SharedMemory.h | 4 ++++ - Source/WebCore/platform/unix/SharedMemoryUnix.cpp | 6 ++++++ - 3 files changed, 14 insertions(+), 6 deletions(-) - -diff --git a/Source/WTF/wtf/unix/UnixFileDescriptor.h b/Source/WTF/wtf/unix/UnixFileDescriptor.h -index ffcfeb4581b2..422159723482 100644 ---- a/Source/WTF/wtf/unix/UnixFileDescriptor.h -+++ b/Source/WTF/wtf/unix/UnixFileDescriptor.h -@@ -35,6 +35,10 @@ namespace WTF { - - class UnixFileDescriptor { - public: -+ // This class is noncopyable because otherwise it's very hard to avoid accidental file -+ // descriptor duplication. If you intentionally want a dup, call the duplicate method. -+ WTF_MAKE_NONCOPYABLE(UnixFileDescriptor); -+ - UnixFileDescriptor() = default; - - enum AdoptionTag { Adopt }; -@@ -54,12 +58,6 @@ public: - m_value = o.release(); - } - -- explicit UnixFileDescriptor(const UnixFileDescriptor& o) -- { -- if (o.m_value >= 0) -- m_value = dupCloseOnExec(o.m_value); -- } -- - UnixFileDescriptor& operator=(UnixFileDescriptor&& o) - { - if (&o == this) -diff --git a/Source/WebCore/platform/SharedMemory.h b/Source/WebCore/platform/SharedMemory.h -index 19feabd1d6b7..f2e11f8c0a92 100644 ---- a/Source/WebCore/platform/SharedMemory.h -+++ b/Source/WebCore/platform/SharedMemory.h -@@ -66,7 +66,11 @@ public: - #endif - - SharedMemoryHandle(SharedMemoryHandle&&) = default; -+#if USE(UNIX_DOMAIN_SOCKETS) -+ explicit SharedMemoryHandle(const SharedMemoryHandle&); -+#else - explicit SharedMemoryHandle(const SharedMemoryHandle&) = default; -+#endif - WEBCORE_EXPORT SharedMemoryHandle(SharedMemoryHandle::Type&&, size_t); - - SharedMemoryHandle& operator=(SharedMemoryHandle&&) = default; -diff --git a/Source/WebCore/platform/unix/SharedMemoryUnix.cpp b/Source/WebCore/platform/unix/SharedMemoryUnix.cpp -index e4a63f02f3da..4d5985716a5d 100644 ---- a/Source/WebCore/platform/unix/SharedMemoryUnix.cpp -+++ b/Source/WebCore/platform/unix/SharedMemoryUnix.cpp -@@ -52,6 +52,12 @@ - - namespace WebCore { - -+SharedMemoryHandle::SharedMemoryHandle(const SharedMemoryHandle& handle) -+{ -+ m_handle = handle.m_handle.duplicate(); -+ m_size = handle.m_size; -+} -+ - UnixFileDescriptor SharedMemoryHandle::releaseHandle() - { - return WTFMove(m_handle); --- -2.43.0 - diff --git a/recipes/wpewebkit/0001-Revert-Use-UnixFileDescriptor-in-IPC-and-ProcessLaun.patch b/recipes/wpewebkit/0001-Revert-Use-UnixFileDescriptor-in-IPC-and-ProcessLaun.patch new file mode 100644 index 000000000..455c40a12 --- /dev/null +++ b/recipes/wpewebkit/0001-Revert-Use-UnixFileDescriptor-in-IPC-and-ProcessLaun.patch @@ -0,0 +1,365 @@ +From a3af77d70c445fce082a95bfc8398a89392b8dbb Mon Sep 17 00:00:00 2001 +From: Simon Pena +Date: Fri, 23 May 2025 13:29:21 +0100 +Subject: Revert "Use UnixFileDescriptor in IPC and ProcessLauncher" + +This reverts commit 0b420fd88a458a0ba19beeb53b6447b6bfdbbb1c. +--- + Source/WebKit/Platform/IPC/Connection.h | 16 +++---- + Source/WebKit/Platform/IPC/IPCUtilities.h | 8 +--- + .../Platform/IPC/unix/ConnectionUnix.cpp | 15 ++++--- + .../Shared/unix/AuxiliaryProcessMain.cpp | 4 +- + .../UIProcess/Launcher/ProcessLauncher.cpp | 2 +- + .../UIProcess/Launcher/ProcessLauncher.h | 1 + + .../Launcher/glib/ProcessLauncherGLib.cpp | 43 +++++++++++-------- + .../ProcessLauncherPlayStation.cpp | 16 ++++--- + 8 files changed, 55 insertions(+), 50 deletions(-) + +diff --git a/Source/WebKit/Platform/IPC/Connection.h b/Source/WebKit/Platform/IPC/Connection.h +index d2cb81c4d7cb..4866f6a3435b 100644 +--- a/Source/WebKit/Platform/IPC/Connection.h ++++ b/Source/WebKit/Platform/IPC/Connection.h +@@ -62,10 +62,6 @@ + #include + #endif + +-#if USE(UNIX_DOMAIN_SOCKETS) +-#include +-#endif +- + #if ENABLE(IPC_TESTING_API) + #include "MessageObserver.h" + #endif +@@ -267,15 +263,15 @@ public: + + #if USE(UNIX_DOMAIN_SOCKETS) + explicit Identifier(Handle&& handle) +- : Identifier({ handle.release(), UnixFileDescriptor::Adopt }) ++ : Identifier(handle.release()) + { + } +- explicit Identifier(UnixFileDescriptor&& fd) +- : handle(WTFMove(fd)) ++ explicit Identifier(int handle) ++ : handle(handle) + { + } +- operator bool() const { return !!handle; } +- UnixFileDescriptor handle; ++ operator bool() const { return handle != -1; } ++ int handle { -1 }; + #elif OS(WINDOWS) + explicit Identifier(Handle&& handle) + : Identifier(handle.leak()) +@@ -682,7 +678,7 @@ private: + GSocketMonitor m_readSocketMonitor; + GSocketMonitor m_writeSocketMonitor; + #else +- UnixFileDescriptor m_socketDescriptor; ++ int m_socketDescriptor; + #endif + #if PLATFORM(PLAYSTATION) + RefPtr m_socketMonitor; +diff --git a/Source/WebKit/Platform/IPC/IPCUtilities.h b/Source/WebKit/Platform/IPC/IPCUtilities.h +index 1b9827fa3bd1..701afa2f7cda 100644 +--- a/Source/WebKit/Platform/IPC/IPCUtilities.h ++++ b/Source/WebKit/Platform/IPC/IPCUtilities.h +@@ -31,10 +31,6 @@ + #include + #endif + +-#if USE(UNIX_DOMAIN_SOCKETS) +-#include +-#endif +- + namespace IPC { + + // Function to check when asserting IPC-related failures, so that IPC testing skips the assertions +@@ -53,8 +49,8 @@ inline bool isTestingIPC() + + #if USE(UNIX_DOMAIN_SOCKETS) + struct SocketPair { +- UnixFileDescriptor client; +- UnixFileDescriptor server; ++ int client; ++ int server; + }; + + enum PlatformConnectionOptions { +diff --git a/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp b/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp +index 3b5cee1501f4..16dd5679869c 100644 +--- a/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp ++++ b/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp +@@ -105,7 +105,7 @@ int Connection::socketDescriptor() const + #if USE(GLIB) + return g_socket_get_fd(m_socket.get()); + #else +- return m_socketDescriptor.value(); ++ return m_socketDescriptor; + #endif + } + +@@ -113,14 +113,14 @@ void Connection::platformInitialize(Identifier&& identifier) + { + #if USE(GLIB) + GUniqueOutPtr error; +- m_socket = adoptGRef(g_socket_new_from_fd(identifier.handle.release(), &error.outPtr())); ++ m_socket = adoptGRef(g_socket_new_from_fd(identifier.handle, &error.outPtr())); + if (!m_socket) { + // Note: g_socket_new_from_fd() takes ownership of the fd only on success, so if this error + // were not fatal, we would need to close it here. + g_error("Failed to adopt IPC::Connection socket: %s", error->message); + } + #else +- m_socketDescriptor = WTFMove(identifier.handle); ++ m_socketDescriptor = identifier.handle; + #endif + m_readBuffer.reserveInitialCapacity(messageMaxSize); + m_fileDescriptors.reserveInitialCapacity(attachmentMaxAmount); +@@ -129,7 +129,8 @@ void Connection::platformInitialize(Identifier&& identifier) + void Connection::platformInvalidate() + { + #if USE(GLIB) +- g_socket_close(m_socket.get(), nullptr); ++ // In the GLib platform the socket descriptor is owned by GSocket. ++ m_socket = nullptr; + #else + if (m_socketDescriptor.value() != -1) + closeWithRetry(m_socketDescriptor.release()); +@@ -588,7 +589,7 @@ SocketPair createPlatformConnection(unsigned options) + + setPasscredIfNeeded(); + +- return { { sockets[0], UnixFileDescriptor::Adopt }, { sockets[1], UnixFileDescriptor::Adopt } }; ++ return { sockets[0], sockets[1] }; + } + #endif + +@@ -601,13 +602,13 @@ SocketPair createPlatformConnection(unsigned options) + + setPasscredIfNeeded(); + +- return { { sockets[0], UnixFileDescriptor::Adopt }, { sockets[1], UnixFileDescriptor::Adopt } }; ++ return { sockets[0], sockets[1] }; + } + + std::optional Connection::createConnectionIdentifierPair() + { + SocketPair socketPair = createPlatformConnection(); +- return { { Identifier { WTFMove(socketPair.server) }, ConnectionHandle { WTFMove(socketPair.client) } } }; ++ return ConnectionIdentifierPair { Identifier { UnixFileDescriptor { socketPair.server, UnixFileDescriptor::Adopt } }, UnixFileDescriptor { socketPair.client, UnixFileDescriptor::Adopt } }; + } + + #if USE(GLIB) && OS(LINUX) +diff --git a/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp b/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp +index 7fcd22cd2172..854a777839e1 100644 +--- a/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp ++++ b/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp +@@ -66,11 +66,11 @@ WTF_ALLOW_UNSAFE_BUFFER_USAGE_END + return false; + + if (auto connectionIdentifier = parseInteger(unsafeSpan(argv[argIndex++]))) +- m_parameters.connectionIdentifier = IPC::Connection::Identifier { { *connectionIdentifier, UnixFileDescriptor::Adopt } }; ++ m_parameters.connectionIdentifier = IPC::Connection::Identifier { *connectionIdentifier }; + else + return false; + +- if (!m_parameters.processIdentifier->toRawValue() || m_parameters.connectionIdentifier.handle.value() <= 0) ++ if (!m_parameters.processIdentifier->toRawValue() || m_parameters.connectionIdentifier.handle <= 0) + return false; + + #if USE(GLIB) && OS(LINUX) +diff --git a/Source/WebKit/UIProcess/Launcher/ProcessLauncher.cpp b/Source/WebKit/UIProcess/Launcher/ProcessLauncher.cpp +index 9c2b47c319ab..27746ff38a51 100644 +--- a/Source/WebKit/UIProcess/Launcher/ProcessLauncher.cpp ++++ b/Source/WebKit/UIProcess/Launcher/ProcessLauncher.cpp +@@ -53,7 +53,7 @@ ProcessLauncher::~ProcessLauncher() + tracePoint(ProcessLaunchEnd, m_launchOptions.processIdentifier.toUInt64(), static_cast(m_launchOptions.processType)); + } + +-#if !PLATFORM(COCOA) ++#if !PLATFORM(COCOA) && !USE(GLIB) + void ProcessLauncher::platformDestroy() + { + } +diff --git a/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h b/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h +index 9a81048adce0..e3ba45fc4d68 100644 +--- a/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h ++++ b/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h +@@ -204,6 +204,7 @@ private: + + #if USE(GLIB) && OS(LINUX) + GSocketMonitor m_socketMonitor; ++ int m_pidServerSocket { -1 }; + #endif + }; + +diff --git a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp +index 272e0a6edea5..5558b9550daf 100644 +--- a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp ++++ b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp +@@ -55,6 +55,16 @@ + + namespace WebKit { + ++void ProcessLauncher::platformDestroy() ++{ ++#if OS(LINUX) ++ if (m_pidServerSocket != -1) { ++ close(m_pidServerSocket); ++ m_pidServerSocket = -1; ++ } ++#endif ++} ++ + #if OS(LINUX) + static bool isFlatpakSpawnUsable() + { +@@ -101,7 +111,7 @@ void ProcessLauncher::launchProcess() + GUniquePtr processIdentifier(g_strdup_printf("%" PRIu64, m_launchOptions.processIdentifier.toUInt64())); + + IPC::SocketPair webkitSocketPair = IPC::createPlatformConnection(connectionOptions()); +- GUniquePtr webkitSocket(g_strdup_printf("%d", webkitSocketPair.client.value())); ++ GUniquePtr webkitSocket(g_strdup_printf("%d", webkitSocketPair.client)); + + #if USE(LIBWPE) && !ENABLE(BUBBLEWRAP_SANDBOX) + if (ProcessProviderLibWPE::singleton().isEnabled()) { +@@ -114,13 +124,13 @@ void ProcessLauncher::launchProcess() + argv[i++] = nullptr; + WTF_ALLOW_UNSAFE_BUFFER_USAGE_END + +- m_processID = ProcessProviderLibWPE::singleton().launchProcess(m_launchOptions, argv, webkitSocketPair.client.value()); ++ m_processID = ProcessProviderLibWPE::singleton().launchProcess(m_launchOptions, argv, webkitSocketPair.client); + if (m_processID <= -1) + g_error("Unable to spawn a new child process"); + + // We've finished launching the process, message back to the main run loop. +- RunLoop::protectedMain()->dispatch([protectedThis = Ref { *this }, this, serverSocket = WTFMove(webkitSocketPair.server)] mutable { +- didFinishLaunchingProcess(m_processID, IPC::Connection::Identifier { WTFMove(serverSocket) }); ++ RunLoop::main().dispatch([protectedThis = Ref { *this }, this, serverSocket = webkitSocketPair.server] { ++ didFinishLaunchingProcess(m_processID, IPC::Connection::Identifier { serverSocket }); + }); + + return; +@@ -129,7 +139,7 @@ void ProcessLauncher::launchProcess() + + #if OS(LINUX) + IPC::SocketPair pidSocketPair = IPC::createPlatformConnection(IPC::PlatformConnectionOptions::SetCloexecOnClient | IPC::PlatformConnectionOptions::SetCloexecOnServer | IPC::PlatformConnectionOptions::SetPasscredOnServer); +- GUniquePtr pidSocketString(g_strdup_printf("%d", pidSocketPair.client.value())); ++ GUniquePtr pidSocketString(g_strdup_printf("%d", pidSocketPair.client)); + #endif + + String executablePath; +@@ -202,11 +212,9 @@ void ProcessLauncher::launchProcess() + // + // Please keep this comment in sync with the duplicate comment in XDGDBusProxy::launch. + GRefPtr launcher = adoptGRef(g_subprocess_launcher_new(G_SUBPROCESS_FLAGS_INHERIT_FDS)); +- int webkitClientSocketValue = webkitSocketPair.client.release(); +- g_subprocess_launcher_take_fd(launcher.get(), webkitClientSocketValue, webkitClientSocketValue); ++ g_subprocess_launcher_take_fd(launcher.get(), webkitSocketPair.client, webkitSocketPair.client); + #if OS(LINUX) +- int pidClientSocketValue = pidSocketPair.client.release(); +- g_subprocess_launcher_take_fd(launcher.get(), pidClientSocketValue, pidClientSocketValue); ++ g_subprocess_launcher_take_fd(launcher.get(), pidSocketPair.client, pidSocketPair.client); + #endif + + #if USE(SYSPROF_CAPTURE) +@@ -230,7 +238,7 @@ void ProcessLauncher::launchProcess() + bool sandboxEnabled = m_launchOptions.extraInitializationData.get("enable-sandbox"_s) == "true"_s; + + if (sandboxEnabled && isInsideFlatpak() && isFlatpakSpawnUsable()) +- process = flatpakSpawn(launcher.get(), m_launchOptions, argv, webkitClientSocketValue, pidClientSocketValue, &error.outPtr()); ++ process = flatpakSpawn(launcher.get(), m_launchOptions, argv, webkitSocketPair.client, pidSocketPair.client, &error.outPtr()); + #if ENABLE(BUBBLEWRAP_SANDBOX) + // You cannot use bubblewrap within Flatpak or some containers so lets ensure it never happens. + // Snap can allow it but has its own limitations that require workarounds. +@@ -245,16 +253,15 @@ void ProcessLauncher::launchProcess() + g_error("Unable to spawn a new child process: %s", error->message); + + #if OS(LINUX) +- GRefPtr pidSocket = adoptGRef(g_socket_new_from_fd(pidSocketPair.server.release(), &error.outPtr())); ++ GRefPtr pidSocket = adoptGRef(g_socket_new_from_fd(pidSocketPair.server, &error.outPtr())); + if (!pidSocket) +- // Note: g_socket_new_from_fd() takes ownership of the fd only on success, so if this error +- // were not fatal, we would need to close it here. + g_error("Failed to create pid socket wrapper: %s", error->message); + + // We need to get the pid of the actual WebKit auxiliary process, not the bwrap or flatpak-spawn + // intermediate process. And do it without blocking, because process launching is slow. + g_socket_set_blocking(pidSocket.get(), FALSE); +- m_socketMonitor.start(pidSocket.get(), G_IO_IN, RunLoop::main(), [protectedThis = Ref { *this }, this, pidSocket, serverSocket = WTFMove(webkitSocketPair.server)](GIOCondition condition) mutable -> gboolean { ++ m_pidServerSocket = webkitSocketPair.server; ++ m_socketMonitor.start(pidSocket.get(), G_IO_IN, RunLoop::main(), [protectedThis = Ref { *this }, this, pidSocket](GIOCondition condition) -> gboolean { + if (!(condition & G_IO_IN)) + g_error("Failed to read pid from child process"); + +@@ -263,7 +270,9 @@ void ProcessLauncher::launchProcess() + + m_socketMonitor.stop(); + +- didFinishLaunchingProcess(m_processID, IPC::Connection::Identifier { WTFMove(serverSocket) }); ++ didFinishLaunchingProcess(m_processID, IPC::Connection::Identifier { m_pidServerSocket }); ++ m_pidServerSocket = -1; ++ + return G_SOURCE_REMOVE; + }); + #else +@@ -274,8 +283,8 @@ void ProcessLauncher::launchProcess() + m_processID = g_ascii_strtoll(processIdStr, nullptr, 0); + RELEASE_ASSERT(m_processID); + +- RunLoop::protectedMain()->dispatch([protectedThis = Ref { *this }, this, serverSocket = WTFMove(webkitSocketPair.server)] mutable { +- didFinishLaunchingProcess(m_processID, IPC::Connection::Identifier { WTFMove(serverSocket) }); ++ RunLoop::main().dispatch([protectedThis = Ref { *this }, this, serverSocket = webkitSocketPair.server] { ++ didFinishLaunchingProcess(m_processID, IPC::Connection::Identifier { serverSocket }); + }); + #endif + } +diff --git a/Source/WebKit/UIProcess/Launcher/playstation/ProcessLauncherPlayStation.cpp b/Source/WebKit/UIProcess/Launcher/playstation/ProcessLauncherPlayStation.cpp +index b1d5c2dcb3fd..2c3ed2d8c0f0 100644 +--- a/Source/WebKit/UIProcess/Launcher/playstation/ProcessLauncherPlayStation.cpp ++++ b/Source/WebKit/UIProcess/Launcher/playstation/ProcessLauncherPlayStation.cpp +@@ -64,12 +64,12 @@ void ProcessLauncher::launchProcess() + IPC::SocketPair socketPair = IPC::createPlatformConnection(IPC::PlatformConnectionOptions::SetCloexecOnServer); + + int sendBufSize = 32 * 1024; +- setsockopt(socketPair.server.value(), SOL_SOCKET, SO_SNDBUF, &sendBufSize, 4); +- setsockopt(socketPair.client.value(), SOL_SOCKET, SO_SNDBUF, &sendBufSize, 4); ++ setsockopt(socketPair.server, SOL_SOCKET, SO_SNDBUF, &sendBufSize, 4); ++ setsockopt(socketPair.client, SOL_SOCKET, SO_SNDBUF, &sendBufSize, 4); + + int recvBufSize = 32 * 1024; +- setsockopt(socketPair.server.value(), SOL_SOCKET, SO_RCVBUF, &recvBufSize, 4); +- setsockopt(socketPair.client.value(), SOL_SOCKET, SO_RCVBUF, &recvBufSize, 4); ++ setsockopt(socketPair.server, SOL_SOCKET, SO_RCVBUF, &recvBufSize, 4); ++ setsockopt(socketPair.client, SOL_SOCKET, SO_RCVBUF, &recvBufSize, 4); + + char coreProcessIdentifierString[16]; + snprintf(coreProcessIdentifierString, sizeof coreProcessIdentifierString, "%ld", m_launchOptions.processIdentifier.toUInt64()); +@@ -82,7 +82,7 @@ void ProcessLauncher::launchProcess() + #if USE(WPE_BACKEND_PLAYSTATION) + auto appLocalPid = ProcessProviderLibWPE::singleton().launchProcess(m_launchOptions, argv, socketPair.client.value()); + #else +- PlayStation::LaunchParam param { socketPair.client.value(), m_launchOptions.userId }; ++ PlayStation::LaunchParam param { socketPair.client, m_launchOptions.userId }; + int32_t appLocalPid = PlayStation::launchProcess( + !m_launchOptions.processPath.isEmpty() ? m_launchOptions.processPath.utf8().data() : defaultProcessPath(m_launchOptions.processType), + argv, param); +@@ -94,10 +94,12 @@ void ProcessLauncher::launchProcess() + #endif + return; + } ++ close(socketPair.client); + + // We've finished launching the process, message back to the main run loop. +- RunLoop::protectedMain()->dispatch([protectedThis = Ref { *this }, appLocalPid, serverIdentifier = WTFMove(socketPair.server)] mutable { +- protectedThis->didFinishLaunchingProcess(appLocalPid, IPC::Connection::Identifier { WTFMove(serverIdentifier) }); ++ RefPtr protectedThis(this); ++ RunLoop::main().dispatch([=] { ++ protectedThis->didFinishLaunchingProcess(appLocalPid, IPC::Connection::Identifier { socketPair.server }); + }); + } + +-- +2.49.0 + diff --git a/recipes/wpewebkit/0002-WPE-Use-ASharedMemory-when-targeting-Android.patch b/recipes/wpewebkit/0002-WPE-Use-ASharedMemory-when-targeting-Android.patch deleted file mode 100644 index c27334be6..000000000 --- a/recipes/wpewebkit/0002-WPE-Use-ASharedMemory-when-targeting-Android.patch +++ /dev/null @@ -1,243 +0,0 @@ -From d18c02cd1db190cdb75908896214ddbaac774528 Mon Sep 17 00:00:00 2001 -From: Adrian Perez de Castro -Date: Fri, 11 Apr 2025 09:07:56 -0700 -Subject: [PATCH 2/7] [WPE] Use ASharedMemory when targeting Android - https://bugs.webkit.org/show_bug.cgi?id=290210 - -Reviewed by Carlos Garcia Campos. - -When targeting Android use the ASharedMemory API to create shared memory -buffers and to adjust their protection bits. OS(ANDROID) guards ensure -that only the new implementation gets built. - -* Source/WebCore/SourcesWPE.txt: List new SharedMemoryAndroid.cpp source. -* Source/WebCore/platform/android/SharedMemoryAndroid.cpp: Added, based -on the code from SharedMemoryUnix.cpp but using ASharedMemory instead. -(WebCore::SharedMemoryHandle::SharedMemoryHandle): -(WebCore::SharedMemoryHandle::releaseHandle): -(WebCore::accessModeMMap): -(WebCore::createSharedMemory): -(WebCore::SharedMemory::allocate): -(WebCore::SharedMemory::map): -(WebCore::SharedMemory::wrapMap): -(WebCore::SharedMemory::~SharedMemory): -(WebCore::SharedMemory::createHandle): -* Source/WebCore/platform/unix/SharedMemoryUnix.cpp: - -Canonical link: https://commits.webkit.org/293579@main ---- - Source/WebCore/SourcesWPE.txt | 2 + - .../platform/android/SharedMemoryAndroid.cpp | 168 ++++++++++++++++++ - .../platform/unix/SharedMemoryUnix.cpp | 4 +- - 3 files changed, 172 insertions(+), 2 deletions(-) - create mode 100644 Source/WebCore/platform/android/SharedMemoryAndroid.cpp - -diff --git a/Source/WebCore/SourcesWPE.txt b/Source/WebCore/SourcesWPE.txt -index e5563386b87a..e76d2dca9691 100644 ---- a/Source/WebCore/SourcesWPE.txt -+++ b/Source/WebCore/SourcesWPE.txt -@@ -87,6 +87,8 @@ platform/libwpe/PlatformPasteboardLibWPE.cpp - platform/text/Hyphenation.cpp - platform/text/LocaleICU.cpp - -+platform/android/SharedMemoryAndroid.cpp -+ - platform/unix/LoggingUnix.cpp - platform/unix/SharedMemoryUnix.cpp - -diff --git a/Source/WebCore/platform/android/SharedMemoryAndroid.cpp b/Source/WebCore/platform/android/SharedMemoryAndroid.cpp -new file mode 100644 -index 000000000000..cdd4bdbbb979 ---- /dev/null -+++ b/Source/WebCore/platform/android/SharedMemoryAndroid.cpp -@@ -0,0 +1,168 @@ -+/* -+ * Copyright (C) 2025 Igalia S.L. -+ * Copyright (C) 2010 Apple Inc. All rights reserved. -+ * Copyright (c) 2010 University of Szeged -+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -+ * THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#include "config.h" -+#include "SharedMemory.h" -+ -+#if OS(ANDROID) -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+namespace WebCore { -+ -+SharedMemoryHandle::SharedMemoryHandle(const SharedMemoryHandle& handle) -+{ -+ m_handle = handle.m_handle.duplicate(); -+ m_size = handle.m_size; -+} -+ -+UnixFileDescriptor SharedMemoryHandle::releaseHandle() -+{ -+ return WTFMove(m_handle); -+} -+ -+static inline int accessModeMMap(SharedMemory::Protection protection) -+{ -+ switch (protection) { -+ case SharedMemory::Protection::ReadOnly: -+ return PROT_READ; -+ case SharedMemory::Protection::ReadWrite: -+ return PROT_READ | PROT_WRITE; -+ } -+ -+ ASSERT_NOT_REACHED(); -+ return PROT_READ | PROT_WRITE; -+} -+ -+static UnixFileDescriptor createSharedMemory(size_t size) -+{ -+ const auto name = makeString("/WK2SharedMemory."_s, cryptographicallyRandomNumber()); -+ int fileDescriptor = ASharedMemory_create(name.utf8().data(), size); -+ return UnixFileDescriptor { fileDescriptor, UnixFileDescriptor::Adopt }; -+} -+ -+RefPtr SharedMemory::allocate(size_t size) -+{ -+ auto fileDescriptor = createSharedMemory(size); -+ if (!fileDescriptor) { -+ WTFLogAlways("Failed to create shared memory: %s", safeStrerror(errno).data()); -+ return nullptr; -+ } -+ -+ if (ASharedMemory_setProt(fileDescriptor.value(), PROT_READ | PROT_WRITE) == -1) { -+ WTFLogAlways("Failed to set ASharedMemory protection: %s", safeStrerror(errno).data()); -+ return nullptr; -+ } -+ -+ void* data = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileDescriptor.value(), 0); -+ if (data == MAP_FAILED) -+ return nullptr; -+ -+ RefPtr instance = adoptRef(new SharedMemory()); -+ instance->m_data = data; -+ instance->m_fileDescriptor = WTFMove(fileDescriptor); -+ instance->m_size = size; -+ return instance; -+} -+ -+RefPtr SharedMemory::map(Handle&& handle, Protection protection) -+{ -+ void* data = mmap(0, handle.size(), accessModeMMap(protection), MAP_SHARED, handle.m_handle.value(), 0); -+ if (data == MAP_FAILED) -+ return nullptr; -+ -+ RefPtr instance = adoptRef(new SharedMemory()); -+ instance->m_data = data; -+ instance->m_size = handle.size(); -+ return instance; -+} -+ -+RefPtr SharedMemory::wrapMap(void* data, size_t size, int fileDescriptor) -+{ -+ RefPtr instance = adoptRef(new SharedMemory()); -+ instance->m_data = data; -+ instance->m_size = size; -+ instance->m_fileDescriptor = UnixFileDescriptor { fileDescriptor, UnixFileDescriptor::Adopt }; -+ instance->m_isWrappingMap = true; -+ return instance; -+} -+ -+SharedMemory::~SharedMemory() -+{ -+ if (m_isWrappingMap) { -+ auto wrapped = m_fileDescriptor.release(); -+ UNUSED_VARIABLE(wrapped); -+ return; -+ } -+ -+ munmap(m_data, m_size); -+} -+ -+auto SharedMemory::createHandle([[maybe_unused]] Protection protection) -> std::optional -+{ -+ UnixFileDescriptor duplicate { m_fileDescriptor.value(), UnixFileDescriptor::Duplicate }; -+ if (!duplicate) { -+ ASSERT_NOT_REACHED(); -+ return std::nullopt; -+ } -+ -+ int protectionMode; -+ switch (protection) { -+ case SharedMemory::Protection::ReadOnly: -+ protectionMode = PROT_READ; -+ break; -+ case SharedMemory::Protection::ReadWrite: -+ protectionMode = PROT_WRITE; -+ break; -+ } -+ -+ if (ASharedMemory_setProt(duplicate.value(), protectionMode) == -1) { -+ ASSERT_NOT_REACHED(); -+ return std::nullopt; -+ } -+ -+ return { Handle(WTFMove(duplicate), m_size) }; -+} -+ -+} // namespace WebCore -+ -+#endif // OS(ANDROID) -diff --git a/Source/WebCore/platform/unix/SharedMemoryUnix.cpp b/Source/WebCore/platform/unix/SharedMemoryUnix.cpp -index 4d5985716a5d..fe2bbaf946ad 100644 ---- a/Source/WebCore/platform/unix/SharedMemoryUnix.cpp -+++ b/Source/WebCore/platform/unix/SharedMemoryUnix.cpp -@@ -28,7 +28,7 @@ - #include "config.h" - #include "SharedMemory.h" - --#if USE(UNIX_DOMAIN_SOCKETS) -+#if USE(UNIX_DOMAIN_SOCKETS) && !OS(ANDROID) - - #include - #include -@@ -191,4 +191,4 @@ auto SharedMemory::createHandle(Protection) -> std::optional - - } // namespace WebCore - --#endif -+#endif // !OS(ANDROID) && USE(UNIX_DOMAIN_SOCKETS) --- -2.43.0 - diff --git a/recipes/wpewebkit/0003-Introduce-OS-ANDROID-to-simplify-preprocessor-guards.patch b/recipes/wpewebkit/0003-Introduce-OS-ANDROID-to-simplify-preprocessor-guards.patch deleted file mode 100644 index 2d619d483..000000000 --- a/recipes/wpewebkit/0003-Introduce-OS-ANDROID-to-simplify-preprocessor-guards.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 4c16dc70ca59ec0ae903748e756c2701b1673479 Mon Sep 17 00:00:00 2001 -From: Adrian Perez de Castro -Date: Wed, 2 Apr 2025 06:18:23 -0700 -Subject: [PATCH 3/7] Introduce OS(ANDROID) to simplify preprocessor guards - https://bugs.webkit.org/show_bug.cgi?id=290913 - -Reviewed by Carlos Garcia Campos. - -Introduce a new WTF_OS_ANDROID macro, and use OS(ANDROID) guards -to replace (and simplify) the existing ones. - -* Source/WTF/wtf/PlatformOS.h: -* Source/WebCore/platform/graphics/angle/PlatformDisplayANGLE.cpp: -(WebCore::PlatformDisplay::angleEGLDisplay const): -* Source/WebCore/platform/graphics/skia/FontCacheSkia.cpp: -(WebCore::FontCache::fontManager const): - -Canonical link: https://commits.webkit.org/293096@main ---- - Source/WTF/wtf/PlatformOS.h | 5 +++++ - .../platform/graphics/angle/PlatformDisplayANGLE.cpp | 2 +- - Source/WebCore/platform/graphics/skia/FontCacheSkia.cpp | 7 +++++-- - 3 files changed, 11 insertions(+), 3 deletions(-) - -diff --git a/Source/WTF/wtf/PlatformOS.h b/Source/WTF/wtf/PlatformOS.h -index a1cc02412378..406785cf8b4a 100644 ---- a/Source/WTF/wtf/PlatformOS.h -+++ b/Source/WTF/wtf/PlatformOS.h -@@ -52,6 +52,11 @@ - #define WTF_OS_AIX 1 - #endif - -+/* OS(ANDROID) - Android */ -+#if defined(__ANDROID__) || defined(ANDROID) -+#define WTF_OS_ANDROID 1 -+#endif -+ - /* OS(DARWIN) - Any Darwin-based OS, including macOS, iOS, iPadOS, macCatalyst, tvOS, watchOS and visionOS */ - #if defined(__APPLE__) - #define WTF_OS_DARWIN 1 -diff --git a/Source/WebCore/platform/graphics/angle/PlatformDisplayANGLE.cpp b/Source/WebCore/platform/graphics/angle/PlatformDisplayANGLE.cpp -index a6959bf5afd0..10643eac40e2 100644 ---- a/Source/WebCore/platform/graphics/angle/PlatformDisplayANGLE.cpp -+++ b/Source/WebCore/platform/graphics/angle/PlatformDisplayANGLE.cpp -@@ -44,7 +44,7 @@ EGLDisplay PlatformDisplay::angleEGLDisplay() const - - Vector displayAttributes { - EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE, --#if !defined(__ANDROID__) && !defined(ANDROID) -+#if !OS(ANDROID) - EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE, - EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE, m_anglePlatform.value(), - #endif -diff --git a/Source/WebCore/platform/graphics/skia/FontCacheSkia.cpp b/Source/WebCore/platform/graphics/skia/FontCacheSkia.cpp -index 92a88f6b5691..48410a334ff7 100644 ---- a/Source/WebCore/platform/graphics/skia/FontCacheSkia.cpp -+++ b/Source/WebCore/platform/graphics/skia/FontCacheSkia.cpp -@@ -29,8 +29,11 @@ - #include "Font.h" - #include "FontDescription.h" - #include "StyleFontSizeFunctions.h" --#if defined(__ANDROID__) || defined(ANDROID) -+#if OS(ANDROID) - #include -+#elif PLATFORM(WIN) -+#include -+#include - #else - #include - #endif -@@ -52,7 +55,7 @@ void FontCache::platformInit() - SkFontMgr& FontCache::fontManager() const - { - if (!m_fontManager) { --#if defined(__ANDROID__) || defined(ANDROID) -+#if OS(ANDROID) - m_fontManager = SkFontMgr_New_Android(nullptr); - #else - m_fontManager = SkFontMgr_New_FontConfig(FcConfigReference(nullptr)); --- -2.43.0 - diff --git a/recipes/wpewebkit/0004-Android-Build-WebDriver-as-a-library.patch b/recipes/wpewebkit/0004-Android-Build-WebDriver-as-a-library.patch deleted file mode 100644 index bd7bcda77..000000000 --- a/recipes/wpewebkit/0004-Android-Build-WebDriver-as-a-library.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 726d18b313f64fc079e00518a1277f5ce58767b3 Mon Sep 17 00:00:00 2001 -From: Adrian Perez de Castro -Date: Fri, 11 Apr 2025 15:09:35 -0700 -Subject: [PATCH 4/7] [Android] Build WebDriver as a library - https://bugs.webkit.org/show_bug.cgi?id=290921 - -Reviewed by Michael Catanzaro. - -On Android processes are spawned from the Java side, which dynamically -loads the libWebDriver.so shared object and calls into its entry point -from Java through JNI. Therefore, setup the CMake build to build a -shared library, and rename the entry point to WebKit::WebDriverProcessMain. - -* Source/WebDriver/CMakeLists.txt: Arrange to compile the WebDriver -target as a shared library when building the WPE port for Android. -* Source/WebDriver/WebDriverMain.cpp: -(main): Use WebKit::WebDriverProcessMain as entry point name under OS(ANDROID). - -Canonical link: https://commits.webkit.org/293601@main ---- - Source/WebDriver/CMakeLists.txt | 10 ++++++++-- - Source/WebDriver/WebDriverMain.cpp | 11 +++++++++++ - 2 files changed, 19 insertions(+), 2 deletions(-) - -diff --git a/Source/WebDriver/CMakeLists.txt b/Source/WebDriver/CMakeLists.txt -index 2ce0c46d4086..d2339c975b5b 100644 ---- a/Source/WebDriver/CMakeLists.txt -+++ b/Source/WebDriver/CMakeLists.txt -@@ -60,13 +60,19 @@ MAKE_JS_FILE_ARRAYS( - ) - list(APPEND WebDriver_SOURCES ${WebDriver_DERIVED_SOURCES_DIR}/WebDriverAtoms.cpp) - --WEBKIT_EXECUTABLE_DECLARE(WebDriver) -+if (ANDROID AND (PORT STREQUAL WPE)) -+ set(WebDriver_TARGET_TYPE LIBRARY) -+else () -+ set(WebDriver_TARGET_TYPE EXECUTABLE) -+endif () -+ -+cmake_language(CALL "WEBKIT_${WebDriver_TARGET_TYPE}_DECLARE" WebDriver) - - add_dependencies(WebDriver JavaScriptCoreSharedScripts) - - WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS() - --WEBKIT_EXECUTABLE(WebDriver) -+cmake_language(CALL "WEBKIT_${WebDriver_TARGET_TYPE}" WebDriver) - - install(TARGETS WebDriver - RUNTIME DESTINATION "${EXEC_INSTALL_DIR}" -diff --git a/Source/WebDriver/WebDriverMain.cpp b/Source/WebDriver/WebDriverMain.cpp -index cbe30a6f434a..df15263697a4 100644 ---- a/Source/WebDriver/WebDriverMain.cpp -+++ b/Source/WebDriver/WebDriverMain.cpp -@@ -29,7 +29,18 @@ - #include - #include - -+// -+// On Android, WebDriver is built as a shared library, and the process is spawned -+// from the Java side, which calls into a C++ function using JNI, and that in turn -+// jumps into the entry point. The mangled name is used directly, from the code at -+// https://github.com/Igalia/wpe-android/blob/b918e3f8b86eda406436cb251c2e7b10a529008c/wpeview/src/main/cpp/Service/EntryPoint.cpp#L55 -+// -+#if OS(ANDROID) -+__attribute__((visibility("default"))) -+int WebKit::WebDriverProcessMain(int argc, char** argv) -+#else - int main(int argc, char** argv) -+#endif - { - WebDriver::WebDriverService::platformInit(); - --- -2.43.0 - diff --git a/recipes/wpewebkit/0005-Android-Declare-namespace-when-building-WebDriver-as.patch b/recipes/wpewebkit/0005-Android-Declare-namespace-when-building-WebDriver-as.patch deleted file mode 100644 index 63752970e..000000000 --- a/recipes/wpewebkit/0005-Android-Declare-namespace-when-building-WebDriver-as.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 82971b5e74509561afab748c3cedf9bab909d76b Mon Sep 17 00:00:00 2001 -From: Simon Pena -Date: Fri, 25 Apr 2025 06:28:05 -0700 -Subject: [PATCH 5/7] [Android] Declare namespace when building WebDriver as a - library https://bugs.webkit.org/show_bug.cgi?id=292008 - -Reviewed by Michael Catanzaro and Adrian Perez de Castro. - -When building WebDriver as a library on Android, ensure the WebKit -namespace is declared. - -* Source/WebDriver/WebDriverMain.cpp: moved entry point - WebDriverProcessMain into WebKit namespace. - -Canonical link: https://commits.webkit.org/294105@main ---- - Source/WebDriver/WebDriverMain.cpp | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/Source/WebDriver/WebDriverMain.cpp b/Source/WebDriver/WebDriverMain.cpp -index df15263697a4..dd3b0286442d 100644 ---- a/Source/WebDriver/WebDriverMain.cpp -+++ b/Source/WebDriver/WebDriverMain.cpp -@@ -36,8 +36,9 @@ - // https://github.com/Igalia/wpe-android/blob/b918e3f8b86eda406436cb251c2e7b10a529008c/wpeview/src/main/cpp/Service/EntryPoint.cpp#L55 - // - #if OS(ANDROID) -+namespace WebKit { - __attribute__((visibility("default"))) --int WebKit::WebDriverProcessMain(int argc, char** argv) -+int WebDriverProcessMain(int argc, char** argv) - #else - int main(int argc, char** argv) - #endif -@@ -49,3 +50,6 @@ int main(int argc, char** argv) - WebDriver::WebDriverService service; - return service.run(argc, argv); - } -+#if OS(ANDROID) -+} -+#endif --- -2.43.0 - diff --git a/recipes/wpewebkit/0006-WPE-Android-build-WebDriver-as-a-shared-library.patch b/recipes/wpewebkit/0006-WPE-Android-build-WebDriver-as-a-shared-library.patch deleted file mode 100644 index 8455c1e8c..000000000 --- a/recipes/wpewebkit/0006-WPE-Android-build-WebDriver-as-a-shared-library.patch +++ /dev/null @@ -1,30 +0,0 @@ -From a8eb11f56089844fc3a09548044afd163541d102 Mon Sep 17 00:00:00 2001 -From: Simon Pena -Date: Fri, 9 May 2025 15:14:36 +0100 -Subject: [PATCH 6/7] [WPE] Android: build WebDriver as a shared library - https://bugs.webkit.org/show_bug.cgi?id=292770 - -Reviewed by NOBODY (OOPS!). - -When building WebDriver on Android, make sure it uses a shared library. - -* Source/WebDriver/CMakeLists.txt: ---- - Source/WebDriver/CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Source/WebDriver/CMakeLists.txt b/Source/WebDriver/CMakeLists.txt -index d2339c975b5b..ae24a7650696 100644 ---- a/Source/WebDriver/CMakeLists.txt -+++ b/Source/WebDriver/CMakeLists.txt -@@ -62,6 +62,7 @@ list(APPEND WebDriver_SOURCES ${WebDriver_DERIVED_SOURCES_DIR}/WebDriverAtoms.cp - - if (ANDROID AND (PORT STREQUAL WPE)) - set(WebDriver_TARGET_TYPE LIBRARY) -+ set(WebDriver_LIBRARY_TYPE SHARED) - else () - set(WebDriver_TARGET_TYPE EXECUTABLE) - endif () --- -2.43.0 - diff --git a/recipes/wpewebkit/0007-Allow-setting-injected-bundle-and-inspector-lib-path.patch b/recipes/wpewebkit/0007-Allow-setting-injected-bundle-and-inspector-lib-path.patch deleted file mode 100644 index 1ae601809..000000000 --- a/recipes/wpewebkit/0007-Allow-setting-injected-bundle-and-inspector-lib-path.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 86063734c12ec7d4fa74d3e0f9d7b86159c9d557 Mon Sep 17 00:00:00 2001 -From: Jani Hautakangas -Date: Thu, 24 Mar 2022 09:41:17 +0200 -Subject: [PATCH 7/7] Allow setting injected bundle and inspector lib paths in - non dev mode - ---- - .../inspector/remote/glib/RemoteInspectorUtils.cpp | 4 ++-- - Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp | 2 -- - 2 files changed, 2 insertions(+), 4 deletions(-) - -diff --git a/Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorUtils.cpp b/Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorUtils.cpp -index 04a49a2af4b5..c394cb86554a 100644 ---- a/Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorUtils.cpp -+++ b/Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorUtils.cpp -@@ -43,13 +43,13 @@ GRefPtr backendCommands() - static std::once_flag flag; - std::call_once(flag, [] { - const char* libDir = PKGLIBDIR; --#if ENABLE(DEVELOPER_MODE) -+ - // Probably no need for a specific env var here. Assume the inspector resources.so file is - // in the same directory as the injected bundle lib, for developer builds. - const char* path = g_getenv("WEBKIT_INJECTED_BUNDLE_PATH"); - if (path && g_file_test(path, G_FILE_TEST_IS_DIR)) - libDir = path; --#endif -+ - GUniquePtr bundleFilename(g_build_filename(libDir, "libWPEWebInspectorResources.so", nullptr)); - GModule* resourcesModule = g_module_open(bundleFilename.get(), G_MODULE_BIND_LAZY); - if (!resourcesModule) { -diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp -index 65cf0eb2b99a..f34220b0e762 100644 ---- a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp -+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp -@@ -337,11 +337,9 @@ void webkitWebContextWillCloseAutomationSession(WebKitWebContext* webContext) - - static const char* injectedBundleDirectory() - { --#if ENABLE(DEVELOPER_MODE) - const char* bundleDirectory = g_getenv("WEBKIT_INJECTED_BUNDLE_PATH"); - if (bundleDirectory && g_file_test(bundleDirectory, G_FILE_TEST_IS_DIR)) - return bundleDirectory; --#endif - - static const char* injectedBundlePath = PKGLIBDIR G_DIR_SEPARATOR_S "injected-bundle" G_DIR_SEPARATOR_S; - return injectedBundlePath; --- -2.43.0 -