diff --git a/meson.build b/meson.build index 4304d623..4573e775 100644 --- a/meson.build +++ b/meson.build @@ -1,148 +1,148 @@ project('adg', 'c', meson_version: '>=0.56.0', version: '0.9.3', license: 'LGPL-2.1-or-later' ) metadata = { 'api': '1.0', 'homepage': 'http://adg.entidi.com/', 'tracker': 'https://track.entidi.com/project/view/2/', } # How to handle LT versions (current:revision:age): # - If the library source code has changed at all since the last # update, then increment revision (‘c:r:a’ becomes ‘c:r+1:a’). # - If any interfaces have been added, removed, or changed since the # last update, increment current, and set revision to 0. # - If any interfaces have been added since the last public release, # then increment age. # - If any interfaces have been removed or changed since the last # public release, then set age to 0. cpml_current = 4 cpml_revision = 2 cpml_age = 0 adg_current = 8 adg_revision = 1 adg_age = 1 cc = meson.get_compiler('c') gnome = import('gnome') i18n = import('i18n') pkgconfig = import('pkgconfig') -pkgdir = meson.project_name() + '-' + metadata['api'] +pkg = meson.project_name() + '-' + metadata['api'].split('.')[0] prefix = get_option('prefix') datadir = join_paths(prefix, get_option('datadir')) -pkgdatadir = join_paths(datadir, pkgdir) +pkgdatadir = join_paths(datadir, pkg) localedir = join_paths(prefix, get_option('localedir')) -includedir = join_paths(prefix, get_option('includedir'), pkgdir) +includedir = join_paths(prefix, get_option('includedir'), pkg) m_dep = cc.find_library('m', required: false) # G_ADD_PRIVATE macro required gobject_dep = dependency('gobject-2.0', version: '>=2.38.0') # cairo_scaled_font_text_to_glyphs() API required cairo_dep = dependency('cairo', version: '>=1.7.4') # Any release cairogobject_dep = dependency('cairo-gobject') # Cairo support in Pango required pangocairo_dep = dependency('pangocairo', version: '>=1.10.0', required: get_option('pango')) # Lookup which GTK package to use gtk = get_option('gtk') if gtk == 'no' gtk_dep = dependency('', required: false) else if gtk != 'gtk2' # First stable release gtk_dep = dependency('gtk+-3.0', version: '>= 3.0.0', required: gtk == 'gtk3') endif use_gtk2 = gtk == 'gtk2' or not gtk_dep.found() if use_gtk2 # gtk_widget_get_allocation() API required gtk_dep = dependency('gtk+-2.0', version: '>=2.18.0') endif endif # Both "check" and "yes" mean gladeui autodetection, # but "yes" will fail if gladeui is not found catalogdir = get_option('catalogdir') if catalogdir == 'yes' or catalogdir == 'check' glade_dep = dependency('gladeui-2.0', required: false) if not glade_dep.found() glade_dep = dependency('gladeui-1.0', required: catalogdir == 'yes') endif if glade_dep.found() catalogdir = glade_dep.get_variable(pkgconfig: 'catalogdir') else catalogdir = '' endif elif catalogdir == 'no' # Both 'no' and '' mean "Do not install catalogs" catalogdir = '' endif # Support for introspection annotations required gtkdoc_dep = dependency('gtk-doc', required: get_option('gtk-doc'), version: '>=1.12') gtkdocdir = get_option('gtkdocdir') if gtkdocdir == '' gtkdocdir = join_paths(get_option('prefix'), get_option('datadir'), 'gtk-doc', 'html') endif # First stable release introspection_dep = dependency('gobject-introspection-1.0', version: '>=1.0.0', required: get_option('introspection')) # Check if GLib supports the testing framework testing = dependency('glib-2.0', version: '>=2.16.0', required: get_option('tests')) subdir('src') subdir('po') if gtk_dep.found() subdir('demo') endif if gtkdoc_dep.found() subdir('docs/cpml') subdir('docs/adg') endif summary({ 'Compiler': cc.get_id(), 'CPML library to use': - 'internal (cpml-@0@ @1@)'.format(metadata['api'], meson.project_version()), + 'internal (cpml-1 @0@)'.format(meson.project_version()), 'Use pango for text': pangocairo_dep.found() ? 'yes (@0@ @1@)'.format(pangocairo_dep.name(), pangocairo_dep.version()) : 'no (use cairo toy API)', 'GTK support': gtk_dep.found() ? 'yes (@0@ @1@)'.format(gtk_dep.name(), gtk_dep.version()) : 'no', 'Install glade catalogs': catalogdir == '' ? 'no' : 'yes, install into @0@'.format(catalogdir), 'Build API reference': gtkdoc_dep.found() ? 'yes (@0@ @1@), install into @2@'. format(gtkdoc_dep.name(), gtkdoc_dep.version(), gtkdocdir) : 'no', 'GObject instrospection': introspection_dep.found() ? 'yes (@0@ @1@)'.format(introspection_dep.name(), introspection_dep.version()) : 'no', 'Test framework support': testing.found() ? 'yes' : 'no' }) diff --git a/src/adg/meson.build b/src/adg/meson.build index bf0d18dd..b7ca9f6a 100644 --- a/src/adg/meson.build +++ b/src/adg/meson.build @@ -1,260 +1,260 @@ adg_directories = include_directories('.') adg_canvas_h = configure_file( input: 'adg-canvas.h.in', output: '@BASENAME@', configuration: data ) adg_marshal = gnome.genmarshal('adg-marshal', sources: 'adg-marshal.genmarshal', prefix: 'adg_marshal', internal: true, install_header: true, install_dir: join_paths(includedir, 'adg'), extra_args: [ '--quiet' ] ) adg_marshal_c = adg_marshal[0] adg_marshal_h = adg_marshal[1] adg_type_builtins = gnome.mkenums('adg-type-builtins', sources: 'adg-enums.h', c_template: 'adg-type-builtins.c.mkenums', h_template: 'adg-type-builtins.h.mkenums', install_header: true, install_dir: join_paths(includedir, 'adg') ) adg_type_builtins_c = adg_type_builtins[0] adg_type_builtins_h = adg_type_builtins[1] adg_c_built = [ adg_type_builtins_c, adg_marshal_c ] adg_h_built = [ adg_type_builtins_h, adg_marshal_h, adg_canvas_h ] adg_c_files = files([ 'adg-adim.c', 'adg-alignment.c', 'adg-arrow.c', 'adg-cairo-fallback.c', 'adg-canvas.c', 'adg-color-style.c', 'adg-container.c', 'adg-dash.c', 'adg-dim-style.c', 'adg-dim.c', 'adg-dress.c', 'adg-edges.c', 'adg-entity.c', 'adg-enums.c', 'adg-fill-style.c', 'adg-font-style.c', 'adg-hatch.c', 'adg-ldim.c', 'adg-line-style.c', 'adg-logo.c', 'adg-marker.c', 'adg-matrix.c', 'adg-model.c', 'adg-param-dress.c', 'adg-path.c', 'adg-point.c', 'adg-projection.c', 'adg-rdim.c', 'adg-ruled-fill.c', 'adg-stroke.c', 'adg-style.c', 'adg-table-cell.c', 'adg-table-row.c', 'adg-table-style.c', 'adg-table.c', 'adg-text.c', 'adg-textual.c', 'adg-title-block.c', 'adg-toy-text.c', 'adg-trail.c', 'adg-utils.c', ]) adg_h_files = files([ 'adg-adim.h', 'adg-alignment.h', 'adg-arrow.h', 'adg-cairo-fallback.h', 'adg-color-style.h', 'adg-container.h', 'adg-dash.h', 'adg-dim-style.h', 'adg-dim.h', 'adg-dress.h', 'adg-edges.h', 'adg-entity.h', 'adg-enums.h', 'adg-fill-style.h', 'adg-font-style.h', 'adg-hatch.h', 'adg-ldim.h', 'adg-line-style.h', 'adg-logo.h', 'adg-marker.h', 'adg-matrix.h', 'adg-model.h', 'adg-param-dress.h', 'adg-path.h', 'adg-point.h', 'adg-projection.h', 'adg-rdim.h', 'adg-ruled-fill.h', 'adg-stroke.h', 'adg-style.h', 'adg-table-cell.h', 'adg-table-row.h', 'adg-table-style.h', 'adg-table.h', 'adg-text.h', 'adg-text-internal.h', 'adg-textual.h', 'adg-toy-text.h', 'adg-title-block.h', 'adg-trail.h', 'adg-utils.h', ]) adg_internal_names = [ 'adg-adim-private.h', 'adg-alignment-private.h', 'adg-arrow-private.h', 'adg-canvas-private.h', 'adg-color-style-private.h', 'adg-container-private.h', 'adg-dash-private.h', 'adg-dim-private.h', 'adg-dim-style-private.h', 'adg-dress-private.h', 'adg-edges-private.h', 'adg-entity-private.h', 'adg-fill-style-private.h', 'adg-font-style-private.h', 'adg-forward-declarations.h', 'adg-hatch-private.h', 'adg-internal.h', 'adg-ldim-private.h', 'adg-line-style-private.h', 'adg-logo-private.h', 'adg-marker-private.h', 'adg-model-private.h', 'adg-path-private.h', 'adg-projection-private.h', 'adg-rdim-private.h', 'adg-ruled-fill-private.h', 'adg-stroke-private.h', 'adg-table-private.h', 'adg-table-style-private.h', 'adg-text-private.h', 'adg-title-block-private.h', 'adg-toy-text-private.h', 'adg-trail-private.h', ] if pangocairo_dep.found() adg_c_files += files([ 'adg-pango-style.c', ]) adg_h_files += files([ 'adg-pango-style.h', ]) adg_internal_names += 'adg-pango-style-private.h' endif if gtk_dep.found() adg_c_files += files([ 'adg-gtk-area.c', 'adg-gtk-layout.c', 'adg-gtk-utils.c', ]) adg_h_files += files([ 'adg-gtk-area.h', 'adg-gtk-layout.h', 'adg-gtk-utils.h', ]) adg_internal_names += [ 'adg-gtk-area-private.h', 'adg-gtk-layout-private.h', ] endif adg_internal_files = files(adg_internal_names) # Build the ADG library adg_deps = [ cpml_dep, pangocairo_dep, gtk_dep, ] adg_cflags = [ '-DLOCALEDIR="' + localedir + '"', ] adg_soversion = '@0@.@1@.@2@'.format( adg_current - adg_age, adg_age, adg_revision ) -adg = library('adg-' + metadata['api'], +adg = library(pkg, sources: adg_c_files + adg_c_built + adg_h_files + adg_h_built + adg_internal_files, dependencies: adg_deps, version: adg_soversion, c_args: adg_cflags, install: true ) adg_dep = declare_dependency( sources: adg_h_built, dependencies: adg_deps, compile_args: adg_cflags, link_with: adg, include_directories: src_directories ) -install_headers(adg_h_files, subdir: 'adg') +install_headers(adg_h_files, subdir: 'adg-1/adg') # pkg-config support for ADG library pkgconfig.generate(adg, name: 'ADG', - filebase: 'adg-' + metadata['api'], + filebase: pkg, description: 'Automatic Drawing Generation', url: metadata['homepage'], - subdirs: pkgdir, + subdirs: pkg, version: meson.project_version() ) # GObject introspection support for ADG library if introspection_dep.found() adg_gir_includes = [ 'GObject-2.0', 'cairo-1.0', cpml_gir[0] ] if pangocairo_dep.found() adg_gir_includes += 'PangoCairo-1.0' endif if gtk_dep.found() adg_gir_includes += use_gtk2 ? 'Gtk-2.0' : 'Gtk-3.0' endif adg_gir = gnome.generate_gir(adg, sources: [ adg_h ] + adg_h_files + adg_h_built + adg_c_files + adg_c_built, namespace: 'Adg', nsversion: metadata['api'], identifier_prefix: 'Adg', symbol_prefix: 'adg', includes: adg_gir_includes, include_directories: src_directories, header: 'adg.h', install: true, extra_args: [ '--quiet', '--sources-top-dirs=' + meson.current_source_dir(), '--sources-top-dirs=' + meson.current_build_dir(), ] ) endif diff --git a/src/cpml/meson.build b/src/cpml/meson.build index 1e4ea2d4..9d7501e1 100644 --- a/src/cpml/meson.build +++ b/src/cpml/meson.build @@ -1,93 +1,93 @@ cpml_directories = include_directories('.') cpml_c_files = files([ 'cpml-arc.c', 'cpml-curve.c', 'cpml-extents.c', 'cpml-gobject.c', 'cpml-line.c', 'cpml-pair.c', 'cpml-primitive.c', 'cpml-segment.c', 'cpml-utils.c', ]) cpml_h_files = files([ 'cpml-arc.h', 'cpml-curve.h', 'cpml-extents.h', 'cpml-gobject.h', 'cpml-pair.h', 'cpml-primitive.h', 'cpml-segment.h', 'cpml-utils.h', ]) cpml_internal_names = [ 'cpml-internal.h', 'cpml-primitive-private.h', ] cpml_internal_files = files(cpml_internal_names) # Build the CPML library cpml_deps = [ m_dep, gobject_dep, cairogobject_dep, cairo_dep, ] cpml_soversion = '@0@.@1@.@2@'.format( cpml_current - cpml_age, cpml_age, cpml_revision ) -cpml = library('cpml-' + metadata['api'], +cpml = library('cpml-1', sources: cpml_c_files + cpml_h_files + cpml_internal_files, dependencies: cpml_deps, version: cpml_soversion, install: true ) cpml_dep = declare_dependency( dependencies: cpml_deps, link_with: cpml, include_directories: src_directories ) -install_headers(cpml_h_files, subdir: 'cpml') +install_headers(cpml_h_files, subdir: 'adg-1/cpml') # pkg-config support for CPML library pkgconfig.generate(cpml, name: 'CPML', - filebase: 'cpml-' + metadata['api'], + filebase: 'cpml-1', description: 'Cairo Path Manipulation Library', url: metadata['homepage'], - subdirs: pkgdir, + subdirs: pkg, version: meson.project_version() ) # GObject introspection support for CPML library if introspection_dep.found() cpml_gir = gnome.generate_gir(cpml, sources: [ cpml_h ] + cpml_h_files + cpml_c_files, namespace: 'Cpml', nsversion: metadata['api'], identifier_prefix: 'Cpml', symbol_prefix: 'cpml', includes: [ 'cairo-1.0' ], header: 'cpml.h', install: true, extra_args: [ '--quiet', '--sources-top-dirs=' + meson.current_source_dir(), '--sources-top-dirs=' + meson.current_build_dir(), ] ) endif diff --git a/src/meson.build b/src/meson.build index 32964866..cf3870bd 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,80 +1,82 @@ src_directories = include_directories('.') # Populate the configuration data table data = configuration_data({ 'PACKAGE_NAME': meson.project_name(), 'PACKAGE_VERSION': meson.project_version(), 'PACKAGE_API': metadata['api'], 'PACKAGE_URL': metadata['homepage'], 'PACKAGE_BUGREPORT': metadata['tracker'], }) adg_h_additional = [] adg_canvas_h_additional = [] if pangocairo_dep.found() data.set('PANGO_ENABLED', 1) adg_h_additional += [ '#include ', '#include "adg/adg-text.h"', '#include "adg/adg-pango-style.h"', ] endif if gtk_dep.found() data.set(use_gtk2 ? 'GTK2_ENABLED' : 'GTK3_ENABLED', 1) adg_h_additional += [ '#include ', '#include "adg/adg-gtk-utils.h"', '#include "adg/adg-gtk-area.h"', '#include "adg/adg-gtk-layout.h"', ] adg_canvas_h_additional += [ '#include ', '', 'void adg_canvas_set_paper (AdgCanvas *canvas,', ' const gchar *paper_name,', ' GtkPageOrientation orientation);', 'void adg_canvas_set_page_setup (AdgCanvas *canvas,', ' GtkPageSetup *page_setup);', 'GtkPageSetup * adg_canvas_get_page_setup (AdgCanvas *canvas);', ] endif if introspection_dep.found() data.set('CAIRO_GOBJECT_ENABLED', 1) endif data.set('ADG_H_ADDITIONAL', '\n'.join(adg_h_additional)) data.set('ADG_CANVAS_H_ADDITIONAL', '\n'.join(adg_canvas_h_additional)) # Define or generate main header files config_h = configure_file( input: 'config.h.meson', output: '@BASENAME@', configuration: data ) cpml_h = files('cpml.h')[0] +install_headers(cpml_h, subdir: 'adg-1') + adg_h = configure_file( input: 'adg.h.in', output: '@BASENAME@', configuration: data, install_dir: includedir ) if catalogdir != '' install_data('adg.xml', install_dir: catalogdir) endif subdir('cpml') subdir('adg') if testing.found() subdir('tests') subdir('cpml/tests') subdir('adg/tests') endif