Skip to content

Commit

Permalink
switch to meson
Browse files Browse the repository at this point in the history
  • Loading branch information
artemanufrij committed Apr 8, 2018
1 parent c4c717c commit 62b83f7
Show file tree
Hide file tree
Showing 215 changed files with 29,229 additions and 7,535 deletions.
44 changes: 0 additions & 44 deletions CMakeLists.txt

This file was deleted.

10 changes: 0 additions & 10 deletions data/CMakeLists.txt

This file was deleted.

Expand Up @@ -37,6 +37,11 @@
</screenshot>
</screenshots>
<releases>
<release version="1.0.0" date="2018-04-10">
<description>
Switch to Meson
</description>
</release>
<release version="0.3.5" date="2018-03-30">
<description>
<p>Fix:</p>
Expand Down
8 changes: 8 additions & 0 deletions data/icons/meson.build
@@ -0,0 +1,8 @@
icon_sizes = ['16', '24', '32', '48', '64']

foreach i : icon_sizes
install_data(
join_paths(i, meson.project_name() + '.svg'),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps')
)
endforeach
40 changes: 40 additions & 0 deletions data/meson.build
@@ -0,0 +1,40 @@

i18n.merge_file(
input: meson.project_name() + '.desktop.in',
output: meson.project_name() + '.desktop',
po_dir: join_paths(meson.source_root(), 'po'),
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)

i18n.merge_file(
input: meson.project_name() + '.appdata.xml.in',
output: meson.project_name() + '.appdata.xml',
po_dir: join_paths(meson.source_root(), 'po'),
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
)

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 (), meson.project_name() + '.desktop')
)
endif

appstreamcli = find_program(['appstreamcli', 'appstream-util'], required:false)

if appstreamcli.found()
test (
'Validate appdata file',
appstreamcli,
args: ['validate', join_paths(meson.current_build_dir (), meson.project_name() + '.appdata.xml')]
)
endif


subdir('icons')
3 changes: 1 addition & 2 deletions debian/control
Expand Up @@ -2,8 +2,7 @@ Source: com.github.artemanufrij.playmyvideos
Section: x11
Priority: optional
Maintainer: Artem Anufrij <artem.anufrij@live.de>
Build-Depends: cmake (>= 2.8),
cmake-elementary,
Build-Depends: meson,
debhelper (>= 9),
libgranite-dev,
libsqlite3-dev,
Expand Down
17 changes: 16 additions & 1 deletion debian/rules
Expand Up @@ -10,5 +10,20 @@
#export DH_VERBOSE=1

%:
dh $@
dh $@

override_dh_auto_clean:
rm -rf debian/build

override_dh_auto_configure:
mkdir -p debian/build
cd debian/build && meson --prefix=/usr ../..

override_dh_auto_build:
cd debian/build && ninja -v

override_dh_auto_test:
cd debian/build && ninja test

override_dh_auto_install:
cd debian/build && DESTDIR=${CURDIR}/debian/com.github.artemanufrij.playmyvideos ninja install
34 changes: 34 additions & 0 deletions meson.build
@@ -0,0 +1,34 @@
project('com.github.artemanufrij.playmyvideos', ['vala', 'c'], version: '1.0.0')


gnome = import('gnome')
i18n = import('i18n')

# Add locale support
conf = configuration_data()
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf.set_quoted('PREFIX', get_option('prefix'))
conf.set_quoted('VERSION', meson.project_version())
conf.set_quoted('PACKAGE', meson.project_name())
conf.set_quoted('LOCALE_DIR', join_paths(get_option('prefix'), get_option('localedir')))
conf.set_quoted('DATADIR', join_paths(get_option('prefix'), get_option('datadir')))
conf.set_quoted('PKGDATADIR', join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()))

configure_file(
output: 'config.h',
configuration: conf
)
config_h_dir = include_directories('src')

# Arguments C - no gcc warnings
c_args = [
'-include', 'config.h',
'-w', '-DGETTEXT_PACKAGE="' + meson.project_name() + '"'
]


subdir('data')
subdir('po')
subdir('schemas')
subdir('src')
meson.add_install_script('meson/post_install.py')
24 changes: 24 additions & 0 deletions meson/post_install.py
@@ -0,0 +1,24 @@
#!/usr/bin/env python3

import os
import subprocess

prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr')
datadir = os.path.join(prefix, 'share')

# Packaging tools define DESTDIR and this isn't needed for them
if 'DESTDIR' not in os.environ:


print('Compiling gsettings schemas...')
schema_dir = os.path.join(datadir, 'glib-2.0/schemas')
subprocess.call(['glib-compile-schemas', schema_dir])

print('Updating icon cache...')
icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor')

subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir])

print('Updating desktop database...')
desktop_database_dir = os.path.join(datadir, 'applications')
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])

0 comments on commit 62b83f7

Please sign in to comment.