Make bytecompile works again

This commit is contained in:
Davide Andreoli 2020-04-23 08:32:14 +02:00
parent e4803fdb3f
commit 3641ce6480
10 changed files with 73 additions and 31 deletions

3
README
View File

@ -1,4 +1,5 @@
Edgar Gadget Loader
===================
This module load python gadgets in Enlightenment.
@ -15,7 +16,7 @@ Requirements
Install
=======
To install the edgar and all the incluede gadgets just use:
To install the edgar and all the included gadgets just use:
meson build
ninja -C build

View File

@ -5,7 +5,7 @@ gadget_name = 'audio'
install_dir = join_paths(gadgets_install_dir, gadget_name)
# build gadget_name.edj
# Build gadget_name.edj
custom_target(gadget_name + '.edj',
input : gadget_name + '.edc',
output : gadget_name + '.edj',
@ -17,14 +17,11 @@ custom_target(gadget_name + '.edj',
install : true
)
# TODO: bytecompile gadget __init__.py
# py3_bytecompile = [py3, '-c', 'from py_compile import compile; compile("@INPUT@", "@OUTPUT@")']
#custom_target('__init__.pyc',
# input : '__init__.py',
# output : '__init__.pyc',
# command : py3_bytecompile,
# install_dir: gadget_install_dir,
# install : true
# )
install_data('__init__.py', install_dir: install_dir)
# Bytecompile gadget script
custom_target('__init__.pyc',
input : '__init__.py',
output : '__init__.pyc',
command : py3_bytecompile,
install_dir: install_dir,
install : true
)

View File

@ -5,7 +5,7 @@ gadget_name = 'calculator'
install_dir = join_paths(gadgets_install_dir, gadget_name)
# build gadget_name.edj
# Build gadget_name.edj
custom_target(gadget_name + '.edj',
input : gadget_name + '.edc',
output : gadget_name + '.edj',
@ -17,5 +17,12 @@ custom_target(gadget_name + '.edj',
install : true
)
# TODO: bytecompile gadget __init__.py
install_data('__init__.py', install_dir: install_dir)
# Bytecompile gadget script
custom_target('__init__.pyc',
input : '__init__.py',
output : '__init__.pyc',
command : py3_bytecompile,
install_dir: install_dir,
install : true
)

View File

@ -5,7 +5,7 @@ gadget_name = 'cpu'
install_dir = join_paths(gadgets_install_dir, gadget_name)
# build gadget_name.edj
# Build gadget_name.edj
custom_target(gadget_name + '.edj',
input : gadget_name + '.edc',
output : gadget_name + '.edj',
@ -17,5 +17,11 @@ custom_target(gadget_name + '.edj',
install : true
)
# TODO: bytecompile gadget __init__.py
install_data('__init__.py', install_dir: install_dir)
# Bytecompile gadget script
custom_target('__init__.pyc',
input : '__init__.py',
output : '__init__.pyc',
command : py3_bytecompile,
install_dir: install_dir,
install : true
)

View File

@ -5,7 +5,7 @@ gadget_name = 'dropbox'
install_dir = join_paths(gadgets_install_dir, gadget_name)
# build gadget_name.edj
# Build gadget_name.edj
custom_target(gadget_name + '.edj',
input : gadget_name + '.edc',
output : gadget_name + '.edj',
@ -17,5 +17,11 @@ custom_target(gadget_name + '.edj',
install : true
)
# TODO: bytecompile gadget __init__.py
install_data('__init__.py', install_dir: install_dir)
# Bytecompile gadget script
custom_target('__init__.pyc',
input : '__init__.py',
output : '__init__.pyc',
command : py3_bytecompile,
install_dir: install_dir,
install : true
)

View File

@ -5,7 +5,7 @@ gadget_name = 'led_clock'
install_dir = join_paths(gadgets_install_dir, gadget_name)
# build gadget_name.edj
# Build gadget_name.edj
custom_target(gadget_name + '.edj',
input : gadget_name + '.edc',
output : gadget_name + '.edj',
@ -17,5 +17,11 @@ custom_target(gadget_name + '.edj',
install : true
)
# TODO: bytecompile gadget __init__.py
install_data('__init__.py', install_dir: install_dir)
# Bytecompile gadget script
custom_target('__init__.pyc',
input : '__init__.py',
output : '__init__.pyc',
command : py3_bytecompile,
install_dir: install_dir,
install : true
)

View File

@ -5,7 +5,7 @@ gadget_name = 'mem'
install_dir = join_paths(gadgets_install_dir, gadget_name)
# build gadget_name.edj
# Build gadget_name.edj
custom_target(gadget_name + '.edj',
input : gadget_name + '.edc',
output : gadget_name + '.edj',
@ -17,5 +17,11 @@ custom_target(gadget_name + '.edj',
install : true
)
# TODO: bytecompile gadget __init__.py
install_data('__init__.py', install_dir: install_dir)
# Bytecompile gadget script
custom_target('__init__.pyc',
input : '__init__.py',
output : '__init__.pyc',
command : py3_bytecompile,
install_dir: install_dir,
install : true
)

View File

@ -5,7 +5,7 @@ gadget_name = 'netspeed'
install_dir = join_paths(gadgets_install_dir, gadget_name)
# build gadget_name.edj
# Build gadget_name.edj
custom_target(gadget_name + '.edj',
input : gadget_name + '.edc',
output : gadget_name + '.edj',
@ -17,5 +17,11 @@ custom_target(gadget_name + '.edj',
install : true
)
# TODO: bytecompile gadget __init__.py
install_data('__init__.py', install_dir: install_dir)
# Bytecompile gadget script
custom_target('__init__.pyc',
input : '__init__.py',
output : '__init__.pyc',
command : py3_bytecompile,
install_dir: install_dir,
install : true
)

View File

@ -20,6 +20,8 @@ e_module_arch = dep_e.get_pkgconfig_variable('module_arch')
#### Python3 ####
py3 = import('python').find_installation('python3', modules: ['efl', 'dbus'])
dep_py3 = py3.dependency(embed: true)
py3_bytecompile = [py3, meson.source_root() / 'meson_bytecompile.py',
'@INPUT@', '@OUTPUT@']
#### Install dirs ####

5
meson_bytecompile.py Normal file
View File

@ -0,0 +1,5 @@
import sys
import py_compile
py_compile.compile(sys.argv[1], sys.argv[2])