Skip to content

Commit

Permalink
readme: use disabler + build_by_default=false
Browse files Browse the repository at this point in the history
  • Loading branch information
Siborgium committed Dec 3, 2022
1 parent c4d8d36 commit af5c659
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 22 deletions.
54 changes: 33 additions & 21 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -67,33 +67,45 @@ if get_option('grid')
subdir('grid')
endif

if get_option('generate-readme')

# find python in the most modern way available
if meson.version() > '0.46.0'
pymod = import('python')
python = pymod.find_installation('python3', required: false)
elif meson.version() > '0.38.0'
pymod = import('python3')
python = pymod.find_python()
else
python = find_program('python3', required: false)
if not python.found()
message('python3 not found in PATH, trying python...')
python = find_program('python', required: true)
python = find_program('python', required: false)
endif
endif

# generate README.md from template
# make sure to copy it to the source directory!
readme = custom_target('readme',
output: [ 'README.md' ],
input: [ 'README.md.in' ],
command: [
python, '@SOURCE_ROOT@/make_readme.py',
'@INPUT@', '@OUTPUT@',
bar_exe.full_path(),
dmenu_exe.full_path(),
grid_client_exe.full_path(),
grid_server_exe.full_path()
],
depends: [bar_exe, dmenu_exe, grid_client_exe, grid_server_exe],
install_dir: conf_data.get('datadir'),
install: true
)
if not python.found()
python = disabler()
endif


# generate README.md from template
# make sure to copy it to the source directory!
readme = custom_target('readme',
output: [ 'README.md' ],
input: [ 'README.md.in' ],
command: [
python, '@SOURCE_ROOT@/make_readme.py',
'@INPUT@', '@OUTPUT@',
bar_exe.full_path(),
dmenu_exe.full_path(),
grid_client_exe.full_path(),
grid_server_exe.full_path()
],
depends: [bar_exe, dmenu_exe, grid_client_exe, grid_server_exe],
build_by_default: false
)

install_data(
['icon-missing.svg', 'icon-missing.png'],
install_dir: conf_data.get('datadir')
['icon-missing.svg', 'icon-missing.png'],
install_dir: conf_data.get('datadir')
)
1 change: 0 additions & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ option('dmenu', type: 'boolean', value: true, description: 'Build the dmenu app.
option('grid', type: 'boolean', value: true, description: 'Build the grid app.')
option('layer-shell', type: 'feature', value: 'auto', description: 'Enable layer-shell support')
option('gdk-x11', type: 'feature', value: 'auto', description: 'Use Gdk X11 API')
option('generate-readme', type: 'boolean', value: false, description: 'Generate fresh README.md in build directory')

0 comments on commit af5c659

Please sign in to comment.