add builtin support for localstatedir

Reported-by: Richard Hughes <richard@hughsie.com>
Closes: https://github.com/mesonbuild/meson/issues/1142
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
pull/1154/head
Igor Gnatenko 8 years ago committed by Jussi Pakkanen
parent 66ed54a94e
commit c9818c02ec
  1. 23
      data/macros.meson
  2. 12
      mesonbuild/coredata.py
  3. 1
      mesonbuild/mconf.py
  4. 1
      mesonbuild/mesonmain.py

@ -10,17 +10,18 @@
export LDFLAGS="%{?__global_ldflags}" \ export LDFLAGS="%{?__global_ldflags}" \
mkdir -p %{__builddir} \ mkdir -p %{__builddir} \
pushd %{__builddir} \ pushd %{__builddir} \
%{__meson} \\\ %{__meson} \\\
--buildtype=plain \\\ --buildtype=plain \\\
--prefix=%{_prefix} \\\ --prefix=%{_prefix} \\\
--libdir=%{_libdir} \\\ --libdir=%{_libdir} \\\
--libexecdir=%{_libexecdir} \\\ --libexecdir=%{_libexecdir} \\\
--bindir=%{_bindir} \\\ --bindir=%{_bindir} \\\
--includedir=%{_includedir} \\\ --includedir=%{_includedir} \\\
--datadir=%{_datadir} \\\ --datadir=%{_datadir} \\\
--mandir=%{_mandir} \\\ --mandir=%{_mandir} \\\
--localedir=%{_datadir}/locale \\\ --localedir=%{_datadir}/locale \\\
--sysconfdir=%{_sysconfdir} \\\ --sysconfdir=%{_sysconfdir} \\\
--localstatedir=%{_localstatedir} \\\
$OLDPWD/%{__sourcedir} \ $OLDPWD/%{__sourcedir} \
popd popd

@ -212,15 +212,17 @@ builtin_options = {
'datadir' : [ UserStringOption, 'Data file directory.', 'share' ], 'datadir' : [ UserStringOption, 'Data file directory.', 'share' ],
'mandir' : [ UserStringOption, 'Manual page directory.', 'share/man' ], 'mandir' : [ UserStringOption, 'Manual page directory.', 'share/man' ],
'localedir' : [ UserStringOption, 'Locale data directory.', 'share/locale' ], 'localedir' : [ UserStringOption, 'Locale data directory.', 'share/locale' ],
# Sysconfdir is a bit special. It defaults to ${prefix}/etc but nobody # sysconfdir and localstatedir are a bit special. These defaults to ${prefix}/etc and
# uses that. Instead they always set it manually to /etc. This default # ${prefix}/var but nobody uses that. Instead they always set it manually to /etc and /var.
# value is thus pointless and not really used but we set it to this # This default values is thus pointless and not really used but we set it to this
# for consistency with other systems. # for consistency with other systems.
# #
# Projects installing to sysconfdir probably want to set the following in project(): # Projects installing to sysconfdir and/or localstatedir probably want
# to set the following in project():
# #
# default_options : ['sysconfdir=/etc'] # default_options : ['sysconfdir=/etc', 'localstatedir=/var']
'sysconfdir' : [ UserStringOption, 'Sysconf data directory.', 'etc' ], 'sysconfdir' : [ UserStringOption, 'Sysconf data directory.', 'etc' ],
'localstatedir' : [ UserStringOption, 'Localstate data directory.', 'var' ],
'werror' : [ UserBooleanOption, 'Treat warnings as errors.', False ], 'werror' : [ UserBooleanOption, 'Treat warnings as errors.', False ],
'warning_level' : [ UserComboOption, 'Compiler warning level to use.', [ '1', '2', '3' ], '1'], 'warning_level' : [ UserComboOption, 'Compiler warning level to use.', [ '1', '2', '3' ], '1'],
'layout' : [ UserComboOption, 'Build directory layout.', ['mirror', 'flat' ], 'mirror' ], 'layout' : [ UserComboOption, 'Build directory layout.', ['mirror', 'flat' ], 'mirror' ],

@ -174,6 +174,7 @@ class Conf:
'mandir', 'mandir',
'localedir', 'localedir',
'sysconfdir', 'sysconfdir',
'localstatedir',
]: ]:
parr.append([key, coredata.get_builtin_option_description(key), parr.append([key, coredata.get_builtin_option_description(key),
self.coredata.get_builtin_option(key), coredata.get_builtin_option_choices(key)]) self.coredata.get_builtin_option(key), coredata.get_builtin_option_choices(key)])

@ -46,6 +46,7 @@ add_builtin_argument('datadir')
add_builtin_argument('mandir') add_builtin_argument('mandir')
add_builtin_argument('localedir') add_builtin_argument('localedir')
add_builtin_argument('sysconfdir') add_builtin_argument('sysconfdir')
add_builtin_argument('localstatedir')
add_builtin_argument('backend') add_builtin_argument('backend')
add_builtin_argument('buildtype') add_builtin_argument('buildtype')
add_builtin_argument('strip', action='store_true') add_builtin_argument('strip', action='store_true')

Loading…
Cancel
Save