[gegl/wip/nielsdg/meson] Port the build system to Meson.



commit 78bfac14610bc3d279d1ab7c404a5ca72360e16a
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sat Oct 14 12:59:37 2017 +0200

    Port the build system to Meson.

 bin/meson.build                                   |   30 ++++
 docs/meson.build                                  |  101 +++++++++++
 examples/meson.build                              |   27 +++
 gcut/meson.build                                  |   30 ++++
 gegl/buffer/meson.build                           |   39 ++++
 gegl/graph/meson.build                            |   13 ++
 gegl/meson.build                                  |  147 ++++++++++++++++
 gegl/module/meson.build                           |   11 ++
 gegl/opencl/meson.build                           |   13 ++
 gegl/operation/meson.build                        |   30 ++++
 gegl/process/meson.build                          |   13 ++
 gegl/property-types/meson.build                   |   13 ++
 libs/meson.build                                  |    2 +
 libs/npd/meson.build                              |   19 ++
 libs/poly2tri-c/meson.build                       |    3 +
 libs/poly2tri-c/poly2tri-c/meson.build            |   39 ++++
 libs/poly2tri-c/poly2tri-c/p2t/common/meson.build |   10 +
 libs/poly2tri-c/poly2tri-c/p2t/meson.build        |   13 ++
 libs/poly2tri-c/poly2tri-c/p2t/sweep/meson.build  |   12 ++
 libs/poly2tri-c/poly2tri-c/refine/meson.build     |   28 +++
 libs/poly2tri-c/poly2tri-c/render/meson.build     |   10 +
 libs/rgbe/meson.build                             |    9 +
 meson.build                                       |  193 +++++++++++++++++++++
 meson_options.txt                                 |   15 ++
 opencl/meson.build                                |   51 ++++++
 operations/common-gpl3+/meson.build               |   76 ++++++++
 operations/common/meson.build                     |  132 ++++++++++++++
 operations/core/meson.build                       |   37 ++++
 operations/external/meson.build                   |   32 ++++
 operations/generated/meson.build                  |   57 ++++++
 operations/json/meson.build                       |    7 +
 operations/meson.build                            |   14 ++
 operations/transform/meson.build                  |   23 +++
 perf/meson.build                                  |   31 ++++
 po/meson.build                                    |    3 +
 seamless-clone/meson.build                        |   18 ++
 tests/compositions/meson.build                    |    1 +
 tests/meson.build                                 |   15 ++
 tests/mipmap/meson.build                          |   14 ++
 tests/python/meson.build                          |   13 ++
 tests/simple/meson.build                          |   41 +++++
 tests/xml/meson.build                             |   16 ++
 tools/meson.build                                 |   35 ++++
 43 files changed, 1436 insertions(+), 0 deletions(-)
---
diff --git a/bin/meson.build b/bin/meson.build
new file mode 100644
index 0000000..fc5446e
--- /dev/null
+++ b/bin/meson.build
@@ -0,0 +1,30 @@
+gegl_sources = [
+  'gegl.c',
+  'gegl-options.c',
+  'gegl-path-smooth.c',
+]
+
+gegl_dependencies = [
+  babl,
+  libpng,
+  mrg,
+  gexiv2,
+  libmath,
+  libgegl_dep,
+]
+
+if mrg_support and gexiv2_support and sdl_support
+  gegl_sources += 'ui.c'
+  gegl_dependencies += sdl
+endif
+
+if spiro_support
+  gegl_sources += 'gegl-path-spiro.c'
+  gegl_dependencies += spiro
+endif
+
+gegl_bin = executable('gegl',
+  gegl_sources,
+  dependencies: gegl_dependencies,
+  install: true,
+)
diff --git a/docs/meson.build b/docs/meson.build
new file mode 100644
index 0000000..2d79a3a
--- /dev/null
+++ b/docs/meson.build
@@ -0,0 +1,101 @@
+index_txt = configure_file(
+  input: 'index.txt.in',
+  output: 'index.txt',
+  configuration: conf,
+)
+helloworld_txt = configure_file(
+  input: 'hello-world.txt.in',
+  output: 'hello-world.txt',
+  configuration: conf,
+)
+
+asciidoc_files = [
+  index_txt,
+  'abyss_policy.txt',
+  'bugzilla.txt',
+  'build.txt',
+  'commandline.txt',
+  'contribute.txt',
+  'copyright.txt',
+  'development.txt',
+  'editor.txt',
+  'environment.txt',
+  'features.txt',
+  'gcut.txt',
+  'gegl-chain.txt',
+  'glossary.txt',
+  helloworld_txt,
+  'journal.txt',
+  'NEWS.txt',
+  'operation-api.txt',
+  'source-overview.txt',
+]
+
+foreach file: asciidoc_files
+  rendered_file = custom_target('@0@.html'.format(file).underscorify(),
+    output: '@BASENAME@.html',
+    input: file,
+    command: [ asciidoc,
+      '--unsafe',
+      '-o', '@OUTPUT@',
+      '-a', 'stylesheet="@0@"'.format(join_paths(meson.source_root(), 'gegl.css')),
+      '-a', 'quirks!',
+      '@INPUT@',
+    ],
+  )
+endforeach
+
+if ruby.found() and dot.found()
+  inheritance_temp = custom_target('inheritance.dot',
+    input: meson.source_root(),
+    output: 'inheritance.dot',
+    command: [ gobj2dot,
+      '@INPUT@',
+    ],
+    capture: true,
+    build_by_default: true,
+  )
+
+  inheritance_img = custom_target('inheritance.png',
+    input: inheritance_temp,
+    output: 'inheritance.png',
+    command: [ dot,
+      '-Tpng',
+    ],
+    capture: true,
+    build_by_default: true,
+  )
+endif
+
+enscript_files = [
+  join_paths(meson.source_root(), 'gegl', 'gegl.h'),
+  join_paths(meson.source_root(), 'gegl', 'gegl-plugin.h'),
+  join_paths(meson.source_root(), 'operations', 'common', 'brightness-contrast.c'),
+  join_paths(meson.source_root(), 'gegl', 'operation', 'gegl-operation.h'),
+  join_paths(meson.source_root(), 'gegl', 'operation', 'gegl-operation-composer.h'),
+  join_paths(meson.source_root(), 'gegl', 'operation', 'gegl-operation-area-filter.h'),
+  join_paths(meson.source_root(), 'gegl', 'operation', 'gegl-operation-filter.h'),
+  join_paths(meson.source_root(), 'gegl', 'operation', 'gegl-operation-meta.h'),
+  join_paths(meson.source_root(), 'gegl', 'operation', 'gegl-operation-point-composer.h'),
+  join_paths(meson.source_root(), 'gegl', 'operation', 'gegl-operation-temporal.h'),
+  join_paths(meson.source_root(), 'gegl', 'operation', 'gegl-operation-point-filter.h'),
+  join_paths(meson.source_root(), 'gegl', 'operation', 'gegl-operation-point-render.h'),
+  join_paths(meson.source_root(), 'gegl', 'operation', 'gegl-operation-sink.h'),
+  join_paths(meson.source_root(), 'gegl', 'operation', 'gegl-operation-source.h'),
+]
+
+foreach file: enscript_files
+  path = file.split('/')
+  basename = path[path.length() - 1]
+  rendered_file = custom_target('@0@.html'.format(file).underscorify(),
+    input: file,
+    output: '@0@.html'.format(basename),
+    command: [ enscript,
+      '-E',
+      '--color',
+      '--language=html',
+      '-p', '@OUTPUT@',
+      '@INPUT@',
+    ],
+  )
+endforeach
diff --git a/examples/meson.build b/examples/meson.build
new file mode 100644
index 0000000..484a1c3
--- /dev/null
+++ b/examples/meson.build
@@ -0,0 +1,27 @@
+examples = [
+  '2geglbuffer',
+  'gegl-convert',
+  'gegl-slicer',
+  'video-invert',
+  'geglbuffer-add-image',
+  'geglbuffer-clock',
+  'frame-counter',
+  'hello-world',
+]
+
+example_dependencies = [
+  common_deps,
+  babl,
+  sdl,
+  libmath,
+  libgegl_dep,
+]
+
+foreach example: examples
+  executable(example,
+    '@0@.c'.format(example),
+    dependencies: example_dependencies,
+  )
+endforeach
+
+# sdl and gegl examples
diff --git a/gcut/meson.build b/gcut/meson.build
new file mode 100644
index 0000000..92ae611
--- /dev/null
+++ b/gcut/meson.build
@@ -0,0 +1,30 @@
+gcut_sources = [
+  'clip.c',
+  'gcut-util.c',
+  'gcut.c',
+  'iconographer.c',
+]
+
+gcut_dependencies = [
+  common_deps,
+  babl,
+  libpng,
+  spiro,
+  libmath,
+  mrg,
+  gexiv2,
+  libgegl_dep,
+]
+
+# XXX
+# if mrg_support and sdl_support
+#   gcut_sources += 'gcut-ui.c'
+#   gcut_dependencies += libsdl
+# endif
+
+gcut = executable('gcut',
+  gcut_sources,
+  dependencies: gcut_dependencies,
+  include_directories: config_h_dir,
+  install: true,
+)
diff --git a/gegl/buffer/meson.build b/gegl/buffer/meson.build
new file mode 100644
index 0000000..caa851e
--- /dev/null
+++ b/gegl/buffer/meson.build
@@ -0,0 +1,39 @@
+libbuffer_sources = [
+  'gegl-buffer.c',
+  'gegl-buffer-access.c',
+  'gegl-buffer-index.h',
+  'gegl-buffer-iterator.c',
+  'gegl-buffer-cl-iterator.c',
+  'gegl-buffer-cl-cache.c',
+  'gegl-buffer-linear.c',
+  'gegl-buffer-load.c',
+  'gegl-buffer-save.c',
+  'gegl-cache.c',
+  'gegl-sampler.c',
+  'gegl-sampler-cubic.c',
+  'gegl-sampler-linear.c',
+  'gegl-sampler-nearest.c',
+  'gegl-sampler-nohalo.c',
+  'gegl-sampler-lohalo.c',
+  'gegl-region-generic.c',
+  'gegl-tile.c',
+  'gegl-tile-source.c',
+  'gegl-tile-storage.c',
+  'gegl-tile-backend.c',
+  'gegl-tile-backend-file-async.c',
+  'gegl-tile-backend-ram.c',
+  'gegl-tile-backend-swap.c',
+  'gegl-tile-handler.c',
+  'gegl-tile-handler-private.h',
+  'gegl-tile-handler-cache.c',
+  'gegl-tile-handler-chain.c',
+  'gegl-tile-handler-empty.c',
+  'gegl-tile-handler-log.c',
+  'gegl-tile-handler-zoom.c',
+]
+
+libbuffer = static_library('buffer',
+  libbuffer_sources,
+  include_directories: libgegl_common_includes,
+  dependencies: libgegl_common_dependencies,
+)
diff --git a/gegl/graph/meson.build b/gegl/graph/meson.build
new file mode 100644
index 0000000..182428a
--- /dev/null
+++ b/gegl/graph/meson.build
@@ -0,0 +1,13 @@
+libgraph_sources = [
+  'gegl-connection.c',
+  'gegl-node.c',
+  'gegl-pad.c',
+  'gegl-visitable.c',
+  'gegl-visitor.c',
+]
+
+libgraph = static_library('graph',
+  libgraph_sources,
+  include_directories: libgegl_common_includes,
+  dependencies: libgegl_common_dependencies,
+)
diff --git a/gegl/meson.build b/gegl/meson.build
new file mode 100644
index 0000000..5b89f51
--- /dev/null
+++ b/gegl/meson.build
@@ -0,0 +1,147 @@
+# Version header
+libgegl_version_conf = configuration_data()
+libgegl_version_conf.set('GEGL_MAJOR_VERSION', gegl_major_version)
+libgegl_version_conf.set('GEGL_MINOR_VERSION', gegl_minor_version)
+libgegl_version_conf.set('GEGL_MICRO_VERSION', gegl_micro_version)
+libgegl_version_header = configure_file(
+  input: 'gegl-version.h.in',
+  output: 'gegl-version.h',
+  configuration: libgegl_version_conf,
+)
+
+# Common includes
+libgegl_common_includes = [
+  config_h_dir,
+  include_directories('.'),
+  include_directories('buffer'),
+  include_directories('graph'),
+  include_directories('module'),
+  include_directories('opencl'),
+  include_directories('operation'),
+  include_directories('process'),
+  include_directories('property-types'),
+]
+
+# Common dependencies
+libgegl_common_dependencies = [
+  common_deps,
+  libmath,
+  babl,
+]
+
+# XXX G_LOG_DOMAIN
+
+# Subdirectory
+subdir('buffer')
+subdir('graph')
+subdir('module')
+subdir('operation')
+subdir('process')
+subdir('property-types')
+subdir('opencl')
+
+# libgegl
+libgegl_sources = [
+  'gegl-algorithms.c',
+  'gegl-apply.c',
+  'gegl-config.c',
+  'gegl-cpuaccel.c',
+  'gegl-dot-visitor.c',
+  'gegl-dot.c',
+  'gegl-enums.c',
+  'gegl-gio.c',
+  'gegl-init.c',
+  'gegl-instrument.c',
+  'gegl-introspection-support.c',
+  'gegl-lookup.c',
+  'gegl-matrix.c',
+  'gegl-random.c',
+  'gegl-serialize.c',
+  'gegl-utils.c',
+  'gegl-xml.c',
+]
+
+libgegl_linkedlibs = [
+  libbuffer,
+  libmodule,
+  liboperation,
+  libgraph,
+  libprocess,
+  libpropertytypes,
+  libcl,
+]
+
+libgegl = library('gegl-@0@'.format(gegl_api_version),
+  libgegl_sources,
+  include_directories: libgegl_common_includes,
+  dependencies: libgegl_common_dependencies,
+  link_with: libgegl_linkedlibs,
+  install: true,
+)
+
+libgegl_dep = declare_dependency(
+  link_with: [ libgegl, libgegl_linkedlibs ],
+  dependencies: libgegl_common_dependencies,
+  include_directories: libgegl_common_includes,
+)
+
+
+# Introspection
+libgegl_introspectable_headers = [
+  libgegl_version_header,
+
+  'gegl-apply.h',
+  'gegl-enums.h',
+  'gegl-init.h',
+  'gegl-lookup.h',
+  'gegl-matrix.h',
+  'gegl-random.h',
+  'gegl-types.h',
+  'gegl-utils.h',
+  'gegl.h',
+
+  'buffer/gegl-buffer-backend.h',
+  'buffer/gegl-buffer-iterator.h',
+  'buffer/gegl-buffer.h',
+  'buffer/gegl-tile-backend.h',
+  'buffer/gegl-tile-handler.h',
+  'buffer/gegl-tile-source.h',
+
+  'graph/gegl-node.h',
+
+  'process/gegl-graph-debug.h',
+  'process/gegl-processor.h',
+
+  'property-types/gegl-audio-fragment.h',
+  'property-types/gegl-color.h',
+  'property-types/gegl-curve.h',
+  'property-types/gegl-paramspecs.h',
+  'property-types/gegl-path.h',
+]
+
+libgegl_gir_sources = [
+  libgegl_introspectable_headers,
+  'gegl-introspection-support.h',
+  'opencl/gegl-cl-introspection-support.h',
+]
+
+libgegl_gir_includes = [
+  'GObject-2.0',
+  'GLib-2.0',
+]
+
+libgegl_gir = gnome.generate_gir(libgegl,
+  namespace: 'Gegl',
+  nsversion: gegl_api_version,
+  sources: libgegl_gir_sources,
+  includes: libgegl_gir_includes,
+  install: true,
+)
+
+
+# VAPI
+libgegl_vapi = gnome.generate_vapi('Gegl-@0@'.format(gegl_api_version),
+  sources: libgegl_gir[0],
+  metadata_dirs: [ '.' ],
+  install: true,
+)
diff --git a/gegl/module/meson.build b/gegl/module/meson.build
new file mode 100644
index 0000000..905d13c
--- /dev/null
+++ b/gegl/module/meson.build
@@ -0,0 +1,11 @@
+libmodule_sources = [
+  'gegldatafiles.c',
+  'geglmodule.c',
+  'geglmoduledb.c',
+]
+
+libmodule = static_library('module',
+  libmodule_sources,
+  include_directories: libgegl_common_includes,
+  dependencies: libgegl_common_dependencies,
+)
diff --git a/gegl/opencl/meson.build b/gegl/opencl/meson.build
new file mode 100644
index 0000000..6074e15
--- /dev/null
+++ b/gegl/opencl/meson.build
@@ -0,0 +1,13 @@
+libcl_sources = [
+  'gegl-cl.c',
+  'gegl-cl-init.c',
+  'gegl-cl-color.c',
+  'gegl-cl-introspection-support.h',
+  'gegl-cl-random.c',
+]
+
+libcl = static_library('cl',
+  libcl_sources,
+  include_directories: libgegl_common_includes,
+  dependencies: libgegl_common_dependencies,
+)
diff --git a/gegl/operation/meson.build b/gegl/operation/meson.build
new file mode 100644
index 0000000..d9d915a
--- /dev/null
+++ b/gegl/operation/meson.build
@@ -0,0 +1,30 @@
+liboperation_sources = [
+  'gegl-extension-handler.c',
+  'gegl-operation.c',
+  'gegl-operation-area-filter.c',
+  'gegl-operation-composer.c',
+  'gegl-operation-composer3.c',
+  'gegl-operation-filter.c',
+  'gegl-operation-handlers.c',
+  'gegl-operation-handlers-private.h',
+  'gegl-operation-meta.c',
+  'gegl-operation-meta-json.c',
+  'gegl-operation-point-composer.c',
+  'gegl-operation-point-composer3.c',
+  'gegl-operation-point-filter.c',
+  'gegl-operation-point-render.c',
+  'gegl-operation-property-keys.c',
+  'gegl-operation-sink.c',
+  'gegl-operation-source.c',
+  'gegl-operation-temporal.c',
+  'gegl-operation-context.c',
+  'gegl-operation-context-private.h',
+  'gegl-operations.c',
+  'gegl-operations.h',
+]
+
+liboperation = static_library('operation',
+  liboperation_sources,
+  include_directories: libgegl_common_includes,
+  dependencies: libgegl_common_dependencies,
+)
diff --git a/gegl/process/meson.build b/gegl/process/meson.build
new file mode 100644
index 0000000..44cd257
--- /dev/null
+++ b/gegl/process/meson.build
@@ -0,0 +1,13 @@
+libprocess_sources = [
+  'gegl-eval-manager.c',
+  'gegl-graph-traversal.c',
+  'gegl-graph-traversal-debug.c',
+  'gegl-list-visitor.c',
+  'gegl-processor.c',
+]
+
+libprocess = static_library('process',
+  libprocess_sources,
+  include_directories: libgegl_common_includes,
+  dependencies: libgegl_common_dependencies,
+)
diff --git a/gegl/property-types/meson.build b/gegl/property-types/meson.build
new file mode 100644
index 0000000..18eeafa
--- /dev/null
+++ b/gegl/property-types/meson.build
@@ -0,0 +1,13 @@
+libpropertytypes_sources = [
+  'gegl-audio-fragment.c',
+  'gegl-color.c',
+  'gegl-curve.c',
+  'gegl-path.c',
+  'gegl-paramspecs.c',
+]
+
+libpropertytypes = static_library('propertytypes',
+  libpropertytypes_sources,
+  include_directories: libgegl_common_includes,
+  dependencies: libgegl_common_dependencies,
+)
diff --git a/libs/meson.build b/libs/meson.build
new file mode 100644
index 0000000..be7f84a
--- /dev/null
+++ b/libs/meson.build
@@ -0,0 +1,2 @@
+subdir('poly2tri-c')
+subdir('rgbe')
diff --git a/libs/npd/meson.build b/libs/npd/meson.build
new file mode 100644
index 0000000..c9465bb
--- /dev/null
+++ b/libs/npd/meson.build
@@ -0,0 +1,19 @@
+libgegl_npd_sources = [
+  'npd_common.c',
+  'deformation.c',
+  'npd_math.c',
+  'graphics.c',
+  'lattice_cut.c',
+  'npd_debug.c',
+  'npd_gegl.c',
+]
+
+libgegl_npd_dependencies = [
+  common_deps,
+  libgegl_dep,
+]
+
+libgegl_npd = library('gegl-npd-@0@'.format(gegl_api_version),
+  libgegl_npd_sources,
+  dependencies: libgegl_npd_dependencies,
+)
diff --git a/libs/poly2tri-c/meson.build b/libs/poly2tri-c/meson.build
new file mode 100644
index 0000000..d778c33
--- /dev/null
+++ b/libs/poly2tri-c/meson.build
@@ -0,0 +1,3 @@
+if not poly2tri_c.found()
+  subdir('poly2tri-c')
+endif
diff --git a/libs/poly2tri-c/poly2tri-c/meson.build b/libs/poly2tri-c/poly2tri-c/meson.build
new file mode 100644
index 0000000..2c2a85e
--- /dev/null
+++ b/libs/poly2tri-c/poly2tri-c/meson.build
@@ -0,0 +1,39 @@
+# Common dependencies
+libpoly2tri_c_common_dependencies = [
+  glib,
+  gobject,
+  gmodule,
+  json_glib,
+  gthread,
+  gio,
+  gio_os,
+  libmath,
+]
+
+# Common includes
+libpoly2tri_c_common_includes = [
+  include_directories('..'),
+]
+
+
+subdir('p2t')
+subdir('refine')
+subdir('render')
+
+libpoly2tri_c_linkedlibs = [
+  libp2tc,
+  libp2tc_refine,
+  libp2tc_render,
+]
+
+libpoly2tri_c = static_library('poly2tri-c',
+  [],
+  link_with: libpoly2tri_c_linkedlibs,
+  include_directories: libpoly2tri_c_common_includes,
+)
+
+# Use the compiled internal library as the poly2tri_c dependency
+poly2tri_c = declare_dependency(
+  link_with: [ libpoly2tri_c, libp2tc_linkedlibs ],
+  include_directories: libpoly2tri_c_common_includes,
+)
diff --git a/libs/poly2tri-c/poly2tri-c/p2t/common/meson.build 
b/libs/poly2tri-c/poly2tri-c/p2t/common/meson.build
new file mode 100644
index 0000000..30fb5ae
--- /dev/null
+++ b/libs/poly2tri-c/poly2tri-c/p2t/common/meson.build
@@ -0,0 +1,10 @@
+libp2tc_common_sources = [
+  'shapes.c',
+  'utils.c',
+]
+
+libp2tc_common = static_library('p2tc-common',
+  libp2tc_common_sources,
+  dependencies: libpoly2tri_c_common_dependencies,
+  include_directories: libpoly2tri_c_common_includes,
+)
diff --git a/libs/poly2tri-c/poly2tri-c/p2t/meson.build b/libs/poly2tri-c/poly2tri-c/p2t/meson.build
new file mode 100644
index 0000000..a403505
--- /dev/null
+++ b/libs/poly2tri-c/poly2tri-c/p2t/meson.build
@@ -0,0 +1,13 @@
+subdir('sweep')
+subdir('common')
+
+libp2tc_linkedlibs = [
+  libp2tc_sweep,
+  libp2tc_common,
+]
+
+libp2tc = library('pt2c',
+  'poly2tri.h',
+  link_with: libp2tc_linkedlibs,
+  include_directories: libpoly2tri_c_common_includes,
+)
diff --git a/libs/poly2tri-c/poly2tri-c/p2t/sweep/meson.build 
b/libs/poly2tri-c/poly2tri-c/p2t/sweep/meson.build
new file mode 100644
index 0000000..1574b92
--- /dev/null
+++ b/libs/poly2tri-c/poly2tri-c/p2t/sweep/meson.build
@@ -0,0 +1,12 @@
+libp2tc_sweep_sources = [
+  'advancing_front.c',
+  'cdt.c',
+  'sweep.c',
+  'sweep_context.c',
+]
+
+libp2tc_sweep = static_library('p2tc-sweep',
+  libp2tc_sweep_sources,
+  dependencies: libpoly2tri_c_common_dependencies,
+  include_directories: libpoly2tri_c_common_includes,
+)
diff --git a/libs/poly2tri-c/poly2tri-c/refine/meson.build b/libs/poly2tri-c/poly2tri-c/refine/meson.build
new file mode 100644
index 0000000..114f69b
--- /dev/null
+++ b/libs/poly2tri-c/poly2tri-c/refine/meson.build
@@ -0,0 +1,28 @@
+libp2tc_refine_sources = [
+  'bounded-line.c',
+  'cdt-flipfix.c',
+  'cdt.c',
+  'circle.c',
+  'cluster.c',
+  'delaunay-terminator.c',
+  'edge.c',
+  'line.c',
+  'mesh-action.c',
+  'mesh.c',
+  'point.c',
+  'pslg.c',
+  'refiner.c',
+  'rmath.c',
+  'triangle.c',
+  'utils.c',
+  'vector2.c',
+  'vedge.c',
+  'visibility.c',
+  'vtriangle.c',
+]
+
+libp2tc_refine = static_library('p2tc-refine',
+  libp2tc_refine_sources,
+  dependencies: libpoly2tri_c_common_dependencies,
+  include_directories: libpoly2tri_c_common_includes,
+)
diff --git a/libs/poly2tri-c/poly2tri-c/render/meson.build b/libs/poly2tri-c/poly2tri-c/render/meson.build
new file mode 100644
index 0000000..24f1171
--- /dev/null
+++ b/libs/poly2tri-c/poly2tri-c/render/meson.build
@@ -0,0 +1,10 @@
+libp2tc_render_sources = [
+  'mesh-render.c',
+  'svg-plot.c',
+]
+
+libp2tc_render = static_library('p2tc-render',
+  libp2tc_render_sources,
+  dependencies: libpoly2tri_c_common_dependencies,
+  include_directories: libpoly2tri_c_common_includes,
+)
diff --git a/libs/rgbe/meson.build b/libs/rgbe/meson.build
new file mode 100644
index 0000000..21bda4f
--- /dev/null
+++ b/libs/rgbe/meson.build
@@ -0,0 +1,9 @@
+rgbe_sources = [
+  'rgbe.c',
+]
+
+librgbe = library('rgbe',
+  rgbe_sources,
+  dependencies: common_deps,
+  include_directories: config_h_dir,
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..ddcba05
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,193 @@
+project('gegl', 'c',
+  version: '0.3.21',
+  license: 'GPL3+',
+  meson_version: '>= 0.43',
+)
+
+i18n = import('i18n')
+gnome = import('gnome')
+
+# Versioning
+gegl_version_split = meson.project_version().split('.')
+gegl_major_version = gegl_version_split[0]
+gegl_minor_version = gegl_version_split[1]
+gegl_micro_version = gegl_version_split[2]
+gegl_api_version = '.'.join([gegl_major_version, gegl_minor_version])
+
+# Options (for more info, see meson_options.txt)
+docs_enabled = get_option('docs')
+gexiv2_support = get_option('gexiv2')
+mrg_support = get_option('mrg')
+cairo_support = get_option('cairo')
+pango_support = get_option('pango')
+pangocairo_support = get_option('pangocairo')
+gdk_pixbuf_support = get_option('gdk-pixbuf')
+lensfun_support = get_option('lensfun')
+libpng_support = get_option('libpng')
+librsvg_support = get_option('librsvg')
+libv4l2_support = get_option('libv4l2')
+openexr_support = get_option('openexr')
+sdl_support = get_option('sdl')
+spiro_support = get_option('spiro')
+
+# Some variables
+prefix = get_option('prefix')
+config_h_dir = include_directories('.')
+locale_dir = join_paths(prefix, get_option('localedir')) # XXX check if this is correct (see GEGL_LOCALEDIR 
in configure.ac)
+# pkgdatadir = join_paths(get_option('datadir'), meson.project_name())
+libdir = get_option('libdir')
+po_dir = join_paths(meson.source_root(), 'po')
+
+# Dependencies
+cc = meson.get_compiler('c')
+
+libmath = cc.find_library('m')
+babl = dependency('babl', version: '>= 0.1.34')
+# glib packages
+glib = dependency('glib-2.0', version: '>= 2.44')
+gobject = dependency('gobject-2.0')
+gmodule = dependency('gmodule-2.0')
+json_glib = dependency('json-glib-1.0')
+gthread = dependency('gthread-2.0')
+gio = dependency('gio-2.0')
+if target_machine.system() == 'windows'
+  gio_os = dependency('gio-windows-2.0')
+else
+  gio_os = dependency('gio-unix-2.0')
+endif
+
+pango = dependency('pango', version: '>= 1.38.0')
+perl = find_program('perl5', 'perl', 'perl5.005', 'perl5.004')
+ruby = find_program('ruby', required: false)
+if not ruby.found()
+  warning('Could not find Ruby interpreter. The HTML API reference will not be updated.')
+endif
+enscript = find_program('enscript', required: false)
+asciidoc = find_program('asciidoc', required: false)
+dot = find_program('dot', required: false)
+w3m = find_program('w3m', required: false)
+python = find_program('python2.5', required: false) # used for introspection unittests
+# XXX pygobject
+poly2tri_c = dependency('poly2tri-c', version: '>= 0.0.0', required: false)
+if not poly2tri_c.found()
+  message('Couldn\'t find poly2tri-c, falling back to internal version')
+endif
+
+if gexiv2_support
+  gexiv2 = dependency('gexiv2')
+endif
+if mrg_support
+  mrg = dependency('mrg', required: false) # XXX normally required: true I think?
+endif
+if cairo_support
+  cairo = dependency('cairo', version: '>= 1.1.12')
+endif
+if pango_support
+  pango = dependency('pango', version: '>= 1.38.0')
+endif
+if pangocairo_support
+  pangocairo = dependency('pangocairo', version: '>= 1.38.0')
+endif
+if gdk_pixbuf_support
+  gdk_pixbuf = dependency('gdk-pixbuf-2.0', version: '>= 2.32.0')
+endif
+if lensfun_support
+  lensfun = dependency('lensfun', version: '>= 0.2.5')
+endif
+# XXX jpeg
+if libpng_support
+  libpng = dependency('libpng')
+endif
+if librsvg_support
+  librsvg = dependency('librsvg-2.0', version: '>= 2.40.6')
+endif
+if libv4l2_support
+  libv4l2 = dependency('libv4l2', version: '>= 1.0.1')
+endif
+if openexr_support
+  openexr = dependency('OpenEXR', version: '>= 1.6.1')
+endif
+if sdl_support
+  sdl = dependency('sdl') # XXX correct? autoconf uses sdl-config
+  # XXX something with running sdl-config to get the right flags?
+endif
+# XXX libraw
+# XXX jasper
+# XXX graphviz
+# XXX lua
+# XXX libavformat
+# XXX lib4l
+# XXX lcms
+if spiro_support
+  spiro = cc.find_library('spiro')
+endif
+# XXX exiv2
+# XXX umfpack
+# XXX webp
+# XXX mmx
+
+# Configuration
+conf = configuration_data()
+conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+conf.set_quoted('GEGL_LOCALEDIR', locale_dir)
+conf.set_quoted('GEGL_LIBRARY', '@0@-@1@'.format(meson.project_name(), gegl_api_version))
+conf.set_quoted('LIBDIR', libdir)
+conf.set_quoted('top_srcdir', meson.source_root())
+conf.set_quoted('GEGL_VERSION', meson.project_version())
+configure_file(output: 'config.h', configuration: conf)
+
+# Custom stuff
+# custom_target('NEWS',
+#   build_by_default: true,
+#   output: join_paths('docs', 'NEWS.html'),
+#   command: [ w3m,
+#     '-cols', '72',
+#     '-dump', '@OUTPUT@', # XXX isn't this @OUTPUT@ ?
+#   ],
+# )
+
+# Common dependencies
+common_deps = [
+  glib,
+  gobject,
+  gmodule,
+  gio,
+  gio_os,
+  json_glib,
+  gthread,
+]
+
+# Pkg-conf
+pkg_conf = configuration_data()
+pkg_conf.set_quoted('prefix', prefix)
+# pkg_conf.set_quoted('exec_prefix', )
+pkg_conf.set_quoted('libdir', libdir)
+# pkg_conf.set_quoted('includedir', includedir)
+pkg_conf.set_quoted('PACKAGE_NAME', meson.project_name())
+pkg_conf.set_quoted('GEGL_API_VERSION', gegl_api_version)
+pkg_conf.set_quoted('GEGL_REAL_VERSION', meson.project_version())
+pkg_conf.set_quoted('GLIB_PACKAGES', 'gobject-2.0 gmodule-2.0 gio-2.0 json-glib-1.0') # XXX add gio-unix or 
gio-windows
+pkg_conf.set_quoted('MATH_LIB', '-lm')
+configure_file(
+  input: 'gegl.pc.in',
+  output: 'gegl.pc',
+  configuration: pkg_conf,
+)
+
+# Subfolders
+subdir('libs')
+subdir('opencl')
+subdir('gegl')
+subdir('libs/npd') # depends on gegl
+subdir('seamless-clone')
+subdir('bin')
+subdir('gcut')
+subdir('tools')
+subdir('operations')
+subdir('examples')
+subdir('tests')
+subdir('perf')
+subdir('po')
+if docs_enabled
+  subdir('docs')
+endif
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..6d25d97
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,15 @@
+option('docs', type: 'boolean', value: true, description: 'enable docs generation')
+# Build support
+option('gexiv2', type: 'boolean', value: true, description: 'build with gexiv2 support')
+option('mrg', type: 'boolean', value: true, description: 'build with mrg support')
+option('cairo', type: 'boolean', value: true, description: 'build with cairo support')
+option('pango', type: 'boolean', value: true, description: 'build with pango support')
+option('pangocairo', type: 'boolean', value: true, description: 'build with pangocairo support')
+option('gdk-pixbuf', type: 'boolean', value: true, description: 'build with gdk-pixbuf support')
+option('lensfun', type: 'boolean', value: true, description: 'build with lensfun support')
+option('libpng', type: 'boolean', value: true, description: 'build with libpng support')
+option('librsvg', type: 'boolean', value: true, description: 'build with librsvg support')
+option('libv4l2', type: 'boolean', value: true, description: 'build with v4l2 support')
+option('openexr', type: 'boolean', value: true, description: 'build with OpenEXR support')
+option('sdl', type: 'boolean', value: true, description: 'build with SDL support')
+option('spiro', type: 'boolean', value: true, description: 'build with spiro support')
diff --git a/opencl/meson.build b/opencl/meson.build
new file mode 100644
index 0000000..7ab4bd8
--- /dev/null
+++ b/opencl/meson.build
@@ -0,0 +1,51 @@
+opencl_sources = [
+  'alien-map.cl',
+  'bilateral-filter-fast.cl',
+  'bilateral-filter.cl',
+  'box-blur.cl',
+  'box-max.cl',
+  'box-min.cl',
+  'brightness-contrast.cl',
+  'c2g.cl',
+  'checkerboard.cl',
+  'color-exchange.cl',
+  'color-temperature.cl',
+  'color-to-alpha.cl',
+  'colors-8bit-lut.cl',
+  'colors.cl',
+  'contrast-curve.cl',
+  'diffraction-patterns.cl',
+  'edge-laplace.cl',
+  'edge-sobel.cl',
+  'gaussian-blur-selective.cl',
+  'gblur-1d.cl',
+  'hue-chroma.cl',
+  'invert-linear.cl',
+  'levels.cl',
+  'mono-mixer.cl',
+  'motion-blur-circular.cl',
+  'motion-blur-linear.cl',
+  'noise-cell.cl',
+  'noise-hsv.cl',
+  'noise-hurl.cl',
+  'noise-reduction.cl',
+  'noise-simplex.cl',
+  'oilify.cl',
+  'opacity.cl',
+  'pixelize.cl',
+  'posterize.cl',
+  'random.cl',
+  'red-eye-removal.cl',
+  'shadows-highlights-correction.cl',
+  'snn-mean.cl',
+  'stretch-contrast.cl',
+  'svg-src-over.cl',
+  'texturize-canvas.cl',
+  'threshold.cl',
+  'value-invert.cl',
+  'video-degradation.cl',
+  'vignette.cl',
+  'weighted-blend.cl',
+]
+
+# XXX
diff --git a/operations/common-gpl3+/meson.build b/operations/common-gpl3+/meson.build
new file mode 100644
index 0000000..27a3654
--- /dev/null
+++ b/operations/common-gpl3+/meson.build
@@ -0,0 +1,76 @@
+operations_common_gpl3_c_sources = [
+  'antialias.c',
+  'apply-lens.c',
+  'bump-map.c',
+  'cartoon.c',
+  'channel-mixer.c',
+  'color-exchange.c',
+  'color-to-alpha.c',
+  'cubism.c',
+  'deinterlace.c',
+  'diffraction-patterns.c',
+  'displace.c',
+  'edge-laplace.c',
+  'edge.c',
+  'emboss.c',
+  'engrave.c',
+  'fractal-explorer.c',
+  'fractal-trace.c',
+  'gaussian-blur-selective.c',
+  'illusion.c',
+  'lens-distortion.c',
+  'lens-flare.c',
+  'maze.c',
+  'mosaic.c',
+  'motion-blur-circular.c',
+  'motion-blur-zoom.c',
+  'noise-slur.c',
+  'noise-solid.c',
+  'oilify.c',
+  'photocopy.c',
+  'plasma.c',
+  'polar-coordinates.c',
+  'red-eye-removal.c',
+  'ripple.c',
+  'shift.c',
+  'sinus.c',
+  'softglow.c',
+  'spiral.c',
+  'supernova.c',
+  'texturize-canvas.c',
+  'tile-glass.c',
+  'tile-paper.c',
+  'value-propagate.c',
+  'video-degradation.c',
+  'waves.c',
+  'whirl-pinch.c',
+  'wind.c',
+]
+
+# module.c (autogenerated)
+operations_common_gpl3_module_c = custom_target('operations-common-gpl3-module.c',
+  input: operations_common_gpl3_c_sources,
+  output: 'module.c',
+  command: [ gen_loader_sh,
+    '@INPUT@',
+  ],
+  capture: true,
+)
+
+operations_common_gpl3_sources = [
+  operations_common_gpl3_c_sources,
+  operations_common_gpl3_module_c,
+]
+
+operations_common_gpl3_cflags = [
+  '-DGEGL_OP_BUNDLE',
+]
+
+operations_common_gpl3 = library('gegl-common-gpl3',
+  operations_common_gpl3_sources,
+  c_args: operations_common_gpl3_cflags,
+  include_directories: config_h_dir,
+  dependencies: libgegl_dep,
+  install: true,
+  install_dir: operations_ext_dir,
+)
diff --git a/operations/common/meson.build b/operations/common/meson.build
new file mode 100644
index 0000000..f9d8b11
--- /dev/null
+++ b/operations/common/meson.build
@@ -0,0 +1,132 @@
+operations_common_c_sources = [
+  'alien-map.c',
+  'bilateral-filter.c',
+  'box-blur.c',
+  'brightness-contrast.c',
+  'buffer-sink.c',
+  'buffer-source.c',
+  'c2g.c',
+  'checkerboard.c',
+  'dither.c',
+  'color-enhance.c',
+  'color-rotate.c',
+  'color-temperature.c',
+  'color-warp.c',
+  'color.c',
+  'component-extract.c',
+  'contrast-curve.c',
+  'convolution-matrix.c',
+  'copy-buffer.c',
+  'difference-of-gaussians.c',
+  'display.c',
+  'distance-transform.c',
+  'dropshadow.c',
+  'edge-neon.c',
+  'edge-sobel.c',
+  'exp-combine.c',
+  'exposure.c',
+  'fattal02.c',
+  'gaussian-blur.c',
+  'gblur-1d.c',
+  'gegl-buffer-load-op.c',
+  'gegl-buffer-save-op.c',
+  'gegl.c',
+  'grey.c',
+  'grid.c',
+  'high-pass.c',
+  'hue-chroma.c',
+  'image-compare.c',
+  'image-gradient.c',
+  'introspect.c',
+  'invert-gamma.c',
+  'invert-linear.c',
+  'layer.c',
+  'levels.c',
+  'linear-gradient.c',
+  'magick-load.c',
+  'mantiuk06.c',
+  'map-absolute.c',
+  'map-relative.c',
+  'matting-global.c',
+  'mblur.c',
+  'mirrors.c',
+  'mix.c',
+  'mono-mixer.c',
+  'motion-blur-linear.c',
+  'newsprint.c',
+  'noise-cie-lch.c',
+  'noise-hsv.c',
+  'noise-hurl.c',
+  'noise-perlin.c',
+  'noise-pick.c',
+  'noise-reduction.c',
+  'noise-rgb.c',
+  'noise-simplex.c',
+  'noise-spread.c',
+  'noise-cell.c',
+  'opacity.c',
+  'open-buffer.c',
+  'over.c',
+  'panorama-projection.c',
+  'pixelize.c',
+  'posterize.c',
+  'radial-gradient.c',
+  'rectangle.c',
+  'reinhard05.c',
+  'remap.c',
+  'rgb-clip.c',
+  'saturation.c',
+  'save.c',
+  'sepia.c',
+  'slic.c',
+  'snn-mean.c',
+  'stress.c',
+  'stretch-contrast-hsv.c',
+  'stretch-contrast.c',
+  'svg-huerotate.c',
+  'svg-luminancetoalpha.c',
+  'svg-matrix.c',
+  'svg-saturate.c',
+  'threshold.c',
+  'tile.c',
+  'tile-seamless.c',
+  'unsharp-mask.c',
+  'unpremultiply.c',
+  'value-invert.c',
+  'vignette.c',
+  'warp.c',
+  'waterpixels.c',
+  'watershed-transform.c',
+  'wavelet-blur-1d.c',
+  'wavelet-blur.c',
+  'weighted-blend.c',
+  'write-buffer.c',
+]
+
+# module.c (autogenerated)
+operations_common_module_c = custom_target('operations-common-module.c',
+  input: operations_common_c_sources,
+  output: 'module.c',
+  command: [ gen_loader_sh,
+    '@INPUT@',
+  ],
+  capture: true,
+)
+
+operations_common_sources = [
+  operations_common_c_sources,
+  operations_common_module_c,
+]
+
+operations_common_cflags = [
+  '-DGEGL_OP_BUNDLE',
+]
+
+operations_common = library('gegl-common',
+  operations_common_sources,
+  c_args: operations_common_cflags,
+  include_directories: config_h_dir,
+  dependencies: libgegl_dep,
+  install: true,
+  install_dir: operations_ext_dir,
+)
diff --git a/operations/core/meson.build b/operations/core/meson.build
new file mode 100644
index 0000000..9c3d274
--- /dev/null
+++ b/operations/core/meson.build
@@ -0,0 +1,37 @@
+operations_core_c_sources = [
+  'cache.c',
+  'load.c',
+  'clone.c',
+  'cast-format.c',
+  'crop.c',
+  'json.c',
+  'nop.c',
+]
+
+# module.c (autogenerated)
+operations_core_module_c = custom_target('operations-core-module.c',
+  input: operations_core_c_sources,
+  output: 'module.c',
+  command: [ gen_loader_sh,
+    '@INPUT@',
+  ],
+  capture: true,
+)
+
+operations_core_sources = [
+  operations_core_c_sources,
+  operations_core_module_c,
+]
+
+operations_core_cflags = [
+  '-DGEGL_OP_BUNDLE',
+]
+
+operations_core = library('gegl-core',
+  operations_core_sources,
+  c_args: operations_core_cflags,
+  include_directories: config_h_dir,
+  dependencies: libgegl_dep,
+  install: true,
+  install_dir: operations_ext_dir,
+)
diff --git a/operations/external/meson.build b/operations/external/meson.build
new file mode 100644
index 0000000..9d63dda
--- /dev/null
+++ b/operations/external/meson.build
@@ -0,0 +1,32 @@
+
+if pangocairo_support
+  library('text',
+    'text.c',
+    dependencies: [ libgegl_dep, pangocairo ],
+    install: true,
+    install_dir: operations_ext_dir,
+  )
+endif
+
+if cairo_support
+  library('path',
+    'path.c',
+    dependencies: [ libgegl_dep, cairo ],
+    install: true,
+    install_dir: operations_ext_dir,
+  )
+  library('vector-fill',
+    'vector-fill.c',
+    dependencies: [ libgegl_dep, cairo ],
+    install: true,
+    install_dir: operations_ext_dir,
+  )
+  library('vector-stroke',
+    'vector-stroke.c',
+    dependencies: [ libgegl_dep, cairo ],
+    install: true,
+    install_dir: operations_ext_dir,
+  )
+endif
+
+# XXX the rest
diff --git a/operations/generated/meson.build b/operations/generated/meson.build
new file mode 100644
index 0000000..7e9d35b
--- /dev/null
+++ b/operations/generated/meson.build
@@ -0,0 +1,57 @@
+operations_generated_c_sources = [
+  'add.c',
+  'clear.c',
+  'color-burn.c',
+  'color-dodge.c',
+  'darken.c',
+  'difference.c',
+  'divide.c',
+  'dst-atop.c',
+  'dst-in.c',
+  'dst-out.c',
+  'dst-over.c',
+  'dst.c',
+  'exclusion.c',
+  'gamma.c',
+  'hard-light.c',
+  'lighten.c',
+  'multiply.c',
+  'overlay.c',
+  'plus.c',
+  'screen.c',
+  'soft-light.c',
+  'src-atop.c',
+  'src-in.c',
+  'src-out.c',
+  'src.c',
+  'subtract.c',
+  'xor.c',
+]
+
+# module.c (autogenerated)
+operations_generated_module_c = custom_target('operations-generated-module.c',
+  input: operations_generated_c_sources,
+  output: 'module.c',
+  command: [ gen_loader_sh,
+    '@INPUT@',
+  ],
+  capture: true,
+)
+
+operations_generated_sources = [
+  operations_generated_c_sources,
+  operations_generated_module_c,
+]
+
+operations_generated_cflags = [
+  '-DGEGL_OP_BUNDLE',
+]
+
+operations_generated = library('gegl-generated',
+  operations_generated_sources,
+  c_args: operations_generated_cflags,
+  include_directories: config_h_dir,
+  dependencies: libgegl_dep,
+  install: true,
+  install_dir: operations_ext_dir,
+)
diff --git a/operations/json/meson.build b/operations/json/meson.build
new file mode 100644
index 0000000..4026695
--- /dev/null
+++ b/operations/json/meson.build
@@ -0,0 +1,7 @@
+json_operations = [
+  'grey2.json',
+]
+
+install_data(json_operations,
+  install_dir: operations_ext_dir,
+)
diff --git a/operations/meson.build b/operations/meson.build
new file mode 100644
index 0000000..1cc6d6d
--- /dev/null
+++ b/operations/meson.build
@@ -0,0 +1,14 @@
+operations_ext_dir = join_paths(libdir, 'gegl-@0@'.format(gegl_api_version))
+
+subdir('core')
+subdir('common')
+subdir('common-gpl3+')
+subdir('generated')
+# subdir('seamless-clone')
+subdir('transform')
+subdir('json')
+subdir('external')
+
+# if workshop_enabled
+#   subdir('workshop')
+# endif
diff --git a/operations/transform/meson.build b/operations/transform/meson.build
new file mode 100644
index 0000000..e6cd9ec
--- /dev/null
+++ b/operations/transform/meson.build
@@ -0,0 +1,23 @@
+operations_transform_sources = [
+  'transform-core.c',
+  'transform-core.h',
+  'module.c',
+  'module.h',
+  'reflect.c',
+  'rotate.c',
+  'rotate-on-center.c',
+  'scale-ratio.c',
+  'scale-size.c',
+  'scale-size-keepaspect.c',
+  'shear.c',
+  'transform.c',
+  'translate.c',
+]
+
+operations_transform = library('gegl-transform',
+  operations_transform_sources,
+  include_directories: config_h_dir,
+  dependencies: libgegl_dep,
+  install: true,
+  install_dir: operations_ext_dir,
+)
diff --git a/perf/meson.build b/perf/meson.build
new file mode 100644
index 0000000..5f3070a
--- /dev/null
+++ b/perf/meson.build
@@ -0,0 +1,31 @@
+perf_tests = [
+  'test-blur',
+  'test-bcontrast',
+  'test-bcontrast-minichunk',
+  'test-unsharpmask',
+  'test-bcontrast-4x',
+  'test-init',
+  'test-gegl-buffer-access',
+  'test-samplers',
+  'test-rotate',
+  'test-saturation',
+  'test-scale',
+  'test-translate',
+]
+
+perf_tests_cflags = [
+  '-DG_DISABLE_SINGLE_INCLUDES',
+  '-DGLIB_DISABLE_DEPRECATION_WARNINGS',
+  '-DCLUTTER_DISABLE_DEPRECATION_WARNINGS',
+  '-DTESTS_DATA_DIR="@0@"'.format(join_paths(meson.source_root(), 'tests', 'data')),
+]
+
+foreach _test: perf_tests
+  test_bin = executable(_test,
+    '@0@.c'.format(_test),
+    dependencies: libgegl_dep,
+    c_args: perf_tests_cflags,
+  )
+
+  test(_test, test_bin)
+endforeach
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..f904cde
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,3 @@
+i18n.gettext(meson.project_name(),
+  preset: 'glib'
+)
diff --git a/seamless-clone/meson.build b/seamless-clone/meson.build
new file mode 100644
index 0000000..81e1ebc
--- /dev/null
+++ b/seamless-clone/meson.build
@@ -0,0 +1,18 @@
+libgegl_sc_sources = [
+  'sc-context.c',
+  'sc-outline.c',
+  'sc-sample.c',
+]
+
+libgegl_sc_dependencies = [
+  common_deps,
+  libgegl_dep,
+  poly2tri_c,
+]
+
+libgegl_sc = library('gegl-sc-@0@'.format(gegl_api_version),
+  libgegl_sc_sources,
+  dependencies: libgegl_sc_dependencies,
+)
+
+# XXX pkg-config file
diff --git a/tests/compositions/meson.build b/tests/compositions/meson.build
new file mode 100644
index 0000000..dedff2b
--- /dev/null
+++ b/tests/compositions/meson.build
@@ -0,0 +1 @@
+run_compositions = find_program('run-compositions.py')
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000..3839689
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,15 @@
+test_env = environment()
+test_env.set('ABS_TOP_BUILDDIR', meson.build_root())
+test_env.set('ABS_TOP_SOURCEDIR', meson.source_root())
+test_env.set('GEGL_SWAP', 'RAM')
+test_env.set('GEGL_PATH', join_paths(meson.build_root(), 'operations'))
+# test_env.append('LD_LIBRARY_PATH', join_paths(meson.build_root(), 'gegl', '.libs'))
+test_env.append('GI_TYPELIB_PATH', join_paths(meson.build_root(), 'gegl'))
+
+# subdir('buffer')
+subdir('mipmap')
+# subdir('compositions')
+subdir('simple')
+subdir('xml')
+# subdir('ff-load-save')
+subdir('python')
diff --git a/tests/mipmap/meson.build b/tests/mipmap/meson.build
new file mode 100644
index 0000000..f2497c2
--- /dev/null
+++ b/tests/mipmap/meson.build
@@ -0,0 +1,14 @@
+mipmap_tests = [
+  'invert.sh',
+  'invert-crop.sh',
+  'unsharp-crop.sh',
+  'unsharp.sh',
+  'rotate.sh',
+  'rotate-crop.sh',
+]
+
+foreach _test: mipmap_tests
+  test(_test, find_program(_test),
+    env: test_env,
+  )
+endforeach
diff --git a/tests/python/meson.build b/tests/python/meson.build
new file mode 100644
index 0000000..9986ba8
--- /dev/null
+++ b/tests/python/meson.build
@@ -0,0 +1,13 @@
+python_tests = [
+  'test-gegl.py',
+  'test-gegl-node.py',
+  'test-gegl-color.py',
+  'test-gegl-buffer.py',
+  'test-gegl-format.py',
+]
+
+foreach _test: python_tests
+  test(_test, find_program(_test),
+    env: test_env,
+  )
+endforeach
diff --git a/tests/simple/meson.build b/tests/simple/meson.build
new file mode 100644
index 0000000..ae84aa4
--- /dev/null
+++ b/tests/simple/meson.build
@@ -0,0 +1,41 @@
+simple_tests = [
+  'test-backend-file',
+  'test-buffer-cast',
+  'test-buffer-changes',
+  'test-buffer-extract',
+  'test-buffer-hot-tile',
+  'test-buffer-sharing',
+  'test-buffer-tile-voiding',
+  'test-change-processor-rect',
+  'test-convert-format',
+  'test-color-op',
+  'test-empty-tile',
+  'test-format-sensing',
+  'test-gegl-rectangle',
+  'test-gegl-color',
+  'test-gegl-tile',
+  'test-image-compare',
+  'test-license-check',
+  'test-misc',
+  'test-node-connections',
+  'test-node-passthrough',
+  'test-node-properties',
+  'test-object-forked',
+  'test-opencl-colors',
+  'test-serialize',
+  'test-path',
+  'test-proxynop-processing',
+  'test-scaled-blit',
+  'test-svg-abyss',
+]
+
+foreach _test: simple_tests
+  test_bin = executable(_test,
+    '@0@.c'.format(_test),
+    dependencies: libgegl_dep,
+  )
+
+  test(_test, test_bin,
+    env: test_env,
+  )
+endforeach
diff --git a/tests/xml/meson.build b/tests/xml/meson.build
new file mode 100644
index 0000000..70e080d
--- /dev/null
+++ b/tests/xml/meson.build
@@ -0,0 +1,16 @@
+xml_tests = [
+  'test-save',
+  'test-load',
+  'test-roundtrip',
+]
+
+foreach _test: xml_tests
+  test_bin = executable(_test,
+    '@0@.c'.format(_test),
+    dependencies: libgegl_dep,
+  )
+
+  test(_test, test_bin,
+    env: test_env,
+  )
+endforeach
diff --git a/tools/meson.build b/tools/meson.build
new file mode 100644
index 0000000..0c7f364
--- /dev/null
+++ b/tools/meson.build
@@ -0,0 +1,35 @@
+# gen-loader.sh
+gen_loader_sh = find_program('gen-loader.sh')
+gobj2dot = find_program('gobj2dot.rb')
+
+# Compiled tools
+tools = [
+  'introspect',
+  'operation_reference',
+  'detect_opencl',
+  'gegl-tester',
+  'operations_html',
+]
+
+tools_cflags = [
+  '-DTOP_SRCDIR="@0@"'.format(meson.source_root()),
+]
+
+# Special case: gegl-imgcmp needs to be installed
+gegl_imgcmp = executable('gegl-imgcmp',
+  'gegl-imgcmp.c',
+  c_args: tools_cflags,
+  dependencies: libgegl_dep,
+  install: true,
+)
+
+foreach tool: tools
+  executable(tool,
+    '@0@.c'.format(tool),
+    c_args: tools_cflags,
+    dependencies: libgegl_dep,
+  )
+endforeach
+
+
+# TODO exp_combine



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]