ports/devel/meson/patches/patch-mesonbuild_build_py

49 lines
2.5 KiB
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Index: mesonbuild/build.py
--- mesonbuild/build.py.orig
+++ mesonbuild/build.py
@@ -35,7 +35,7 @@ from .mesonlib import (
File, MesonException, MachineChoice, PerMachine, OrderedSet, listify,
extract_as_list, typeslistify, stringlistify, classify_unity_sources,
get_filenames_templates_dict, substitute_values, has_path_sep,
- OptionKey, PerMachineDefaultable, OptionOverrideProxy,
+ OptionKey, PerMachineDefaultable, OptionOverrideProxy, is_openbsd,
MesonBugException, EnvironmentVariables, pickle_load,
)
from .compilers import (
2023-10-12 04:10:54 +00:00
@@ -2396,6 +2396,26 @@ class SharedLibrary(BuildTarget):
2023-08-16 22:26:55 +00:00
elif self.soversion:
# If unspecified, pick the soversion
self.darwin_versions = 2 * [self.soversion]
+ if is_openbsd():
+ self.libversion = os.getenv('LIB' + self.name + '_VERSION')
+ if (self.libversion is None and
+ self.soversion is not None and
+ len(self.soversion) != 0 and
+ str(os.getenv('MODMESON_PORT_BUILD')).casefold() == 'yes'):
+ self.libversion = '0.0'
+ if self.libversion is not None:
+ self.ltversion_orig = self.ltversion if self.ltversion is not None else self.soversion
+ self.ltversion = self.libversion.format(self)
+ self.soversion = self.ltversion
+ shared_libs_log = os.path.join(self.environment.get_build_dir(), 'shared_libs.log')
+ if not os.path.isfile(shared_libs_log):
+ f = open(shared_libs_log, 'w+')
+ f.write("# SHARED_LIBS+= {:<25}<obsd version> # <orig version>\n".format("<libname>"))
+ f.close
+ f = open(shared_libs_log, 'a')
+ f.write("SHARED_LIBS += {:<25} {} # {}\n".format(self.name, \
+ self.soversion, self.ltversion_orig))
+ f.close
# Visual Studio module-definitions file
if 'vs_module_defs' in kwargs:
2023-10-12 04:10:54 +00:00
@@ -2467,6 +2487,8 @@ class SharedLibrary(BuildTarget):
2023-08-16 22:26:55 +00:00
# filename. If ltversion != soversion we create an soversion alias:
# libfoo.so.0 -> libfoo.so.0.100.0
# Where libfoo.so.0.100.0 is the actual library
+ if is_openbsd() and self.libversion is not None:
+ return {}
if self.suffix == 'so' and self.ltversion and self.ltversion != self.soversion:
alias_tpl = self.filename_tpl.replace('ltversion', 'soversion')
ltversion_filename = alias_tpl.format(self)