Skip to content

Commit

Permalink
Add meson build system
Browse files Browse the repository at this point in the history
Co-authored-by: Félix Piédallu <felix@piedallu.me>
Co-authored-by: Jan Tojnar <jtojnar@gmail.com>
  • Loading branch information
3 people committed Feb 4, 2024
1 parent 5fd3f3c commit f519046
Show file tree
Hide file tree
Showing 10 changed files with 605 additions and 16 deletions.
49 changes: 34 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ compiler:
- gcc

sudo: required
services: docker

dist: trusty

Expand All @@ -15,18 +16,36 @@ addons:
- libgirepository1.0-dev
- libgegl-dev

script:
- ./autogen.sh
- ./configure
- make
- make clean
- make distcheck
- make maintainer-clean
- ./autogen.sh
- ./configure --with-introspection
- make
- make maintainer-clean
- ./autogen.sh
- ./configure --with-gegl
- make
- make maintainer-clean
jobs:
include:
- stage: "Build"
name: "Autotools build"
script:
- ./autogen.sh
- ./configure
- make
- make clean
- make distcheck
- make maintainer-clean
- ./autogen.sh
- ./configure --with-introspection
- make
- make maintainer-clean
- ./autogen.sh
- ./configure --with-gegl
- make
- make maintainer-clean

- name: "Meson build"
script:
- sudo docker pull ubuntu:disco
- sudo docker run -t -v $(pwd):/sources ubuntu:disco /bin/bash -ec "
apt update -y
&& apt install -y meson gettext libjson-c-dev libgirepository1.0-dev libgegl-dev git
&& meson /sources _build --buildtype=release
&& ninja -C _build test
&& ninja -C _build dist
&& meson /sources _build_gegl --buildtype=release -Dgegl=true
&& ninja -C _build_gegl test
&& ninja -C _build_gegl dist
"
9 changes: 8 additions & 1 deletion appveyor_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ pacman --noconfirm -S --needed \
base-devel \
${PKG_PREFIX}-json-c \
${PKG_PREFIX}-glib2 \
${PKG_PREFIX}-gobject-introspection
${PKG_PREFIX}-gobject-introspection \
${PKG_PREFIX}-meson \
git


# Add m4 directories to the ACLOCAL_PATH
Expand All @@ -30,6 +32,11 @@ done
export ACLOCAL_PATH
export PWD="$APPVEYOR_BULD_FOLDER"

# Meson build, we need a way to parallel this with Autotools
meson setup _build --buildtype=release -Dgegl=false -Ddocs=false
meson dist -C _build
rm -rf _build

./autogen.sh
./configure
make distcheck
37 changes: 37 additions & 0 deletions doc/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
doc_conf = configuration_data()
doc_conf.merge_from(conf)

doc_conf.set('DOXYGEN_SOURCE_ROOT', meson.project_source_root())
doc_conf.set('DOXYXML_BUILD_PATH', meson.current_build_dir())
doc_conf.set('DOXYGEN_EXCLUDED', '')

doxyfile = configure_file(
input: 'Doxyfile.in',
output: 'Doxyfile',
configuration: doc_conf,
)

doxygen_index = custom_target(
'doxygen',
input: doxyfile,
output: 'index.xml',
command: [
doxygen,
'@INPUT@',
],
)

subdir('source')

run_target(
'sphinx',
depends: [
doxygen_index,
],
command: [
sphinx_build,
'-c', meson.current_build_dir() / 'source',
meson.current_source_dir() / 'source',
meson.current_build_dir() / 'build',
],
)
5 changes: 5 additions & 0 deletions doc/source/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sphinx_conf_file = configure_file(
input: 'conf.py.in',
output: 'conf.py',
configuration: doc_conf,
)
66 changes: 66 additions & 0 deletions gegl/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
libmypaint_gegl_inc = include_directories('.')

libmypaint_gegl_sources = [
'../glib/mypaint-gegl-glib.c',
'mypaint-gegl-surface.c',
]

libmypaint_gegl_headers = [
'../glib/mypaint-gegl-glib.h',
'mypaint-gegl-surface.h',
]

libmypaint_gegl = library(
f'mypaint-gegl-@api_platform_version@',
libmypaint_gegl_sources,
include_directories: toplevel_inc,
link_with: libmypaint,
dependencies: [
json,
gobject,
gegl,
],
version: abi_version_info,
install: true,
)

install_headers(
libmypaint_gegl_headers,
subdir: 'libmypaint-gegl',
)


if get_option('introspection')
gnome = import('gnome')

libmypaint_gegl_gir = gnome.generate_gir(
libmypaint_gegl,
namespace: 'MyPaintGegl',
nsversion: api_platform_version,

sources: libmypaint_gegl_sources + libmypaint_gegl_headers,
symbol_prefix: 'mypaint_gegl',
identifier_prefix: 'MyPaintGegl',

includes: [
'GObject-2.0',
gegl_gir,
libmypaint_gir[0],
],
install: true,
)
endif


pkgconfig.generate(
libmypaint_gegl,
name: meson.project_name() + '-gegl-' + api_platform_version,
version: version_full,
description: 'MyPaint brush engine library, with GEGL integration',
requires: [
libmypaint,
gegl,
],
url: project_url,
subdirs: 'libmypaint-gegl',
)

0 comments on commit f519046

Please sign in to comment.