meson initial approach

ft.librem5
Manuel Genovés 2019-04-01 17:15:33 +02:00
parent aa4a878dbc
commit 5bf0d877d3
3 changed files with 80 additions and 14 deletions

2
.gitignore vendored
View File

@ -20,4 +20,4 @@ data/ui/shortcut_handlers
.vscode/
*.glade~
dist/uberwriter-2.0b0-py3.7.egg
buildir/*
builddir/*

75
data/meson.build 100644
View File

@ -0,0 +1,75 @@
gnome = import('gnome')
message('Compiling resources')
# gnome.compile_resources(
# meson.project_name(),
# meson.project_name() + '.gresource.xml',
# gresource_bundle: true,
# source_dir: '.',
# install_dir: DATA_DIR,
# install: true,
# dependencies: configure_file(
# input: 'AboutDialog.ui.in',
# output: 'AboutDialog.ui',
# configuration: conf
# )
# )
# Installing the schema file
install_data(
project_id + '.gschema.xml',
install_dir: 'share/glib-2.0/schemas'
)
# Merging the translations with the desktop file
# i18n.merge_file(
# output: project_id + '.desktop',
# input: project_id + '.desktop.in',
# po_dir: join_paths(meson.source_root(), 'subprojects/po'),
# type: 'desktop',
# install: true,
# install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'applications')
# )
# Validating the desktop file
desktop_file_validate = find_program('desktop-file-validate', required:false)
if desktop_file_validate.found()
test (
'Validate desktop file',
desktop_file_validate,
args: join_paths(meson.current_build_dir (), project_id + '.desktop')
)
message(join_paths(meson.current_build_dir (), project_id + '.desktop'))
endif
# Merging the translations with the appdata file
# i18n.merge_file(
# output: project_id + '.appdata.xml',
# input: project_id + '.appdata.xml.in',
# po_dir: join_paths(meson.source_root(), 'subprojects/po'),
# install: true,
# install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'metainfo')
# )
# Validating the appdata file
appstreamcli = find_program('appstream-util', required: false)
if appstreamcli.found()
test (
'Validate appdata file',
appstreamcli,
args: ['validate-relax', join_paths(meson.current_build_dir (), project_id + '.appdata.xml')]
)
endif
# Validating schemas
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
message('Making a list of icons')
# subdir('icons')

View File

@ -1,5 +1,5 @@
project('uberwriter',
version: '2.1.4',
version: '2.1.5',
meson_version: '>= 0.40.0'
)
i18n = import('i18n')
@ -20,6 +20,7 @@ dependency('gtk+-3.0', version :'>=3.20')
python_dir = join_paths(get_option('prefix'), python.sysconfig_path('purelib'))
LIBEXEC_DIR = join_paths(get_option('prefix'), get_option('libexecdir'))
DATA_DIR = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
message(DATA_DIR)
bindir = join_paths(get_option('prefix'), get_option('bindir'))
conf = configuration_data()
@ -32,24 +33,14 @@ conf.set('libexecdir', LIBEXEC_DIR)
conf.set('VERSION', meson.project_version())
conf.set('PYTHON', python_bin.path())
#subdir('data')
subdir('data')
#subdir('po')
message(python_dir)
install_subdir(
'uberwriter',
install_dir: python_dir
)
install_subdir(
'data',
install_dir: DATA_DIR
)
install_subdir(
'thirdparty',
install_dir: join_paths(python_dir, 'lollypop')
)
message('Preparing init file')
configure_file(
input: 'bin/uberwriter',