forked from mamolinux/battery-monitor
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install python sources using meson build (mamolinux#56)
- Setup meson to install python sources during python and meson builds - Install executable binary using meson and avoid using python builds for now - Remove unnecessary python packaging files
- Loading branch information
Showing
11 changed files
with
87 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
include debian/changelog | ||
global-exclude *.py[cod] | ||
graft data* | ||
graft po* | ||
include src/battery-monitor.in | ||
graft src/BatteryMonitor/icons* | ||
graft src/BatteryMonitor/ui* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@version@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
python_sources = [ | ||
'about_window.py', | ||
'bm_daemon.py', | ||
'BMonitor.py', | ||
'cmd_lines.py', | ||
'config.py', | ||
'ErrorLib.py', | ||
'gui.py', | ||
'indicator.py', | ||
'__init__.py', | ||
'main.py', | ||
'Notification.py', | ||
] | ||
|
||
version_file = configure_file( | ||
input: 'VERSION.in', | ||
output: 'VERSION', | ||
configuration: { | ||
'version': meson.project_version(), | ||
} | ||
) | ||
|
||
python.install_sources( | ||
python_sources, version_file, | ||
subdir: 'BatteryMonitor', | ||
preserve_path: true, | ||
) | ||
|
||
# Install assets like ui and icons | ||
icons = files('icons/charging.png', 'icons/critical-battery.png', 'icons/discharging.png', 'icons/full-charge.png', 'icons/icon.png', 'icons/low-battery.png', 'icons/not-charging.png') | ||
|
||
install_data( | ||
icons, | ||
install_dir: join_paths(pysrcinstalldir, 'BatteryMonitor', 'icons') | ||
) | ||
|
||
|
||
ui = files('ui/battery-monitor.ui', 'ui/logger.ui', 'ui/shortcuts.ui',) | ||
|
||
install_data( | ||
ui, | ||
install_dir: join_paths(pysrcinstalldir, 'BatteryMonitor', 'ui') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!@PYTHON@ | ||
# -*- coding: utf-8 -*- | ||
import re | ||
import sys | ||
|
||
sys.path.insert(1, '@pkgdatadir@') | ||
|
||
from BatteryMonitor.main import start_BM | ||
if __name__ == '__main__': | ||
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) | ||
sys.exit(start_BM()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
pysrcinstalldir = python.get_install_dir() # python.get_path('platlib') | ||
message(f'Python dir: @pysrcinstalldir@') | ||
|
||
conf = configuration_data() | ||
conf.set('PYTHON', python.full_path()) | ||
conf.set('pkgdatadir', pysrcinstalldir) | ||
|
||
configure_file( | ||
input: 'battery-monitor.in', | ||
output: 'battery-monitor', | ||
configuration: conf, | ||
install: true, | ||
install_dir: bindir, | ||
install_mode: 'rwxr-xr-x' | ||
) | ||
|
||
subdir('BatteryMonitor') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
#!/bin/bash | ||
pip3 install . | ||
rm -rf builddir | ||
meson setup -Dprefix=$HOME/.local builddir | ||
meson compile -C builddir --verbose | ||
meson install -C builddir | ||
battery-monitor -V | ||
ninja uninstall -C builddir |
This file was deleted.
Oops, something went wrong.