Skip to content

Commit

Permalink
Use default_options to set version independent Python dir
Browse files Browse the repository at this point in the history
Remove `allow-site-packages-dir` build option.

To use the site-packages dir you will need to patch meson.build.
  • Loading branch information
igo95862 committed May 25, 2024
1 parent 656873b commit fd731b2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ jobs:
uses: actions/checkout@v4
- name: Run meson
run: |
arch-meson -Dman=true -Dallow-site-packages-dir=true build
arch-meson -Dman=true build
meson compile --verbose -C build
meson install -C build --destdir install
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ If your distro does not have a package you can try to manually install with meso

#### Using meson to install

1. Run `meson setup build -Dpython.purelibdir=lib/bubblejail/python-packages` to setup build directory
1. Run `meson setup build` to setup build directory
1. Switch to build directory `cd build`
1. Compile `meson compile`
1. Install `sudo meson install`
Expand Down
10 changes: 6 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2020 igo95862
project('bubblejail',
version : '0.8.3'
version : '0.8.3',
# Patch out these lines to install bubblejail's packages to site-packages
default_options : {
'python.purelibdir' : 'lib/bubblejail/python-packages',
'python.platlibdir' : 'lib/bubblejail/python-packages',
},
)

fs = import('fs')
Expand All @@ -10,9 +15,6 @@ py_installation = pymod.find_installation('python3')
python_purelib_option = get_option('python.purelibdir')

if python_purelib_option == py_installation.get_path('purelib') or python_purelib_option == ''
if not get_option('allow-site-packages-dir')
error('Please configure meson with -Dpython.purelibdir=lib/bubblejail/python-packages -Dpython.platlibdir=lib/bubblejail/python-packages options.')
endif
extra_python_packages_dir = ''
else
extra_python_packages_dir = get_option('prefix') / python_purelib_option
Expand Down
1 change: 0 additions & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
# SPDX-FileCopyrightText: 2022 igo95862
option('version_display', type: 'string', value: '', description: 'Custom --version display.')
option('man', type : 'boolean', value : true, description : 'Generate and install man pages for CLI tool and services.')
option('allow-site-packages-dir', type : 'boolean', value : false, description : 'Allow using Python\'s site-packages directory for Python modules instead of version independent location.')
option('use-vendored-python-lxns', type : 'feature', value : 'disabled', description : 'Use meson subproject for python-lxns library.')

0 comments on commit fd731b2

Please sign in to comment.