Meson: add rule for tags.r2 (#10215)

This commit is contained in:
Paul I 2018-05-29 00:25:48 +03:00 committed by radare
parent 452f1ae3db
commit cad927a591
11 changed files with 44 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -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')
)

View File

@ -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']
)

23
libr/flag/d/meson.build Normal file
View File

@ -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
)

View File

@ -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 */

View File

@ -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
)

View File

@ -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

View File

@ -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'
)

View File

@ -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: '')

View File

@ -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')