Metadata-Version: 1.2
Name: meson
-Version: 0.48.0
+Version: 0.48.1
Summary: A high performance build system
Home-page: http://mesonbuild.com
Author: Jussi Pakkanen
-.TH MESON "1" "September 2018" "meson 0.48.0" "User Commands"
+.TH MESON "1" "October 2018" "meson 0.48.1" "User Commands"
.SH NAME
meson - a high productivity build system
.SH DESCRIPTION
Metadata-Version: 1.2
Name: meson
-Version: 0.48.0
+Version: 0.48.1
Summary: A high performance build system
Home-page: http://mesonbuild.com
Author: Jussi Pakkanen
test cases/frameworks/6 gettext/data/test2.desktop.in
test cases/frameworks/6 gettext/data2/meson.build
test cases/frameworks/6 gettext/data2/test.desktop.in
+test cases/frameworks/6 gettext/generated/desktopgenerator.py
+test cases/frameworks/6 gettext/generated/meson.build
+test cases/frameworks/6 gettext/generated/something.desktop.in.in
test cases/frameworks/6 gettext/po/LINGUAS
test cases/frameworks/6 gettext/po/POTFILES
test cases/frameworks/6 gettext/po/de.po
@staticmethod
def _libdir_is_system(libdir, compilers, env):
+ libdir = os.path.normpath(libdir)
for cc in compilers.values():
if libdir in cc.get_library_dirs(env):
return True
if not isinstance(i, (build.CustomTarget, build.CustomTargetIndex)):
continue
idir = self.get_target_dir(i)
+ if not idir:
+ idir = '.'
if idir not in custom_target_include_dirs:
custom_target_include_dirs.append(idir)
incs = []
if getattr(self, 'compiler_type', False) and self.compiler_type.is_osx_compiler:
# Clang, GCC and ICC on macOS all use the same rpath arguments
return self.build_osx_rpath_args(build_dir, rpath_paths, build_rpath)
+ elif self.compiler_type.is_windows_compiler:
+ return []
return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, build_rpath, install_rpath)
def get_dependency_gen_args(self, outtarget, outfile):
'g': ['/O0'],
'1': ['/O1'],
'2': ['/O2'],
- '3': ['/O3'],
+ '3': ['/O2'],
's': ['/O1'], # Implies /Os.
}
import ast
import argparse
-version = '0.48.0'
+version = '0.48.1'
backendlist = ['ninja', 'vs', 'vs2010', 'vs2015', 'vs2017', 'xcode']
default_yielding = False
# development purposes, such as testing, debugging, etc..
import functools
+import glob
import os
import re
)
+def get_shared_library_suffix(environment, native):
+ """This is only gauranteed to work for languages that compile to machine
+ code, not for languages like C# that use a bytecode and always end in .dll
+ """
+ if mesonlib.for_windows(native, environment):
+ return '.dll'
+ elif mesonlib.for_darwin(native, environment):
+ return '.dylib'
+ return '.so'
+
+
class GTestDependency(ExternalDependency):
def __init__(self, environment, kwargs):
super().__init__('gtest', environment, 'cpp', kwargs)
self.compile_args = list(cargs.difference(self.__cpp_blacklist))
if version_compare(self.version, '>= 3.9'):
- self._set_new_link_args()
+ self._set_new_link_args(environment)
else:
self._set_old_link_args()
self.link_args = strip_system_libdirs(environment, self.link_args)
new_args.append(arg)
return new_args
- def _set_new_link_args(self):
+ def __check_libfiles(self, shared):
+ """Use llvm-config's --libfiles to check if libraries exist."""
+ mode = '--link-shared' if shared else '--link-static'
+
+ # Set self.required to true to force an exception in get_config_value
+ # if the returncode != 0
+ restore = self.required
+ self.required = True
+
+ try:
+ # It doesn't matter what the stage is, the caller needs to catch
+ # the exception anyway.
+ self.link_args = self.get_config_value(['--libfiles', mode], '')
+ finally:
+ self.required = restore
+
+ def _set_new_link_args(self, environment):
"""How to set linker args for LLVM versions >= 3.9"""
- if ((mesonlib.is_dragonflybsd() or mesonlib.is_freebsd()) and not
- self.static and version_compare(self.version, '>= 4.0')):
- # llvm-config on DragonFly BSD and FreeBSD for versions 4.0, 5.0,
- # and 6.0 have an error when generating arguments for shared mode
- # linking, even though libLLVM.so is installed, because for some
- # reason the tool expects to find a .so for each static library.
- # This works around that.
- self.link_args = self.get_config_value(['--ldflags'], 'link_args')
- self.link_args.append('-lLLVM')
- return
+ mode = self.get_config_value(['--shared-mode'], 'link_args')[0]
+ if not self.static and mode == 'static':
+ # If llvm is configured with LLVM_BUILD_LLVM_DYLIB but not with
+ # LLVM_LINK_LLVM_DYLIB and not LLVM_BUILD_SHARED_LIBS (which
+ # upstreams doesn't recomend using), then llvm-config will lie to
+ # you about how to do shared-linking. It wants to link to a a bunch
+ # of individual shared libs (which don't exist because llvm wasn't
+ # built with LLVM_BUILD_SHARED_LIBS.
+ #
+ # Therefore, we'll try to get the libfiles, if the return code is 0
+ # or we get an empty list, then we'll try to build a working
+ # configuration by hand.
+ try:
+ self.__check_libfiles(True)
+ except DependencyException:
+ lib_ext = get_shared_library_suffix(environment, self.native)
+ libdir = self.get_config_value(['--libdir'], 'link_args')[0]
+ # Sort for reproducability
+ matches = sorted(glob.iglob(os.path.join(libdir, 'libLLVM*{}'.format(lib_ext))))
+ if not matches:
+ if self.required:
+ raise
+ self.is_found = False
+ return
+
+ self.link_args = self.get_config_value(['--ldflags'], 'link_args')
+ libname = os.path.basename(matches[0]).rstrip(lib_ext).lstrip('lib')
+ self.link_args.append('-l{}'.format(libname))
+ return
+ elif self.static and mode == 'shared':
+ # If, however LLVM_BUILD_SHARED_LIBS is true # (*cough* gentoo *cough*)
+ # then this is correct. Building with LLVM_BUILD_SHARED_LIBS has a side
+ # effect, it stops the generation of static archives. Therefore we need
+ # to check for that and error out on static if this is the case
+ try:
+ self.__check_libfiles(False)
+ except DependencyException:
+ if self.required:
+ raise
+ self.is_found = False
+ return
+
link_args = ['--link-static', '--system-libs'] if self.static else ['--link-shared']
self.link_args = self.get_config_value(
['--libs', '--ldflags'] + link_args + list(self.required_modules),
def get_build_command(self, unbuffered=False):
cmd = mesonlib.meson_command[:]
- if unbuffered and 'python' in cmd[0]:
+ if unbuffered and 'python' in os.path.basename(cmd[0]):
cmd.insert(1, '-u')
return cmd
'\nIf build failures persist, manually wipe your build directory to clear any\n'
'stored system data.\n'
'\nTo change option values, run "meson configure" instead.')
- sys.exit(1)
+ sys.exit(0)
else:
if reconfigure:
print('Directory does not contain a valid build tree:\n{}'.format(build_dir))
class HotdocTargetBuilder:
- def __init__(self, name, state, hotdoc, kwargs):
+ def __init__(self, name, state, hotdoc, interpreter, kwargs):
self.hotdoc = hotdoc
self.build_by_default = kwargs.pop('build_by_default', False)
self.kwargs = kwargs
self.name = name
self.state = state
+ self.interpreter = interpreter
self.include_paths = OrderedDict()
self.builddir = state.environment.get_build_dir()
self.check_extra_arg_type(arg, v)
return
- valid_types = (str, bool, mesonlib.File, build.IncludeDirs)
+ valid_types = (str, bool, mesonlib.File, build.IncludeDirs, build.CustomTarget, build.BuildTarget)
if not isinstance(value, valid_types):
raise InvalidArguments('Argument "%s=%s" should be of type: %s.' % (
arg, value, [t.__name__ for t in valid_types]))
cmd.append(os.path.join(self.builddir, arg.get_curdir(), inc_dir))
continue
+ elif isinstance(arg, build.CustomTarget) or isinstance(arg, build.BuildTarget):
+ self._dependencies.append(arg)
+ arg = self.interpreter.backend.get_target_filename_abs(arg)
cmd.append(arg)
' required for the project name.')
project_name = args[0]
- builder = HotdocTargetBuilder(project_name, state, self.hotdoc, kwargs)
+ builder = HotdocTargetBuilder(project_name, state, self.hotdoc, self.interpreter, kwargs)
target, install_script = builder.make_targets()
targets = [HotdocTargetHolder(target, self.interpreter)]
if install_script:
kwargs['command'] = command
inputfile = kwargs['input']
- if isinstance(inputfile, str):
- inputfile = mesonlib.File.from_source_file(state.environment.source_dir,
+ if hasattr(inputfile, 'held_object'):
+ ct = build.CustomTarget(kwargs['output'] + '_merge', state.subdir, state.subproject, kwargs)
+ else:
+ if isinstance(inputfile, str):
+ inputfile = mesonlib.File.from_source_file(state.environment.source_dir,
state.subdir, inputfile)
- output = kwargs['output']
- ifile_abs = inputfile.absolute_path(state.environment.source_dir,
- state.environment.build_dir)
- values = mesonlib.get_filenames_templates_dict([ifile_abs], None)
- outputs = mesonlib.substitute_values([output], values)
- output = outputs[0]
-
- ct = build.CustomTarget(output + '_' + state.subdir + '_merge', state.subdir, state.subproject, kwargs)
+ output = kwargs['output']
+ ifile_abs = inputfile.absolute_path(state.environment.source_dir,
+ state.environment.build_dir)
+ values = mesonlib.get_filenames_templates_dict([ifile_abs], None)
+ outputs = mesonlib.substitute_values([output], values)
+ output = outputs[0]
+ ct = build.CustomTarget(output + '_' + state.subdir + '_merge', state.subdir, state.subproject, kwargs)
return ModuleReturnValue(ct, [ct])
@FeatureNewKwargs('i18n.gettext', '0.37.0', ['preset'])
import sys, struct
import shutil, subprocess
+from ..mesonlib import OrderedSet
+
SHT_STRTAB = 3
DT_NEEDED = 1
DT_RPATH = 15
try:
args = []
if rpaths:
- for rp in rpaths:
+ # TODO: fix this properly, not totally clear how
+ #
+ # removing rpaths from binaries on macOS has tons of
+ # weird edge cases. For instance, if the user provided
+ # a '-Wl,-rpath' argument in LDFLAGS that happens to
+ # coincide with an rpath generated from a dependency,
+ # this would cause installation failures, as meson would
+ # generate install_name_tool calls with two identical
+ # '-delete_rpath' arguments, which install_name_tool
+ # fails on. Because meson itself ensures that it never
+ # adds duplicate rpaths, duplicate rpaths necessarily
+ # come from user variables. The idea of using OrderedSet
+ # is to remove *at most one* duplicate RPATH entry. This
+ # is not optimal, as it only respects the user's choice
+ # partially: if they provided a non-duplicate '-Wl,-rpath'
+ # argument, it gets removed, if they provided a duplicate
+ # one, it remains in the final binary. A potentially optimal
+ # solution would split all user '-Wl,-rpath' arguments from
+ # LDFLAGS, and later add them back with '-add_rpath'.
+ for rp in OrderedSet(rpaths):
args += ['-delete_rpath', rp]
subprocess.check_call(['install_name_tool', fname] + args,
stdout=subprocess.DEVNULL,
subprocess.check_call(['install_name_tool', fname] + args,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)
- except Exception as e:
+ except Exception:
raise
sys.exit(0)
--- /dev/null
+#!/usr/bin/env python3
+
+import sys, shutil
+
+ifile = sys.argv[1]
+ofile = sys.argv[2]
+
+os.unlink(ofile)
+shutil.copy(ifile, ofile)
--- /dev/null
+dgen = find_program('desktopgenerator.py')
+
+desktop_in_file = custom_target('something.desktop.in',
+ input : ['something.desktop.in.in'],
+ output : 'something.desktop.in',
+ command : [dgen, '@INPUT@', '@OUTPUT@'],
+)
+
+i18n.merge_file(
+ input : desktop_in_file,
+ output : 'something.desktop',
+ type : 'desktop',
+ po_dir : '../po',
+)
--- /dev/null
+[Desktop Entry]
+Name=Something doer
+Comment=Do something
+# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
+Keywords=zip;tar;extract;unpack;
+TryExec=file-roller
+Exec=file-roller %U
+StartupNotify=true
+Terminal=false
+Type=Application
+# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
+Icon=something
+Categories=GTK;GNOME;Utility
+X-GNOME-DocPath=file-roller/file-roller.xml
+X-GNOME-UsesNotifications=true
subdir('src')
subdir('data')
subdir('data2')
+subdir('generated')