Skip to content

Commit

Permalink
Start porting to meson python build (mamolinux#73)
Browse files Browse the repository at this point in the history
- Update ci with latest ubuntu release
  and build dependencies
  • Loading branch information
hsbasu authored Oct 19, 2024
1 parent 706e428 commit 794148d
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 14 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ jobs:

- name: install-deps
run: |
sudo apt install gettext gir1.2-gtk-3.0 python3-build python3-setuptools python3 python3-apt \
python3-aptdaemon.gtk3widgets python3-gi python3-configobj python3-setproctitle
sudo apt install desktop-file-utils gettext gir1.2-gtk-3.0 libglib2.0-bin \
libgtk-4-bin meson python3 python3-build python3-setuptools python3-apt \
python3-aptdaemon.gtk3widgets python3-gi python3-configobj python3-setproctitle \
python3-tldextract
- name: make
run: ./test/test
run: ./test/test -qq
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include debian/changelog
graft src/LeaptimeManager/ui*
global-exclude *.py[cod]
graft data*
graft src/LeapTimeManager/ui*
22 changes: 22 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
project('leaptime-manager',
version: run_command('head', '-1', 'debian/changelog', check: true).stdout().split(' ')[1].strip('(').strip(')'),
default_options: ['warning_level=3',
'prefix=/usr',
]
)

application_id = meson.project_name()
i18n = import('i18n')
gnome = import('gnome')
pymod = import('python')
python = pymod.find_installation('python3')

prefix = get_option('prefix')
bindir = get_option('bindir')
datadir = get_option('datadir')

gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
update_desktop_database: true,
)
13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
build-backend = 'mesonpy'
requires = [
"meson >= 1.3.0",
"meson-python >= 0.14.0",
"setuptools>=61.0"
]

[project]
name = "leaptime-manager"
Expand Down Expand Up @@ -28,6 +32,7 @@ dependencies = [
"PyGObject",
"python-apt",
"setproctitle",
"tldextract",
]
dynamic = ["version"]

Expand All @@ -36,8 +41,8 @@ Homepage = "https://hsbasu.github.io/leaptime-manager"
Repository = "https://www.github.com/mamolinux/leaptime-manager.git"
Issues = "https://www.github.com/mamolinux/leaptime-manager/issues"

[project.scripts]
leaptime-manager = "LeaptimeManager.main:start_LTMCli"
# [project.scripts]
# leaptime-manager = "LeaptimeManager.main:start_LTMCli"

[tool.setuptools.packages.find]
where = ["src"]
Expand Down
12 changes: 6 additions & 6 deletions test/test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -x
python3 -m build
pip3 install -v ./dist/leaptime_manager-*.whl
leaptime-manager -V
set +x
rm -rf builddir
meson setup -Dprefix=$HOME/.local builddir
meson compile -C builddir --verbose
meson install -C builddir --dry-run
# leaptime-manager -V
# ninja uninstall -C builddir

0 comments on commit 794148d

Please sign in to comment.