From 86e8c45d91eae9ca9cd0bb9e384e8540788516f5 Mon Sep 17 00:00:00 2001
From: arch1t3cht <arch1t3cht@gmail.com>
Date: Mon, 17 Feb 2025 22:28:55 +0100
Subject: [PATCH] meson: Don't depend on boost's system and regex modules

boost::system and boost::regex have been header-only for a while now
and the linkable library for them is only a stub. Some systems
(in particular msys2: https://github.com/msys2/MINGW-packages/issues/22081)
no longer provide the library, so stop requiring it.

Fixes #326.
---
 meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index 9d4763a22a..668960e1c0 100644
--- a/meson.build
+++ b/meson.build
@@ -104,10 +104,10 @@ deps += dependency('iconv', fallback: ['iconv', 'libiconv_dep'])
 deps += dependency('libass', version: '>=0.9.7',
                    fallback: ['libass', 'libass_dep'])
 
-boost_modules = ['chrono', 'thread', 'locale', 'regex']
+boost_modules = ['chrono', 'thread', 'locale']
 if not get_option('local_boost')
     boost_dep = dependency('boost', version: '>=1.70.0',
-                            modules: boost_modules + ['system'],
+                            modules: boost_modules,
                             required: false,
                             static: get_option('default_library') == 'static')
 endif
@@ -115,7 +115,7 @@ endif
 if get_option('local_boost') or not boost_dep.found()
     boost_dep = []
     boost = subproject('boost')
-    foreach module: boost_modules
+    foreach module: (boost_modules + ['regex'])
         boost_dep += boost.get_variable('boost_' + module + '_dep')
     endforeach
 endif
