haiku: set default prefix and library paths

pull/11323/head
X512 3 years ago committed by Eli Schwartz
parent ef189b1d36
commit 3074731797
  1. 18
      mesonbuild/coredata.py
  2. 57
      mesonbuild/utils/universal.py

@ -23,7 +23,9 @@ from .mesonlib import (
HoldableObject,
MesonException, EnvironmentException, MachineChoice, PerMachine,
PerMachineDefaultable, default_libdir, default_libexecdir,
default_prefix, split_args, OptionKey, OptionType, stringlistify,
default_prefix, default_datadir, default_includedir, default_infodir,
default_localedir, default_mandir, default_sbindir, default_sysconfdir,
split_args, OptionKey, OptionType, stringlistify,
pickle_load, replace_if_different
)
from .wrap import WrapMode
@ -1195,18 +1197,18 @@ class BuiltinOption(T.Generic[_T, _U]):
BUILTIN_DIR_OPTIONS: 'MutableKeyedOptionDictType' = OrderedDict([
(OptionKey('prefix'), BuiltinOption(UserStringOption, 'Installation prefix', default_prefix())),
(OptionKey('bindir'), BuiltinOption(UserStringOption, 'Executable directory', 'bin')),
(OptionKey('datadir'), BuiltinOption(UserStringOption, 'Data file directory', 'share')),
(OptionKey('includedir'), BuiltinOption(UserStringOption, 'Header file directory', 'include')),
(OptionKey('infodir'), BuiltinOption(UserStringOption, 'Info page directory', 'share/info')),
(OptionKey('datadir'), BuiltinOption(UserStringOption, 'Data file directory', default_datadir())),
(OptionKey('includedir'), BuiltinOption(UserStringOption, 'Header file directory', default_includedir())),
(OptionKey('infodir'), BuiltinOption(UserStringOption, 'Info page directory', default_infodir())),
(OptionKey('libdir'), BuiltinOption(UserStringOption, 'Library directory', default_libdir())),
(OptionKey('licensedir'), BuiltinOption(UserStringOption, 'Licenses directory', '')),
(OptionKey('libexecdir'), BuiltinOption(UserStringOption, 'Library executable directory', default_libexecdir())),
(OptionKey('localedir'), BuiltinOption(UserStringOption, 'Locale data directory', 'share/locale')),
(OptionKey('localedir'), BuiltinOption(UserStringOption, 'Locale data directory', default_localedir())),
(OptionKey('localstatedir'), BuiltinOption(UserStringOption, 'Localstate data directory', 'var')),
(OptionKey('mandir'), BuiltinOption(UserStringOption, 'Manual page directory', 'share/man')),
(OptionKey('sbindir'), BuiltinOption(UserStringOption, 'System executable directory', 'sbin')),
(OptionKey('mandir'), BuiltinOption(UserStringOption, 'Manual page directory', default_mandir())),
(OptionKey('sbindir'), BuiltinOption(UserStringOption, 'System executable directory', default_sbindir())),
(OptionKey('sharedstatedir'), BuiltinOption(UserStringOption, 'Architecture-independent data directory', 'com')),
(OptionKey('sysconfdir'), BuiltinOption(UserStringOption, 'Sysconf data directory', 'etc')),
(OptionKey('sysconfdir'), BuiltinOption(UserStringOption, 'Sysconf data directory', default_sysconfdir())),
])
BUILTIN_CORE_OPTIONS: 'MutableKeyedOptionDictType' = OrderedDict([

@ -82,6 +82,13 @@ __all__ = [
'default_libdir',
'default_libexecdir',
'default_prefix',
'default_datadir',
'default_includedir',
'default_infodir',
'default_localedir',
'default_mandir',
'default_sbindir',
'default_sysconfdir',
'detect_subprojects',
'detect_vcs',
'do_conf_file',
@ -977,12 +984,60 @@ def default_libdir() -> str:
def default_libexecdir() -> str:
if is_haiku():
return 'lib'
# There is no way to auto-detect this, so it must be set at build time
return 'libexec'
def default_prefix() -> str:
return 'c:/' if is_windows() else '/usr/local'
if is_windows():
return 'c:/'
if is_haiku():
return '/boot/system/non-packaged'
return '/usr/local'
def default_datadir() -> str:
if is_haiku():
return 'data'
return 'share'
def default_includedir() -> str:
if is_haiku():
return 'develop/headers'
return 'include'
def default_infodir() -> str:
if is_haiku():
return 'documentation/info'
return 'share/info'
def default_localedir() -> str:
if is_haiku():
return 'data/locale'
return 'share/locale'
def default_mandir() -> str:
if is_haiku():
return 'documentation/man'
return 'share/man'
def default_sbindir() -> str:
if is_haiku():
return 'bin'
return 'sbin'
def default_sysconfdir() -> str:
if is_haiku():
return 'settings'
return 'etc'
def has_path_sep(name: str, sep: str = '/\\') -> bool:

Loading…
Cancel
Save