-
Notifications
You must be signed in to change notification settings - Fork 103
Prepare porting to meson buildsytem #317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# meson build files | ||
builddir |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
app_icon_dir = join_paths(datadir, 'icons', 'hicolor', 'scalable', 'apps') | ||
category_icon_dir = join_paths(datadir, 'icons', 'hicolor', 'scalable', 'categories') | ||
schema_dir = join_paths(datadir, 'glib-2.0', 'schemas') | ||
# message(f'Icon dir: @app_icon_dir@') | ||
# message(f'Schema dir: @schema_dir@') | ||
|
||
# install icons | ||
install_emptydir(app_icon_dir) | ||
install_data( | ||
join_paths(meson.current_source_dir(), 'icons', f'@[email protected]'), | ||
install_dir: app_icon_dir, | ||
) | ||
|
||
install_data( | ||
join_paths(meson.current_source_dir(), 'icons/categories/applications-webapps.svg'), | ||
install_dir: category_icon_dir, | ||
) | ||
|
||
|
||
# Install desktop file | ||
# desktop_file = i18n.merge_file( | ||
# input: 'webapp-manager.desktop.in', | ||
# output: 'webapp-manager.desktop', | ||
# type: 'desktop', | ||
# po_dir: '../po', | ||
# install: true, | ||
# install_dir: desktop_dir | ||
# ) | ||
|
||
# Install schema file | ||
schema_file = i18n.merge_file( | ||
input: 'org.x.webapp-manager.gschema.xml.in', | ||
output: 'org.x.webapp-manager.gschema.xml', | ||
type: 'xml', | ||
po_dir: '../po', | ||
install: true, | ||
install_dir: schema_dir | ||
) | ||
|
||
compile_schemas = find_program('glib-compile-schemas', required: false) | ||
if compile_schemas.found() | ||
test('Validate schema file', | ||
compile_schemas, | ||
args: ['--strict', '--dry-run', meson.current_source_dir()]) | ||
endif | ||
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,15 @@ Source: webapp-manager | |
Section: admin | ||
Priority: optional | ||
Maintainer: Linux Mint <[email protected]> | ||
Build-Depends: debhelper (>= 9) | ||
Standards-Version: 3.9.5 | ||
Build-Depends: debhelper-compat (= 13), | ||
desktop-file-utils, | ||
dh-python, | ||
libglib2.0-bin, | ||
libgtk-4-bin, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove gtk4 dep |
||
meson (>= 1.3.0), | ||
pkgconf, | ||
python3-all, | ||
Standards-Version: 4.6.1 | ||
|
||
Package: webapp-manager | ||
Architecture: all | ||
|
@@ -15,7 +22,8 @@ Depends: gir1.2-xapp-1.0 (>= 1.4), | |
python3-pil, | ||
python3-setproctitle, | ||
python3-tldextract, | ||
xapps-common, | ||
${misc:Depends}, | ||
xapps-common,, | ||
${python3:Depends}, | ||
${misc:Depends} | ||
Description: Web Application Manager | ||
Launch websites as if they were apps. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,35 @@ | ||
#!/bin/sh | ||
# postinst script for webapp-manager | ||
# | ||
# see: dh_installdeb(1) | ||
|
||
set -e | ||
|
||
|
||
case "$1" in | ||
configure) | ||
if which glib-compile-schemas >/dev/null 2>&1 | ||
then | ||
glib-compile-schemas /usr/share/glib-2.0/schemas | ||
fi | ||
if which glib-compile-schemas >/dev/null 2>&1 | ||
then | ||
glib-compile-schemas /usr/share/glib-2.0/schemas | ||
fi | ||
if which gtk-update-icon-cache >/dev/null 2>&1 | ||
then | ||
gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor | ||
fi | ||
;; | ||
|
||
abort-upgrade|abort-remove|abort-deconfigure) | ||
|
||
;; | ||
|
||
*) | ||
echo "postinst called with unknown argument \`$1'" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# dh_installdeb will replace this with shell code automatically | ||
# generated by other debhelper scripts. | ||
|
||
#DEBHELPER# | ||
|
||
exit 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove postinst file, it gets auto-generated. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
# postrm script for webapp-manager | ||
# | ||
# see: dh_installdeb(1) | ||
|
||
set -e | ||
|
||
|
||
case "$1" in | ||
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) | ||
if which glib-compile-schemas >/dev/null 2>&1 | ||
then | ||
glib-compile-schemas /usr/share/glib-2.0/schemas | ||
fi | ||
if which gtk-update-icon-cache >/dev/null 2>&1 | ||
then | ||
gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor | ||
fi | ||
;; | ||
|
||
*) | ||
echo "postrm called with unknown argument \`$1'" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# dh_installdeb will replace this with shell code automatically | ||
# generated by other debhelper scripts. | ||
|
||
#DEBHELPER# | ||
|
||
exit 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. postrm is also autogenerated. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
#!/usr/bin/make -f | ||
# See debhelper(7) (uncomment to enable) | ||
# output every command that modifies files on the build system. | ||
# export DH_VERBOSE = 1 | ||
|
||
DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') | ||
export PYBUILD_NAME=webapp-manager | ||
export PYBUILD_SYSTEM=pyproject | ||
|
||
# DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') | ||
|
||
%: | ||
dh ${@} | ||
|
||
# Inject version number in the code | ||
override_dh_installdeb: | ||
dh_installdeb | ||
for pkg in $$(dh_listpackages -i); do \ | ||
find debian/$$pkg -type f -exec sed -i -e s/__DEB_VERSION__/$(DEB_VERSION)/g {} +; \ | ||
done | ||
dh ${@} --with=python3 --buildsystem=meson | ||
|
||
# # Inject version number in the code | ||
# override_dh_installdeb: | ||
# dh_installdeb | ||
# for pkg in $$(dh_listpackages -i); do \ | ||
# find debian/$$pkg -type f -exec sed -i -e s/__DEB_VERSION__/$(DEB_VERSION)/g {} +; \ | ||
# done | ||
|
||
override_dh_auto_build: | ||
dh_auto_build -O--buildsystem=meson | ||
make -j8 | ||
Comment on lines
+13
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't need any of this. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
project('webapp-manager', | ||
version: run_command('head', '-1', 'debian/changelog', check: true).stdout().split(' ')[1].strip('(').strip(')'), | ||
license: ['GPL3'], | ||
meson_version: '>= 1.3.0', | ||
default_options: ['warning_level=3', | ||
'prefix=/usr', | ||
] | ||
) | ||
|
||
application_id = meson.project_name() | ||
i18n = import('i18n') | ||
pymod = import('python') | ||
python = pymod.find_installation('python3') | ||
|
||
prefix = get_option('prefix') | ||
bindir = get_option('bindir') | ||
datadir = get_option('datadir') | ||
|
||
subdir('src') | ||
subdir('data') | ||
# subdir('po') | ||
|
||
meson.add_install_script('post_install.py') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from os import environ, path | ||
from subprocess import call | ||
|
||
if not environ.get('DESTDIR', ''): | ||
PREFIX = environ.get('MESON_INSTALL_PREFIX', '/usr') | ||
|
||
schemadir = path.join(PREFIX, 'share', 'glib-2.0', 'schemas') | ||
print('Compiling gsettings schemas...') | ||
call(['glib-compile-schemas', schemadir]) | ||
|
||
themedir = path.join(PREFIX, 'share', 'icons', 'hicolor') | ||
print('Updating icon cache...') | ||
call(['gtk-update-icon-cache', '-qtf', themedir]) | ||
|
||
mimedir = path.join(PREFIX, 'share', 'mime') | ||
print('Updating mime database...') | ||
call(['update-mime-database', mimedir]) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@version@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Schema files don't need localized or checked, just
install_data()