Skip to content

Commit 37ddb06

Browse files
committed
Prepare porting to meson buildsytem
- Setup meson to install python sources during meson builds - Install executable binary using meson - Update debian builds to use meson - Update testing script
1 parent c26dbf5 commit 37ddb06

18 files changed

+806
-29
lines changed

data/meson.build

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
app_icon_dir = join_paths(datadir, 'icons', 'hicolor', 'scalable', 'apps')
2+
category_icon_dir = join_paths(datadir, 'icons', 'hicolor', 'scalable', 'categories')
3+
schema_dir = join_paths(datadir, 'glib-2.0', 'schemas')
4+
# message(f'Icon dir: @app_icon_dir@')
5+
# message(f'Schema dir: @schema_dir@')
6+
7+
# install icons
8+
install_emptydir(app_icon_dir)
9+
install_data(
10+
join_paths(meson.current_source_dir(), 'icons', f'@[email protected]'),
11+
install_dir: app_icon_dir,
12+
)
13+
14+
install_data(
15+
join_paths(meson.current_source_dir(), 'icons/categories/applications-webapps.svg'),
16+
install_dir: category_icon_dir,
17+
)
18+
19+
20+
# Install desktop file
21+
# desktop_file = i18n.merge_file(
22+
# input: 'webapp-manager.desktop.in',
23+
# output: 'webapp-manager.desktop',
24+
# type: 'desktop',
25+
# po_dir: '../po',
26+
# install: true,
27+
# install_dir: desktop_dir
28+
# )
29+
30+
# Install schema file
31+
schema_file = i18n.merge_file(
32+
input: 'org.x.webapp-manager.gschema.xml.in',
33+
output: 'org.x.webapp-manager.gschema.xml',
34+
type: 'xml',
35+
po_dir: '../po',
36+
install: true,
37+
install_dir: schema_dir
38+
)
39+
40+
compile_schemas = find_program('glib-compile-schemas', required: false)
41+
if compile_schemas.found()
42+
test('Validate schema file',
43+
compile_schemas,
44+
args: ['--strict', '--dry-run', meson.current_source_dir()])
45+
endif

debian/compat

-1
This file was deleted.

debian/control

+12-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@ Source: webapp-manager
22
Section: admin
33
Priority: optional
44
Maintainer: Linux Mint <[email protected]>
5-
Build-Depends: debhelper (>= 9)
6-
Standards-Version: 3.9.5
5+
Build-Depends: debhelper-compat (= 13),
6+
desktop-file-utils,
7+
dh-python,
8+
libglib2.0-bin,
9+
libgtk-4-bin,
10+
meson (>= 1.3.0),
11+
pkg-config,
12+
python3-all,
13+
Standards-Version: 4.6.1
714

815
Package: webapp-manager
916
Architecture: all
@@ -15,7 +22,8 @@ Depends: gir1.2-xapp-1.0 (>= 1.4),
1522
python3-pil,
1623
python3-setproctitle,
1724
python3-tldextract,
18-
xapps-common,
19-
${misc:Depends},
25+
xapps-common,,
26+
${python3:Depends},
27+
${misc:Depends}
2028
Description: Web Application Manager
2129
Launch websites as if they were apps.

debian/postinst

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
11
#!/bin/sh
2+
# postinst script for webapp-manager
3+
#
4+
# see: dh_installdeb(1)
5+
26
set -e
37

8+
49
case "$1" in
510
configure)
6-
if which glib-compile-schemas >/dev/null 2>&1
7-
then
8-
glib-compile-schemas /usr/share/glib-2.0/schemas
9-
fi
11+
if which glib-compile-schemas >/dev/null 2>&1
12+
then
13+
glib-compile-schemas /usr/share/glib-2.0/schemas
14+
fi
15+
if which gtk4-update-icon-cache >/dev/null 2>&1
16+
then
17+
gtk4-update-icon-cache -q -t -f /usr/share/icons/hicolor
18+
fi
1019
;;
1120

1221
abort-upgrade|abort-remove|abort-deconfigure)
13-
1422
;;
1523

1624
*)
1725
echo "postinst called with unknown argument \`$1'" >&2
1826
exit 1
1927
;;
2028
esac
29+
30+
# dh_installdeb will replace this with shell code automatically
31+
# generated by other debhelper scripts.
32+
33+
#DEBHELPER#
34+
35+
exit 0

debian/postrm

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/sh
2+
# postrm script for webapp-manager
3+
#
4+
# see: dh_installdeb(1)
5+
6+
set -e
7+
8+
9+
case "$1" in
10+
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
11+
if which glib-compile-schemas >/dev/null 2>&1
12+
then
13+
glib-compile-schemas /usr/share/glib-2.0/schemas
14+
fi
15+
if which gtk4-update-icon-cache >/dev/null 2>&1
16+
then
17+
gtk4-update-icon-cache -q -t -f /usr/share/icons/hicolor
18+
fi
19+
;;
20+
21+
*)
22+
echo "postrm called with unknown argument \`$1'" >&2
23+
exit 1
24+
;;
25+
esac
26+
27+
# dh_installdeb will replace this with shell code automatically
28+
# generated by other debhelper scripts.
29+
30+
#DEBHELPER#
31+
32+
exit 0

debian/rules

+19-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
#!/usr/bin/make -f
2+
# See debhelper(7) (uncomment to enable)
3+
# output every command that modifies files on the build system.
4+
# export DH_VERBOSE = 1
25

3-
DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
6+
export PYBUILD_NAME=webapp-manager
7+
export PYBUILD_SYSTEM=pyproject
8+
9+
# DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
410

511
%:
6-
dh ${@}
7-
8-
# Inject version number in the code
9-
override_dh_installdeb:
10-
dh_installdeb
11-
for pkg in $$(dh_listpackages -i); do \
12-
find debian/$$pkg -type f -exec sed -i -e s/__DEB_VERSION__/$(DEB_VERSION)/g {} +; \
13-
done
12+
dh ${@} --with=python3 --buildsystem=meson
13+
14+
# # Inject version number in the code
15+
# override_dh_installdeb:
16+
# dh_installdeb
17+
# for pkg in $$(dh_listpackages -i); do \
18+
# find debian/$$pkg -type f -exec sed -i -e s/__DEB_VERSION__/$(DEB_VERSION)/g {} +; \
19+
# done
20+
21+
override_dh_auto_build:
22+
dh_auto_build -O--buildsystem=meson
23+
make -j8

meson.build

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
project('webapp-manager',
2+
version: run_command('head', '-1', 'debian/changelog', check: true).stdout().split(' ')[1].strip('(').strip(')'),
3+
license: ['GPL3'],
4+
meson_version: '>= 1.3.0',
5+
default_options: ['warning_level=3',
6+
'prefix=/usr',
7+
]
8+
)
9+
10+
application_id = meson.project_name()
11+
i18n = import('i18n')
12+
gnome = import('gnome')
13+
pymod = import('python')
14+
python = pymod.find_installation('python3')
15+
16+
prefix = get_option('prefix')
17+
bindir = get_option('bindir')
18+
datadir = get_option('datadir')
19+
20+
subdir('src')
21+
subdir('data')
22+
# subdir('po')
23+
24+
gnome.post_install(
25+
glib_compile_schemas: true,
26+
gtk_update_icon_cache: true,
27+
update_desktop_database: true,
28+
)

src/WebappManager/VERSION.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@version@

0 commit comments

Comments
 (0)