build: build help.h with meson
parent
fe1de720d0
commit
718e07f78a
|
@ -1,8 +1,4 @@
|
||||||
scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
|
man_files = files(
|
||||||
sh = find_program('sh', native: true)
|
|
||||||
mandir = get_option('mandir')
|
|
||||||
|
|
||||||
man_files = [
|
|
||||||
'apk.8.scd',
|
'apk.8.scd',
|
||||||
'apk-add.8.scd',
|
'apk-add.8.scd',
|
||||||
'apk-audit.8.scd',
|
'apk-audit.8.scd',
|
||||||
|
@ -25,22 +21,28 @@ man_files = [
|
||||||
'apk-verify.8.scd',
|
'apk-verify.8.scd',
|
||||||
'apk-version.8.scd',
|
'apk-version.8.scd',
|
||||||
'apk-world.5.scd',
|
'apk-world.5.scd',
|
||||||
]
|
)
|
||||||
|
|
||||||
foreach filename : man_files
|
if scdoc_dep.found()
|
||||||
topic = filename.split('.')[-3].split('/')[-1]
|
scdoc_prog = find_program(scdoc_dep.get_pkgconfig_variable('scdoc'), native: true)
|
||||||
section = filename.split('.')[-2]
|
sh = find_program('sh', native: true)
|
||||||
output = '@0@.@1@'.format(topic, section)
|
mandir = get_option('mandir')
|
||||||
|
|
||||||
custom_target(
|
foreach filename : man_files
|
||||||
output,
|
topic = '@0@'.format(filename).split('.')[-3].split('/')[-1]
|
||||||
input: filename,
|
section = '@0@'.format(filename).split('.')[-2]
|
||||||
capture: true,
|
output = '@0@.@1@'.format(topic, section)
|
||||||
output: output,
|
|
||||||
command: [
|
custom_target(
|
||||||
sh, '-c', '@0@ < @INPUT@'.format(scdoc_prog.path())
|
output,
|
||||||
],
|
input: filename,
|
||||||
install: true,
|
capture: true,
|
||||||
install_dir: '@0@/man@1@'.format(mandir, section)
|
output: output,
|
||||||
)
|
command: [
|
||||||
endforeach
|
sh, '-c', '@0@ < @INPUT@'.format(scdoc_prog.path())
|
||||||
|
],
|
||||||
|
install: true,
|
||||||
|
install_dir: '@0@/man@1@'.format(mandir, section)
|
||||||
|
)
|
||||||
|
endforeach
|
||||||
|
endif
|
||||||
|
|
|
@ -13,7 +13,7 @@ apk_libdir = get_option('libdir')
|
||||||
zlib_dep = dependency('zlib')
|
zlib_dep = dependency('zlib')
|
||||||
openssl_dep = dependency('openssl')
|
openssl_dep = dependency('openssl')
|
||||||
lua_dep = dependency('lua' + get_option('lua_version'), required: get_option('lua'))
|
lua_dep = dependency('lua' + get_option('lua_version'), required: get_option('lua'))
|
||||||
scdoc = dependency('scdoc', version: '>=1.10', required: get_option('docs'))
|
scdoc_dep = dependency('scdoc', version: '>=1.10', required: get_option('docs'))
|
||||||
|
|
||||||
add_project_arguments('-D_GNU_SOURCE', language: 'c')
|
add_project_arguments('-D_GNU_SOURCE', language: 'c')
|
||||||
|
|
||||||
|
@ -23,9 +23,6 @@ if get_option('default_library') == 'static'
|
||||||
add_project_arguments('-DOPENSSL_NO_ENGINE', language: 'c')
|
add_project_arguments('-DOPENSSL_NO_ENGINE', language: 'c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
subdir('doc')
|
||||||
subdir('libfetch')
|
subdir('libfetch')
|
||||||
subdir('src')
|
subdir('src')
|
||||||
|
|
||||||
if scdoc.found()
|
|
||||||
subdir('doc')
|
|
||||||
endif
|
|
||||||
|
|
|
@ -51,8 +51,21 @@ apk_src = [
|
||||||
'app_stats.c',
|
'app_stats.c',
|
||||||
'app_verify.c',
|
'app_verify.c',
|
||||||
'app_version.c',
|
'app_version.c',
|
||||||
|
'help.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
genhelp_script = find_program('genhelp.lua')
|
||||||
|
|
||||||
|
generated_help = custom_target(
|
||||||
|
'help.h',
|
||||||
|
capture: true,
|
||||||
|
output: 'help.h',
|
||||||
|
input: man_files,
|
||||||
|
command: [genhelp_script, '@INPUT@'],
|
||||||
|
)
|
||||||
|
|
||||||
|
apk_src += [ generated_help ]
|
||||||
|
|
||||||
apk_cargs = [
|
apk_cargs = [
|
||||||
'-DAPK_VERSION="' + meson.project_version() + '"',
|
'-DAPK_VERSION="' + meson.project_version() + '"',
|
||||||
'-D_ATFILE_SOURCE',
|
'-D_ATFILE_SOURCE',
|
||||||
|
|
Loading…
Reference in New Issue