[dia: 2/105] #19: Build libdia from lib/ as a shared library using meson.



commit cba43a0424465a60e26518dd70f2b16d7995325f
Author: Eduard Nicodei <eddnicodei gmail com>
Date:   Sun Dec 16 01:03:52 2018 +0000

    #19: Build libdia from lib/ as a shared library using meson.
    
      - Add dependencies in main meson.build.
      - Add more config.h variables.
      - Create lib/meson.build and add all sources from Makefile.am
      - Add meson custom_targets for diamarshal.[ch]
      - Add dummy definition of Q_ to intl.h (turns out this was actual
        bug/oversight and not issue with meson port).
      - Add basic po/meson.build.

 lib/intl.h      |   1 +
 lib/meson.build | 231 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build     |  19 +++++
 po/meson.build  |   1 +
 4 files changed, 252 insertions(+)
---
diff --git a/lib/intl.h b/lib/intl.h
index 324a6312..645e45a3 100644
--- a/lib/intl.h
+++ b/lib/intl.h
@@ -7,6 +7,7 @@
 #  include <glib/gi18n.h>
 #else /* NLS is disabled */
 #  define _(String) (String)
+#  define Q_(String) (String)
 #  define N_(String) (String)
 #  define NC_(Context, String) (String)
 #  define gettext(String) (String)
diff --git a/lib/meson.build b/lib/meson.build
new file mode 100644
index 00000000..12995cd7
--- /dev/null
+++ b/lib/meson.build
@@ -0,0 +1,231 @@
+stdprop_sources = [
+    'properties.h',
+    'properties.c',
+    'propinternals.h',
+    'propdesc.c',
+    'proplist.c',
+    'propoffsets.c',
+    'propobject.c',
+    'prop_basic.c',
+    'prop_basic.h',
+    'prop_dict.c',
+    'prop_dict.h',
+    'prop_matrix.c',
+    'prop_matrix.h',
+    'prop_pattern.c',
+    'prop_pattern.h',
+    'prop_pixbuf.c',
+    'prop_pixbuf.h',
+    'prop_inttypes.c',
+    'prop_inttypes.h',
+    'prop_geomtypes.c',
+    'prop_geomtypes.h',
+    'prop_attr.c',
+    'prop_attr.h',
+    'prop_text.c',
+    'prop_text.h',
+    'prop_widgets.c',
+    'prop_widgets.h',
+    'prop_sdarray.c',
+    'prop_sdarray.h',
+    'prop_sdarray_widget.c',
+    'prop_sdarray_widget.h',
+    'propdialogs.c',
+    'propregistry.c'
+]
+
+libdia_sources = stdprop_sources + [
+    'diatypes.h',
+    'diavar.h',
+    'diamenu.h',
+    'diagramdata.h',
+    'diagramdata.c',
+    'layer.c',
+    'geometry.h',
+    'geometry.c',
+    'color.h',
+    'color.c',
+    'dia_xml.c',
+    'dia_xml.h',
+    'dia_xml_libxml.h',
+    'attributes.h',
+    'attributes.c',
+    'text.c',
+    'text.h',
+    'textline.c',
+    'textline.h',
+    'font.c',
+    'font.h',
+    'group.c',
+    'group.h',
+    'utils.c',
+    'utils.h',
+    'arrows.c',
+    'arrows.h',
+    'message.c',
+    'message.h',
+    'focus.c',
+    'focus.h',
+    'sheet.c',
+    'sheet.h',
+    'connectionpoint.c',
+    'connectionpoint.h',
+    'handle.h',
+    'object.h',
+    'object.c',
+    'object-alias.h',
+    'object-alias.c',
+    'object_defaults.c',
+    'connection.c',
+    'connection.h',
+    'orth_conn.c',
+    'orth_conn.h',
+    'poly_conn.c',
+    'poly_conn.h',
+    'bezier_conn.c',
+    'bezier_conn.h',
+    'bezier-common.c',
+    'bezier-common.h',
+    'connection.h',
+    'element.c',
+    'element.h',
+    'polyshape.c',
+    'polyshape.h',
+    'beziershape.c',
+    'beziershape.h',
+    'objchange.c',
+    'objchange.h',
+    'dialogs.c',
+    'dialogs.h',
+    'widgets.c',
+    'widgets.h',
+    'diaoptionmenu.c',
+    'diaoptionmenu.h',
+    'units.c',
+    'units.h',
+    'dia_image.c',
+    'dia_image.h',
+    'pattern.c',
+    'pattern.h',
+    'standard-path.c',
+    'standard-path.h',
+    'intl.c',
+    'intl.h',
+    'filter.c',
+    'filter.h',
+    'connpoint_line.c',
+    'connpoint_line.h',
+    'textattr.h',
+    'dia_dirs.c',
+    'dia_dirs.h',
+    'plug-ins.c',
+    'plug-ins.h',
+    'dummy_dep.h',
+    'paper.c',
+    'paper.h',
+    'boundingbox.c',
+    'boundingbox.h',
+    'dynamic_obj.c',
+    'dynamic_obj.h',
+    'create.c',
+    'create.h',
+    'dia-enums.h',
+    'diatransform.h',
+    'diatransform.c',
+    'diarenderer.h',
+    'diarenderer.c',
+    'diaimportrenderer.c',
+    'diaimportrenderer.h',
+    'diainteractiverenderer.c',
+    'diagdkrenderer.h',
+    'diagdkrenderer.c',
+    'diapathrenderer.h',
+    'diapathrenderer.c',
+    'path-math.h',
+    'path-math.c',
+    'diapatternselector.h',
+    'diapatternselector.c',
+    'diatransformrenderer.h',
+    'diatransformrenderer.c',
+    'diasvgrenderer.h',
+    'diasvgrenderer.c',
+    'dia_svg.h',
+    'dia_svg.c',
+    'autoroute.c',
+    'autoroute.h',
+    'parent.c',
+    'parent.h',
+    'render_pixmap.h',
+    'render_pixmap.c',
+    'diaarrowchooser.h',
+    'diaarrowchooser.c',
+    'diaarrowselector.c',
+    'diacolorselector.c',
+    'dialinestyleselector.c',
+    'dialinechooser.h',
+    'dialinechooser.c',
+    'diadynamicmenu.h',
+    'diadynamicmenu.c',
+    'diafontselector.h',
+    'diafontselector.c',
+    'persistence.c',
+    'persistence.h',
+    'diaerror.c',
+    'diaerror.h',
+    'debug.c',
+    'debug.h',
+    'prefs.c',
+    'prefs.h',
+    'dialib.c',
+    'dialib.h',
+    'diacontext.c',
+    'diacontext.h',
+    'diacellrendererenum.c',
+    'diacellrendererenum.h',
+    'diacellrendererproperty.c',
+    'diacellrendererproperty.h',
+    'dia-lib-icons.h'
+]
+
+libm_dep = cc.find_library(
+    'm', required : false)
+
+libzlib_dep = dependency('zlib')
+
+
+glib_genmarshal = find_program('glib-genmarshal')
+diamarshal_c = custom_target(
+    'diamarshal.c',
+    input : 'diamarshal.list',
+    output : 'diamarshal.c',
+    command : [ glib_genmarshal,
+                '--prefix=dia_marshal',
+                '--include-header', 'diamarshal.h',
+                '--output', '@OUTPUT@',
+                '--body',
+                '@INPUT@'])
+
+diamarshal_h = custom_target(
+    'diamarshal.h',
+    input : 'diamarshal.list',
+    output : 'diamarshal.h',
+    command : [ glib_genmarshal,
+                '--prefix=dia_marshal',
+                '--output', '@OUTPUT@',
+                '--header',
+                '@INPUT@'])
+
+libdia_deps = [
+    libgtk_dep,
+    libglib_dep,
+    libxml_dep,
+    libm_dep,
+    libzlib_dep,
+    gmodule_dep
+]
+
+libdia = shared_library('dia',
+    libdia_sources + [diamarshal_c, diamarshal_h],
+    dependencies : libdia_deps,
+    include_directories : configuration_inc,
+    c_args : ['-Wall'])
diff --git a/meson.build b/meson.build
index edc314b2..df91b81d 100644
--- a/meson.build
+++ b/meson.build
@@ -6,6 +6,17 @@ project('dia',
         default_options : []
 )
 
+i18n = import('i18n')
+
+gettext_package = 'dia'
+subdir('po')
+
+#GTK_MODULES="gtk+-2.0 >= 2.16.0 glib-2.0 >= 2.20.0 libxml-2.0 gdk-pixbuf-2.0 gthread-2.0 gmodule-2.0"
+libgtk_dep  = dependency('gtk+-2.0', version : '>= 2.16.0')
+libglib_dep = dependency('glib-2.0', version : '>= 2.20.0')
+libxml_dep  = dependency('libxml-2.0')
+gmodule_dep = dependency('gmodule-2.0')
+
 # TODO
 #AC_PROG_INSTALL
 #AC_PROG_LN_S
@@ -36,8 +47,16 @@ conf = configuration_data()
 
 prefix = get_option('prefix')
 conf.set_quoted('VERSION', meson.project_version())
+conf.set_quoted('GETTEXT_PACKAGE', 'dia')
+conf.set_quoted('DATADIR', get_option('datadir'))
+conf.set_quoted('LIBDIR', get_option('libdir'))
+conf.set_quoted('LOCALEDIR', get_option('localedir'))
+conf.set('ENABLE_NLS', 1)
 
 configure_file(output : 'config.h',
                configuration : conf)
+configuration_inc = include_directories('.')
+
+subdir('lib')
 
 
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 00000000..57d1266b
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext(gettext_package, preset: 'glib')


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