Skip to content

Commit

Permalink
Use native meson python module for python install.
Browse files Browse the repository at this point in the history
Signed-off-by: James Hilliard <[email protected]>
  • Loading branch information
jameshilliard committed Sep 25, 2021
1 parent 543308d commit 05912e9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
4 changes: 3 additions & 1 deletion libgstc/meson.build
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
subdir('c')
subdir('python')
if not get_option('enable-python').disabled()
subdir('python')
endif
26 changes: 25 additions & 1 deletion libgstc/python/meson.build
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
run_command('pip3', 'install', '.')
pymod = import('python')
python = pymod.find_installation(
get_option('with-python-version'),
required : get_option('enable-python').enabled(),
disabler : true
)

pythonver = python.language_version()
if pythonver.version_compare('<3.5')
error('Python @0@ is not supported anymore, please port your code to python3.5 or newer.'.format(python.language_version()))
endif

pygstc_src_files = [
'pygstc/__init__.py',
'pygstc/gstc.py',
'pygstc/gstcerror.py',
'pygstc/logger.py',
'pygstc/tcp.py'
]

python.install_sources(
pygstc_src_files,
subdir : 'pygstc',
pure : true
)
2 changes: 2 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ option('enable-examples', type : 'feature', value : 'auto', yield : true, descri
option('enable-gtk-doc', type : 'boolean', value : false, description : 'Use gtk-doc to build documentation')
option('enable-systemd', type : 'feature', value : 'auto', description : 'Enable systemd gstd.service install')
option('enable-initd', type : 'feature', value : 'disabled', description : 'Enable init script install')
option('enable-python', type : 'feature', value : 'auto', description : 'Install the pygstc library')

# String options
option('with-gstd-runstatedir', type : 'string', value : '${prefix}/var/run/gstd', description : 'Specify the location of the gstd\'s PID file')
option('with-gstd-logstatedir', type : 'string', value : '${prefix}/var/log/gstd', description : 'Specify the location of gstd\'s log files')
option('with-gstd-systemddir', type : 'string', value : 'Systemd default systemduserunitdir', description : 'Specify the location of gstd.service file')
option('with-gstd-initddir', type : 'string', value : '${sysconfdir}/init.d', description : 'Specify the location of gstd init script')
option('with-statedir-owner', type : 'string', value : 'root', description : 'Specify the owner of gstd\'s run and log dirs created by the initd script')
option('with-python-version', type : 'string', value : 'python3', description : 'Specify the python version for pygstc installation')

# Common options
option('package-name', type : 'string', yield : true,
Expand Down

0 comments on commit 05912e9

Please sign in to comment.