aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorX512 <danger_mail@list.ru>2022-06-10 22:34:00 +0900
committerEli Schwartz <eschwartz93@gmail.com>2023-01-20 14:57:33 -0500
commit307473179773c59009ee824452743ff11645366d (patch)
tree91a67c77357c2c57c7877df421c24f4989b4ef1a /mesonbuild
parentef189b1d361399c2ba504944e51f48f21cdd1f6f (diff)
downloadmeson-307473179773c59009ee824452743ff11645366d.zip
meson-307473179773c59009ee824452743ff11645366d.tar.gz
meson-307473179773c59009ee824452743ff11645366d.tar.bz2
haiku: set default prefix and library paths
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/coredata.py18
-rw-r--r--mesonbuild/utils/universal.py57
2 files changed, 66 insertions, 9 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index 893ac45..de5a8c9 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.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([
diff --git a/mesonbuild/utils/universal.py b/mesonbuild/utils/universal.py
index f6e2c4c..5c91449 100644
--- a/mesonbuild/utils/universal.py
+++ b/mesonbuild/utils/universal.py
@@ -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: