Skip to content

Commit f519046

Browse files
QuLogicSalamandarjtojnar
committed
Add meson build system
Co-authored-by: Félix Piédallu <[email protected]> Co-authored-by: Jan Tojnar <[email protected]>
1 parent 5fd3f3c commit f519046

File tree

10 files changed

+605
-16
lines changed

10 files changed

+605
-16
lines changed

.travis.yml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ compiler:
44
- gcc
55

66
sudo: required
7+
services: docker
78

89
dist: trusty
910

@@ -15,18 +16,36 @@ addons:
1516
- libgirepository1.0-dev
1617
- libgegl-dev
1718

18-
script:
19-
- ./autogen.sh
20-
- ./configure
21-
- make
22-
- make clean
23-
- make distcheck
24-
- make maintainer-clean
25-
- ./autogen.sh
26-
- ./configure --with-introspection
27-
- make
28-
- make maintainer-clean
29-
- ./autogen.sh
30-
- ./configure --with-gegl
31-
- make
32-
- make maintainer-clean
19+
jobs:
20+
include:
21+
- stage: "Build"
22+
name: "Autotools build"
23+
script:
24+
- ./autogen.sh
25+
- ./configure
26+
- make
27+
- make clean
28+
- make distcheck
29+
- make maintainer-clean
30+
- ./autogen.sh
31+
- ./configure --with-introspection
32+
- make
33+
- make maintainer-clean
34+
- ./autogen.sh
35+
- ./configure --with-gegl
36+
- make
37+
- make maintainer-clean
38+
39+
- name: "Meson build"
40+
script:
41+
- sudo docker pull ubuntu:disco
42+
- sudo docker run -t -v $(pwd):/sources ubuntu:disco /bin/bash -ec "
43+
apt update -y
44+
&& apt install -y meson gettext libjson-c-dev libgirepository1.0-dev libgegl-dev git
45+
&& meson /sources _build --buildtype=release
46+
&& ninja -C _build test
47+
&& ninja -C _build dist
48+
&& meson /sources _build_gegl --buildtype=release -Dgegl=true
49+
&& ninja -C _build_gegl test
50+
&& ninja -C _build_gegl dist
51+
"

appveyor_build.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ pacman --noconfirm -S --needed \
1111
base-devel \
1212
${PKG_PREFIX}-json-c \
1313
${PKG_PREFIX}-glib2 \
14-
${PKG_PREFIX}-gobject-introspection
14+
${PKG_PREFIX}-gobject-introspection \
15+
${PKG_PREFIX}-meson \
16+
git
1517

1618

1719
# Add m4 directories to the ACLOCAL_PATH
@@ -30,6 +32,11 @@ done
3032
export ACLOCAL_PATH
3133
export PWD="$APPVEYOR_BULD_FOLDER"
3234

35+
# Meson build, we need a way to parallel this with Autotools
36+
meson setup _build --buildtype=release -Dgegl=false -Ddocs=false
37+
meson dist -C _build
38+
rm -rf _build
39+
3340
./autogen.sh
3441
./configure
3542
make distcheck

doc/meson.build

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
doc_conf = configuration_data()
2+
doc_conf.merge_from(conf)
3+
4+
doc_conf.set('DOXYGEN_SOURCE_ROOT', meson.project_source_root())
5+
doc_conf.set('DOXYXML_BUILD_PATH', meson.current_build_dir())
6+
doc_conf.set('DOXYGEN_EXCLUDED', '')
7+
8+
doxyfile = configure_file(
9+
input: 'Doxyfile.in',
10+
output: 'Doxyfile',
11+
configuration: doc_conf,
12+
)
13+
14+
doxygen_index = custom_target(
15+
'doxygen',
16+
input: doxyfile,
17+
output: 'index.xml',
18+
command: [
19+
doxygen,
20+
'@INPUT@',
21+
],
22+
)
23+
24+
subdir('source')
25+
26+
run_target(
27+
'sphinx',
28+
depends: [
29+
doxygen_index,
30+
],
31+
command: [
32+
sphinx_build,
33+
'-c', meson.current_build_dir() / 'source',
34+
meson.current_source_dir() / 'source',
35+
meson.current_build_dir() / 'build',
36+
],
37+
)

doc/source/meson.build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sphinx_conf_file = configure_file(
2+
input: 'conf.py.in',
3+
output: 'conf.py',
4+
configuration: doc_conf,
5+
)

gegl/meson.build

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
libmypaint_gegl_inc = include_directories('.')
2+
3+
libmypaint_gegl_sources = [
4+
'../glib/mypaint-gegl-glib.c',
5+
'mypaint-gegl-surface.c',
6+
]
7+
8+
libmypaint_gegl_headers = [
9+
'../glib/mypaint-gegl-glib.h',
10+
'mypaint-gegl-surface.h',
11+
]
12+
13+
libmypaint_gegl = library(
14+
f'mypaint-gegl-@api_platform_version@',
15+
libmypaint_gegl_sources,
16+
include_directories: toplevel_inc,
17+
link_with: libmypaint,
18+
dependencies: [
19+
json,
20+
gobject,
21+
gegl,
22+
],
23+
version: abi_version_info,
24+
install: true,
25+
)
26+
27+
install_headers(
28+
libmypaint_gegl_headers,
29+
subdir: 'libmypaint-gegl',
30+
)
31+
32+
33+
if get_option('introspection')
34+
gnome = import('gnome')
35+
36+
libmypaint_gegl_gir = gnome.generate_gir(
37+
libmypaint_gegl,
38+
namespace: 'MyPaintGegl',
39+
nsversion: api_platform_version,
40+
41+
sources: libmypaint_gegl_sources + libmypaint_gegl_headers,
42+
symbol_prefix: 'mypaint_gegl',
43+
identifier_prefix: 'MyPaintGegl',
44+
45+
includes: [
46+
'GObject-2.0',
47+
gegl_gir,
48+
libmypaint_gir[0],
49+
],
50+
install: true,
51+
)
52+
endif
53+
54+
55+
pkgconfig.generate(
56+
libmypaint_gegl,
57+
name: meson.project_name() + '-gegl-' + api_platform_version,
58+
version: version_full,
59+
description: 'MyPaint brush engine library, with GEGL integration',
60+
requires: [
61+
libmypaint,
62+
gegl,
63+
],
64+
url: project_url,
65+
subdirs: 'libmypaint-gegl',
66+
)

0 commit comments

Comments
 (0)