[pacman-dev] [PATCH] Add meson.build files to build with meson
Provide both build systems in parallel for now, to ensure that we work
out all the differences between the two. Some time from now, we'll give
up on autotools.
Meson tends to be faster and probably easier to read/maintain. On my
machine, the full meson configure+build+install takes a little under
half as long as a similar autotools-based invocation.
Building with meson is a two step process. First, configure the build:
meson build
Then, compile the project:
ninja -C build
There's some mild differences in functionality between meson and
autotools. specifically:
1) No singular update-po target. meson only generates individual
update-po targets for each textdomain (of which we have 3). To make
this easier, there's a build-aux/update-po script which finds all
update-po targets and runs them.
2) No doxygen support. Doxygen seems to be terrible and requires that
everything be built through the Doxyfile. Support for out-of-tree builds
(enforced by meson) appears to be nonexistant. I'd suggest just running
doxygen directly since we never package these files and just export them
for the website.
3) No 'make dist' equivalent. Just run 'git archive' to generate a
suitable tarball for distribution.
---
Yes, this is huge. All 330 tests pass, and I've been building/using
pacman from my 'meson' branch for a while now.
Feedback wanted.
.ycm_extra_conf.py | 250 ++++++++++
build-aux/edit-script.sh.in | 33 ++
build-aux/meson-make-symlink.sh | 12 +
build-aux/tap-driver.py | 296 +++++++++++
build-aux/update-po | 39 ++
doc/meson.build | 118 +++++
lib/libalpm/meson.build | 33 ++
lib/libalpm/po/meson.build | 15 +
meson.build | 487 +++++++++++++++++++
meson_options.txt | 58 +++
scripts/libmakepkg/integrity/meson.build | 20 +
scripts/libmakepkg/lint_config/meson.build | 18 +
scripts/libmakepkg/lint_package/meson.build | 20 +
scripts/libmakepkg/lint_pkgbuild/meson.build | 37 ++
scripts/libmakepkg/meson.build | 31 ++
scripts/libmakepkg/source/meson.build | 22 +
scripts/libmakepkg/tidy/meson.build | 23 +
scripts/libmakepkg/util/meson.build | 24 +
scripts/meson.build | 66 +++
scripts/po/meson.build | 15 +
src/common/meson.build | 4 +
src/pacman/meson.build | 23 +
src/pacman/po/meson.build | 15 +
src/util/meson.build | 3 +
test/pacman/meson.build | 357 ++++++++++++++
test/scripts/meson.build | 12 +
test/util/meson.build | 6 +
27 files changed, 2037 insertions(+)
create mode 100644 .ycm_extra_conf.py
create mode 100644 build-aux/edit-script.sh.in
create mode 100644 build-aux/meson-make-symlink.sh
create mode 100644 build-aux/tap-driver.py
create mode 100755 build-aux/update-po
create mode 100644 doc/meson.build
create mode 100644 lib/libalpm/meson.build
create mode 100644 lib/libalpm/po/meson.build
create mode 100644 meson.build
create mode 100644 meson_options.txt
create mode 100644 scripts/libmakepkg/integrity/meson.build
create mode 100644 scripts/libmakepkg/lint_config/meson.build
create mode 100644 scripts/libmakepkg/lint_package/meson.build
create mode 100644 scripts/libmakepkg/lint_pkgbuild/meson.build
create mode 100644 scripts/libmakepkg/meson.build
create mode 100644 scripts/libmakepkg/source/meson.build
create mode 100644 scripts/libmakepkg/tidy/meson.build
create mode 100644 scripts/libmakepkg/util/meson.build
create mode 100644 scripts/meson.build
create mode 100644 scripts/po/meson.build
create mode 100644 src/common/meson.build
create mode 100644 src/pacman/meson.build
create mode 100644 src/pacman/po/meson.build
create mode 100644 src/util/meson.build
create mode 100644 test/pacman/meson.build
create mode 100644 test/scripts/meson.build
create mode 100644 test/util/meson.build
diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py
new file mode 100644
index 00000000..f297deef
--- /dev/null
+++ b/.ycm_extra_conf.py
@@ -0,0 +1,250 @@
+#!/usr/bin/env python
+
+# SPDX-License-Identifier: Unlicense
+#
+# Based on the template file provided by the 'YCM-Generator' project authored by
+# Reuben D'Netto.
+# Jiahui Xie has re-reformatted and expanded the original script in accordance
+# to the requirements of the PEP 8 style guide and 'systemd' project,
+# respectively.
+#
+# The original license is preserved as it is.
+#
+#
+# This is free and unencumbered software released into the public domain.
+#
+# Anyone is free to copy, modify, publish, use, compile, sell, or
+# distribute this software, either in source code form or as a compiled
+# binary, for any purpose, commercial or non-commercial, and by any
+# means.
+#
+# In jurisdictions that recognize copyright laws, the author or authors
+# of this software dedicate any and all copyright interest in the
+# software to the public domain. We make this dedication for the benefit
+# of the public at large and to the detriment of our heirs and
+# successors. We intend this dedication to be an overt act of
+# relinquishment in perpetuity of all present and future rights to this
+# software under copyright law.
+#
+# 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 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.
+#
+# For more information, please refer to http://unlicense.org/
+
+"""
+YouCompleteMe configuration file tailored to support the 'meson' build system
+used by the 'systemd' project.
+"""
+
+import glob
+import os
+import ycm_core
+
+
+SOURCE_EXTENSIONS = (".C", ".cpp", ".cxx", ".cc", ".c", ".m", ".mm")
+HEADER_EXTENSIONS = (".H", ".h", ".hxx", ".hpp", ".hh")
+
+
+def DirectoryOfThisScript():
+ """
+ Return the absolute path of the parent directory containing this
+ script.
+ """
+ return os.path.dirname(os.path.abspath(__file__))
+
+
+def GuessBuildDirectory():
+ """
+ Guess the build directory using the following heuristics:
+
+ 1. Returns the current directory of this script plus 'build'
+ subdirectory in absolute path if this subdirectory exists.
+
+ 2. Otherwise, probes whether there exists any directory
+ containing '.ninja_log' file two levels above the current directory;
+ returns this single directory only if there is one candidate.
+ """
+ result = os.path.join(DirectoryOfThisScript(), "build")
+
+ if os.path.exists(result):
+ return result
+
+ result = glob.glob(os.path.join(DirectoryOfThisScript(),
+ "..", "..", "*", ".ninja_log"))
+
+ if not result:
+ return ""
+
+ if 1 != len(result):
+ return ""
+
+ return os.path.split(result[0])[0]
+
+
+def TraverseByDepth(root, include_extensions):
+ """
+ Return a set of child directories of the 'root' containing file
+ extensions specified in 'include_extensions'.
+
+ NOTE:
+ 1. The 'root' directory itself is excluded from the result set.
+ 2. No subdirectories would be excluded if 'include_extensions' is left
+ to 'None'.
+ 3. Each entry in 'include_extensions' must begin with string '.'.
+ """
+ is_root = True
+ result = set()
+ # Perform a depth first top down traverse of the given directory tree.
+ for root_dir, subdirs, file_list in os.walk(root):
+ if not is_root:
+ # print("Relative Root: ", root_dir)
+ # print(subdirs)
+ if include_extensions:
+ get_ext = os.path.splitext
+ subdir_extensions = {
+ get_ext(f)[-1] for f in file_list if get_ext(f)[-1]
+ }
+ if subdir_extensions & include_extensions:
+ result.add(root_dir)
+ else:
+ result.add(root_dir)
+ else:
+ is_root = False
+
+ return result
+
+
+_project_src_dir = os.path.join(DirectoryOfThisScript(), "src")
+_include_dirs_set = TraverseByDepth(_project_src_dir, frozenset({".h"}))
+flags = [
+ "-x",
+ "c"
+ # The following flags are partially redundant due to the existence of
+ # 'compile_commands.json'.
+ # '-Wall',
+ # '-Wextra',
+ # '-Wfloat-equal',
+ # '-Wpointer-arith',
+ # '-Wshadow',
+ # '-std=gnu99',
+]
+
+for include_dir in _include_dirs_set:
+ flags.append("-I" + include_dir)
+
+# Set this to the absolute path to the folder (NOT the file!) containing the
+# compile_commands.json file to use that instead of 'flags'. See here for
+# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
+#
+# You can get CMake to generate this file for you by adding:
+# set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
+# to your CMakeLists.txt file.
+#
+# Most projects will NOT need to set this to anything; you can just change the
+# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
+compilation_database_folder = GuessBuildDirectory()
+
+if os.path.exists(compilation_database_folder):
+ database = ycm_core.CompilationDatabase(compilation_database_folder)
+else:
+ database = None
+
+
+def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
+ """
+ Iterate through 'flags' and replace the relative paths prefixed by
+ '-isystem', '-I', '-iquote', '--sysroot=' with absolute paths
+ start with 'working_directory'.
+ """
+ if not working_directory:
+ return list(flags)
+ new_flags = []
+ make_next_absolute = False
+ path_flags = ["-isystem", "-I", "-iquote", "--sysroot="]
+ for flag in flags:
+ new_flag = flag
+
+ if make_next_absolute:
+ make_next_absolute = False
+ if not flag.startswith("/"):
+ new_flag = os.path.join(working_directory, flag)
+
+ for path_flag in path_flags:
+ if flag == path_flag:
+ make_next_absolute = True
+ break
+
+ if flag.startswith(path_flag):
+ path = flag[len(path_flag):]
+ new_flag = path_flag + os.path.join(working_directory, path)
+ break
+
+ if new_flag:
+ new_flags.append(new_flag)
+ return new_flags
+
+
+def IsHeaderFile(filename):
+ """
+ Check whether 'filename' is considered as a header file.
+ """
+ extension = os.path.splitext(filename)[1]
+ return extension in HEADER_EXTENSIONS
+
+
+def GetCompilationInfoForFile(filename):
+ """
+ Helper function to look up compilation info of 'filename' in the 'database'.
+ """
+ # The compilation_commands.json file generated by CMake does not have
+ # entries for header files. So we do our best by asking the db for flags for
+ # a corresponding source file, if any. If one exists, the flags for that
+ # file should be good enough.
+ if not database:
+ return None
+
+ if IsHeaderFile(filename):
+ basename = os.path.splitext(filename)[0]
+ for extension in SOURCE_EXTENSIONS:
+ replacement_file = basename + extension
+ if os.path.exists(replacement_file):
+ compilation_info = \
+ database.GetCompilationInfoForFile(replacement_file)
+ if compilation_info.compiler_flags_:
+ return compilation_info
+ return None
+ return database.GetCompilationInfoForFile(filename)
+
+
+def FlagsForFile(filename, **kwargs):
+ """
+ Callback function to be invoked by YouCompleteMe in order to get the
+ information necessary to compile 'filename'.
+
+ It returns a dictionary with a single element 'flags'. This element is a
+ list of compiler flags to pass to libclang for the file 'filename'.
+ """
+ if database:
+ # Bear in mind that compilation_info.compiler_flags_ does NOT return a
+ # python list, but a "list-like" StringVec object
+ compilation_info = GetCompilationInfoForFile(filename)
+ if not compilation_info:
+ return None
+
+ final_flags = MakeRelativePathsInFlagsAbsolute(
+ compilation_info.compiler_flags_,
+ compilation_info.compiler_working_dir_)
+
+ else:
+ relative_to = DirectoryOfThisScript()
+ final_flags = MakeRelativePathsInFlagsAbsolute(flags, relative_to)
+
+ return {
+ "flags": final_flags,
+ "do_cache": True
+ }
diff --git a/build-aux/edit-script.sh.in b/build-aux/edit-script.sh.in
new file mode 100644
index 00000000..3e3a1b6a
--- /dev/null
+++ b/build-aux/edit-script.sh.in
@@ -0,0 +1,33 @@
+#!@BASH@
+
+input=$1
+output=$2
+mode=$3
+
+"@SED@" \
+ -e "s|@rootdir[@]|@ROOTDIR@|g" \
+ -e "s|@localedir[@]|@LOCALEDIR@|g" \
+ -e "s|@sysconfdir[@]|@sysconfdir@|g" \
+ -e "s|@localstatedir[@]|@localstatedir@|g" \
+ -e "s|@libmakepkgdir[@]|@LIBMAKEPKGDIR@|g" \
+ -e "s|@pkgdatadir[@]|@PKGDATADIR@|g" \
+ -e "s|@prefix[@]|@PREFIX@|g" \
+ -e "1s|#!/bin/bash|#!@BASH@|g" \
+ -e "s|@PACKAGE_VERSION[@]|@PACKAGE_VERSION@|g" \
+ -e "s|@PACKAGE_NAME[@]|@PACKAGE_NAME@|g" \
+ -e "s|@BUILDSCRIPT[@]|@BUILDSCRIPT@|g" \
+ -e "s|@TEMPLATE_DIR[@]|@TEMPLATE_DIR@|g" \
+ -e "s|@DEBUGSUFFIX[@]|@DEBUGSUFFIX@|g" \
+ -e "s|@INODECMD[@]|@INODECMD@|g" \
+ -e "s|@OWNERCMD[@]|@OWNERCMD@|g" \
+ -e "s|@MODECMD[@]|@MODECMD@|g" \
+ -e "s|@SEDINPLACEFLAGS[@]|@SEDINPLACEFLAGS@|g" \
+ -e "s|@SEDPATH[@]|@SEDPATH@|g" \
+ -e "s|@DUFLAGS[@]|@DUFLAGS@|g" \
+ -e "s|@DUPATH[@]|@DUPATH@|g" \
+ -e "s|@configure_input[@]|Generated from ${output##*/}.sh.in; do not edit by hand.|g" \
+ "$input" >"$output"
+
+if [[ $mode ]]; then
+ chmod "$mode" "$output"
+fi
diff --git a/build-aux/meson-make-symlink.sh b/build-aux/meson-make-symlink.sh
new file mode 100644
index 00000000..501cd43d
--- /dev/null
+++ b/build-aux/meson-make-symlink.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -eu
+
+# this is needed mostly because $DESTDIR is provided as a variable,
+# and we need to create the target directory...
+
+mkdir -vp "$(dirname "${DESTDIR:-}$2")"
+if [ "$(dirname $1)" = . ]; then
+ ln -vfs -T "$1" "${DESTDIR:-}$2"
+else
+ ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2"
+fi
diff --git a/build-aux/tap-driver.py b/build-aux/tap-driver.py
new file mode 100644
index 00000000..c231caec
--- /dev/null
+++ b/build-aux/tap-driver.py
@@ -0,0 +1,296 @@
+#!/usr/bin/env python3
+# Adapted from tappy copyright (c) 2016, Matt Layman
+# MIT license
+# https://github.com/python-tap/tappy
+
+import io
+import re
+import subprocess
+import sys
+
+
+class Directive(object):
+ """A representation of a result line directive."""
+
+ skip_pattern = re.compile(
+ r"""^SKIP\S*
+ (?P<whitespace>\s*) # Optional whitespace.
+ (?P<reason>.*) # Slurp up the rest.""",
+ re.IGNORECASE | re.VERBOSE)
+ todo_pattern = re.compile(
+ r"""^TODO\b # The directive name
+ (?P<whitespace>\s*) # Immediately following must be whitespace.
+ (?P<reason>.*) # Slurp up the rest.""",
+ re.IGNORECASE | re.VERBOSE)
+
+ def __init__(self, text):
+ """Initialize the directive by parsing the text.
+ The text is assumed to be everything after a '#\s*' on a result line.
+ """
+ self._text = text
+ self._skip = False
+ self._todo = False
+ self._reason = None
+
+ match = self.skip_pattern.match(text)
+ if match:
+ self._skip = True
+ self._reason = match.group('reason')
+
+ match = self.todo_pattern.match(text)
+ if match:
+ if match.group('whitespace'):
+ self._todo = True
+ else:
+ # Catch the case where the directive has no descriptive text.
+ if match.group('reason') == '':
+ self._todo = True
+ self._reason = match.group('reason')
+
+ @property
+ def text(self):
+ """Get the entire text."""
+ return self._text
+
+ @property
+ def skip(self):
+ """Check if the directive is a SKIP type."""
+ return self._skip
+
+ @property
+ def todo(self):
+ """Check if the directive is a TODO type."""
+ return self._todo
+
+ @property
+ def reason(self):
+ """Get the reason for the directive."""
+ return self._reason
+
+
+class Parser(object):
+ """A parser for TAP files and lines."""
+
+ # ok and not ok share most of the same characteristics.
+ result_base = r"""
+ \s* # Optional whitespace.
+ (?P<number>\d*) # Optional test number.
+ \s* # Optional whitespace.
+ (?P<description>[^#]*) # Optional description before #.
+ \#? # Optional directive marker.
+ \s* # Optional whitespace.
+ (?P<directive>.*) # Optional directive text.
+ """
+ ok = re.compile(r'^ok' + result_base, re.VERBOSE)
+ not_ok = re.compile(r'^not\ ok' + result_base, re.VERBOSE)
+ plan = re.compile(r"""
+ ^1..(?P<expected>\d+) # Match the plan details.
+ [^#]* # Consume any non-hash character to confirm only
+ # directives appear with the plan details.
+ \#? # Optional directive marker.
+ \s* # Optional whitespace.
+ (?P<directive>.*) # Optional directive text.
+ """, re.VERBOSE)
+ diagnostic = re.compile(r'^#')
+ bail = re.compile(r"""
+ ^Bail\ out!
+ \s* # Optional whitespace.
+ (?P<reason>.*) # Optional reason.
+ """, re.VERBOSE)
+ version = re.compile(r'^TAP version (?P<version>\d+)$')
+
+ TAP_MINIMUM_DECLARED_VERSION = 13
+
+ def parse(self, fh):
+ """Generate tap.line.Line objects, given a file-like object `fh`.
+ `fh` may be any object that implements both the iterator and
+ context management protocol (i.e. it can be used in both a
+ "with" statement and a "for...in" statement.)
+ Trailing whitespace and newline characters will be automatically
+ stripped from the input lines.
+ """
+ with fh:
+ for line in fh:
+ yield self.parse_line(line.rstrip())
+
+ def parse_line(self, text):
+ """Parse a line into whatever TAP category it belongs."""
+ match = self.ok.match(text)
+ if match:
+ return self._parse_result(True, match)
+
+ match = self.not_ok.match(text)
+ if match:
+ return self._parse_result(False, match)
+
+ if self.diagnostic.match(text):
+ return ('diagnostic', text)
+
+ match = self.plan.match(text)
+ if match:
+ return self._parse_plan(match)
+
+ match = self.bail.match(text)
+ if match:
+ return ('bail', match.group('reason'))
+
+ match = self.version.match(text)
+ if match:
+ return self._parse_version(match)
+
+ return ('unknown',)
+
+ def _parse_plan(self, match):
+ """Parse a matching plan line."""
+ expected_tests = int(match.group('expected'))
+ directive = Directive(match.group('directive'))
+
+ # Only SKIP directives are allowed in the plan.
+ if directive.text and not directive.skip:
+ return ('unknown',)
+
+ return ('plan', expected_tests, directive)
+
+ def _parse_result(self, ok, match):
+ """Parse a matching result line into a result instance."""
+ return ('result', ok, match.group('number'),
+ match.group('description').strip(),
+ Directive(match.group('directive')))
+
+ def _parse_version(self, match):
+ version = int(match.group('version'))
+ if version < self.TAP_MINIMUM_DECLARED_VERSION:
+ raise ValueError('It is an error to explicitly specify '
+ 'any version lower than 13.')
+ return ('version', version)
+
+
+class Rules(object):
+
+ def __init__(self):
+ self._lines_seen = {'plan': [], 'test': 0, 'failed': 0, 'version': []}
+ self._errors = []
+
+ def check(self, final_line_count):
+ """Check the status of all provided data and update the suite."""
+ if self._lines_seen['version']:
+ self._process_version_lines()
+ self._process_plan_lines(final_line_count)
+
+ def check_errors(self):
+ if self._lines_seen['failed'] > 0:
+ self._add_error('Tests failed.')
+ if self._errors:
+ for error in self._errors:
+ print(error)
+ return 1
+ return 0
+
+ def _process_version_lines(self):
+ """Process version line rules."""
+ if len(self._lines_seen['version']) > 1:
+ self._add_error('Multiple version lines appeared.')
+ elif self._lines_seen['version'][0] != 1:
+ self._add_error('The version must be on the first line.')
+
+ def _process_plan_lines(self, final_line_count):
+ """Process plan line rules."""
+ if not self._lines_seen['plan']:
+ self._add_error('Missing a plan.')
+ return
+
+ if len(self._lines_seen['plan']) > 1:
+ self._add_error('Only one plan line is permitted per file.')
+ return
+
+ expected_tests, at_line = self._lines_seen['plan'][0]
+ if not self._plan_on_valid_line(at_line, final_line_count):
+ self._add_error(
+ 'A plan must appear at the beginning or end of the file.')
+ return
+
+ if expected_tests != self._lines_seen['test']:
+ self._add_error(
+ 'Expected {expected_count} tests '
+ 'but only {seen_count} ran.'.format(
+ expected_count=expected_tests,
+ seen_count=self._lines_seen['test']))
+
+ def _plan_on_valid_line(self, at_line, final_line_count):
+ """Check if a plan is on a valid line."""
+ # Put the common cases first.
+ if at_line == 1 or at_line == final_line_count:
+ return True
+
+ # The plan may only appear on line 2 if the version is at line 1.
+ after_version = (
+ self._lines_seen['version'] and
+ self._lines_seen['version'][0] == 1 and
+ at_line == 2)
+ if after_version:
+ return True
+
+ return False
+
+ def handle_bail(self, reason):
+ """Handle a bail line."""
+ self._add_error('Bailed: {reason}').format(reason=reason)
+
+ def handle_skipping_plan(self):
+ """Handle a plan that contains a SKIP directive."""
+ sys.exit(77)
+
+ def saw_plan(self, expected_tests, at_line):
+ """Record when a plan line was seen."""
+ self._lines_seen['plan'].append((expected_tests, at_line))
+
+ def saw_test(self, ok):
+ """Record when a test line was seen."""
+ self._lines_seen['test'] += 1
+ if not ok:
+ self._lines_seen['failed'] += 1
+
+ def saw_version_at(self, line_counter):
+ """Record when a version line was seen."""
+ self._lines_seen['version'].append(line_counter)
+
+ def _add_error(self, message):
+ self._errors += [message]
+
+
+if __name__ == '__main__':
+ parser = Parser()
+ rules = Rules()
+
+ try:
+ out = subprocess.check_output(sys.argv[1:], universal_newlines=True)
+ except subprocess.CalledProcessError as e:
+ sys.stdout.write(e.output)
+ raise e
+
+ line_generator = parser.parse(io.StringIO(out))
+ line_counter = 0
+ for line in line_generator:
+ line_counter += 1
+
+ if line[0] == 'unknown':
+ continue
+
+ if line[0] == 'result':
+ rules.saw_test(line[1])
+ print('{okay} {num} {description} {directive}'.format(
+ okay=('' if line[1] else 'not ') + 'ok', num=line[2],
+ description=line[3], directive=line[4].text))
+ elif line[0] == 'plan':
+ if line[2].skip:
+ rules.handle_skipping_plan()
+ rules.saw_plan(line[1], line_counter)
+ elif line[0] == 'bail':
+ rules.handle_bail(line[1])
+ elif line[0] == 'version':
+ rules.saw_version_at(line_counter)
+ elif line[0] == 'diagnostic':
+ print(line[1])
+
+ rules.check(line_counter)
+ sys.exit(rules.check_errors())
diff --git a/build-aux/update-po b/build-aux/update-po
new file mode 100755
index 00000000..ce1ad4be
--- /dev/null
+++ b/build-aux/update-po
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+find_build_directory() {
+ local build_dirs=(*/.ninja_log)
+
+ if [[ ! -e ${build_dirs[0]} ]]; then
+ echo "error: No build directory found. Have you run 'meson build' yet?" >&2
+ return 1
+ elif (( ${#build_dirs[*]} > 1 )); then
+ echo "error: Multiple build directories found. Unable to proceed." >&2
+ return 1
+ fi
+
+ printf '%s\n' "${build_dirs[0]%/*}"
+}
+
+
+filter_targets_by_name() {
+ if command -v jq &>/dev/null; then
+ jq --arg re "$1" -r 'map(.name)[] | select(match($re))'
+ else
+ json_pp | awk -v filter="$1" -F'[:"]' \
+ '$2 == "name" && $(NF - 1) ~ filter { print $(NF - 1) }'
+ fi
+}
+
+# Make things simple and require that we're in the build root rather than
+# trying to chase down the location of this script and the relative build dir.
+if [[ ! -d .git ]]; then
+ echo "This script must be run from the root of the repository" >&2
+ exit 1
+fi
+
+build_dir=$(find_build_directory) || exit 1
+
+mapfile -t targets < \
+ <(meson introspect "$build_dir" --targets | filter_targets_by_name "-update-po$")
+
+ninja -C "$build_dir" "${targets[@]}"
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 00000000..b1ffd793
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1,118 @@
+manpages = [
+ { 'name': 'alpm-hooks.5' },
+ { 'name': 'pacman.8' },
+ { 'name': 'makepkg.8' },
+ { 'name': 'makepkg-template.1' },
+ { 'name': 'repo-add.8' },
+ { 'name': 'vercmp.8' },
+ { 'name': 'pkgdelta.8' },
+ { 'name': 'pacman-key.8' },
+ { 'name': 'PKGBUILD.5', 'extra_depends' : [ 'PKGBUILD-example.txt' ] },
+ { 'name': 'makepkg.conf.5' },
+ { 'name': 'pacman.conf.5' },
+ { 'name': 'libalpm.3' },
+ { 'name': 'BUILDINFO.5' },
+]
+
+asciidoc_conf = join_paths(meson.current_source_dir(), 'asciidoc.conf')
+
+asciidoc_opts = [
+ '-f', asciidoc_conf,
+ '-a', 'pacman_version="@0@"'.format(PACKAGE_VERSION),
+ '-a', 'pacman_date=@0@'.format(run_command('date', '+%Y-%m-%d').stdout().strip()),
+ '-a', 'pkgdatadir=@0@'.format(PKGDATADIR),
+ '-a', 'localstatedir=@0@'.format(LOCALSTATEDIR),
+ '-a', 'sysconfdir=@0@'.format(SYSCONFDIR),
+ '-a', 'datarootdir=@0@'.format(DATAROOTDIR),
+]
+
+html_targets = []
+html_files = []
+
+foreach page : manpages
+ manpage = page['name']
+ htmlpage = '@0@.html'.format(manpage)
+ input = '@0@.asciidoc'.format(manpage)
+
+ section = page['name'].split('.')[-1]
+
+ mandirn = join_paths(MANDIR, 'man' + section)
+
+ custom_target(
+ manpage,
+ command : [
+ A2X,
+ '--no-xmllint',
+ '-d', 'manpage',
+ '-f', 'manpage',
+ '--xsltproc-opts', '-param man.endnotes.list.enabled 0 -param man.endnotes.are.numbered 0',
+ '-D', '@OUTDIR@',
+ '--asciidoc-opts', ' '.join(asciidoc_opts),
+ '@INPUT@',
+ ],
+ input : input,
+ output : [manpage],
+ depend_files : [
+ asciidoc_conf,
+ ] + page.get('extra_depends', []),
+ install : true,
+ install_dir : mandirn,
+ )
+
+ html = custom_target(
+ htmlpage,
+ command : [
+ ASCIIDOC,
+ ] + asciidoc_opts + [
+ '-a', 'linkcss',
+ '-a', 'toc',
+ '-a', 'icons',
+ '-a', 'max-width=960px',
+ '-a', 'stylesheet=asciidoc-override.css',
+ '-o', '@OUTPUT@',
+ '@INPUT@',
+ ],
+ input : input,
+ output : [htmlpage],
+ depend_files : [
+ asciidoc_conf,
+ 'asciidoc-override.css',
+ ] + page.get('extra_depends', []),
+ build_by_default : false,
+ install : false,
+ )
+ html_targets += [html]
+ html_files += [htmlpage]
+endforeach
+
+run_target('html',
+ command : ['/bin/true'],
+ depends : html_targets)
+
+custom_target(
+ 'website.tar.gz',
+ command : [
+ 'bsdtar', 'czf', '@OUTPUT@',
+ '-C', meson.current_build_dir(),
+ ] + html_files + [
+ '-C', meson.current_source_dir(),
+ 'submitting-patches.html',
+ 'translation-help.html',
+ 'HACKING.html',
+ 'index.html',
+ 'asciidoc-override.css',
+ '-C', '/etc/asciidoc/stylesheets/',
+ 'asciidoc.css',
+ '-C', '/etc/asciidoc/javascripts/',
+ 'asciidoc.js',
+ '-C', '/etc/asciidoc/',
+ 'images',
+ ],
+ output : ['website.tar.gz'],
+ build_by_default : false,
+ depends : html_targets,
+)
+
+meson.add_install_script(MESON_MAKE_SYMLINK,
+ 'repo-add.8',
+ join_paths(MANDIR, 'man8/repo-remove.8'))
diff --git a/lib/libalpm/meson.build b/lib/libalpm/meson.build
new file mode 100644
index 00000000..84c3dde3
--- /dev/null
+++ b/lib/libalpm/meson.build
@@ -0,0 +1,33 @@
+libalpm_sources = files('''
+ add.h add.c
+ alpm.h alpm.c
+ alpm_list.h alpm_list.c
+ backup.h backup.c
+ base64.h base64.c
+ be_local.c
+ be_package.c
+ be_sync.c
+ conflict.h conflict.c
+ db.h db.c
+ delta.h delta.c
+ deps.h deps.c
+ diskspace.h diskspace.c
+ dload.h dload.c
+ error.c
+ filelist.h filelist.c
+ graph.h graph.c
+ group.h group.c
+ handle.h handle.c
+ hook.h hook.c
+ libarchive-compat.h
+ log.h log.c
+ package.h package.c
+ pkghash.h pkghash.c
+ rawstr.c
+ remove.h remove.c
+ signing.c signing.h
+ sync.h sync.c
+ trans.h trans.c
+ util.h util.c
+ version.c
+'''.split())
diff --git a/lib/libalpm/po/meson.build b/lib/libalpm/po/meson.build
new file mode 100644
index 00000000..cec28a15
--- /dev/null
+++ b/lib/libalpm/po/meson.build
@@ -0,0 +1,15 @@
+i18n.gettext(
+ 'libalpm',
+ args : [
+ '--directory=@0@'.format(meson.current_source_dir()),
+ '--msgid-bugs-address=http://bugs.archlinux.org/index.php?project=3',
+ '--copyright-holder="Pacman Development Team
On 22/10/18 7:46 am, Dave Reisner wrote:
3) No 'make dist' equivalent. Just run 'git archive' to generate a suitable tarball for distribution.
Is there a way to include pregenerated man pages with git archive? A
On Mon, Oct 22, 2018 at 07:54:57AM +1000, Allan McRae wrote:
On 22/10/18 7:46 am, Dave Reisner wrote:
3) No 'make dist' equivalent. Just run 'git archive' to generate a suitable tarball for distribution.
Is there a way to include pregenerated man pages with git archive?
A
No, git archive only considers what's in the git tree. Is there a reason we're determined to pre-generate the manpages instead of just adding makedepends on ascididoc?
On 10/21/18 6:12 PM, Dave Reisner wrote:
On Mon, Oct 22, 2018 at 07:54:57AM +1000, Allan McRae wrote:
On 22/10/18 7:46 am, Dave Reisner wrote:
3) No 'make dist' equivalent. Just run 'git archive' to generate a suitable tarball for distribution.
Is there a way to include pregenerated man pages with git archive?
A
No, git archive only considers what's in the git tree. Is there a reason we're determined to pre-generate the manpages instead of just adding makedepends on ascididoc?
I've got a better question, shouldn't we explicitly want to generate them at build time? The output depends on buildtime options -- it uses pkgdatadir, localstatedir, sysconfdir, datarootdir to redefine paths in the manpages. -- Eli Schwartz Bug Wrangler and Trusted User
On 22/10/18 8:12 am, Dave Reisner wrote:
On Mon, Oct 22, 2018 at 07:54:57AM +1000, Allan McRae wrote:
On 22/10/18 7:46 am, Dave Reisner wrote:
3) No 'make dist' equivalent. Just run 'git archive' to generate a suitable tarball for distribution.
Is there a way to include pregenerated man pages with git archive?
A
No, git archive only considers what's in the git tree. Is there a reason we're determined to pre-generate the manpages instead of just adding makedepends on ascididoc?
I think providing prebuilt man pages is more important now we require python3 for testing given asciidoc requires python2. Also, most projects ship prebuilt man pages. I think some GNU ones commit the built page to the tree, so that could be an option. Allan
On 10/21/18 6:26 PM, Allan McRae wrote:
On 22/10/18 8:12 am, Dave Reisner wrote:
On Mon, Oct 22, 2018 at 07:54:57AM +1000, Allan McRae wrote:
On 22/10/18 7:46 am, Dave Reisner wrote:
3) No 'make dist' equivalent. Just run 'git archive' to generate a suitable tarball for distribution.
Is there a way to include pregenerated man pages with git archive?
A
No, git archive only considers what's in the git tree. Is there a reason we're determined to pre-generate the manpages instead of just adding makedepends on ascididoc?
I think providing prebuilt man pages is more important now we require python3 for testing given asciidoc requires python2.
Maybe by the time we fully commit to meson, this will be ready for public release: https://github.com/asciidoc/asciidoc-py3 In fact, currently, Fedora uses it -- though via some sort of nonexistent tag or something. :/
Also, most projects ship prebuilt man pages. I think some GNU ones commit the built page to the tree, so that could be an option.
Both those things are also true about the configure and Makefile.in files... -- Eli Schwartz Bug Wrangler and Trusted User
On 22/10/18 8:57 am, Eli Schwartz wrote:
Also, most projects ship prebuilt man pages. I think some GNU ones commit the built page to the tree, so that could be an option.
Both those things are also true about the configure and Makefile.in files...
That is another good reason not to use git archive to create release tarballs. A
On Mon, Oct 22, 2018 at 09:56:04AM +1000, Allan McRae wrote:
On 22/10/18 8:57 am, Eli Schwartz wrote:
Also, most projects ship prebuilt man pages. I think some GNU ones commit the built page to the tree, so that could be an option.
Both those things are also true about the configure and Makefile.in files...
That is another good reason not to use git archive to create release tarballs.
A
Consider that the reason we need 'make dist' and can't just use 'git archive' is because autotools *requires* extra tooling around just to generate the build system. This is no longer needed with meson. Pre-generating the manpages means that our substitutions are invalidated. For example, someone building from the tarball with --prefix=/some/where/else or no --prefix at all will have a pacman.conf(5) that still claims the right path is /etc/pacman.conf I understand your point about python2 vs python3, but I think that's something we can work out based on a python3-based asciidoc in existance. What problems here would you like to see solved for the inclusion of meson? That will help me focus my time spent on this. dR
On 22/10/18 10:03 am, Dave Reisner wrote:
On Mon, Oct 22, 2018 at 09:56:04AM +1000, Allan McRae wrote:
On 22/10/18 8:57 am, Eli Schwartz wrote:
Also, most projects ship prebuilt man pages. I think some GNU ones commit the built page to the tree, so that could be an option.
Both those things are also true about the configure and Makefile.in files...
That is another good reason not to use git archive to create release tarballs.
A
Consider that the reason we need 'make dist' and can't just use 'git archive' is because autotools *requires* extra tooling around just to generate the build system. This is no longer needed with meson.
Good point! I'm not overly familiar with meson, so missed that completely.
Pre-generating the manpages means that our substitutions are invalidated. For example, someone building from the tarball with --prefix=/some/where/else or no --prefix at all will have a pacman.conf(5) that still claims the right path is /etc/pacman.conf
I understand your point about python2 vs python3, but I think that's something we can work out based on a python3-based asciidoc in existance.
Does the meson build script allow us to not create docs if wanted?
What problems here would you like to see solved for the inclusion of meson? That will help me focus my time spent on this.
None need solved for inclusion in the current state. I'm just trying to understand what our future release process will look like. While we have autotools in parallel, if I run "make dist" with this patch, do all the needed meson files get included too? Can we get a helper script to run doxygen? Thanks, Allan
On 10/21/18 9:16 PM, Allan McRae wrote:
On 22/10/18 10:03 am, Dave Reisner wrote:
On Mon, Oct 22, 2018 at 09:56:04AM +1000, Allan McRae wrote:
On 22/10/18 8:57 am, Eli Schwartz wrote:
Also, most projects ship prebuilt man pages. I think some GNU ones commit the built page to the tree, so that could be an option.
Both those things are also true about the configure and Makefile.in files...
That is another good reason not to use git archive to create release tarballs.
A
Consider that the reason we need 'make dist' and can't just use 'git archive' is because autotools *requires* extra tooling around just to generate the build system. This is no longer needed with meson.
Good point! I'm not overly familiar with meson, so missed that completely.
Pre-generating the manpages means that our substitutions are invalidated. For example, someone building from the tarball with --prefix=/some/where/else or no --prefix at all will have a pacman.conf(5) that still claims the right path is /etc/pacman.conf
I understand your point about python2 vs python3, but I think that's something we can work out based on a python3-based asciidoc in existance.
Does the meson build script allow us to not create docs if wanted?
Yes, it does. The file meson_options.txt is used as a central location to list all options, their description, and default values -- which is nicely readable too, slightly unlike configure.ac. :)
What problems here would you like to see solved for the inclusion of meson? That will help me focus my time spent on this.
None need solved for inclusion in the current state. I'm just trying to understand what our future release process will look like.
While we have autotools in parallel, if I run "make dist" with this patch, do all the needed meson files get included too? Can we get a helper script to run doxygen?
No, I think this is entirely down to EXTRA_DIST in Makefile.am, but specifying "meson_options.txt meson.build" might be enough. -- Eli Schwartz Bug Wrangler and Trusted User
On 10/21/18 9:32 PM, Eli Schwartz wrote:
On 10/21/18 9:16 PM, Allan McRae wrote:
None need solved for inclusion in the current state. I'm just trying to understand what our future release process will look like.
While we have autotools in parallel, if I run "make dist" with this patch, do all the needed meson files get included too? Can we get a helper script to run doxygen?
No, I think this is entirely down to EXTRA_DIST in Makefile.am, but specifying "meson_options.txt meson.build" might be enough.
Nope, not only does this not include the new files in build-aux, autotools also only matches this file in the current directorya. So, time to hardcode a long list of files... -- Eli Schwartz Bug Wrangler and Trusted User
On Mon, Oct 22, 2018 at 11:16:25AM +1000, Allan McRae wrote:
On 22/10/18 10:03 am, Dave Reisner wrote:
On Mon, Oct 22, 2018 at 09:56:04AM +1000, Allan McRae wrote:
On 22/10/18 8:57 am, Eli Schwartz wrote:
Also, most projects ship prebuilt man pages. I think some GNU ones commit the built page to the tree, so that could be an option.
Both those things are also true about the configure and Makefile.in files...
That is another good reason not to use git archive to create release tarballs.
A
Consider that the reason we need 'make dist' and can't just use 'git archive' is because autotools *requires* extra tooling around just to generate the build system. This is no longer needed with meson.
Good point! I'm not overly familiar with meson, so missed that completely.
Pre-generating the manpages means that our substitutions are invalidated. For example, someone building from the tarball with --prefix=/some/where/else or no --prefix at all will have a pacman.conf(5) that still claims the right path is /etc/pacman.conf
I understand your point about python2 vs python3, but I think that's something we can work out based on a python3-based asciidoc in existance.
Does the meson build script allow us to not create docs if wanted?
Yes, see the meson_options.txt as part of this patch. One can invoke meson with -Ddoc=disabled to prevent manpages from being built.
What problems here would you like to see solved for the inclusion of meson? That will help me focus my time spent on this.
None need solved for inclusion in the current state. I'm just trying to understand what our future release process will look like.
Great!
While we have autotools in parallel, if I run "make dist" with this patch, do all the needed meson files get included too? Can we get a helper script to run doxygen?
No, meson.build files will not be included with the autotools-built 'make dist' tarball. It feels weird to do this. I suspect that if we want to switch the Arch build over while this dual build-system world exists, we should just build from a tag in the git repo. Yes, I can add a script in build-aux to invoke doxygen. It's also possible I could create the Doxyfile as a .in file, and generate the right OUTPUT_DIRECTORY for invocation through the buildsys. There's actually an upstream example of exactly this: https://github.com/mesonbuild/meson/blob/master/test%20cases/frameworks/14%2... I'll look into options here.
Thanks, Allan
On Sun, Oct 21, 2018 at 10:11:18PM -0400, Dave Reisner wrote:
On Mon, Oct 22, 2018 at 11:16:25AM +1000, Allan McRae wrote:
On 22/10/18 10:03 am, Dave Reisner wrote:
On Mon, Oct 22, 2018 at 09:56:04AM +1000, Allan McRae wrote:
On 22/10/18 8:57 am, Eli Schwartz wrote:
Also, most projects ship prebuilt man pages. I think some GNU ones commit the built page to the tree, so that could be an option.
Both those things are also true about the configure and Makefile.in files...
That is another good reason not to use git archive to create release tarballs.
A
Consider that the reason we need 'make dist' and can't just use 'git archive' is because autotools *requires* extra tooling around just to generate the build system. This is no longer needed with meson.
Good point! I'm not overly familiar with meson, so missed that completely.
Pre-generating the manpages means that our substitutions are invalidated. For example, someone building from the tarball with --prefix=/some/where/else or no --prefix at all will have a pacman.conf(5) that still claims the right path is /etc/pacman.conf
I understand your point about python2 vs python3, but I think that's something we can work out based on a python3-based asciidoc in existance.
Does the meson build script allow us to not create docs if wanted?
Yes, see the meson_options.txt as part of this patch. One can invoke meson with -Ddoc=disabled to prevent manpages from being built.
What problems here would you like to see solved for the inclusion of meson? That will help me focus my time spent on this.
None need solved for inclusion in the current state. I'm just trying to understand what our future release process will look like.
Great!
While we have autotools in parallel, if I run "make dist" with this patch, do all the needed meson files get included too? Can we get a helper script to run doxygen?
No, meson.build files will not be included with the autotools-built 'make dist' tarball. It feels weird to do this. I suspect that if we want to switch the Arch build over while this dual build-system world exists, we should just build from a tag in the git repo.
Yes, I can add a script in build-aux to invoke doxygen. It's also possible I could create the Doxyfile as a .in file, and generate the right OUTPUT_DIRECTORY for invocation through the buildsys. There's actually an upstream example of exactly this:
https://github.com/mesonbuild/meson/blob/master/test%20cases/frameworks/14%2...
I'll look into options here.
Figured this out, there's now a -Ddoxygen flag on the build system which will build and install the doxygen crap if wanted. Adding this requires a slight tweak on the autotools side to handle the Doxyfile -> Doxyfile.in rename and subsequent generation. dR
On 10/21/18 7:56 PM, Allan McRae wrote:
On 22/10/18 8:57 am, Eli Schwartz wrote:
Also, most projects ship prebuilt man pages. I think some GNU ones commit the built page to the tree, so that could be an option.
Both those things are also true about the configure and Makefile.in files...
That is another good reason not to use git archive to create release tarballs.
Well, the point I'm trying to make here is that they're connected. They ship prebuilt man pages because they're already forced into using make dist in order to generate the build system. The egregiously offensive ones even commit their autotools results to git which is pure madness... It's not pure madness to check manpages into git, but it also doesn't seem like a hugely important thing. Excepting projects that only provide troff-formatted manpages from the start, and autotools project where it doesn't prove anything, how many are left that provide pregenerated manpages? ... Anyway, given this patch is meant to provide an alternative to autotools, if we ever stop generating autotools dist tarballs it is because we don't need configure/Makefile.in anymore, in which case arguing based on that merit will be obsolete, and the only question to consider is the doc files specifically. For which we'll need to ask the question, did we ever need them in the first place or were we just used to having them as a byproduct of the previous build system requirements. I guess we have time to think about how to fully implement a dist target for meson, after getting it completed as a valid build target first... -- Eli Schwartz Bug Wrangler and Trusted User
On 10/21/18 at 05:46pm, Dave Reisner wrote: -- >8 -- (lots of words)
diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..3f9b2ae0 --- /dev/null +++ b/meson.build @@ -0,0 +1,487 @@
-- >8 -- (many more words)
+PYTHON = find_program('python')
This should look for python3, should it not? -- >8 -- (I really hope this was mostly copy-paste)
+libcommon = static_library( + 'common', + libcommon_sources, + install : false)
It's a mistake, but common/ini.c currently includes alpm.h, which grabs the system alpm.h, or dies if it's not installed, because this doesn't link_with libalpm. I'll send a patch to fix this particular error, but I can imagine this sort of subtle error creeping in again. Should we proactively link_with libalpm to prevent this from recurring? -- >8 -- (seriously, this patch is huge)
diff --git a/test/pacman/meson.build b/test/pacman/meson.build new file mode 100644 index 00000000..dbdb429e --- /dev/null +++ b/test/pacman/meson.build @@ -0,0 +1,357 @@ +pacman_tests = [ + { 'name': 'tests/backup001.py' },
Having the test list and expected success/failure duplicated here is almost certain to lead to meson and autotools getting out of sync. Can/should we dynamically create this list at least for as long as we're maintaining both build systems?
On Thu, Nov 01, 2018 at 01:03:27AM -0700, Andrew Gregory wrote:
On 10/21/18 at 05:46pm, Dave Reisner wrote:
-- >8 -- (lots of words)
diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..3f9b2ae0 --- /dev/null +++ b/meson.build @@ -0,0 +1,487 @@
-- >8 -- (many more words)
+PYTHON = find_program('python')
This should look for python3, should it not?
-- >8 -- (I really hope this was mostly copy-paste)
+libcommon = static_library( + 'common', + libcommon_sources, + install : false)
It's a mistake, but common/ini.c currently includes alpm.h, which grabs the system alpm.h, or dies if it's not installed, because this doesn't link_with libalpm. I'll send a patch to fix this particular error, but I can imagine this sort of subtle error creeping in again. Should we proactively link_with libalpm to prevent this from recurring?
I get what you're saying about ini.c wrongly including alpm.h, but I'm not sure I follow about linking with libalpm. Shouldn't the includes be fixed such that the inclusion of alpm.h comes from lib/libalpm rather than /usr/include? I'm not clear on what linking with the local libalpm accomplishes other than being an unnecessary dependency.
-- >8 -- (seriously, this patch is huge)
diff --git a/test/pacman/meson.build b/test/pacman/meson.build new file mode 100644 index 00000000..dbdb429e --- /dev/null +++ b/test/pacman/meson.build @@ -0,0 +1,357 @@ +pacman_tests = [ + { 'name': 'tests/backup001.py' },
Having the test list and expected success/failure duplicated here is almost certain to lead to meson and autotools getting out of sync. Can/should we dynamically create this list at least for as long as we're maintaining both build systems?
I'll think about how to do this... I'm not crazy about the idea of making configuration of the meson build anything more than just 'meson build', and this all needs to ready for processing at the time meson generates the inputs for ninja.
On 11/01/18 at 08:51pm, Dave Reisner wrote:
On Thu, Nov 01, 2018 at 01:03:27AM -0700, Andrew Gregory wrote:
On 10/21/18 at 05:46pm, Dave Reisner wrote:
...
+libcommon = static_library( + 'common', + libcommon_sources, + install : false)
It's a mistake, but common/ini.c currently includes alpm.h, which grabs the system alpm.h, or dies if it's not installed, because this doesn't link_with libalpm. I'll send a patch to fix this particular error, but I can imagine this sort of subtle error creeping in again. Should we proactively link_with libalpm to prevent this from recurring?
I get what you're saying about ini.c wrongly including alpm.h, but I'm not sure I follow about linking with libalpm. Shouldn't the includes be fixed such that the inclusion of alpm.h comes from lib/libalpm rather than /usr/include? I'm not clear on what linking with the local libalpm accomplishes other than being an unnecessary dependency.
I've still not played with meson enough to fully understand exactly how it works. The use of link_with was just to get meson to use lib/libalpm as an include dir. If there's a better way to do that, great, I just want to make sure that if a common file includes alpm.h in the future, it doesn't sneakily use the system copy.
On Thu, Nov 01, 2018 at 06:38:03PM -0700, Andrew Gregory wrote:
On 11/01/18 at 08:51pm, Dave Reisner wrote:
On Thu, Nov 01, 2018 at 01:03:27AM -0700, Andrew Gregory wrote:
On 10/21/18 at 05:46pm, Dave Reisner wrote:
...
+libcommon = static_library( + 'common', + libcommon_sources, + install : false)
It's a mistake, but common/ini.c currently includes alpm.h, which grabs the system alpm.h, or dies if it's not installed, because this doesn't link_with libalpm. I'll send a patch to fix this particular error, but I can imagine this sort of subtle error creeping in again. Should we proactively link_with libalpm to prevent this from recurring?
I get what you're saying about ini.c wrongly including alpm.h, but I'm not sure I follow about linking with libalpm. Shouldn't the includes be fixed such that the inclusion of alpm.h comes from lib/libalpm rather than /usr/include? I'm not clear on what linking with the local libalpm accomplishes other than being an unnecessary dependency.
I've still not played with meson enough to fully understand exactly how it works. The use of link_with was just to get meson to use lib/libalpm as an include dir. If there's a better way to do that, great, I just want to make sure that if a common file includes alpm.h in the future, it doesn't sneakily use the system copy.
Ah yes, we're saying the same thing. Fixed on my branch.
participants (5)
-
Allan McRae
-
Andrew Gregory
-
Dave Reisner
-
Dave Reisner
-
Eli Schwartz