diff options
-rw-r--r-- | .clang-tidy | 12 | ||||
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | INSTALL | 59 | ||||
-rw-r--r-- | INSTALL.md | 76 | ||||
-rw-r--r-- | NEWS | 22 | ||||
-rw-r--r-- | include/ganv/Box.hpp (renamed from ganv/Box.hpp) | 0 | ||||
-rw-r--r-- | include/ganv/Canvas.hpp (renamed from ganv/Canvas.hpp) | 2 | ||||
-rw-r--r-- | include/ganv/Circle.hpp (renamed from ganv/Circle.hpp) | 0 | ||||
-rw-r--r-- | include/ganv/Edge.hpp (renamed from ganv/Edge.hpp) | 0 | ||||
-rw-r--r-- | include/ganv/Item.hpp (renamed from ganv/Item.hpp) | 2 | ||||
-rw-r--r-- | include/ganv/Module.hpp (renamed from ganv/Module.hpp) | 0 | ||||
-rw-r--r-- | include/ganv/Node.hpp (renamed from ganv/Node.hpp) | 0 | ||||
-rw-r--r-- | include/ganv/Port.hpp (renamed from ganv/Port.hpp) | 0 | ||||
-rw-r--r-- | include/ganv/box.h (renamed from ganv/box.h) | 0 | ||||
-rw-r--r-- | include/ganv/canvas.h (renamed from ganv/canvas.h) | 16 | ||||
-rw-r--r-- | include/ganv/circle.h (renamed from ganv/circle.h) | 0 | ||||
-rw-r--r-- | include/ganv/edge.h (renamed from ganv/edge.h) | 0 | ||||
-rw-r--r-- | include/ganv/ganv.h (renamed from ganv/ganv.h) | 0 | ||||
-rw-r--r-- | include/ganv/ganv.hpp (renamed from ganv/ganv.hpp) | 0 | ||||
-rw-r--r-- | include/ganv/group.h (renamed from ganv/group.h) | 0 | ||||
-rw-r--r-- | include/ganv/item.h (renamed from ganv/item.h) | 0 | ||||
-rw-r--r-- | include/ganv/module.h (renamed from ganv/module.h) | 0 | ||||
-rw-r--r-- | include/ganv/node.h (renamed from ganv/node.h) | 0 | ||||
-rw-r--r-- | include/ganv/port.h (renamed from ganv/port.h) | 0 | ||||
-rw-r--r-- | include/ganv/text.h (renamed from ganv/text.h) | 0 | ||||
-rw-r--r-- | include/ganv/types.h (renamed from ganv/types.h) | 0 | ||||
-rw-r--r-- | include/ganv/types.hpp (renamed from ganv/types.hpp) | 0 | ||||
-rw-r--r-- | include/ganv/widget.h (renamed from ganv/widget.h) | 0 | ||||
-rw-r--r-- | include/ganv/wrap.hpp (renamed from ganv/wrap.hpp) | 0 | ||||
-rw-r--r-- | meson.build | 247 | ||||
-rw-r--r-- | meson/suppressions/meson.build | 188 | ||||
-rw-r--r-- | meson_options.txt | 23 | ||||
-rw-r--r-- | src/Canvas.cpp | 81 | ||||
-rw-r--r-- | src/text.c | 1 | ||||
-rwxr-xr-x | waf | 27 | ||||
m--------- | waflib | 0 | ||||
-rw-r--r-- | wscript | 309 |
38 files changed, 623 insertions, 453 deletions
diff --git a/.clang-tidy b/.clang-tidy index 0ee948a..8ea7707 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -13,16 +13,18 @@ Checks: > -*-use-auto, -*-use-nullptr, -*-vararg, + -altera-*, -android-cloexec-fopen, -bugprone-branch-clone, + -bugprone-easily-swappable-parameters, -bugprone-incorrect-roundings, -bugprone-integer-division, -bugprone-macro-parentheses, - -bugprone-macro-parentheses, -bugprone-reserved-identifier, -cert-dcl21-cpp, -cert-dcl37-c, -cert-dcl51-cpp, + -cert-err33-c, -cert-err34-c, -cert-msc30-c, -cert-msc32-c, @@ -31,10 +33,12 @@ Checks: > -clang-analyzer-cplusplus.NewDeleteLeaks, -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, -clang-analyzer-unix.Malloc, + -concurrency-mt-unsafe, -cppcoreguidelines-avoid-non-const-global-variables, -cppcoreguidelines-macro-usage, -cppcoreguidelines-non-private-member-variables-in-classes, -cppcoreguidelines-owning-memory, + -cppcoreguidelines-prefer-member-initializer, -cppcoreguidelines-pro-bounds-array-to-pointer-decay, -cppcoreguidelines-pro-bounds-pointer-arithmetic, -cppcoreguidelines-pro-type-const-cast, @@ -56,15 +60,21 @@ Checks: > -llvmlibc-*, -misc-no-recursion, -misc-non-private-member-variables-in-classes, + -misc-use-anonymous-namespace, -modernize-loop-convert, + -modernize-macro-to-enum, -modernize-raw-string-literal, -modernize-use-trailing-return-type, + -modernize-use-using, -performance-faster-string-find, -readability-const-return-type, -readability-container-size-empty, + -readability-function-cognitive-complexity, + -readability-identifier-length, -readability-implicit-bool-conversion, -readability-inconsistent-declaration-parameter-name, -readability-make-member-function-const, + -readability-simplify-boolean-expr, WarningsAsErrors: '*' HeaderFilterRegex: '.*' FormatStyle: file @@ -1,4 +1,4 @@ -build/** -.waf-* -.lock-waf* -__pycache__ +# Copyright 2020-2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR ISC + +build/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index b2babe7..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "waflib"] - path = waflib - url = ../autowaf.git diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 623cddd..0000000 --- a/INSTALL +++ /dev/null @@ -1,59 +0,0 @@ -Installation Instructions -========================= - -Basic Installation ------------------- - -Building this software requires only Python. To install with default options: - - ./waf configure - ./waf - ./waf install - -You may need to become root for the install stage, for example: - - sudo ./waf install - -Configuration Options ---------------------- - -All supported options can be viewed using the command: - - ./waf --help - -Most options only need to be passed during the configure stage, for example: - - ./waf configure --prefix=/usr - ./waf - ./waf install - -Compiler Configuration ----------------------- - -Several standard environment variables can be used to control how compilers are -invoked: - - * CC: Path to C compiler - * CFLAGS: C compiler options - * CXX: Path to C++ compiler - * CXXFLAGS: C++ compiler options - * CPPFLAGS: C preprocessor options - * LINKFLAGS: Linker options - -Installation Directories ------------------------- - -The --prefix option (or the PREFIX environment variable) can be used to change -the prefix which all files are installed under. There are also several options -allowing for more fine-tuned control, see the --help output for details. - -Packaging ---------- - -Everything can be installed to a specific root directory by passing a --destdir -option to the install stage (or setting the DESTDIR environment variable), -which adds a prefix to all install paths. For example: - - ./waf configure --prefix=/usr - ./waf - ./waf install --destdir=/tmp/package diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..15c39f4 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,76 @@ +Installation Instructions +========================= + +Prerequisites +------------- + +To build from source, you will need: + + * A relatively modern C and C++ compiler (GCC, Clang, and MSVC are known to work). + + * [Meson](http://mesonbuild.com/), which depends on + [Python](http://python.org/). + +This is a brief overview of building this project with meson. See the meson +documentation for more detailed information. + +Configuration +------------- + +The build is configured with the `setup` command, which creates a new build +directory with the given name: + + meson setup build + +Some environment variables are read during `setup` and stored with the +configuration: + + * `CC`: Path to C compiler. + * `CFLAGS`: C compiler options. + * `CXX`: Path to C++ compiler. + * `CXXFLAGS`: C++ compiler options. + * `LDFLAGS`: Linker options. + +However, it is better to use meson options for configuration. All options can +be inspected with the `configure` command from within the build directory: + + cd build + meson configure + +Options can be set by passing C-style "define" options to `configure`: + + meson configure -Dc_args="-march=native" -Dprefix="/opt/mypackage/" + +Note that some options, such as `strict` and `werror` are for +developer/maintainer use only. Please don't file issues about anything that +happens when they are enabled. + +Building +-------- + +From within a configured build directory, everything can be built with the +`compile` command: + + meson compile + +Similarly, tests can be run with the `test` command: + + meson test + +Meson can also generate a project for several popular IDEs, see the `backend` +option for details. + +Installation +------------ + +A compiled project can be installed with the `install` command: + + meson install + +You may need to acquire root permissions to install to a system-wide prefix. +For packaging, the installation may be staged to a directory using the +`DESTDIR` environment variable or the `--destdir` option: + + DESTDIR=/tmp/mypackage/ meson install + + meson install --destdir=/tmp/mypackage/ @@ -1,11 +1,23 @@ -ganv (1.7.0) unstable; +ganv (1.8.3) unstable; urgency=medium + + * Update installation instructions + + -- David Robillard <d@drobilla.net> Mon, 22 Aug 2022 14:59:07 +0000 + +ganv (1.8.2) stable; urgency=medium + + * Switch to meson build system + + -- David Robillard <d@drobilla.net> Sat, 13 Aug 2022 22:12:49 +0000 + +ganv (1.8.0) stable; urgency=medium * Expand canvas automatically to fit nodes * Fix various compiler warnings - -- David Robillard <d@drobilla.net> Sun, 29 Nov 2020 10:51:22 +0000 + -- David Robillard <d@drobilla.net> Thu, 07 Jan 2021 22:38:31 +0000 -ganv (1.6.0) stable; +ganv (1.6.0) stable; urgency=medium * Add API to specify module port order. * Add support for PDF and PS export. @@ -29,7 +41,7 @@ ganv (1.6.0) stable; -- David Robillard <d@drobilla.net> Thu, 09 Apr 2020 11:45:01 +0000 -ganv (1.4.2) stable; +ganv (1.4.2) stable; urgency=medium * Fix bug where edges would not update when nodes are moved after the canvas is cleared (fix stuck connections in Patchage after refresh). @@ -37,7 +49,7 @@ ganv (1.4.2) stable; -- David Robillard <d@drobilla.net> Fri, 08 Aug 2014 22:24:33 +0000 -ganv (1.4.0) stable; +ganv (1.4.0) stable; urgency=medium * Add Connection::set_curved() * Add ability to select connections by their handles, either individually or diff --git a/ganv/Box.hpp b/include/ganv/Box.hpp index fe24622..fe24622 100644 --- a/ganv/Box.hpp +++ b/include/ganv/Box.hpp diff --git a/ganv/Canvas.hpp b/include/ganv/Canvas.hpp index 350a6e7..fe94ff9 100644 --- a/ganv/Canvas.hpp +++ b/include/ganv/Canvas.hpp @@ -146,7 +146,7 @@ public: sigc::signal<void, Node*, Node*> signal_disconnect; private: - GanvCanvas* const _gobj; + GanvCanvas* _gobj; }; } // namespace Ganv diff --git a/ganv/Circle.hpp b/include/ganv/Circle.hpp index b60b89d..b60b89d 100644 --- a/ganv/Circle.hpp +++ b/include/ganv/Circle.hpp diff --git a/ganv/Edge.hpp b/include/ganv/Edge.hpp index a0d9a7c..a0d9a7c 100644 --- a/ganv/Edge.hpp +++ b/include/ganv/Edge.hpp diff --git a/ganv/Item.hpp b/include/ganv/Item.hpp index e6b690c..0d14a19 100644 --- a/ganv/Item.hpp +++ b/include/ganv/Item.hpp @@ -78,7 +78,7 @@ public: SIGNAL1(click, GdkEventButton*) protected: - GanvItem* const _gobj; + GanvItem* _gobj; private: static gboolean on_item_event(GanvItem*, GdkEvent* ev, void* item) diff --git a/ganv/Module.hpp b/include/ganv/Module.hpp index 8beea60..8beea60 100644 --- a/ganv/Module.hpp +++ b/include/ganv/Module.hpp diff --git a/ganv/Node.hpp b/include/ganv/Node.hpp index 7980566..7980566 100644 --- a/ganv/Node.hpp +++ b/include/ganv/Node.hpp diff --git a/ganv/Port.hpp b/include/ganv/Port.hpp index c665b08..c665b08 100644 --- a/ganv/Port.hpp +++ b/include/ganv/Port.hpp diff --git a/ganv/box.h b/include/ganv/box.h index 11e0662..11e0662 100644 --- a/ganv/box.h +++ b/include/ganv/box.h diff --git a/ganv/canvas.h b/include/ganv/canvas.h index 089bb1d..ca50b21 100644 --- a/ganv/canvas.h +++ b/include/ganv/canvas.h @@ -92,7 +92,15 @@ typedef void (*GanvEdgeFunc)(GanvEdge* edge, void* data); */ typedef void (*GanvNodeFunc)(GanvNode* node, void* data); -typedef int (*GanvPortOrderFunc)(const GanvPort*, const GanvPort*, void* data); +/** + * GanvPortOrderFunc: + * @lhs: Left-hand port to compare. + * @rhs: Right-hand port to compare. + * @data: User callback data. + * + * A function to compare two ports. + */ +typedef int (*GanvPortOrderFunc)(const GanvPort* lhs, const GanvPort* rhs, void* data); /** * ganv_canvas_new: @@ -621,9 +629,9 @@ ganv_canvas_move_contents_to(GanvCanvas* canvas, double x, double y); /** * ganv_canvas_set_port_order: - * @canvas The canvas to set the default port order on. - * @port_cmp Port comparison function. - * @data Data to be passed to order. + * @canvas: The canvas to set the default port order on. + * @port_cmp: (scope call): Port comparison function. + * @data: Data to be passed to order. * * Set a comparator function to use as the default order for ports on modules. * If left unset, ports are shown in the order they are added. diff --git a/ganv/circle.h b/include/ganv/circle.h index 23bfa2d..23bfa2d 100644 --- a/ganv/circle.h +++ b/include/ganv/circle.h diff --git a/ganv/edge.h b/include/ganv/edge.h index 8bf8ad0..8bf8ad0 100644 --- a/ganv/edge.h +++ b/include/ganv/edge.h diff --git a/ganv/ganv.h b/include/ganv/ganv.h index f86165f..f86165f 100644 --- a/ganv/ganv.h +++ b/include/ganv/ganv.h diff --git a/ganv/ganv.hpp b/include/ganv/ganv.hpp index 3e3f259..3e3f259 100644 --- a/ganv/ganv.hpp +++ b/include/ganv/ganv.hpp diff --git a/ganv/group.h b/include/ganv/group.h index 72efa3c..72efa3c 100644 --- a/ganv/group.h +++ b/include/ganv/group.h diff --git a/ganv/item.h b/include/ganv/item.h index 2433574..2433574 100644 --- a/ganv/item.h +++ b/include/ganv/item.h diff --git a/ganv/module.h b/include/ganv/module.h index 969965b..969965b 100644 --- a/ganv/module.h +++ b/include/ganv/module.h diff --git a/ganv/node.h b/include/ganv/node.h index 03c5982..03c5982 100644 --- a/ganv/node.h +++ b/include/ganv/node.h diff --git a/ganv/port.h b/include/ganv/port.h index 8bf4a80..8bf4a80 100644 --- a/ganv/port.h +++ b/include/ganv/port.h diff --git a/ganv/text.h b/include/ganv/text.h index 2aee253..2aee253 100644 --- a/ganv/text.h +++ b/include/ganv/text.h diff --git a/ganv/types.h b/include/ganv/types.h index 70c21ec..70c21ec 100644 --- a/ganv/types.h +++ b/include/ganv/types.h diff --git a/ganv/types.hpp b/include/ganv/types.hpp index ba797ba..ba797ba 100644 --- a/ganv/types.hpp +++ b/include/ganv/types.hpp diff --git a/ganv/widget.h b/include/ganv/widget.h index af31576..af31576 100644 --- a/ganv/widget.h +++ b/include/ganv/widget.h diff --git a/ganv/wrap.hpp b/include/ganv/wrap.hpp index 8e0a421..8e0a421 100644 --- a/ganv/wrap.hpp +++ b/include/ganv/wrap.hpp diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..c6f2e28 --- /dev/null +++ b/meson.build @@ -0,0 +1,247 @@ +# Copyright 2021-2023 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR GPL-3.0-or-later + +project( + 'ganv', + ['c', 'cpp'], + default_options: [ + 'b_ndebug=if-release', + 'buildtype=release', + 'c_std=c99', + 'cpp_std=c++11', + ], + license: 'GPLv3+', + meson_version: '>= 0.56.0', + version: '1.8.3', +) + +ganv_src_root = meson.current_source_dir() +major_version = meson.project_version().split('.')[0] +version_suffix = '-@0@'.format(major_version) +versioned_name = 'ganv' + version_suffix + +####################### +# Compilers and Flags # +####################### + +# Required tools +pkg = import('pkgconfig') +gnome = import('gnome') +cc = meson.get_compiler('c') +cpp = meson.get_compiler('cpp') + +# Set global warning suppressions +subdir('meson/suppressions') +add_project_arguments(c_suppressions, language: ['c']) +if is_variable('cpp') + add_project_arguments(cpp_suppressions, language: ['cpp']) +endif + +################ +# Dependencies # +################ + +m_dep = cc.find_library('m', required: false) + +intl_dep = cc.find_library('intl', required: get_option('nls')) + +gtk2_dep = dependency('gtk+-2.0', version: '>= 2.10.0', include_type: 'system') + +gtkmm2_dep = dependency( + 'gtkmm-2.4', + include_type: 'system', + version: '>= 2.10.0', +) + +gvc_dep = dependency( + 'libgvc', + include_type: 'system', + required: get_option('graphviz'), +) + +########################## +# Platform Configuration # +########################## + +# Use versioned name everywhere to support parallel major version installations +if host_machine.system() == 'windows' + if get_option('default_library') == 'both' + error('default_library=both is not supported on Windows') + endif + soversion = '' +else + soversion = meson.project_version().split('.')[0] +endif + +################# +# Configuration # +################# + +config_defines = [] + +# Graphviz layout +if gvc_dep.found() + config_defines += ['-DHAVE_AGRAPH'] +endif + +# Force-directed graph layout +if not get_option('fdgl').disabled() + config_defines += ['-DGANV_FDGL'] +endif + +# Light theme +if get_option('light') + config_defines += ['-DGANV_USE_LIGHT_THEME'] +endif + +# Native language support +if not get_option('nls').disabled() + dgettext_code = '''#include <libintl.h> +int main(void) { !!dgettext("ganv", "string"); }''' + + config_defines += [ + '-DHAVE_DGETTEXT=@0@'.format( + cc.compiles(dgettext_code, name: 'dgettext').to_int(), + ), + ] +endif + +add_project_arguments(config_defines, language: ['c', 'cpp']) + +########### +# Library # +########### + +include_dirs = include_directories('include') + +c_headers = files( + 'include/ganv/box.h', + 'include/ganv/canvas.h', + 'include/ganv/circle.h', + 'include/ganv/edge.h', + 'include/ganv/ganv.h', + 'include/ganv/group.h', + 'include/ganv/item.h', + 'include/ganv/module.h', + 'include/ganv/node.h', + 'include/ganv/port.h', + 'include/ganv/text.h', + 'include/ganv/types.h', + 'include/ganv/widget.h', +) + +cpp_headers = files( + 'include/ganv/Box.hpp', + 'include/ganv/Canvas.hpp', + 'include/ganv/Circle.hpp', + 'include/ganv/Edge.hpp', + 'include/ganv/Item.hpp', + 'include/ganv/Module.hpp', + 'include/ganv/Node.hpp', + 'include/ganv/Port.hpp', + 'include/ganv/ganv.hpp', + 'include/ganv/types.hpp', + 'include/ganv/wrap.hpp', +) + +sources = files( + 'src/Canvas.cpp', + 'src/Port.cpp', + 'src/box.c', + 'src/circle.c', + 'src/edge.c', + 'src/group.c', + 'src/item.c', + 'src/module.c', + 'src/node.c', + 'src/port.c', + 'src/text.c', + 'src/widget.c', +) + +# Set appropriate arguments for building against the library type +extra_args = [] +if get_option('default_library') == 'static' + extra_args = ['-DGANV_STATIC'] +endif + +# Generate marshal files with glib-genmarshal +ganv_marshal_sources = gnome.genmarshal( + 'ganv-marshal', + extra_args: ['--quiet'], + prefix: 'ganv_marshal', + sources: files('src/ganv-marshal.list'), +) + +# Build shared and/or static library +libganv = library( + versioned_name, + sources + ganv_marshal_sources, + c_args: c_suppressions + extra_args + ['-DGANV_INTERNAL'], + cpp_args: cpp_suppressions + extra_args + ['-DGANV_INTERNAL'], + dependencies: [gtk2_dep, gtkmm2_dep, gvc_dep, intl_dep, m_dep], + include_directories: include_dirs, + install: true, + soversion: soversion, + version: meson.project_version(), +) + +# Declare dependency for internal meson dependants +ganv_dep = declare_dependency( + compile_args: extra_args, + include_directories: include_dirs, + link_with: libganv, +) + +# Generage pkg-config file for external dependants +pkg.generate( + libganv, + description: 'Interactive Gtk canvas widget for graph-based interfaces', + extra_cflags: extra_args, + filebase: versioned_name, + name: 'Ganv', + subdirs: [versioned_name], + version: meson.project_version(), +) + +# Override pkg-config dependency for internal meson dependants +meson.override_dependency(versioned_name, ganv_dep) + +# Install headers to a versioned include directory +install_headers(c_headers + cpp_headers, subdir: versioned_name / 'ganv') + +# Generate GObject introspection data +if not get_option('gir').disabled() + # TODO: With newer g-ir-scanner we could simply do + # ['--compiler=' + cpp.cmd_array()[0]] + g_ir_scanner_args = ['--quiet'] + if target_machine.system() == 'darwin' + g_ir_scanner_args += ['-lc++'] + elif target_machine.system() in ['gnu', 'linux'] + g_ir_scanner_args += ['-lstdc++'] + endif + + gnome.generate_gir( + libganv, + dependencies: [ganv_dep], + extra_args: g_ir_scanner_args, + fatal_warnings: true, + header: 'ganv.h', + includes: ['GObject-2.0', 'Gdk-2.0', 'Gtk-2.0'], + install: true, + namespace: 'Ganv', + nsversion: '1.0', + sources: sources + c_headers + ganv_marshal_sources, + ) +endif + +if not meson.is_subproject() + summary('Tools', get_option('tools'), bool_yn: true) + summary('Install prefix', get_option('prefix')) + summary('Headers', get_option('prefix') / get_option('includedir')) + summary('Libraries', get_option('prefix') / get_option('libdir')) + + if get_option('tools') + summary('Executables', get_option('prefix') / get_option('bindir')) + endif +endif diff --git a/meson/suppressions/meson.build b/meson/suppressions/meson.build new file mode 100644 index 0000000..6e8868e --- /dev/null +++ b/meson/suppressions/meson.build @@ -0,0 +1,188 @@ +# Copyright 2020-2023 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR ISC + +# Project-specific warning suppressions + +warning_level = get_option('warning_level') + +clang_common_suppressions = [ + '-Wno-cast-qual', + '-Wno-covered-switch-default', + '-Wno-disabled-macro-expansion', + '-Wno-documentation-unknown-command', + '-Wno-double-promotion', + '-Wno-float-conversion', + '-Wno-float-equal', + '-Wno-implicit-fallthrough', + '-Wno-implicit-float-conversion', + '-Wno-padded', + '-Wno-reserved-id-macro', + '-Wno-reserved-identifier', + '-Wno-shadow', + '-Wno-shorten-64-to-32', + '-Wno-sign-conversion', + '-Wno-switch-enum', + '-Wno-unused-macros', + '-Wno-used-but-marked-unused', +] + +gcc_common_suppressions = [ + '-Wno-cast-qual', + '-Wno-conversion', + '-Wno-deprecated-declarations', + '-Wno-double-promotion', + '-Wno-float-conversion', + '-Wno-float-equal', + '-Wno-format', + '-Wno-implicit-fallthrough', + '-Wno-padded', + '-Wno-shadow', + '-Wno-sign-conversion', + '-Wno-suggest-attribute=const', + '-Wno-suggest-attribute=pure', + '-Wno-switch-default', + '-Wno-switch-enum', + '-Wno-unused-macros', +] + +##### +# C # +##### + +if is_variable('cc') + c_suppressions = [] + + if cc.get_id() == 'clang' + if warning_level == 'everything' + c_suppressions += [ + '-Wno-bad-function-cast', + '-Wno-declaration-after-statement', + '-Wno-documentation', + '-Wno-unsafe-buffer-usage', + ] + + if host_machine.system() == 'freebsd' + c_suppressions += [ + '-Wno-c11-extensions', + ] + endif + endif + + if warning_level in ['everything', '3'] + c_suppressions += ( + clang_common_suppressions + [ + '-Wno-cast-function-type', + '-Wno-pedantic', + ] + ) + endif + + elif cc.get_id() == 'gcc' + if warning_level == 'everything' + c_suppressions += [ + '-Wno-bad-function-cast', + '-Wno-c++-compat', + '-Wno-unsuffixed-float-constants', + ] + endif + + if warning_level in ['everything', '3'] + c_suppressions += ( + gcc_common_suppressions + [ + '-Wno-pedantic', + ] + ) + endif + + if warning_level in ['everything', '3', '2'] + c_suppressions += ( + gcc_common_suppressions + [ + '-Wno-cast-function-type', + ] + ) + endif + + elif cc.get_id() == 'msvc' + if warning_level == 'everything' + c_suppressions += [ + '/wd4061', # enumerator in switch is not explicitly handled + '/wd4100', # unreferenced formal parameter + '/wd4191', # unsafe function conversion + '/wd4200', # zero-sized array in struct/union + '/wd4244', # possible loss of data from integer conversion + '/wd4267', # possible loss of data from size conversion + '/wd4365', # signed/unsigned mismatch + '/wd4514', # unreferenced inline function has been removed + '/wd4706', # assignment within conditional expression + '/wd4710', # function not inlined + '/wd4711', # function selected for automatic inline expansion + '/wd4800', # implicit conversion from int to bool + '/wd4820', # padding added after construct + '/wd4996', # POSIX name for this item is deprecated + '/wd5045', # compiler will insert Spectre mitigation + ] + endif + endif + + c_suppressions = cc.get_supported_arguments(c_suppressions) +endif + +####### +# C++ # +####### + +if is_variable('cpp') + cpp_suppressions = [] + + if cpp.get_id() == 'clang' + cpp_suppressions += clang_common_suppressions + + if warning_level == 'everything' + cpp_suppressions += [ + '-Wno-c++98-compat', + '-Wno-exit-time-destructors', + '-Wno-global-constructors', + '-Wno-missing-noreturn', + '-Wno-old-style-cast', + '-Wno-unsafe-buffer-usage', + '-Wno-weak-vtables', + '-Wno-zero-as-null-pointer-constant', + ] + endif + + if warning_level in ['everything', '3'] + cpp_suppressions += [ + '-Wno-cast-function-type', + ] + endif + + elif cpp.get_id() == 'gcc' + cpp_suppressions += gcc_common_suppressions + + if warning_level == 'everything' + cpp_suppressions += [ + '-Wno-effc++', + '-Wno-missing-noreturn', + '-Wno-null-dereference', + '-Wno-old-style-cast', + '-Wno-redundant-tags', + '-Wno-useless-cast', + '-Wno-zero-as-null-pointer-constant', + ] + endif + + if warning_level in ['everything', '3'] + cpp_suppressions += [ + '-Wno-pedantic', + ] + endif + + if warning_level in ['everything', '3', '2'] + cpp_suppressions += [ + '-Wno-cast-function-type', + ] + endif + endif + + cpp_suppressions = cpp.get_supported_arguments(cpp_suppressions) +endif diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..69ae358 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,23 @@ +# Copyright 2022-2023 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR ISC + +option('fdgl', type: 'feature', value: 'auto', yield: true, + description: 'Build with force-directed graph layout support') + +option('gir', type: 'feature', value: 'auto', yield: true, + description: 'Build GObject introspection data') + +option('graphviz', type: 'feature', value: 'auto', yield: true, + description: 'Build with graphviz-based layout support') + +option('light', type: 'boolean', value: 'false', yield: true, + description: 'Use light-coloured theme') + +option('nls', type: 'feature', value: 'auto', yield: true, + description: 'Build with native language support') + +option('title', type: 'string', value: 'Ganv', + description: 'Project title') + +option('tools', type: 'boolean', value: true, yield: true, + description: 'Build command line utilities') diff --git a/src/Canvas.cpp b/src/Canvas.cpp index 1219950..4065539 100644 --- a/src/Canvas.cpp +++ b/src/Canvas.cpp @@ -40,7 +40,6 @@ #include "ganv/node.h" #include "ganv/port.h" #include "ganv/types.h" -#include "ganv_config.h" #include <cairo-pdf.h> #include <cairo-ps.h> @@ -89,9 +88,9 @@ # define _BLD_cdt 0 # define _PACKAGE_ast 0 # include <arith.h> +# include <cgraph.h> # include <gvc.h> # include <gvcext.h> -# include <types.h> #endif #ifdef GANV_FDGL # include "./fdgl.hpp" @@ -762,9 +761,9 @@ GanvCanvasImpl::layout_dot(const std::string& filename) } FOREACH_EDGE(_edges, i) { - const GanvEdge* const edge = *i; - GVNodes::iterator tail_i = nodes.find(edge->impl->tail); - GVNodes::iterator head_i = nodes.find(edge->impl->head); + const GanvEdge* const edge = *i; + const GVNodes::iterator tail_i = nodes.find(edge->impl->tail); + const GVNodes::iterator head_i = nodes.find(edge->impl->head); if (tail_i != nodes.end() && head_i != nodes.end()) { Agedge_t* e = agedge(G, tail_i->second, head_i->second, NULL, true); @@ -790,7 +789,7 @@ GanvCanvasImpl::layout_dot(const std::string& filename) for (GVNodes::iterator i = nodes.begin(); i != nodes.end(); ++i) { GanvNode* partner = ganv_node_get_partner(i->first); if (partner) { - GVNodes::iterator p = nodes.find(partner); + const GVNodes::iterator p = nodes.find(partner); if (p != nodes.end()) { Agedge_t* e = agedge(G, i->second, p->second, NULL, true); agsafeset(e, (char*)"style", (char*)"invis", (char*)""); @@ -1134,7 +1133,7 @@ GanvCanvasImpl::join_selection() for (size_t i = 0; i < inputs.size(); ++i) ports_joined(inputs[i], outputs[0]); } else { // n -> m - size_t num_to_connect = std::min(inputs.size(), outputs.size()); + const size_t num_to_connect = std::min(inputs.size(), outputs.size()); for (size_t i = 0; i < num_to_connect; ++i) { ports_joined(inputs[i], outputs[i]); } @@ -1433,8 +1432,8 @@ GanvCanvasImpl::connect_drag_handler(GdkEvent* event) } else if (event->type == GDK_BUTTON_RELEASE) { ganv_canvas_ungrab_item(root, event->button.time); - double x = event->button.x; - double y = event->button.y; + const double x = event->button.x; + const double y = event->button.y; GanvNode* joinee = get_node_at(x, y); @@ -1969,14 +1968,14 @@ ganv_canvas_class_init(GanvCanvasClass* klass) 600.0, (GParamFlags)G_PARAM_READWRITE)); - GEnumValue down_dir = { GANV_DIRECTION_DOWN, "down", "down" }; - GEnumValue right_dir = { GANV_DIRECTION_RIGHT, "right", "right" }; - GEnumValue null_dir = { 0, 0, 0 }; + const GEnumValue down_dir = { GANV_DIRECTION_DOWN, "down", "down" }; + const GEnumValue right_dir = { GANV_DIRECTION_RIGHT, "right", "right" }; + const GEnumValue null_dir = { 0, 0, 0 }; dir_values[0] = down_dir; dir_values[1] = right_dir; dir_values[2] = null_dir; - GType dir_type = g_enum_register_static("GanvDirection", - dir_values); + const GType dir_type = g_enum_register_static("GanvDirection", + dir_values); g_object_class_install_property( gobject_class, PROP_DIRECTION, g_param_spec_enum( @@ -2213,13 +2212,13 @@ ganv_canvas_clear_selection(GanvCanvas* canvas) { canvas->impl->unselect_ports(); - Items items(canvas->impl->_selected_items); + const Items items{canvas->impl->_selected_items}; canvas->impl->_selected_items.clear(); FOREACH_ITEM(items, i) { ganv_item_set(GANV_ITEM(*i), "selected", FALSE, NULL); } - GanvCanvasImpl::SelectedEdges edges(canvas->impl->_selected_edges); + const GanvCanvasImpl::SelectedEdges edges{canvas->impl->_selected_edges}; canvas->impl->_selected_edges.clear(); FOREACH_SELECTED_EDGE(edges, c) { ganv_item_set(GANV_ITEM(*c), "selected", FALSE, NULL); @@ -2352,7 +2351,8 @@ ganv_canvas_get_edge(GanvCanvas* canvas, { GanvEdgeKey key; make_edge_search_key(&key, tail, head); - GanvCanvasImpl::Edges::const_iterator i = canvas->impl->_edges.find((GanvEdge*)&key); + + const GanvCanvasImpl::Edges::const_iterator i = canvas->impl->_edges.find((GanvEdge*)&key); return (i != canvas->impl->_edges.end()) ? *i : NULL; } @@ -2524,13 +2524,13 @@ ganv_canvas_clear(GanvCanvas* canvas) canvas->impl->_selected_items.clear(); canvas->impl->_selected_edges.clear(); - Items items = canvas->impl->_items; // copy + const Items items = canvas->impl->_items; // copy FOREACH_ITEM(items, i) { gtk_object_destroy(GTK_OBJECT(*i)); } canvas->impl->_items.clear(); - GanvCanvasImpl::Edges edges = canvas->impl->_edges; // copy + const GanvCanvasImpl::Edges edges = canvas->impl->_edges; // copy FOREACH_EDGE(edges, i) { gtk_object_destroy(GTK_OBJECT(*i)); } @@ -2662,6 +2662,8 @@ ganv_canvas_arrange(GanvCanvas* canvas) const double y = GANV_ITEM(*i)->impl->y; g_signal_emit(*i, signal_moved, 0, x, y, NULL); } +#else + (void)canvas; #endif } @@ -2739,6 +2741,9 @@ ganv_canvas_export_dot(GanvCanvas* canvas, const char* filename) #ifdef HAVE_AGRAPH GVNodes nodes = canvas->impl->layout_dot(filename); nodes.cleanup(); +#else + (void)canvas; + (void)filename; #endif } @@ -3342,12 +3347,12 @@ ganv_canvas_grab_item(GanvItem* item, guint event_mask, GdkCursor* cursor, guint return GDK_GRAB_NOT_VIEWABLE; } - int retval = gdk_pointer_grab(item->impl->canvas->layout.bin_window, - FALSE, - (GdkEventMask)event_mask, - NULL, - cursor, - etime); + const int retval = gdk_pointer_grab(item->impl->canvas->layout.bin_window, + FALSE, + (GdkEventMask)event_mask, + NULL, + cursor, + etime); if (retval != GDK_GRAB_SUCCESS) { return retval; @@ -3401,11 +3406,11 @@ pick_current_item(GanvCanvas* canvas, GdkEvent* event) * current item, but not enter on any other item. This is more or less * like X pointer grabbing for canvas items. */ - int button_down = canvas->impl->state & (GDK_BUTTON1_MASK - | GDK_BUTTON2_MASK - | GDK_BUTTON3_MASK - | GDK_BUTTON4_MASK - | GDK_BUTTON5_MASK); + const int button_down = canvas->impl->state & (GDK_BUTTON1_MASK + | GDK_BUTTON2_MASK + | GDK_BUTTON3_MASK + | GDK_BUTTON4_MASK + | GDK_BUTTON5_MASK); if (!button_down) { canvas->impl->left_grabbed_item = FALSE; } @@ -3721,16 +3726,16 @@ ganv_canvas_paint_rect(GanvCanvas* canvas, gint x0, gint y0, gint x1, gint y1) { g_return_if_fail(!canvas->impl->need_update); - gint draw_x1 = + const gint draw_x1 = MAX(x0, canvas->layout.hadjustment->value - canvas->impl->zoom_xofs); - gint draw_y1 = + const gint draw_y1 = MAX(y0, canvas->layout.vadjustment->value - canvas->impl->zoom_yofs); - gint draw_x2 = MIN(draw_x1 + GTK_WIDGET(canvas)->allocation.width, x1); - gint draw_y2 = MIN(draw_y1 + GTK_WIDGET(canvas)->allocation.height, y1); + const gint draw_x2 = MIN(draw_x1 + GTK_WIDGET(canvas)->allocation.width, x1); + const gint draw_y2 = MIN(draw_y1 + GTK_WIDGET(canvas)->allocation.height, y1); - gint draw_width = draw_x2 - draw_x1; - gint draw_height = draw_y2 - draw_y1; + const gint draw_width = draw_x2 - draw_x1; + const gint draw_height = draw_y2 - draw_y1; if ((draw_width < 1) || (draw_height < 1)) { return; @@ -4031,8 +4036,8 @@ ganv_canvas_get_item_at(GanvCanvas* canvas, double x, double y) { g_return_val_if_fail(GANV_IS_CANVAS(canvas), NULL); - GanvItem* item = NULL; - double dist = GANV_ITEM_GET_CLASS(canvas->impl->root)->point( + GanvItem* item = NULL; + const double dist = GANV_ITEM_GET_CLASS(canvas->impl->root)->point( canvas->impl->root, x - canvas->impl->root->impl->x, y - canvas->impl->root->impl->y, @@ -29,7 +29,6 @@ #include <glib.h> #include <gtk/gtk.h> #include <pango/pango-font.h> -#include <pango/pango-fontmap.h> #include <pango/pango-layout.h> #include <pango/pango-types.h> #include <pango/pangocairo.h> @@ -1,27 +0,0 @@ -#!/usr/bin/env python - -# Minimal waf script for projects that include waflib directly - -import sys -import inspect -import os - -try: - from waflib import Context, Scripting -except Exception as e: - sys.stderr.write('error: Failed to import waf (%s)\n' % e) - if os.path.exists('.git'): - sys.stderr.write("Are submodules up to date? " - "Try 'git submodule update --init --recursive'\n") - - sys.exit(1) - - -def main(): - script_path = os.path.abspath(inspect.getfile(inspect.getmodule(main))) - project_path = os.path.dirname(os.path.realpath(script_path)) - Scripting.waf_entry_point(os.getcwd(), Context.WAFVERSION, project_path) - - -if __name__ == '__main__': - main() diff --git a/waflib b/waflib deleted file mode 160000 -Subproject b600c928b221a001faeab7bd92786d0b25714bc diff --git a/wscript b/wscript deleted file mode 100644 index 139d439..0000000 --- a/wscript +++ /dev/null @@ -1,309 +0,0 @@ -#!/usr/bin/env python - -import os - -from waflib import Options, Utils -from waflib.extras import autowaf - -# Library and package version (UNIX style major, minor, micro) -# major increment <=> incompatible changes -# minor increment <=> compatible changes (additions) -# micro increment <=> no interface changes -GANV_VERSION = '1.7.1' -GANV_MAJOR_VERSION = '1' - -# Mandatory waf variables -APPNAME = 'ganv' # Package name for waf dist -VERSION = GANV_VERSION # Package version for waf dist -top = '.' # Source directory -out = 'build' # Build directory - -# Release variables -uri = 'http://drobilla.net/sw/ganv' -dist_pattern = 'http://download.drobilla.net/ganv-%d.%d.%d.tar.bz2' -post_tags = ['Hacking', 'LAD', 'Ganv'] - - -def options(ctx): - ctx.load('compiler_c') - ctx.load('compiler_cxx') - ctx.add_flags( - ctx.configuration_options(), - {'no-graphviz': 'do not compile with graphviz support', - 'light-theme': 'use light coloured theme', - 'no-fdgl': 'use experimental force-directed graph layout', - 'no-nls': 'disable i18n (native language support)', - 'gir': 'build GObject introspection data'}) - -def configure(conf): - conf.load('compiler_c', cache=True) - conf.load('compiler_cxx', cache=True) - conf.load('autowaf', cache=True) - autowaf.set_c_lang(conf, 'c99') - autowaf.set_cxx_lang(conf, 'c++11') - - if Options.options.ultra_strict: - autowaf.add_compiler_flags(conf.env, 'c', { - 'clang': [ - '-Wno-bad-function-cast', - '-Wno-documentation', - ], - 'gcc': [ - '-Wno-bad-function-cast', - ] - }) - - autowaf.add_compiler_flags(conf.env, 'cxx', { - 'clang': [ - '-Wno-exit-time-destructors', - '-Wno-global-constructors', - '-Wno-missing-noreturn', - '-Wno-old-style-cast', - '-Wno-weak-vtables', - '-Wno-zero-as-null-pointer-constant', - ], - 'gcc': [ - '-Wno-effc++', - '-Wno-missing-noreturn', - '-Wno-old-style-cast', - '-Wno-useless-cast', - '-Wno-zero-as-null-pointer-constant', - ] - }) - - autowaf.add_compiler_flags(conf.env, '*', { - 'clang': [ - '-Wno-cast-qual', - '-Wno-covered-switch-default', - '-Wno-disabled-macro-expansion', - '-Wno-documentation-unknown-command', - '-Wno-double-promotion', - '-Wno-float-conversion', - '-Wno-float-equal', - '-Wno-implicit-fallthrough', - '-Wno-implicit-float-conversion', - '-Wno-padded', - '-Wno-reserved-id-macro', - '-Wno-shadow', - '-Wno-shorten-64-to-32', - '-Wno-sign-conversion', - '-Wno-switch-enum', - '-Wno-unused-macros', - '-Wno-used-but-marked-unused', - ], - 'gcc': [ - '-Wno-cast-function-type', - '-Wno-cast-qual', - '-Wno-conversion', - '-Wno-deprecated-declarations', - '-Wno-double-promotion', - '-Wno-float-conversion', - '-Wno-float-equal', - '-Wno-format', - '-Wno-implicit-fallthrough', - '-Wno-padded', - '-Wno-pedantic', - '-Wno-shadow', - '-Wno-sign-conversion', - '-Wno-switch-enum', - '-Wno-unused-macros', - ], - }) - - conf.check_pkg('gtk+-2.0', uselib_store='GTK', system=True) - conf.check_pkg('gtkmm-2.4 >= 2.10.0', uselib_store='GTKMM', system=True) - - if Options.options.gir: - conf.check_pkg('gobject-introspection-1.0', - uselib_store='GIR', - system=True, - mandatory=False) - conf.find_program('g-ir-doc-tool', var='G_IR_DOC_TOOL', mandatory=False) - conf.find_program('yelp-build', var='YELP_BUILD', mandatory=False) - - if not Options.options.no_graphviz: - conf.check_pkg('libgvc', - uselib_store='AGRAPH', - system=True, - mandatory=False) - if conf.env.HAVE_AGRAPH: - conf.define('HAVE_AGRAPH', 1) - - if not Options.options.no_fdgl: - conf.define('GANV_FDGL', 1) - - if Options.options.light_theme: - conf.define('GANV_USE_LIGHT_THEME', 1) - - if not Options.options.no_nls: - conf.check_function('cxx', 'dgettext', - header_name = 'libintl.h', - lib = 'intl', - define_name = 'ENABLE_NLS', - return_type = 'char*', - arg_types = 'const char*,const char*', - mandatory = False) - - autowaf.set_lib_env(conf, 'ganv', GANV_VERSION) - conf.write_config_header('ganv_config.h', remove=False) - - autowaf.display_summary( - conf, - {'Static (Graphviz) arrange': bool(conf.env.HAVE_AGRAPH), - 'Interactive force-directed arrange': conf.is_defined('GANV_FDGL'), - 'Native language support': bool(conf.env.ENABLE_NLS), - 'GObject introspection': bool(conf.env.HAVE_GIR), - 'Unit tests': bool(conf.env.BUILD_TESTS)}) - -ganv_source = [ - 'src/Canvas.cpp', - 'src/Port.cpp', - 'src/box.c', - 'src/circle.c', - 'src/edge.c', - 'src/ganv-marshal.c', - 'src/group.c', - 'src/item.c', - 'src/module.c', - 'src/node.c', - 'src/port.c', - 'src/text.c', - 'src/widget.c' -] - -def declare_doc_files(task): - bld = task.generator.bld - path = bld.path.get_bld().find_or_declare('doc-html') - for i in path.ant_glob('*', remove=False): - i.sig = Utils.h_file(i.abspath()) - -def build(bld): - # Headers - includedir = '${INCLUDEDIR}/ganv-%s/ganv' % GANV_MAJOR_VERSION - bld.install_files(includedir, bld.path.ant_glob('ganv/*.h*')) - - # Pkgconfig file - autowaf.build_pc(bld, 'GANV', GANV_VERSION, GANV_MAJOR_VERSION, - 'GTK GTKMM AGRAPH', - {'GANV_MAJOR_VERSION' : GANV_MAJOR_VERSION}) - - bld(rule = 'glib-genmarshal --prefix=ganv_marshal --header ${SRC} > ${TGT}', - source = 'src/ganv-marshal.list', - target = 'src/ganv-marshal.h') - - bld(rule = 'glib-genmarshal --prefix=ganv_marshal --body ${SRC} > ${TGT}', - source = 'src/ganv-marshal.list', - target = 'src/ganv-marshal.c.in') - - bld(rule = 'cat ${SRC} > ${TGT}', - source = ['src/ganv-marshal.h', 'src/ganv-marshal.c.in'], - target = 'src/ganv-marshal.c') - - # Library - lib = bld(features = 'c cshlib cxx cxxshlib', - export_includes = ['.'], - source = ganv_source, - includes = ['.', './src'], - name = 'libganv', - target = 'ganv-%s' % GANV_MAJOR_VERSION, - uselib = 'GTK GTKMM AGRAPH', - vnum = GANV_VERSION, - install_path = '${LIBDIR}') - if bld.is_defined('ENABLE_NLS'): - lib.lib = ['intl'] - - # Benchmark program (C++) - bld(features = 'cxx cxxprogram', - source = 'src/ganv_bench.cpp', - includes = ['.', './src'], - use = 'libganv', - uselib = 'GTK GTKMM AGRAPH', - target = 'src/ganv_bench') - - if bld.env.BUILD_TESTS: - test_libs = [] - test_cflags = [''] - test_linkflags = [''] - if not bld.env.NO_COVERAGE: - test_cflags += ['--coverage'] - test_linkflags += ['--coverage'] - - # Static library for test program - bld(features = 'c cstlib cxx cxxshlib', - source = ganv_source, - includes = ['.', './src'], - name = 'libganv_profiled', - target = 'ganv_profiled', - uselib = 'GTK GTKMM AGRAPH', - install_path = '', - cflags = test_cflags, - linkflags = test_linkflags) - - # Test program (C) - bld(features = 'cxx cxxprogram', - source = 'src/ganv_test.c', - includes = ['.', './src'], - use = 'libganv_profiled', - lib = test_libs, - uselib = 'GTK GTKMM AGRAPH', - target = 'src/ganv_test', - cflags = test_cflags, - linkflags = test_linkflags) - - # Documentation - #autowaf.build_dox(bld, 'GANV', GANV_VERSION, top, out) - - if bld.env.HAVE_GIR: - bld.add_group() - - bld_dir = os.path.join(out, APPNAME) - if not (len(bld.stack_path) > 1): # not top-level - bld_dir = out - - pc_path = os.path.abspath(os.path.join(bld_dir, 'ganv-1.pc')) - - bld(name = 'ganv-gir', - source = ganv_source + bld.path.ant_glob('ganv/*.h'), - target = 'Ganv-1.0.gir', - install_path = '${LIBDIR}/girepository-1.0', - rule = 'g-ir-scanner --warn-all -n Ganv --nsversion=1.0' - ' --no-libtool ' + - ('--pkg=%s' % pc_path) + - (' -I%s' % bld.path.bldpath()) + - ''.join([' -I' + path for path in bld.env.INCLUDES_GTK]) + - (' -L%s' % bld_dir) + - ' --library=ganv-1' - ' --include=GObject-2.0 --include=Gdk-2.0 --include Gtk-2.0' - ' -o ${TGT} ${SRC}') - - bld(name = 'ganv-typelib', - after = 'ganv-gir', - source = 'Ganv-1.0.gir', - target = 'Ganv-1.0.typelib', - install_path = '${LIBDIR}/girepository-1.0', - rule = 'g-ir-compiler ${SRC} -o ${TGT}') - - if bld.env.DOCS and bld.env['G_IR_DOC_TOOL'] and bld.env['YELP_BUILD']: - # The source and target files used here aren't exclusive, - # but are declared so waf can track dependencies - bld(rule = '${G_IR_DOC_TOOL} --language C -o doc-xml ${SRC}', - source = 'Ganv-1.0.gir', - target = 'doc-xml/index.page') - bld(name = 'yelp-build', - rule = '${YELP_BUILD} html -o doc-html doc-xml', - source = 'doc-xml/index.page', - target = 'doc-html/index.html') - bld(name = 'find-docs', - always = True, - rule = declare_doc_files, - after = 'yelp-build') - - bld.install_files( - os.path.join('${DOCDIR}', 'ganv-0', 'html'), - bld.path.get_bld().ant_glob('doc-html/*')) - - bld.add_post_fun(autowaf.run_ldconfig) - -def i18n(bld): - autowaf.build_i18n(bld, '..', 'ganv', APPNAME, ganv_source, - 'David Robillard') |