Message ID | 20250623071834.38955-1-barnabas.pocze@ideasonboard.com |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi Barnabás, Thank you for the patch. On Mon, Jun 23, 2025 at 09:18:34AM +0200, Barnabás Pőcze wrote: > Use the libyaml wrap file from the meson wrapdb instead of > creating the wrap file manually and using the cmake module. > This provides better integration with meson, such as the > `force_fallback_for` built-in option. > > The `werror=false` needs to be set when the subproject is > used because libyaml does not compile without warnings, > and that would abort the build process otherwise. > > This is also needed because the upstream CMakeLists.txt is > out of date, failing with a sufficiently new cmake version: > > CMake Error at CMakeLists.txt:2 (cmake_minimum_required): > Compatibility with CMake < 3.5 has been removed from CMake. > > The above is nonetheless addressed by https://github.com/yaml/libyaml/pull/314, > but the project seems a bit inactive at the moment. > > The wrap file was added using `meson wrap install libyaml`, > and it can be updated using `meson wrap update libyaml`. > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > --- > src/libcamera/meson.build | 15 +++------------ > subprojects/libyaml.wrap | 16 ++++++++++------ > 2 files changed, 13 insertions(+), 18 deletions(-) > > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build > index 28a3b0f36..9f782e729 100644 > --- a/src/libcamera/meson.build > +++ b/src/libcamera/meson.build > @@ -84,7 +84,9 @@ if not cc.has_function('dlopen') > libdl = cc.find_library('dl') > endif > libudev = dependency('libudev', required : get_option('udev')) > -libyaml = dependency('yaml-0.1', required : false) > +libyaml = dependency('yaml-0.1', default_options : [ > + 'werror=false', > +]) > > # Use one of gnutls or libcrypto (provided by OpenSSL), trying gnutls first. > libcrypto = dependency('gnutls', required : false) > @@ -120,17 +122,6 @@ if libudev.found() > ]) > endif > > -# Fallback to a subproject if libyaml isn't found, as it's not packaged in AOSP. > -if not libyaml.found() > - cmake = import('cmake') > - > - libyaml_vars = cmake.subproject_options() > - libyaml_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'}) > - libyaml_vars.append_compile_args('c', '-Wno-unused-value') > - libyaml_wrap = cmake.subproject('libyaml', options : libyaml_vars) > - libyaml = libyaml_wrap.dependency('yaml') > -endif > - > control_sources = [] > > controls_mode_files = { > diff --git a/subprojects/libyaml.wrap b/subprojects/libyaml.wrap > index 392416c61..85d9af44e 100644 > --- a/subprojects/libyaml.wrap > +++ b/subprojects/libyaml.wrap > @@ -1,7 +1,11 @@ > -# SPDX-License-Identifier: CC0-1.0 I'm still concerned by dropping the SPDX tag. Can we either keep it or document the license through .reuse/dep5 ? I would prefer the former, even if it means manual work when updating the wrap file, as it's better to keep license information in the files the license applies to. > +[wrap-file] > +directory = yaml-0.2.5 > +source_url = https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz > +source_filename = yaml-0.2.5.tar.gz > +source_hash = c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4 > +patch_filename = libyaml_0.2.5-1_patch.zip > +patch_url = https://wrapdb.mesonbuild.com/v2/libyaml_0.2.5-1/get_patch > +patch_hash = bf2e9b922be00b6b00c5fce29d9fb8dc83f0431c77239f3b73e8b254d3f3f5b5 > > -[wrap-git] > -directory = libyaml > -url = https://github.com/yaml/libyaml > -# tags/0.2.5 > -revision = 2c891fc7a770e8ba2fec34fc6b545c672beb37e6 > +[provide] > +yaml-0.1 = yaml_dep
Hi 2025. 06. 23. 16:07 keltezéssel, Laurent Pinchart írta: > Hi Barnabás, > > Thank you for the patch. > > On Mon, Jun 23, 2025 at 09:18:34AM +0200, Barnabás Pőcze wrote: >> Use the libyaml wrap file from the meson wrapdb instead of >> creating the wrap file manually and using the cmake module. >> This provides better integration with meson, such as the >> `force_fallback_for` built-in option. >> >> The `werror=false` needs to be set when the subproject is >> used because libyaml does not compile without warnings, >> and that would abort the build process otherwise. >> >> This is also needed because the upstream CMakeLists.txt is >> out of date, failing with a sufficiently new cmake version: >> >> CMake Error at CMakeLists.txt:2 (cmake_minimum_required): >> Compatibility with CMake < 3.5 has been removed from CMake. >> >> The above is nonetheless addressed by https://github.com/yaml/libyaml/pull/314, >> but the project seems a bit inactive at the moment. >> >> The wrap file was added using `meson wrap install libyaml`, >> and it can be updated using `meson wrap update libyaml`. >> >> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> >> --- >> src/libcamera/meson.build | 15 +++------------ >> subprojects/libyaml.wrap | 16 ++++++++++------ >> 2 files changed, 13 insertions(+), 18 deletions(-) >> >> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build >> index 28a3b0f36..9f782e729 100644 >> --- a/src/libcamera/meson.build >> +++ b/src/libcamera/meson.build >> @@ -84,7 +84,9 @@ if not cc.has_function('dlopen') >> libdl = cc.find_library('dl') >> endif >> libudev = dependency('libudev', required : get_option('udev')) >> -libyaml = dependency('yaml-0.1', required : false) >> +libyaml = dependency('yaml-0.1', default_options : [ >> + 'werror=false', >> +]) >> >> # Use one of gnutls or libcrypto (provided by OpenSSL), trying gnutls first. >> libcrypto = dependency('gnutls', required : false) >> @@ -120,17 +122,6 @@ if libudev.found() >> ]) >> endif >> >> -# Fallback to a subproject if libyaml isn't found, as it's not packaged in AOSP. >> -if not libyaml.found() >> - cmake = import('cmake') >> - >> - libyaml_vars = cmake.subproject_options() >> - libyaml_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'}) >> - libyaml_vars.append_compile_args('c', '-Wno-unused-value') >> - libyaml_wrap = cmake.subproject('libyaml', options : libyaml_vars) >> - libyaml = libyaml_wrap.dependency('yaml') >> -endif >> - >> control_sources = [] >> >> controls_mode_files = { >> diff --git a/subprojects/libyaml.wrap b/subprojects/libyaml.wrap >> index 392416c61..85d9af44e 100644 >> --- a/subprojects/libyaml.wrap >> +++ b/subprojects/libyaml.wrap >> @@ -1,7 +1,11 @@ >> -# SPDX-License-Identifier: CC0-1.0 > > I'm still concerned by dropping the SPDX tag. Can we either keep it or > document the license through .reuse/dep5 ? I would prefer the former, > even if it means manual work when updating the wrap file, as it's better > to keep license information in the files the license applies to. Okay. But which license is appropriate? https://github.com/mesonbuild/wrapdb/issues/2213#issuecomment-2994828556 would suggest that they are not considered copyrightable. Regards, Barnabás Pőcze > >> +[wrap-file] >> +directory = yaml-0.2.5 >> +source_url = https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz >> +source_filename = yaml-0.2.5.tar.gz >> +source_hash = c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4 >> +patch_filename = libyaml_0.2.5-1_patch.zip >> +patch_url = https://wrapdb.mesonbuild.com/v2/libyaml_0.2.5-1/get_patch >> +patch_hash = bf2e9b922be00b6b00c5fce29d9fb8dc83f0431c77239f3b73e8b254d3f3f5b5 >> >> -[wrap-git] >> -directory = libyaml >> -url = https://github.com/yaml/libyaml >> -# tags/0.2.5 >> -revision = 2c891fc7a770e8ba2fec34fc6b545c672beb37e6 >> +[provide] >> +yaml-0.1 = yaml_dep >
On Mon, Jun 23, 2025 at 04:13:51PM +0200, Barnabás Pőcze wrote: > 2025. 06. 23. 16:07 keltezéssel, Laurent Pinchart írta: > > On Mon, Jun 23, 2025 at 09:18:34AM +0200, Barnabás Pőcze wrote: > >> Use the libyaml wrap file from the meson wrapdb instead of > >> creating the wrap file manually and using the cmake module. > >> This provides better integration with meson, such as the > >> `force_fallback_for` built-in option. > >> > >> The `werror=false` needs to be set when the subproject is > >> used because libyaml does not compile without warnings, > >> and that would abort the build process otherwise. > >> > >> This is also needed because the upstream CMakeLists.txt is > >> out of date, failing with a sufficiently new cmake version: > >> > >> CMake Error at CMakeLists.txt:2 (cmake_minimum_required): > >> Compatibility with CMake < 3.5 has been removed from CMake. > >> > >> The above is nonetheless addressed by https://github.com/yaml/libyaml/pull/314, > >> but the project seems a bit inactive at the moment. > >> > >> The wrap file was added using `meson wrap install libyaml`, > >> and it can be updated using `meson wrap update libyaml`. > >> > >> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > >> --- > >> src/libcamera/meson.build | 15 +++------------ > >> subprojects/libyaml.wrap | 16 ++++++++++------ > >> 2 files changed, 13 insertions(+), 18 deletions(-) > >> > >> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build > >> index 28a3b0f36..9f782e729 100644 > >> --- a/src/libcamera/meson.build > >> +++ b/src/libcamera/meson.build > >> @@ -84,7 +84,9 @@ if not cc.has_function('dlopen') > >> libdl = cc.find_library('dl') > >> endif > >> libudev = dependency('libudev', required : get_option('udev')) > >> -libyaml = dependency('yaml-0.1', required : false) > >> +libyaml = dependency('yaml-0.1', default_options : [ > >> + 'werror=false', > >> +]) > >> > >> # Use one of gnutls or libcrypto (provided by OpenSSL), trying gnutls first. > >> libcrypto = dependency('gnutls', required : false) > >> @@ -120,17 +122,6 @@ if libudev.found() > >> ]) > >> endif > >> > >> -# Fallback to a subproject if libyaml isn't found, as it's not packaged in AOSP. > >> -if not libyaml.found() > >> - cmake = import('cmake') > >> - > >> - libyaml_vars = cmake.subproject_options() > >> - libyaml_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'}) > >> - libyaml_vars.append_compile_args('c', '-Wno-unused-value') > >> - libyaml_wrap = cmake.subproject('libyaml', options : libyaml_vars) > >> - libyaml = libyaml_wrap.dependency('yaml') > >> -endif > >> - > >> control_sources = [] > >> > >> controls_mode_files = { > >> diff --git a/subprojects/libyaml.wrap b/subprojects/libyaml.wrap > >> index 392416c61..85d9af44e 100644 > >> --- a/subprojects/libyaml.wrap > >> +++ b/subprojects/libyaml.wrap > >> @@ -1,7 +1,11 @@ > >> -# SPDX-License-Identifier: CC0-1.0 > > > > I'm still concerned by dropping the SPDX tag. Can we either keep it or > > document the license through .reuse/dep5 ? I would prefer the former, > > even if it means manual work when updating the wrap file, as it's better > > to keep license information in the files the license applies to. > > Okay. But which license is appropriate? https://github.com/mesonbuild/wrapdb/issues/2213#issuecomment-2994828556 > would suggest that they are not considered copyrightable. That's my understanding as well. The correct license in that case would be CC0-1.0 as far as I understand. > >> +[wrap-file] > >> +directory = yaml-0.2.5 > >> +source_url = https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz > >> +source_filename = yaml-0.2.5.tar.gz > >> +source_hash = c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4 > >> +patch_filename = libyaml_0.2.5-1_patch.zip > >> +patch_url = https://wrapdb.mesonbuild.com/v2/libyaml_0.2.5-1/get_patch > >> +patch_hash = bf2e9b922be00b6b00c5fce29d9fb8dc83f0431c77239f3b73e8b254d3f3f5b5 > >> > >> -[wrap-git] > >> -directory = libyaml > >> -url = https://github.com/yaml/libyaml > >> -# tags/0.2.5 > >> -revision = 2c891fc7a770e8ba2fec34fc6b545c672beb37e6 > >> +[provide] > >> +yaml-0.1 = yaml_dep
Hi 2025. 06. 23. 16:17 keltezéssel, Laurent Pinchart írta: > On Mon, Jun 23, 2025 at 04:13:51PM +0200, Barnabás Pőcze wrote: >> 2025. 06. 23. 16:07 keltezéssel, Laurent Pinchart írta: >>> On Mon, Jun 23, 2025 at 09:18:34AM +0200, Barnabás Pőcze wrote: >>>> Use the libyaml wrap file from the meson wrapdb instead of >>>> creating the wrap file manually and using the cmake module. >>>> This provides better integration with meson, such as the >>>> `force_fallback_for` built-in option. >>>> >>>> The `werror=false` needs to be set when the subproject is >>>> used because libyaml does not compile without warnings, >>>> and that would abort the build process otherwise. >>>> >>>> This is also needed because the upstream CMakeLists.txt is >>>> out of date, failing with a sufficiently new cmake version: >>>> >>>> CMake Error at CMakeLists.txt:2 (cmake_minimum_required): >>>> Compatibility with CMake < 3.5 has been removed from CMake. >>>> >>>> The above is nonetheless addressed by https://github.com/yaml/libyaml/pull/314, >>>> but the project seems a bit inactive at the moment. >>>> >>>> The wrap file was added using `meson wrap install libyaml`, >>>> and it can be updated using `meson wrap update libyaml`. >>>> >>>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> >>>> --- >>>> src/libcamera/meson.build | 15 +++------------ >>>> subprojects/libyaml.wrap | 16 ++++++++++------ >>>> 2 files changed, 13 insertions(+), 18 deletions(-) >>>> >>>> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build >>>> index 28a3b0f36..9f782e729 100644 >>>> --- a/src/libcamera/meson.build >>>> +++ b/src/libcamera/meson.build >>>> @@ -84,7 +84,9 @@ if not cc.has_function('dlopen') >>>> libdl = cc.find_library('dl') >>>> endif >>>> libudev = dependency('libudev', required : get_option('udev')) >>>> -libyaml = dependency('yaml-0.1', required : false) >>>> +libyaml = dependency('yaml-0.1', default_options : [ >>>> + 'werror=false', >>>> +]) >>>> >>>> # Use one of gnutls or libcrypto (provided by OpenSSL), trying gnutls first. >>>> libcrypto = dependency('gnutls', required : false) >>>> @@ -120,17 +122,6 @@ if libudev.found() >>>> ]) >>>> endif >>>> >>>> -# Fallback to a subproject if libyaml isn't found, as it's not packaged in AOSP. >>>> -if not libyaml.found() >>>> - cmake = import('cmake') >>>> - >>>> - libyaml_vars = cmake.subproject_options() >>>> - libyaml_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'}) >>>> - libyaml_vars.append_compile_args('c', '-Wno-unused-value') >>>> - libyaml_wrap = cmake.subproject('libyaml', options : libyaml_vars) >>>> - libyaml = libyaml_wrap.dependency('yaml') >>>> -endif >>>> - >>>> control_sources = [] >>>> >>>> controls_mode_files = { >>>> diff --git a/subprojects/libyaml.wrap b/subprojects/libyaml.wrap >>>> index 392416c61..85d9af44e 100644 >>>> --- a/subprojects/libyaml.wrap >>>> +++ b/subprojects/libyaml.wrap >>>> @@ -1,7 +1,11 @@ >>>> -# SPDX-License-Identifier: CC0-1.0 >>> >>> I'm still concerned by dropping the SPDX tag. Can we either keep it or >>> document the license through .reuse/dep5 ? I would prefer the former, >>> even if it means manual work when updating the wrap file, as it's better >>> to keep license information in the files the license applies to. >> >> Okay. But which license is appropriate? https://github.com/mesonbuild/wrapdb/issues/2213#issuecomment-2994828556 >> would suggest that they are not considered copyrightable. > > That's my understanding as well. The correct license in that case would > be CC0-1.0 as far as I understand. Okay, then I will keep the SPDX annotation. But if possible I would like to avoid sending a new version just for that. Regards, Barnabás Pőcze > >>>> +[wrap-file] >>>> +directory = yaml-0.2.5 >>>> +source_url = https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz >>>> +source_filename = yaml-0.2.5.tar.gz >>>> +source_hash = c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4 >>>> +patch_filename = libyaml_0.2.5-1_patch.zip >>>> +patch_url = https://wrapdb.mesonbuild.com/v2/libyaml_0.2.5-1/get_patch >>>> +patch_hash = bf2e9b922be00b6b00c5fce29d9fb8dc83f0431c77239f3b73e8b254d3f3f5b5 >>>> >>>> -[wrap-git] >>>> -directory = libyaml >>>> -url = https://github.com/yaml/libyaml >>>> -# tags/0.2.5 >>>> -revision = 2c891fc7a770e8ba2fec34fc6b545c672beb37e6 >>>> +[provide] >>>> +yaml-0.1 = yaml_dep >
On Mon, Jun 23, 2025 at 04:22:57PM +0200, Barnabás Pőcze wrote: > Hi > > 2025. 06. 23. 16:17 keltezéssel, Laurent Pinchart írta: > > On Mon, Jun 23, 2025 at 04:13:51PM +0200, Barnabás Pőcze wrote: > >> 2025. 06. 23. 16:07 keltezéssel, Laurent Pinchart írta: > >>> On Mon, Jun 23, 2025 at 09:18:34AM +0200, Barnabás Pőcze wrote: > >>>> Use the libyaml wrap file from the meson wrapdb instead of > >>>> creating the wrap file manually and using the cmake module. > >>>> This provides better integration with meson, such as the > >>>> `force_fallback_for` built-in option. > >>>> > >>>> The `werror=false` needs to be set when the subproject is > >>>> used because libyaml does not compile without warnings, > >>>> and that would abort the build process otherwise. > >>>> > >>>> This is also needed because the upstream CMakeLists.txt is > >>>> out of date, failing with a sufficiently new cmake version: > >>>> > >>>> CMake Error at CMakeLists.txt:2 (cmake_minimum_required): > >>>> Compatibility with CMake < 3.5 has been removed from CMake. > >>>> > >>>> The above is nonetheless addressed by https://github.com/yaml/libyaml/pull/314, > >>>> but the project seems a bit inactive at the moment. > >>>> > >>>> The wrap file was added using `meson wrap install libyaml`, > >>>> and it can be updated using `meson wrap update libyaml`. > >>>> > >>>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > >>>> --- > >>>> src/libcamera/meson.build | 15 +++------------ > >>>> subprojects/libyaml.wrap | 16 ++++++++++------ > >>>> 2 files changed, 13 insertions(+), 18 deletions(-) > >>>> > >>>> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build > >>>> index 28a3b0f36..9f782e729 100644 > >>>> --- a/src/libcamera/meson.build > >>>> +++ b/src/libcamera/meson.build > >>>> @@ -84,7 +84,9 @@ if not cc.has_function('dlopen') > >>>> libdl = cc.find_library('dl') > >>>> endif > >>>> libudev = dependency('libudev', required : get_option('udev')) > >>>> -libyaml = dependency('yaml-0.1', required : false) > >>>> +libyaml = dependency('yaml-0.1', default_options : [ > >>>> + 'werror=false', > >>>> +]) > >>>> > >>>> # Use one of gnutls or libcrypto (provided by OpenSSL), trying gnutls first. > >>>> libcrypto = dependency('gnutls', required : false) > >>>> @@ -120,17 +122,6 @@ if libudev.found() > >>>> ]) > >>>> endif > >>>> > >>>> -# Fallback to a subproject if libyaml isn't found, as it's not packaged in AOSP. > >>>> -if not libyaml.found() > >>>> - cmake = import('cmake') > >>>> - > >>>> - libyaml_vars = cmake.subproject_options() > >>>> - libyaml_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'}) > >>>> - libyaml_vars.append_compile_args('c', '-Wno-unused-value') > >>>> - libyaml_wrap = cmake.subproject('libyaml', options : libyaml_vars) > >>>> - libyaml = libyaml_wrap.dependency('yaml') > >>>> -endif > >>>> - > >>>> control_sources = [] > >>>> > >>>> controls_mode_files = { > >>>> diff --git a/subprojects/libyaml.wrap b/subprojects/libyaml.wrap > >>>> index 392416c61..85d9af44e 100644 > >>>> --- a/subprojects/libyaml.wrap > >>>> +++ b/subprojects/libyaml.wrap > >>>> @@ -1,7 +1,11 @@ > >>>> -# SPDX-License-Identifier: CC0-1.0 > >>> > >>> I'm still concerned by dropping the SPDX tag. Can we either keep it or > >>> document the license through .reuse/dep5 ? I would prefer the former, > >>> even if it means manual work when updating the wrap file, as it's better > >>> to keep license information in the files the license applies to. > >> > >> Okay. But which license is appropriate? https://github.com/mesonbuild/wrapdb/issues/2213#issuecomment-2994828556 > >> would suggest that they are not considered copyrightable. > > > > That's my understanding as well. The correct license in that case would > > be CC0-1.0 as far as I understand. > > Okay, then I will keep the SPDX annotation. But if possible I would like > to avoid sending a new version just for that. With the SPDX tag preserved, Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > >>>> +[wrap-file] > >>>> +directory = yaml-0.2.5 > >>>> +source_url = https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz > >>>> +source_filename = yaml-0.2.5.tar.gz > >>>> +source_hash = c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4 > >>>> +patch_filename = libyaml_0.2.5-1_patch.zip > >>>> +patch_url = https://wrapdb.mesonbuild.com/v2/libyaml_0.2.5-1/get_patch > >>>> +patch_hash = bf2e9b922be00b6b00c5fce29d9fb8dc83f0431c77239f3b73e8b254d3f3f5b5 > >>>> > >>>> -[wrap-git] > >>>> -directory = libyaml > >>>> -url = https://github.com/yaml/libyaml > >>>> -# tags/0.2.5 > >>>> -revision = 2c891fc7a770e8ba2fec34fc6b545c672beb37e6 > >>>> +[provide] > >>>> +yaml-0.1 = yaml_dep
Quoting Laurent Pinchart (2025-06-23 15:30:08) > On Mon, Jun 23, 2025 at 04:22:57PM +0200, Barnabás Pőcze wrote: > > Hi > > > > 2025. 06. 23. 16:17 keltezéssel, Laurent Pinchart írta: > > > On Mon, Jun 23, 2025 at 04:13:51PM +0200, Barnabás Pőcze wrote: > > >> 2025. 06. 23. 16:07 keltezéssel, Laurent Pinchart írta: > > >>> On Mon, Jun 23, 2025 at 09:18:34AM +0200, Barnabás Pőcze wrote: > > >>>> Use the libyaml wrap file from the meson wrapdb instead of > > >>>> creating the wrap file manually and using the cmake module. > > >>>> This provides better integration with meson, such as the > > >>>> `force_fallback_for` built-in option. > > >>>> > > >>>> The `werror=false` needs to be set when the subproject is > > >>>> used because libyaml does not compile without warnings, > > >>>> and that would abort the build process otherwise. > > >>>> > > >>>> This is also needed because the upstream CMakeLists.txt is > > >>>> out of date, failing with a sufficiently new cmake version: > > >>>> > > >>>> CMake Error at CMakeLists.txt:2 (cmake_minimum_required): > > >>>> Compatibility with CMake < 3.5 has been removed from CMake. > > >>>> > > >>>> The above is nonetheless addressed by https://github.com/yaml/libyaml/pull/314, > > >>>> but the project seems a bit inactive at the moment. > > >>>> > > >>>> The wrap file was added using `meson wrap install libyaml`, > > >>>> and it can be updated using `meson wrap update libyaml`. > > >>>> > > >>>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > > >>>> --- > > >>>> src/libcamera/meson.build | 15 +++------------ > > >>>> subprojects/libyaml.wrap | 16 ++++++++++------ > > >>>> 2 files changed, 13 insertions(+), 18 deletions(-) > > >>>> > > >>>> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build > > >>>> index 28a3b0f36..9f782e729 100644 > > >>>> --- a/src/libcamera/meson.build > > >>>> +++ b/src/libcamera/meson.build > > >>>> @@ -84,7 +84,9 @@ if not cc.has_function('dlopen') > > >>>> libdl = cc.find_library('dl') > > >>>> endif > > >>>> libudev = dependency('libudev', required : get_option('udev')) > > >>>> -libyaml = dependency('yaml-0.1', required : false) > > >>>> +libyaml = dependency('yaml-0.1', default_options : [ > > >>>> + 'werror=false', > > >>>> +]) > > >>>> > > >>>> # Use one of gnutls or libcrypto (provided by OpenSSL), trying gnutls first. > > >>>> libcrypto = dependency('gnutls', required : false) > > >>>> @@ -120,17 +122,6 @@ if libudev.found() > > >>>> ]) > > >>>> endif > > >>>> > > >>>> -# Fallback to a subproject if libyaml isn't found, as it's not packaged in AOSP. > > >>>> -if not libyaml.found() > > >>>> - cmake = import('cmake') > > >>>> - > > >>>> - libyaml_vars = cmake.subproject_options() > > >>>> - libyaml_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'}) > > >>>> - libyaml_vars.append_compile_args('c', '-Wno-unused-value') > > >>>> - libyaml_wrap = cmake.subproject('libyaml', options : libyaml_vars) > > >>>> - libyaml = libyaml_wrap.dependency('yaml') > > >>>> -endif > > >>>> - > > >>>> control_sources = [] > > >>>> > > >>>> controls_mode_files = { > > >>>> diff --git a/subprojects/libyaml.wrap b/subprojects/libyaml.wrap > > >>>> index 392416c61..85d9af44e 100644 > > >>>> --- a/subprojects/libyaml.wrap > > >>>> +++ b/subprojects/libyaml.wrap > > >>>> @@ -1,7 +1,11 @@ > > >>>> -# SPDX-License-Identifier: CC0-1.0 > > >>> > > >>> I'm still concerned by dropping the SPDX tag. Can we either keep it or > > >>> document the license through .reuse/dep5 ? I would prefer the former, > > >>> even if it means manual work when updating the wrap file, as it's better > > >>> to keep license information in the files the license applies to. > > >> > > >> Okay. But which license is appropriate? https://github.com/mesonbuild/wrapdb/issues/2213#issuecomment-2994828556 > > >> would suggest that they are not considered copyrightable. > > > > > > That's my understanding as well. The correct license in that case would > > > be CC0-1.0 as far as I understand. > > > > Okay, then I will keep the SPDX annotation. But if possible I would like > > to avoid sending a new version just for that. > > With the SPDX tag preserved, > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> I'm fine with this too ... Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > > > >>>> +[wrap-file] > > >>>> +directory = yaml-0.2.5 > > >>>> +source_url = https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz > > >>>> +source_filename = yaml-0.2.5.tar.gz > > >>>> +source_hash = c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4 > > >>>> +patch_filename = libyaml_0.2.5-1_patch.zip > > >>>> +patch_url = https://wrapdb.mesonbuild.com/v2/libyaml_0.2.5-1/get_patch > > >>>> +patch_hash = bf2e9b922be00b6b00c5fce29d9fb8dc83f0431c77239f3b73e8b254d3f3f5b5 > > >>>> > > >>>> -[wrap-git] > > >>>> -directory = libyaml > > >>>> -url = https://github.com/yaml/libyaml > > >>>> -# tags/0.2.5 > > >>>> -revision = 2c891fc7a770e8ba2fec34fc6b545c672beb37e6 > > >>>> +[provide] > > >>>> +yaml-0.1 = yaml_dep > > -- > Regards, > > Laurent Pinchart
diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 28a3b0f36..9f782e729 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -84,7 +84,9 @@ if not cc.has_function('dlopen') libdl = cc.find_library('dl') endif libudev = dependency('libudev', required : get_option('udev')) -libyaml = dependency('yaml-0.1', required : false) +libyaml = dependency('yaml-0.1', default_options : [ + 'werror=false', +]) # Use one of gnutls or libcrypto (provided by OpenSSL), trying gnutls first. libcrypto = dependency('gnutls', required : false) @@ -120,17 +122,6 @@ if libudev.found() ]) endif -# Fallback to a subproject if libyaml isn't found, as it's not packaged in AOSP. -if not libyaml.found() - cmake = import('cmake') - - libyaml_vars = cmake.subproject_options() - libyaml_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'}) - libyaml_vars.append_compile_args('c', '-Wno-unused-value') - libyaml_wrap = cmake.subproject('libyaml', options : libyaml_vars) - libyaml = libyaml_wrap.dependency('yaml') -endif - control_sources = [] controls_mode_files = { diff --git a/subprojects/libyaml.wrap b/subprojects/libyaml.wrap index 392416c61..85d9af44e 100644 --- a/subprojects/libyaml.wrap +++ b/subprojects/libyaml.wrap @@ -1,7 +1,11 @@ -# SPDX-License-Identifier: CC0-1.0 +[wrap-file] +directory = yaml-0.2.5 +source_url = https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz +source_filename = yaml-0.2.5.tar.gz +source_hash = c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4 +patch_filename = libyaml_0.2.5-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/libyaml_0.2.5-1/get_patch +patch_hash = bf2e9b922be00b6b00c5fce29d9fb8dc83f0431c77239f3b73e8b254d3f3f5b5 -[wrap-git] -directory = libyaml -url = https://github.com/yaml/libyaml -# tags/0.2.5 -revision = 2c891fc7a770e8ba2fec34fc6b545c672beb37e6 +[provide] +yaml-0.1 = yaml_dep
Use the libyaml wrap file from the meson wrapdb instead of creating the wrap file manually and using the cmake module. This provides better integration with meson, such as the `force_fallback_for` built-in option. The `werror=false` needs to be set when the subproject is used because libyaml does not compile without warnings, and that would abort the build process otherwise. This is also needed because the upstream CMakeLists.txt is out of date, failing with a sufficiently new cmake version: CMake Error at CMakeLists.txt:2 (cmake_minimum_required): Compatibility with CMake < 3.5 has been removed from CMake. The above is nonetheless addressed by https://github.com/yaml/libyaml/pull/314, but the project seems a bit inactive at the moment. The wrap file was added using `meson wrap install libyaml`, and it can be updated using `meson wrap update libyaml`. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/libcamera/meson.build | 15 +++------------ subprojects/libyaml.wrap | 16 ++++++++++------ 2 files changed, 13 insertions(+), 18 deletions(-)