void-packages/srcpkgs/nwg-launchers/patches/disable-readme-generation.p...

48 lines
1.7 KiB
Diff

# https://github.com/nwg-piotr/nwg-launchers/commit/c4d8d369782d32becfe8a8105abec9b61119a629
diff --git a/meson.build b/meson.build
index f6159b4..fc5ef60 100644
--- a/meson.build
+++ b/meson.build
@@ -67,14 +67,15 @@ if get_option('grid')
subdir('grid')
endif
-python = find_program('python3', required: false)
-if not python.found()
- python = find_program('python', required: false)
-endif
+if get_option('generate-readme')
+ python = find_program('python3', required: false)
+ if not python.found()
+ message('python3 not found in PATH, trying python...')
+ python = find_program('python', required: true)
+ endif
-# generate README.md from template
-# make sure to copy it to the source directory!
-if python.found()
+ # 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' ],
@@ -90,8 +91,6 @@ if python.found()
install_dir: conf_data.get('datadir'),
install: true
)
-else
- message('Python was not found, fresh README.md will not be generated')
endif
install_data(
diff --git a/meson_options.txt b/meson_options.txt
index 683699e..65888ae 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -3,3 +3,4 @@ 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')