From 9ff6d61ab159b7c7b6d7433e0368660946b16bdf Mon Sep 17 00:00:00 2001 From: John Turner Date: Thu, 11 Sep 2025 01:36:58 -0400 Subject: rewrite meson.build file to handle installing just the client or server --- meson.build | 50 ++++++++++++++++++++++++++++++++++++++++---------- meson_options.txt | 2 ++ 2 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 meson_options.txt diff --git a/meson.build b/meson.build index 7c9ab84..fd7efcf 100644 --- a/meson.build +++ b/meson.build @@ -1,15 +1,41 @@ -project('paste') +project('pypaste') -python = import('python').find_installation( - modules: ['pygments', 'zstandard', 'aiohttp', 'bozo4'], -) +sources = files('pypaste/__init__.py') + +modules = [] + +if get_option('client') + sources += files( + 'pypaste/client/__init__.py', + 'pypaste/client/__main__.py', + 'pypaste/client/plugins/__init__.py', + 'pypaste/client/plugins/zen/__init__.py', + 'pypaste/client/plugins/pgz/__init__.py' + ) + + modules += ['requests'] +endif -sources = files( - 'pypaste/__init__.py', - 'pypaste/__main__.py', - 'pypaste/s3/__init__.py', - 'pypaste/s3/bucket.py', - 'pypaste/sqlite/__init__.py', +if get_option('server') + sources += files( + 'pypaste/server/__init__.py', + 'pypaste/server/__main__.py', + 'pypaste/server/s3/__init__.py', + 'pypaste/server/s3/bucket.py', + 'pypaste/server/sqlite/__init__.py' + ) + + modules += [ + 'aiohttp', + 'aiosqlite', + 'zstandard', + 'pygments', + 'bozo4' + ] +endif + +python = import('python').find_installation( + modules: modules ) python.install_sources(sources, preserve_path: true) @@ -18,3 +44,7 @@ install_data( 'eff_large_wordlist.txt', install_dir: get_option('datadir') / 'dict', ) + +# Local Variables: +# eval: (remove-hook 'before-save-hook 'fmt-current-buffer t) +# End: diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..432d996 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,2 @@ +option('client', type: 'boolean', value: false) +option('server', type: 'boolean', value: false) -- cgit v1.2.3