diff --git a/libr/anal/d/meson.build b/libr/anal/d/meson.build index da2321cf86..1d28091393 100644 --- a/libr/anal/d/meson.build +++ b/libr/anal/d/meson.build @@ -35,6 +35,6 @@ foreach file : sdb_files build_by_default: true, build_always: false, install: true, - install_dir: join_paths(get_option('datadir'), 'radare2', r2_version, 'fcnsign') + install_dir: join_paths(r2_sdb, 'fcnsign') ) endforeach diff --git a/libr/asm/d/meson.build b/libr/asm/d/meson.build index 9d7f0be6f4..d659880bc1 100644 --- a/libr/asm/d/meson.build +++ b/libr/asm/d/meson.build @@ -38,6 +38,6 @@ foreach file : sdb_files build_by_default: true, build_always: false, install: true, - install_dir: join_paths(get_option('datadir'), 'radare2', r2_version, 'opcodes') + install_dir: join_paths(r2_sdb, 'opcodes') ) endforeach diff --git a/libr/bin/d/meson.build b/libr/bin/d/meson.build index 43beedd7e7..a60658e352 100644 --- a/libr/bin/d/meson.build +++ b/libr/bin/d/meson.build @@ -55,7 +55,7 @@ foreach file : sdb_files build_by_default: true, build_always: false, install: true, - install_dir: join_paths(get_option('datadir'), 'radare2', r2_version, 'format/dll') + install_dir: join_paths(r2_sdb, 'format/dll') ) endforeach @@ -70,5 +70,5 @@ format_files = [ ] install_data(format_files, - install_dir: join_paths(get_option('datadir'), 'radare2', r2_version, 'format') + install_dir: join_paths(r2_sdb, 'format') ) diff --git a/libr/cons/d/meson.build b/libr/cons/d/meson.build index f7a56c4ff2..2ff61bac0a 100644 --- a/libr/cons/d/meson.build +++ b/libr/cons/d/meson.build @@ -1,4 +1,4 @@ install_subdir('.', - install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'radare2', r2_version, 'cons'), + install_dir: join_paths(get_option('prefix'), r2_themes), exclude_files: ['Makefile', 'meson.build'] ) diff --git a/libr/flag/d/meson.build b/libr/flag/d/meson.build new file mode 100644 index 0000000000..0e57d64b1a --- /dev/null +++ b/libr/flag/d/meson.build @@ -0,0 +1,23 @@ +files = run_command(glob_cmd + ['*']).stdout().strip().split(';') + +script = '''#script +import os +from sys import argv +for fname in argv[1:]: + if any(ex in fname for ex in ('meson.build', 'Makefile')): + continue + with open(fname) as f: + text = ' '.join(f.read().splitlines()) + print('ft %s %s' % (os.path.basename(fname), text)) +''' + +custom_target('tags.r2', + input: files, + output: 'tags.r2', + command: [py3_exe, '-c', script, '@INPUT@'], + capture: true, + build_by_default: true, + build_always: false, + install: true, + install_dir: r2_flags +) diff --git a/libr/include/r_types.h b/libr/include/r_types.h index d6a389844a..3bd527f0ba 100644 --- a/libr/include/r_types.h +++ b/libr/include/r_types.h @@ -3,7 +3,6 @@ // defines like IS_DIGIT, etc' #include "r_util/r_str_util.h" -#include "r_userconf.h" // TODO: fix this to make it crosscompile-friendly: R_SYS_OSTYPE ? /* operating system */ diff --git a/libr/magic/d/meson.build b/libr/magic/d/meson.build index d1e1eb3208..c0559e37d7 100644 --- a/libr/magic/d/meson.build +++ b/libr/magic/d/meson.build @@ -1,4 +1,4 @@ install_subdir('default', - install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'radare2', r2_version, 'magic'), + install_dir: join_paths(get_option('prefix'), r2_sdb, 'magic'), strip_directory: true ) diff --git a/libr/syscall/d/meson.build b/libr/syscall/d/meson.build index 21e17d3fb3..b8907d4e0c 100644 --- a/libr/syscall/d/meson.build +++ b/libr/syscall/d/meson.build @@ -31,6 +31,6 @@ foreach file : sdb_files build_by_default: true, build_always: false, install: true, - install_dir: join_paths(get_option('datadir'), 'radare2', r2_version, 'syscall') + install_dir: join_paths(r2_sdb, 'syscall') ) endforeach diff --git a/meson.build b/meson.build index 6a60a43283..5419d7a0ad 100644 --- a/meson.build +++ b/meson.build @@ -36,13 +36,13 @@ if git_exe.found() if git_rev_list.returncode() == 0 version_commit = git_rev_list.stdout().strip() endif - + # Get gittap git_describe = run_command(git_exe, '-C', repo, 'describe', '--tags', '--match', '[0-9]*') if git_describe.returncode() == 0 gittap = git_describe.stdout().strip() endif - + # Get gittip git_rev_parse = run_command(git_exe, '-C', repo, 'rev-parse', 'HEAD') if git_rev_parse.returncode() == 0 @@ -121,6 +121,7 @@ if host_machine.system() == 'windows' r2_zigns = join_paths(r2_datdir, 'zigns') r2_themes = join_paths(r2_datdir, 'cons') r2_fortunes = join_paths(r2_datdir, 'doc') + r2_flags = join_paths(r2_datdir, 'flag') r2_hud = join_paths(r2_datdir, 'hud') opts2 = [ @@ -129,6 +130,7 @@ if host_machine.system() == 'windows' 'r2_zigns', 'r2_themes', 'r2_fortunes', + 'r2_flags', 'r2_hud' ] foreach opt : opts2 @@ -162,6 +164,7 @@ else r2_zigns = join_paths(get_option('datadir'), 'radare2', r2_version, 'zigns') r2_themes = join_paths(get_option('datadir'), 'radare2', r2_version, 'cons') r2_fortunes = join_paths(get_option('datadir'), 'doc/radare2') + r2_flags = join_paths(get_option('datadir'), 'radare2', r2_version, 'flag') r2_hud = join_paths(get_option('datadir'), 'radare2', r2_version, 'hud') r2_plugins = join_paths(get_option('libdir'), 'radare2', r2_version) r2_extras = join_paths(get_option('libdir'), 'radare2-extras', r2_version) @@ -203,6 +206,7 @@ userconf.set('SDB', r2_sdb) userconf.set('ZIGNS', r2_zigns) userconf.set('THEMES', r2_themes) userconf.set('FORTUNES', r2_fortunes) +userconf.set('FLAGS', r2_flags) userconf.set('HUD', r2_hud) userconf.set('PLUGINS', r2_plugins) userconf.set('EXTRAS', r2_extras) @@ -289,6 +293,7 @@ subdir('libr/bin/d') subdir('libr/syscall/d') subdir('libr/cons/d') subdir('libr/magic/d') +subdir('libr/flag/d') if not meson.is_subproject() subdir('binr/rahash2') @@ -332,12 +337,13 @@ else endif install_subdir('shlr/www', - install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'radare2', r2_version) + install_dir: r2_wwwroot, + strip_directory: true ) fortunes_files = run_command(glob_cmd + ['doc/fortunes.*']).stdout().strip().split(';') install_data(fortunes_files, - install_dir: join_paths(get_option('datadir'), 'doc/radare2') + install_dir: r2_fortunes ) man1_files = run_command(glob_cmd + ['man/*.1']).stdout().strip().split(';') @@ -351,6 +357,6 @@ install_data(man7_files, ) install_data('doc/hud', - install_dir: join_paths(get_option('datadir'), 'radare2', r2_version, 'hud'), + install_dir: r2_hud, rename: 'main' ) diff --git a/meson_options.txt b/meson_options.txt index f6817a8f7a..f261817e0d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -7,6 +7,7 @@ option('r2_sdb', type: 'string', value: '') option('r2_zigns', type: 'string', value: '') option('r2_themes', type: 'string', value: '') option('r2_fortunes', type: 'string', value: '') +option('r2_flags', type: 'string', value: '') option('r2_hud', type: 'string', value: '') option('r2_version_commit', type: 'string', value: '') option('r2_gittap', type: 'string', value: '') diff --git a/sys/meson.py b/sys/meson.py index 4353e92a0a..82601a4308 100644 --- a/sys/meson.py +++ b/sys/meson.py @@ -196,6 +196,8 @@ def win_dist_libr2(**path_fmt): copy(r'{BUILDDIR}\libr\bin\d\*.sdb', r'{DIST}\{R2_SDB}\format\dll') copytree(r'{ROOT}\libr\cons\d', r'{DIST}\{R2_THEMES}', exclude=('Makefile', 'meson.build')) + makedirs(r'{DIST}\{R2_FLAGS}') + copy(r'{BUILDDIR}\libr\flag\d\*.r2', r'{DIST}\{R2_FLAGS}') makedirs(r'{DIST}\{R2_HUD}') copy(r'{ROOT}\doc\hud', r'{DIST}\{R2_HUD}\main')