diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 966c8c84a0..02afbf2cee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -102,7 +102,70 @@ jobs: - name: ccache statistics run: ccache --show-stats if: ${{ env.DEBUG == '1' }} + linux-meson: + name: Linux Meson Build + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + + env: + CC: ccache gcc + CXX: ccache g++ + + steps: + - uses: actions/checkout@v2 + + # create and use a timestamp for the cache key: GH Actions will never update a cache + # only use an existing cache item or create a new one. To use an existing cache *and* + # push back the the updated cache after build, we use a always new cache key (to force + # the creation of the cache item at the end) in combination with "restore-keys" as fallback + - name: Prepare ccache timestamp + id: ccache_cache_timestamp + run: echo "::set-output name=timestamp::$(date +%Y-%m-%d-%H-%M)" + + - name: Configure ccache + uses: actions/cache@v2 + with: + path: ${{ env.CCACHE_DIR }} + key: ${{ runner.os }}-${{ github.job }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} + restore-keys: ${{ runner.os }}-${{ github.job }}-ccache- + + - name: Show environment + run: env | sort + if: ${{ env.DEBUG == '1' }} + + - name: Install dependencies + run: | + sudo apt-get update -qq + sudo apt-get install --assume-yes --no-install-recommends \ + ccache \ + gettext autopoint \ + libtool \ + libgtk-3-dev \ + doxygen \ + python3-docutils \ + python3-lxml \ + rst2pdf \ + meson + + - name: Configuration + run: | + meson _build + + - name: Build + run: | + ninja -C _build + + - name: Run Tests + run: | + ninja -C _build test + + # distcheck not applicable, meson exports the source tree per git-archive + + - name: ccache statistics + run: ccache --show-stats + if: ${{ env.DEBUG == '1' }} mingw: name: Mingw Build diff --git a/.gitignore b/.gitignore index 813abb672c..81a709906e 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,9 @@ Makefile.in /ABOUT-NLS /aclocal.m4 /autom4te.cache +/build/ +/builddir/ +/build-*/ /build-aux/ /build-stamp /codenames diff --git a/Makefile.am b/Makefile.am index 26bb83b7e9..e491330984 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,7 @@ WIN32_BUILD_FILES = \ EXTRA_DIST = \ autogen.sh \ scripts/gen-api-gtkdoc.py \ + scripts/gen-signallist.sh \ geany.desktop.in \ geany.pc.in \ ChangeLog.pre-1-22 \ diff --git a/README b/README index d644df5c2a..96fa7e03be 100644 --- a/README +++ b/README @@ -78,6 +78,38 @@ and open the online version instead when requested. Installing from a Git clone +++++++++++++++++++++++++++ +Using the Meson build system +++++++++++++++++++++++++++++ + +N.B. Meson support is still incomplete and a work-in-progress. + +Meson requires to chose a separate build directory. Either create +one, or let meson do it: + +`meson build` or `mkdir build; cd build; meson ..` + +Either command will configure the build system. The system is probed +in many ways and system-dependant build files are created. This includes +location of dependencies and compiler and linker flags required for them. + +To build Geany, follow with a `meson compile -C build` + +To install Geany, follow the build with a `sudo meson install -C build`. + +By default, meson will install Geany to `/usr/local`. A different +prefix can be selected at the initial command or via reconfiguration: + +`meson --prefix /opt build` or `meson configure --prefix /opt build` + +Geany has some selectable features that may reduce the required +build and runtime dependencies. See meson_optionts.txt for a full list. + +To turn a feature off, use `-D=false` when configuring the build, +for example: `meson configure -Dvte=false build` + +Using Autotools ++++++++++++++++ + Install Autotools (*autopoint*, *automake*, *autoconf* and *libtool*), *gettext*, and the GLib development files **before** running any of the following commands, as well as *rst2html* from Docutils (see above for diff --git a/configure.ac b/configure.ac index 10d19a1276..716dacc11f 100644 --- a/configure.ac +++ b/configure.ac @@ -48,7 +48,7 @@ fi AC_CHECK_HEADERS([fcntl.h glob.h stdlib.h sys/time.h errno.h limits.h]) # Checks for dependencies needed by ctags -AC_CHECK_HEADERS([fnmatch.h direct.h io.h sys/dir.h]) +AC_CHECK_HEADERS([dirent.h fnmatch.h direct.h io.h sys/dir.h]) AC_DEFINE([HAVE_STDBOOL_H], [1], [whether or not to use .]) AC_CHECK_FUNC([regcomp], [have_regcomp=yes], @@ -184,7 +184,6 @@ AC_CONFIG_FILES([ doc/geany.1 geany.pc geany.nsi - doc/Doxyfile tests/Makefile tests/ctags/Makefile ]) diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000000..498786637d --- /dev/null +++ b/data/meson.build @@ -0,0 +1,22 @@ +install_subdir('templates', install_dir: cdata.get('GEANY_DATA_DIR')) +install_subdir('tags', install_dir: cdata.get('GEANY_DATA_DIR')) +install_subdir('colorschemes', install_dir: cdata.get('GEANY_DATA_DIR')) + +install_subdir('filedefs', install_dir: cdata.get('GEANY_DATA_DIR'), exclude_files: 'filetypes.python.in') + +configure_file(input: 'filedefs/filetypes.python.in', + output: 'filetypes.python', + install: true, + install_dir: cdata.get('GEANY_DATA_DIR') + '/filedefs', + configuration: cdata) + +misc = [ + 'filetype_extensions.conf', + 'snippets.conf', + 'ui_toolbar.xml', + 'geany.glade', + 'geany-3.0.css', + 'geany-3.20.css', + 'geany.css', +] +install_data(sources: misc, install_dir: cdata.get('GEANY_DATA_DIR')) diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 1e59386a5f..c95bd5790f 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -248,7 +248,7 @@ ALIASES = "signal=- @ref " \ "signaldesc=" \ "signals=@b Signals: " \ "endsignals= " \ - "gironly=@internal" + "gironly=@GIRONLY@" # Apparently Doxygen doesn't seem to like \only without a previous command, so create a no-op ALIASES += "noop=\if FALSE \endif" @@ -567,7 +567,7 @@ INLINE_INFO = NO # name. If set to NO the members will appear in declaration order. # The default value is: YES. -SORT_MEMBER_DOCS = YES +SORT_MEMBER_DOCS = @SORT@ # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member @@ -575,7 +575,7 @@ SORT_MEMBER_DOCS = YES # this will also influence the order of the classes in the class list. # The default value is: NO. -SORT_BRIEF_DOCS = YES +SORT_BRIEF_DOCS = @SORT@ # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and @@ -848,8 +848,7 @@ RECURSIVE = NO # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = @top_srcdir@/doc/geany-gtkdoc.h \ - @top_srcdir@/doc/geany-sciwrappers-gtkdoc.h +EXCLUDE = @top_srcdir@/src/callbacks.c # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -1090,7 +1089,7 @@ IGNORE_PREFIX = # If the GENERATE_HTML tag is set to YES doxygen will generate HTML output # The default value is: YES. -GENERATE_HTML = YES +GENERATE_HTML = @HTML@ # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1881,7 +1880,7 @@ MAN_LINKS = NO # captures the structure of the code including all documentation. # The default value is: NO. -GENERATE_XML = NO +GENERATE_XML = @XML@ # The XML_OUTPUT tag is used to specify where the XML pages will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -2016,7 +2015,7 @@ SEARCH_INCLUDES = NO # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = @top_builddir@/src/ +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the diff --git a/doc/Makefile.am b/doc/Makefile.am index 63511e7bd1..b8d0532090 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -82,9 +82,23 @@ clean-pdf-local: endif +AT=@ + # API Documentation if WITH_DOXYGEN +# $(AT) instead of @ so that configure doesn't mess up the rules already +Doxyfile: Doxyfile.in + $(AM_V_GEN)$(SED) \ + -e 's,$(AT)top_srcdir$(AT),$(top_srcdir),' \ + -e 's,$(AT)top_builddir$(AT),$(top_builddir),' \ + -e 's,$(AT)VERSION$(AT),$(VERSION),' \ + -e 's,$(AT)GIRONLY$(AT),@internal,' \ + -e 's,$(AT)HTML$(AT),YES,' \ + -e 's,$(AT)XML$(AT),NO,' \ + -e 's,$(AT)SORT$(AT),YES,' \ + $< > $@ || ( $(RM) -f $@ ; exit 1 ) + doxygen_sources = \ $(srcdir)/plugins.dox \ $(srcdir)/pluginsignals.c \ @@ -92,7 +106,7 @@ doxygen_sources = \ $(srcdir)/stash-example.c \ $(srcdir)/stash-gui-example.c -EXTRA_DIST += $(doxygen_sources) +EXTRA_DIST += Doxyfile.in $(doxygen_sources) doxygen_dependencies = \ $(doxygen_sources) \ @@ -114,18 +128,16 @@ clean-api-docs-local: if ENABLE_GTKDOC_HEADER -# set WARN_IF_UNDOCUMENTED because apparently doxygens warns for undocumented stuff -# in headers (even though it's correctly documented in the corresponding .c file) only -# for xml output -Doxyfile-gi: Doxyfile +Doxyfile-gi: Doxyfile.in $(AM_V_GEN)$(SED) \ - -e 's,gironly=@internal,gironly=,' \ - -e 's,^\(GENERATE_HTML.*\)YES,\1NO,' \ - -e 's,^\(GENERATE_XML.*\)NO,\1YES,' \ - -e 's,^\(WARN_IF_UNDOCUMENTED.*\)YES,\1NO,' \ - -e 's,^\(SORT_MEMBER_DOCS.*\)YES,\1NO,' \ - -e 's,^\(SORT_BRIEF_DOCS.*\)YES,\1NO,' \ - $< > $@ || { $(RM) $@ && exit 1; } + -e 's,$(AT)top_srcdir$(AT),$(top_srcdir),' \ + -e 's,$(AT)top_builddir$(AT),$(top_builddir),' \ + -e 's,$(AT)VERSION$(AT),$(VERSION),' \ + -e 's,$(AT)GIRONLY$(AT),,' \ + -e 's,$(AT)HTML$(AT),NO,' \ + -e 's,$(AT)XML$(AT),YES,' \ + -e 's,$(AT)SORT$(AT),NO,' \ + $< > $@ || ( $(RM) -f $@ ; exit 1 ) # we depend on Doxyfile.stamp not have this run in parallel with it to avoid # concurrent Doxygen runs, which might overwrite each other's files @@ -145,7 +157,9 @@ ALL_LOCAL_TARGETS += geany-gtkdoc.h geany-sciwrappers-gtkdoc.h CLEAN_LOCAL_TARGETS += clean-gtkdoc-header-local clean-gtkdoc-header-local: - -rm -rf xml/ Doxyfile-gi Doxyfile-gi.stamp geany-gtkdoc.h geany-sciwrappers-gtkdoc.h + rm -rf xml/ \ + Doxyfile Doxyfile.stamp Doxyfile-gi Doxyfile-gi.stamp \ + geany-gtkdoc.h geany-sciwrappers-gtkdoc.h endif @@ -158,6 +172,7 @@ uninstall-local: rm -f $(DOCDIR)/html/index.html rm -f $(DOCDIR)/manual.txt rm -f $(DOCDIR)/ScintillaLicense.txt + rm -f $(DOCDIR)/LexillaLicense.txt # manually install some files under another name install-data-local: @@ -171,3 +186,4 @@ endif $(mkinstalldirs) $(DOCDIR) $(INSTALL_DATA) $(srcdir)/geany.txt $(DOCDIR)/manual.txt $(INSTALL_DATA) $(top_srcdir)/scintilla/License.txt $(DOCDIR)/ScintillaLicense.txt + $(INSTALL_DATA) $(top_srcdir)/scintilla/lexilla/License.txt $(DOCDIR)/LexillaLicense.txt diff --git a/doc/meson.build b/doc/meson.build new file mode 100644 index 0000000000..ed54b30792 --- /dev/null +++ b/doc/meson.build @@ -0,0 +1,138 @@ +configure_file( + input: 'geany.1.in', + output: 'geany.1', + install: true, + install_dir: join_paths(join_paths(prefix, get_option('mandir'), 'man1')), + configuration: cdata +) + +if rst2pdf.found() + custom_target('pdf-manual', + input: ['geany.txt'], + output: ['geany-@0@.pdf'.format(cdata.get('VERSION'))], + command: [rst2pdf, '@INPUT@', '-o', '@OUTPUT@'], + build_by_default: true + ) +endif + +tarball = run_command('test', '-f', 'geany.html', check: false) +if tarball.returncode() == 0 or rst2html.found() + install_data( + 'images/build_menu_commands_dialog.png', + 'images/find_dialog.png', + 'images/find_in_files_dialog.png', + 'images/main_window.png', + 'images/pref_dialog_edit_completions.png', + 'images/pref_dialog_edit_display.png', + 'images/pref_dialog_edit_features.png', + 'images/pref_dialog_edit_indentation.png', + 'images/pref_dialog_files.png', + 'images/pref_dialog_gen_misc.png', + 'images/pref_dialog_gen_startup.png', + 'images/pref_dialog_interface_interface.png', + 'images/pref_dialog_interface_notebook.png', + 'images/pref_dialog_interface_toolbar.png', + 'images/pref_dialog_keys.png', + 'images/pref_dialog_printing.png', + 'images/pref_dialog_templ.png', + 'images/pref_dialog_tools.png', + 'images/pref_dialog_various.png', + 'images/pref_dialog_vte.png', + 'images/replace_dialog.png', + install_dir: join_paths(cdata.get('GEANY_DOC_DIR'), 'html', 'images') + ) + if tarball.returncode() == 0 + message('Building from tarball, installing prebuild html') + geany_html = files('geany.html') + else + cmd = [rst2html, '-stg', '--stylesheet=@INPUT0@', '@INPUT1@', '@OUTPUT@'] + geany_html = custom_target('geany.html', + input: ['geany.css', 'geany.txt'], + output: ['geany.html'], + build_by_default: true, + command: cmd + ) + custom_target('hacking.html', + input: ['geany.css', '../HACKING'], + output: ['hacking.html'], + build_by_default: true, + command: cmd + ) + endif + # geany.html is installed as index.html + custom_target('index.html', + input: [geany_html], + output: ['index.html'], + command: [ln, '-f', '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: join_paths(cdata.get('GEANY_DOC_DIR'), 'html') + ) +endif + +install_data('geany.txt', + rename: 'manual.txt', + install_dir: cdata.get('GEANY_DOC_DIR') +) + +# Normally, doxygen is required for the gtkdoc headers +# but it can be disabled if really needed (e.g. if plugins are also disabled), +# packagers must not disable this! +if doxygen.found() + doxcfg = configuration_data() + doxcfg.merge_from(cdata) + doxcfg.set('GIRONLY', '@internal') + doxcfg.set('HTML', 'YES') + doxcfg.set('XML', 'NO') + doxcfg.set('SORT', 'YES') + + doxgicfg = doxcfg + doxgicfg.set('GIRONLY', '') + doxgicfg.set('HTML', 'NO') + doxgicfg.set('XML', 'YES') + doxgicfg.set('SORT', 'NO') + + dep_doxygen = files([ + 'plugins.dox', + 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c' + ]) + if python.found() + doxyfile_gi = configure_file( + input: 'Doxyfile.in', + output: 'Doxyfile-gi', + configuration: doxgicfg + ) + doxygen_gi = custom_target('doxygen-gi', + input: doxyfile_gi, + # stamp file due https://github.com/mesonbuild/meson/issues/2320 + output: 'doxygen-gi.stamp', + command: [sh, '-c', 'doxygen "$1" && touch "$2"', 'sh', '@INPUT@', '@OUTPUT@'], + depends: libgeany, + depend_files: dep_doxygen + ) + gtkdoc_py = find_program('../scripts/gen-api-gtkdoc.py') + custom_target('gtkdoc-headers', + output: ['geany-gtkdoc.h', 'geany-sciwrappers-gtkdoc.h'], + command: [gtkdoc_py, join_paths(meson.current_build_dir(), 'xml'), '-d', '.', '-o', '@OUTPUT0@', '--sci-output', '@OUTPUT1@'], + depends: doxygen_gi, + install: true, + install_dir: join_paths(get_option('includedir'), 'geany', 'gtkdoc') + ) + endif + doxyfile = configure_file( + input: 'Doxyfile.in', + output: 'Doxyfile', + configuration: doxcfg + ) + custom_target('doxygen', + input: doxyfile, + # stamp file due https://github.com/mesonbuild/meson/issues/2320 + output: 'doxygen.stamp', + command: [sh, '-c', 'doxygen "$1" && touch "$2"', 'sh', '@INPUT@', '@OUTPUT@'], + depends: libgeany, + depend_files: dep_doxygen, + build_by_default: true + ) +endif diff --git a/icons/24x24/Makefile.am b/icons/24x24/Makefile.am index 423b96983f..adf4c2b516 100644 --- a/icons/24x24/Makefile.am +++ b/icons/24x24/Makefile.am @@ -1,4 +1,9 @@ -icons_actionsdir = $(datadir)/icons/hicolor/24x24/actions +iconsdir = $(datadir)/icons/hicolor/24x24 +icons_appsdir = $(iconsdir)/apps +icons_actionsdir = $(iconsdir)/actions + +dist_icons_apps_DATA = \ + geany.png dist_icons_actions_DATA = \ geany-build.png \ diff --git a/icons/24x24/geany.png b/icons/24x24/geany.png new file mode 100644 index 0000000000..9d24f37e99 Binary files /dev/null and b/icons/24x24/geany.png differ diff --git a/icons/meson.build b/icons/meson.build new file mode 100644 index 0000000000..7cd0c68f45 --- /dev/null +++ b/icons/meson.build @@ -0,0 +1,46 @@ +icon_dirs = [ '16x16', '24x24', '32x32', '48x48', 'scalable' ] + +# in all resolutions +app_icon = 'geany' + +# in all resolutions +action_icons = [ + 'geany-build', + 'geany-close-all', + 'geany-save-all' +] + +icons_dir = join_paths(get_option('datadir'), 'icons', 'hicolor') +tango_dir = join_paths(get_option('datadir'), 'icons', 'Tango') + +foreach dir : icon_dirs + ext = dir == 'scalable' ? '.svg' : '.png' + install_data(join_paths(dir, app_icon+ext), install_dir: join_paths(icons_dir, dir, 'apps')) + foreach icon : action_icons + install_data(join_paths(dir, icon+ext), install_dir: join_paths(icons_dir, dir, 'actions')) + endforeach + install_data(join_paths('tango', dir, 'geany-save-all'+ext), install_dir: join_paths(tango_dir, dir, 'actions')) +endforeach + +# classviewer icons only in 16x16 +class_icons = [ + 'classviewer-class.png', + 'classviewer-macro.png', + 'classviewer-member.png', + 'classviewer-method.png', + 'classviewer-namespace.png', + 'classviewer-other.png', + 'classviewer-struct.png', + 'classviewer-var.png' +] + +foreach icon : class_icons + install_data(join_paths('16x16', icon), install_dir: join_paths(icons_dir, '16x16', 'apps')) +endforeach + +if meson.version().version_compare('>=0.57.0') + gnome.post_install(gtk_update_icon_cache: true) +else + warning('You may need to run `gtk-update-icon-cache` yourself after installing') + warning('E.g. gtk-update-icon-cache -f -t ' + join_paths(prefix, icons_dir)) +endif diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000..bbbaa7b33c --- /dev/null +++ b/meson.build @@ -0,0 +1,912 @@ +project('geany', 'c', 'cpp', + meson_version: '>= 0.53', + version: '1.38', + default_options : ['c_std=c11', 'cpp_std=c++17']) + +gnome = import('gnome') +pymod = import('python') + +cc = meson.get_compiler('c') +cxx = meson.get_compiler('cpp') +prefix = get_option('prefix') + +deps_in = [ + ['glib-2.0', '2.32'], + ['gmodule-2.0', '2.32'], + ['gtk+-3.0', '3.0'] +] + +deps = [] +deps_for_pc = '' +foreach dep : deps_in + deps += [dependency(dep[0], version: '>= ' + dep[1])] + deps_for_pc += ' ' + dep[0] + ' >= ' + dep[1] +endforeach + +glib = deps[0] + +# detect libc +glibc = false +if cc.has_header('gnu/libc-version.h') + glibc = true +endif + +gnu_source = glibc + +cdata = configuration_data() +check_headers = [ + 'alloca.h', + 'asprintf.h', + 'direct.h', + 'dirent.h', + 'dlfcn.h', + 'errno.h', + 'fcntl.h', + 'fnmatch.h', + 'glob.h', + 'inttypes.h', + 'io.h', + 'langinfo.h', + 'libintl.h', + 'limits.h', + 'locale.h', + 'memory.h', + 'stdbool.h', + 'sys/dir.h', + 'sys/stat.h', + 'sys/time.h', + 'sys/types.h', + 'unistd.h', + 'wchar.h', + 'wctype.h', +] + +check_functions = [ + ['alloca', '#include '], + ['asprintf', '#include '], + ['chsize', '#include '], + ['fnmatch', '#include '], + ['ftruncate', '#include '], + ['isblank', '#include '], + ['mbrtowc', '#include '], + ['memcpy', '#include '], + ['mkstemp', '#include '], + ['realpath', '#include \n#include '], + ['regcomp', '#include '], + ['socket', '#include '], + # man page says strings.h but we include only string.h and it works + ['strcasecmp', '#include '], + ['strncasecmp', '#include '], + ['stricmp', '#include '], + ['strnicmp', '#include '], + ['strerror', '#include '], + ['strstr', '#include '], + ['tempnam', '#include '], + ['truncate', '#include '], + ['wcrtomb', '#include '], + ['wcscoll', '#include '], + +] + +foreach h : check_headers + define = 'HAVE_' + h.underscorify().to_upper() + if cc.has_header(h) + cdata.set(define, 1) + else + cdata.set(define, false) + endif +endforeach + +foreach f : check_functions + define = 'HAVE_' + f.get(0).underscorify().to_upper() + ccprefix = '\n'.join([gnu_source ? '#define _GNU_SOURCE' : '', f.get(1)]) + if cc.has_function(f.get(0), prefix : ccprefix) + cdata.set(define, 1) + else + cdata.set(define, false) + endif +endforeach + +# From configure.ac: +# non-functions checks for u-ctags. Not that we really need those as we don't +# use u-ctags's main, but the corresponding macros have to be defined to +# something, so simply perform the actual checks. +#AC_CHECK_DECLS([__environ],,,[[#include ]]) +#AC_CHECK_DECLS([_NSGetEnviron],,,[[#include ]]) +# In meson we cannot as easily test for declarations so defining as 0 is easiest +cdata.set('HAVE_DECL___ENVIRON', 0) +cdata.set('HAVE_DECL__NSGETENVIRON', 0) + +cdata.set_quoted('PACKAGE', 'geany') +cdata.set_quoted('PACKAGE_BUGREPORT', 'https://github.com/geany/geany/issues') +cdata.set_quoted('PACKAGE_NAME','Geany') +cdata.set_quoted('PACKAGE_STRING', 'Geany ' + meson.project_version()) +cdata.set_quoted('PACKAGE_VERSION', meson.project_version()) +cdata.set('GETTEXT_PACKAGE', 'PACKAGE') +cdata.set('VERSION', meson.project_version()) +cdata.set('ENABLE_NLS', 1) +if (host_machine.system() == 'windows') + cdata.set('HAVE_VTE', false) +else + cdata.set('HAVE_VTE', get_option('vte')) +endif +cdata.set('HAVE_PLUGINS', get_option('plugins')) +cdata.set('HAVE_SOCKET', get_option('socket')) +if (host_machine.system() == 'windows') + cdata.set('GEANY_DATA_DIR', join_paths(prefix, 'data')) + cdata.set('GEANY_DOC_DIR', join_paths(prefix)) +else + cdata.set('GEANY_DATA_DIR', join_paths(prefix, get_option('datadir'), 'geany')) + cdata.set('GEANY_DOC_DIR', join_paths(prefix, get_option('datadir'), 'doc', 'geany')) +endif +cdata.set('top_srcdir', meson.source_root()) +cdata.set('top_builddir', meson.build_root()) + +# for geany.pc (adapted from GTK+) +pcconf = cdata +pcconf.set('DEPENDENCIES', deps_for_pc) +pcconf.set('prefix', get_option('prefix')) +pcconf.set('libdir', join_paths('${exec_prefix}', get_option('libdir'))) +pcconf.set('includedir', join_paths('${prefix}', get_option('includedir'))) +pcconf.set('datarootdir', join_paths('${prefix}', get_option('datadir'))) +# actually constant, just match autconf +pcconf.set('exec_prefix', '${prefix}') +pcconf.set('datadir', '${datarootdir}') +pcconf.set('localedir', join_paths('${datarootdir}', 'locale')) + +# needed programs +sh = find_program('sh') +cp = find_program('cp') +ln = find_program('ln') +doxygen = find_program('doxygen', required: get_option('api-docs')) +python = pymod.find_installation('python3', modules: doxygen.found() and get_option('gtkdoc') ? ['lxml'] : []) +# These two are truly optional +rst2html = find_program('rst2html', required: get_option('html-docs')) +rst2pdf = find_program('rst2pdf', required: get_option('pdf-docs')) +git = find_program('git', required: false) +if git.found() + ret = run_command(git, 'rev-parse', '--short', '--revs-only', 'HEAD', check: true) + cdata.set_quoted('REVISION', ret.stdout().strip()) +else + cdata.set_quoted('REVISION', '-1') +endif + +python_command = get_option('python-command') +if python_command == '' or python_command == 'auto' + if target_machine.system() == 'windows' + python_command = 'py' + else + python_command = 'python' + endif +endif +cdata.set('PYTHON_COMMAND', python_command) + +configure_file( + output : 'config.h', + configuration : cdata +) + +configure_file( + input: 'geany.pc.in', + install: true, + install_dir: join_paths(prefix, get_option('libdir'), 'pkgconfig'), + output: 'geany.pc', + configuration: pcconf +) + +# CFLAGS for basic stuff that only depends on libc +basic_cflags = [ '-DHAVE_CONFIG_H=1', '-O2' ] +if (gnu_source) + basic_cflags += '-D_GNU_SOURCE' +endif + +# CFLAGS common between Geany and bundled plugins +def_cflags = basic_cflags + [ + '-DGTK', +# we're using lots of deprecated stuff with gtk3 (often because there is no proper alternative!) + '-Wno-deprecated-declarations', + '-DGDK_DISABLE_DEPRECATION_WARNINGS', + '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32', + '-DGEANY_PREFIX="@0@"'.format(get_option('prefix')), + '-DGEANY_DOCDIR="@0@"'.format(join_paths(prefix, get_option('datadir'), 'doc')) +] +foreach d : [ 'includedir', 'libdir', 'libexecdir', 'datadir', 'localedir' ] + def_cflags += '-DGEANY_@0@="@1@"'.format(d.underscorify().to_upper(), join_paths(prefix, get_option(d))) +endforeach + +# CFLAGS for everything else, i.e. most of Geany +geany_cflags = def_cflags +have_gcc4_visibility = cc.has_argument('-fvisibility=hidden') +geany_cflags += '-DGEANY_PRIVATE' +if target_machine.system() == 'windows' + geany_cflags += '-DGEANY_EXPORT_SYMBOL=__declspec(dllexport)' +elif have_gcc4_visibility + geany_cflags += '-fvisibility=hidden' + geany_cflags += '-DGEANY_EXPORT_SYMBOL=__attribute__((visibility("default")))' +endif +geany_cflags += '-DGEANY_API_SYMBOL=GEANY_EXPORT_SYMBOL' +sci_cflags = geany_cflags +sci_cflags += [ '-std=c++17', '-Wno-non-virtual-dtor', '-DNDEBUG', '-DSCI_LEXER', '-DNO_CXX11_REGEX' ] + +iregex = include_directories('ctags/gnu_regex') +ifnmatch = include_directories('ctags/fnmatch') +ictags = include_directories('ctags/main', 'ctags/parsers', 'ctags/dsl') +itagmanager = include_directories('src/tagmanager') +iscintilla = include_directories('scintilla/include', 'scintilla/lexilla/include') +igeany = include_directories('src') + +install_headers( + 'scintilla/include/Scintilla.h', + 'scintilla/include/Scintilla.iface', + 'scintilla/include/ScintillaWidget.h', + 'scintilla/include/Sci_Position.h', + 'scintilla/lexilla/include/SciLexer.h', + subdir: 'geany/scintilla' +) + +lexilla = static_library('lexilla', + 'scintilla/lexilla/include/Lexilla.h', + 'scintilla/lexilla/include/SciLexer.h', + 'scintilla/lexilla/lexers/LexAbaqus.cxx', + 'scintilla/lexilla/lexers/LexAda.cxx', + 'scintilla/lexilla/lexers/LexAsciidoc.cxx', + 'scintilla/lexilla/lexers/LexAsm.cxx', + 'scintilla/lexilla/lexers/LexBash.cxx', + 'scintilla/lexilla/lexers/LexBasic.cxx', + 'scintilla/lexilla/lexers/LexBatch.cxx', + 'scintilla/lexilla/lexers/LexCaml.cxx', + 'scintilla/lexilla/lexers/LexCmake.cxx', + 'scintilla/lexilla/lexers/LexCOBOL.cxx', + 'scintilla/lexilla/lexers/LexCoffeeScript.cxx', + 'scintilla/lexilla/lexers/LexCPP.cxx', + 'scintilla/lexilla/lexers/LexCSS.cxx', + 'scintilla/lexilla/lexers/LexD.cxx', + 'scintilla/lexilla/lexers/LexDiff.cxx', + 'scintilla/lexilla/lexers/LexErlang.cxx', + 'scintilla/lexilla/lexers/LexForth.cxx', + 'scintilla/lexilla/lexers/LexGDScript.cxx', + 'scintilla/lexilla/lexers/LexFortran.cxx', + 'scintilla/lexilla/lexers/LexHaskell.cxx', + 'scintilla/lexilla/lexers/LexHTML.cxx', + 'scintilla/lexilla/lexers/LexJulia.cxx', + 'scintilla/lexilla/lexers/LexLaTeX.cxx', + 'scintilla/lexilla/lexers/LexLisp.cxx', + 'scintilla/lexilla/lexers/LexLua.cxx', + 'scintilla/lexilla/lexers/LexMake.cxx', + 'scintilla/lexilla/lexers/LexMarkdown.cxx', + 'scintilla/lexilla/lexers/LexMatlab.cxx', + 'scintilla/lexilla/lexers/LexNsis.cxx', + 'scintilla/lexilla/lexers/LexNull.cxx', + 'scintilla/lexilla/lexers/LexPascal.cxx', + 'scintilla/lexilla/lexers/LexPerl.cxx', + 'scintilla/lexilla/lexers/LexPO.cxx', + 'scintilla/lexilla/lexers/LexPowerShell.cxx', + 'scintilla/lexilla/lexers/LexProps.cxx', + 'scintilla/lexilla/lexers/LexPython.cxx', + 'scintilla/lexilla/lexers/LexR.cxx', + 'scintilla/lexilla/lexers/LexRuby.cxx', + 'scintilla/lexilla/lexers/LexRust.cxx', + 'scintilla/lexilla/lexers/LexSmalltalk.cxx', + 'scintilla/lexilla/lexers/LexSQL.cxx', + 'scintilla/lexilla/lexers/LexTCL.cxx', + 'scintilla/lexilla/lexers/LexTxt2tags.cxx', + 'scintilla/lexilla/lexers/LexVerilog.cxx', + 'scintilla/lexilla/lexers/LexVHDL.cxx', + 'scintilla/lexilla/lexers/LexYAML.cxx', + 'scintilla/lexilla/lexlib/Accessor.cxx', + 'scintilla/lexilla/lexlib/Accessor.h', + 'scintilla/lexilla/lexlib/CatalogueModules.h', + 'scintilla/lexilla/lexlib/CharacterCategory.cxx', + 'scintilla/lexilla/lexlib/CharacterCategory.h', + 'scintilla/lexilla/lexlib/CharacterSet.cxx', + 'scintilla/lexilla/lexlib/CharacterSet.h', + 'scintilla/lexilla/lexlib/DefaultLexer.cxx', + 'scintilla/lexilla/lexlib/DefaultLexer.h', + 'scintilla/lexilla/lexlib/LexAccessor.cxx', + 'scintilla/lexilla/lexlib/LexAccessor.h', + 'scintilla/lexilla/lexlib/LexerBase.cxx', + 'scintilla/lexilla/lexlib/LexerBase.h', + 'scintilla/lexilla/lexlib/LexerModule.cxx', + 'scintilla/lexilla/lexlib/LexerModule.h', + 'scintilla/lexilla/lexlib/LexerNoExceptions.cxx', + 'scintilla/lexilla/lexlib/LexerNoExceptions.h', + 'scintilla/lexilla/lexlib/LexerSimple.cxx', + 'scintilla/lexilla/lexlib/LexerSimple.h', + 'scintilla/lexilla/lexlib/OptionSet.h', + 'scintilla/lexilla/lexlib/PropSetSimple.cxx', + 'scintilla/lexilla/lexlib/PropSetSimple.h', + 'scintilla/lexilla/lexlib/SparseState.h', + 'scintilla/lexilla/lexlib/StringCopy.h', + 'scintilla/lexilla/lexlib/StyleContext.cxx', + 'scintilla/lexilla/lexlib/StyleContext.h', + 'scintilla/lexilla/lexlib/SubStyles.h', + 'scintilla/lexilla/lexlib/WordList.cxx', + 'scintilla/lexilla/lexlib/WordList.h', + 'scintilla/lexilla/src/Lexilla.cxx', + cpp_args: sci_cflags, + dependencies: deps, + include_directories: [ + iscintilla, + include_directories('scintilla/lexilla/lexlib', 'scintilla/lexilla/include') + ] +) +dep_lexilla = declare_dependency( + link_with: lexilla, + include_directories: include_directories('scintilla/lexilla/include') +) + +scintilla = static_library('scintilla', + 'scintilla/gtk/Converter.h', + 'scintilla/gtk/PlatGTK.cxx', + 'scintilla/gtk/ScintillaGTKAccessible.cxx', + 'scintilla/gtk/ScintillaGTKAccessible.h', + 'scintilla/gtk/ScintillaGTK.cxx', + 'scintilla/gtk/ScintillaGTK.h', + 'scintilla/gtk/scintilla-marshal.c', + 'scintilla/gtk/scintilla-marshal.h', + 'scintilla/include/ILexer.h', + 'scintilla/include/ILoader.h', + 'scintilla/include/ScintillaCall.h', + 'scintilla/include/Scintilla.h', + 'scintilla/include/ScintillaMessages.h', + 'scintilla/include/ScintillaStructures.h', + 'scintilla/include/ScintillaTypes.h', + 'scintilla/include/ScintillaWidget.h', + 'scintilla/include/Sci_Position.h', + 'scintilla/src/AutoComplete.cxx', + 'scintilla/src/AutoComplete.h', + 'scintilla/src/CallTip.cxx', + 'scintilla/src/CallTip.h', + 'scintilla/src/CaseConvert.cxx', + 'scintilla/src/CaseConvert.h', + 'scintilla/src/CaseFolder.cxx', + 'scintilla/src/CaseFolder.h', + 'scintilla/src/CellBuffer.cxx', + 'scintilla/src/CellBuffer.h', + 'scintilla/src/CharacterCategoryMap.cxx', + 'scintilla/src/CharacterCategoryMap.h', + 'scintilla/src/CharacterType.cxx', + 'scintilla/src/CharacterType.h', + 'scintilla/src/CharClassify.cxx', + 'scintilla/src/CharClassify.h', + 'scintilla/src/ContractionState.cxx', + 'scintilla/src/ContractionState.h', + 'scintilla/src/DBCS.cxx', + 'scintilla/src/DBCS.h', + 'scintilla/src/Debugging.h', + 'scintilla/src/Decoration.cxx', + 'scintilla/src/Decoration.h', + 'scintilla/src/Document.cxx', + 'scintilla/src/Document.h', + 'scintilla/src/EditModel.cxx', + 'scintilla/src/EditModel.h', + 'scintilla/src/Editor.cxx', + 'scintilla/src/Editor.h', + 'scintilla/src/EditView.cxx', + 'scintilla/src/EditView.h', + 'scintilla/src/ElapsedPeriod.h', + 'scintilla/src/FontQuality.h', + 'scintilla/src/Geometry.cxx', + 'scintilla/src/Geometry.h', + 'scintilla/src/Indicator.cxx', + 'scintilla/src/Indicator.h', + 'scintilla/src/KeyMap.cxx', + 'scintilla/src/KeyMap.h', + 'scintilla/src/LineMarker.cxx', + 'scintilla/src/LineMarker.h', + 'scintilla/src/MarginView.cxx', + 'scintilla/src/MarginView.h', + 'scintilla/src/Partitioning.h', + 'scintilla/src/PerLine.cxx', + 'scintilla/src/PerLine.h', + 'scintilla/src/Platform.h', + 'scintilla/src/PositionCache.cxx', + 'scintilla/src/PositionCache.h', + 'scintilla/src/Position.h', + 'scintilla/src/RESearch.cxx', + 'scintilla/src/RESearch.h', + 'scintilla/src/RunStyles.cxx', + 'scintilla/src/RunStyles.h', + 'scintilla/src/ScintillaBase.cxx', + 'scintilla/src/ScintillaBase.h', + 'scintilla/src/Selection.cxx', + 'scintilla/src/Selection.h', + 'scintilla/src/SparseVector.h', + 'scintilla/src/SplitVector.h', + 'scintilla/src/Style.cxx', + 'scintilla/src/Style.h', + 'scintilla/src/UniConversion.cxx', + 'scintilla/src/UniConversion.h', + 'scintilla/src/UniqueString.cxx', + 'scintilla/src/UniqueString.h', + 'scintilla/src/ViewStyle.cxx', + 'scintilla/src/ViewStyle.h', + 'scintilla/src/XPM.cxx', + 'scintilla/src/XPM.h', + cpp_args: sci_cflags, + dependencies: deps + [ dep_lexilla ], + include_directories: [ + iscintilla, + include_directories('scintilla/include', 'scintilla/src') + ] +) +dep_scintilla = declare_dependency( + link_with: scintilla, + include_directories: include_directories('scintilla/include') +) + +if cdata.get('HAVE_FNMATCH') == 1 + dep_fnmatch = dependency('', required: false) +else + # use fnmatch bundled with ctags + fnmatch = static_library('fnmatch', + 'ctags/fnmatch/fnmatch.c', + 'ctags/fnmatch/fnmatch.h', + include_directories: [ifnmatch], + c_args: basic_cflags + ) + dep_fnmatch = declare_dependency(link_with: [fnmatch], include_directories: [ifnmatch]) +endif + +if cdata.get('HAVE_REGCOMP') == 1 + dep_regex = dependency('', required: false) +else + # use regcomp bundled with ctags + regex = static_library('regex', + 'ctags/gnu_regex/regex.c', + 'ctags/gnu_regex/regex.h', + dependencies: [dep_fnmatch], + c_args: basic_cflags + [ '-D__USE_GNU' ] + ) + dep_regex = declare_dependency(link_with: [regex], include_directories: [iregex]) +endif + +ctags = static_library('ctags', + 'ctags/dsl/es.c', + 'ctags/dsl/es.h', + 'ctags/dsl/optscript.c', + 'ctags/dsl/optscript.h', + 'ctags/main/args.c', + 'ctags/main/args_p.h', + 'ctags/main/colprint.c', + 'ctags/main/colprint_p.h', + 'ctags/main/CommonPrelude.c', + 'ctags/main/ctags.h', + 'ctags/main/debug.c', + 'ctags/main/debug.h', + 'ctags/main/dependency.c', + 'ctags/main/dependency.h', + 'ctags/main/dependency_p.h', + 'ctags/main/e_msoft.h', + 'ctags/main/entry.c', + 'ctags/main/entry.h', + 'ctags/main/entry_p.h', + 'ctags/main/entry_private.c', + 'ctags/main/error.c', + 'ctags/main/error_p.h', + 'ctags/main/field.c', + 'ctags/main/field.h', + 'ctags/main/field_p.h', + 'ctags/main/flags.c', + 'ctags/main/flags_p.h', + 'ctags/main/fmt.c', + 'ctags/main/fmt_p.h', + 'ctags/main/gcc-attr.h', + 'ctags/main/general.h', + 'ctags/main/gvars.h', + 'ctags/main/htable.c', + 'ctags/main/htable.h', + 'ctags/main/inline.h', + 'ctags/main/interactive_p.h', + 'ctags/main/keyword.c', + 'ctags/main/keyword.h', + 'ctags/main/keyword_p.h', + 'ctags/main/kind.c', + 'ctags/main/kind.h', + 'ctags/main/kind_p.h', + 'ctags/main/lregex.c', + 'ctags/main/lregex-default.c', + 'ctags/main/lregex.h', + 'ctags/main/lregex_p.h', + 'ctags/main/lxpath.c', + 'ctags/main/lxpath.h', + 'ctags/main/lxpath_p.h', + 'ctags/main/main.c', + 'ctags/main/main_p.h', + 'ctags/main/mbcs.c', + 'ctags/main/mbcs.h', + 'ctags/main/mbcs_p.h', + 'ctags/main/mio.c', + 'ctags/main/mio.h', + 'ctags/main/nestlevel.c', + 'ctags/main/nestlevel.h', + 'ctags/main/numarray.c', + 'ctags/main/numarray.h', + 'ctags/main/objpool.c', + 'ctags/main/objpool.h', + 'ctags/main/options.c', + 'ctags/main/options.h', + 'ctags/main/options_p.h', + 'ctags/main/param.c', + 'ctags/main/param.h', + 'ctags/main/param_p.h', + 'ctags/main/parse.c', + 'ctags/main/parse.h', + 'ctags/main/parse_p.h', + 'ctags/main/parsers_p.h', + 'ctags/main/portable-dirent_p.h', + 'ctags/main/portable-scandir.c', + 'ctags/main/promise.c', + 'ctags/main/promise.h', + 'ctags/main/promise_p.h', + 'ctags/main/ptag.c', + 'ctags/main/ptag_p.h', + 'ctags/main/ptrarray.c', + 'ctags/main/ptrarray.h', + 'ctags/main/rbtree.c', + 'ctags/main/rbtree.h', + 'ctags/main/read.c', + 'ctags/main/read.h', + 'ctags/main/read_p.h', + 'ctags/main/repoinfo.c', + 'ctags/main/repoinfo.h', + 'ctags/main/routines.c', + 'ctags/main/routines.h', + 'ctags/main/routines_p.h', + 'ctags/main/script.c', + 'ctags/main/script_p.h', + 'ctags/main/seccomp.c', + 'ctags/main/selectors.c', + 'ctags/main/selectors.h', + 'ctags/main/sort.c', + 'ctags/main/sort_p.h', + 'ctags/main/stats.c', + 'ctags/main/stats_p.h', + 'ctags/main/strlist.c', + 'ctags/main/strlist.h', + 'ctags/main/subparser.h', + 'ctags/main/subparser_p.h', + 'ctags/main/tokeninfo.c', + 'ctags/main/tokeninfo.h', + 'ctags/main/trace.c', + 'ctags/main/trace.h', + 'ctags/main/trashbox.c', + 'ctags/main/trashbox.h', + 'ctags/main/trashbox_p.h', + 'ctags/main/types.h', + 'ctags/main/unwindi.c', + 'ctags/main/unwindi.h', + 'ctags/main/vstring.c', + 'ctags/main/vstring.h', + 'ctags/main/writer.c', + 'ctags/main/writer-ctags.c', + 'ctags/main/writer-etags.c', + 'ctags/main/writer-json.c', + 'ctags/main/writer_p.h', + 'ctags/main/writer-xref.c', + 'ctags/main/xtag.c', + 'ctags/main/xtag.h', + 'ctags/main/xtag_p.h', + 'ctags/parsers/abaqus.c', + 'ctags/parsers/abc.c', + 'ctags/parsers/asciidoc.c', + 'ctags/parsers/asm.c', + 'ctags/parsers/basic.c', + 'ctags/parsers/bibtex.c', + 'ctags/parsers/cobol.c', + 'ctags/parsers/cpreprocessor.c', + 'ctags/parsers/cpreprocessor.h', + 'ctags/parsers/css.c', + 'ctags/parsers/cxx/cxx.c', + 'ctags/parsers/cxx/cxx_debug.c', + 'ctags/parsers/cxx/cxx_debug.h', + 'ctags/parsers/cxx/cxx_debug_type.c', + 'ctags/parsers/cxx/cxx_keyword.c', + 'ctags/parsers/cxx/cxx_keyword.h', + 'ctags/parsers/cxx/cxx_parser_block.c', + 'ctags/parsers/cxx/cxx_parser.c', + 'ctags/parsers/cxx/cxx_parser_function.c', + 'ctags/parsers/cxx/cxx_parser.h', + 'ctags/parsers/cxx/cxx_parser_internal.h', + 'ctags/parsers/cxx/cxx_parser_lambda.c', + 'ctags/parsers/cxx/cxx_parser_namespace.c', + 'ctags/parsers/cxx/cxx_parser_template.c', + 'ctags/parsers/cxx/cxx_parser_tokenizer.c', + 'ctags/parsers/cxx/cxx_parser_typedef.c', + 'ctags/parsers/cxx/cxx_parser_using.c', + 'ctags/parsers/cxx/cxx_parser_variable.c', + 'ctags/parsers/cxx/cxx_qtmoc.c', + 'ctags/parsers/cxx/cxx_scope.c', + 'ctags/parsers/cxx/cxx_scope.h', + 'ctags/parsers/cxx/cxx_subparser.c', + 'ctags/parsers/cxx/cxx_subparser.h', + 'ctags/parsers/cxx/cxx_subparser_internal.h', + 'ctags/parsers/cxx/cxx_tag.c', + 'ctags/parsers/cxx/cxx_tag.h', + 'ctags/parsers/cxx/cxx_token.c', + 'ctags/parsers/cxx/cxx_token_chain.c', + 'ctags/parsers/cxx/cxx_token_chain.h', + 'ctags/parsers/cxx/cxx_token.h', + 'ctags/parsers/diff.c', + 'ctags/parsers/erlang.c', + 'ctags/parsers/flex.c', + 'ctags/parsers/gdscript.c', + 'ctags/parsers/geany_c.c', + 'ctags/parsers/geany_docbook.c', + 'ctags/parsers/geany_fortran.c', + 'ctags/parsers/geany_lcpp.c', + 'ctags/parsers/geany_lcpp.h', + 'ctags/parsers/geany_markdown.c', + 'ctags/parsers/geany_matlab.c', + 'ctags/parsers/geany_tcl.c', + 'ctags/parsers/geany_tex.c', + 'ctags/parsers/geany_vhdl.c', + 'ctags/parsers/go.c', + 'ctags/parsers/haskell.c', + 'ctags/parsers/haxe.c', + 'ctags/parsers/html.c', + 'ctags/parsers/iniconf.c', + 'ctags/parsers/iniconf.h', + 'ctags/parsers/jscript.c', + 'ctags/parsers/json.c', + 'ctags/parsers/julia.c', + 'ctags/parsers/lua.c', + 'ctags/parsers/make.c', + 'ctags/parsers/make.h', + 'ctags/parsers/nsis.c', + 'ctags/parsers/objc.c', + 'ctags/parsers/pascal.c', + 'ctags/parsers/perl.c', + 'ctags/parsers/perl.h', + 'ctags/parsers/php.c', + 'ctags/parsers/powershell.c', + 'ctags/parsers/python.c', + 'ctags/parsers/r.c', + 'ctags/parsers/r.h', + 'ctags/parsers/rst.c', + 'ctags/parsers/ruby.c', + 'ctags/parsers/rust.c', + 'ctags/parsers/sh.c', + 'ctags/parsers/sql.c', + 'ctags/parsers/txt2tags.c', + 'ctags/parsers/verilog.c', + c_args: geany_cflags + [ '-DG_LOG_DOMAIN="CTags"', + '-DEXTERNAL_PARSER_LIST_FILE="src/tagmanager/tm_parsers.h"' ], + dependencies: deps + [dep_fnmatch, dep_regex], + include_directories: [ictags] +) +dep_ctags = declare_dependency(link_with: [ctags], include_directories: [ictags]) + +install_headers( + 'src/tagmanager/tm_source_file.h', + 'src/tagmanager/tm_tag.h', + 'src/tagmanager/tm_workspace.h', + 'src/tagmanager/tm_parser.h', + subdir: 'geany/tagmanager' +) + +tagmanager = static_library('tagmanager', + 'src/tagmanager/tm_ctags.h', + 'src/tagmanager/tm_ctags.c', + 'src/tagmanager/tm_parser.h', + 'src/tagmanager/tm_parser.c', + 'src/tagmanager/tm_parsers.h', + 'src/tagmanager/tm_source_file.h', + 'src/tagmanager/tm_source_file.c', + 'src/tagmanager/tm_tag.h', + 'src/tagmanager/tm_tag.c', + 'src/tagmanager/tm_workspace.h', + 'src/tagmanager/tm_workspace.c', + c_args: geany_cflags + [ '-DG_LOG_DOMAIN="Tagmanager"' ], + dependencies: [dep_ctags, glib] +) +dep_tagmanager = declare_dependency( + link_with: tagmanager, + include_directories: [itagmanager] +) + +# Generate signallist.i +gen_src = custom_target('gen-signallist', + input : [ 'data/geany.glade' ], + output : [ 'signallist.i' ], + command : [find_program('scripts/gen-signallist.sh'), '@INPUT@', '@OUTPUT@' ] +) + +win_src = [] +win_deps = [] +if (host_machine.system() == 'windows') + win_src += [ 'src/win32.c', 'src/win32.h' ] + foreach lib : ['ole32', 'wsock32', 'comdlg32'] + win_deps += cc.find_library(lib) + endforeach +endif + +install_headers( + 'plugins/geanyfunctions.h', + 'plugins/geanyplugin.h', + 'src/app.h', + 'src/build.h', + 'src/dialogs.h', + 'src/document.h', + 'src/editor.h', + 'src/encodings.h', + 'src/filetypes.h', + 'src/geany.h', + 'src/gtkcompat.h', + 'src/highlighting.h', + 'src/keybindings.h', + 'src/main.h', + 'src/msgwindow.h', + 'src/navqueue.h', + 'src/plugindata.h', + 'src/pluginutils.h', + 'src/prefs.h', + 'src/project.h', + 'src/sciwrappers.h', + 'src/search.h', + 'src/spawn.h', + 'src/stash.h', + 'src/support.h', + 'src/symbols.h', + 'src/templates.h', + 'src/toolbar.h', + 'src/ui_utils.h', + 'src/utils.h', + subdir: 'geany' +) + +libgeany = shared_library('geany', + 'src/about.c', + 'src/about.h', + 'src/app.h', + 'src/build.c', + 'src/build.h', + 'src/callbacks.c', + 'src/callbacks.h', + 'src/dialogs.c', + 'src/dialogs.h', + 'src/document.c', + 'src/document.h', + 'src/editor.c', + 'src/editor.h', + 'src/encodings.c', + 'src/encodings.h', + 'src/filetypes.c', + 'src/filetypes.h', + 'src/geanyentryaction.c', + 'src/geanyentryaction.h', + 'src/geanymenubuttonaction.c', + 'src/geanymenubuttonaction.h', + 'src/geanyobject.c', + 'src/geanyobject.h', + 'src/geanywraplabel.c', + 'src/geanywraplabel.h', + 'src/gtkcompat.h', + 'src/highlighting.c', + 'src/highlighting.h', + 'src/highlightingmappings.h', + 'src/keybindings.c', + 'src/keybindings.h', + 'src/keyfile.c', + 'src/keyfile.h', + 'src/log.c', + 'src/log.h', + 'src/libmain.c', + 'src/main.h', + 'src/geany.h', + 'src/msgwindow.c', + 'src/msgwindow.h', + 'src/navqueue.c', + 'src/navqueue.h', + 'src/notebook.c', + 'src/notebook.h', + 'src/plugins.c', + 'src/plugins.h', + 'src/pluginutils.c', + 'src/pluginutils.h', + 'src/prefs.c', + 'src/prefs.h', + 'src/printing.c', + 'src/printing.h', + 'src/project.c', + 'src/project.h', + 'src/sciwrappers.c', + 'src/sciwrappers.h', + 'src/search.c', + 'src/search.h', + 'src/socket.c', + 'src/socket.h', + 'src/spawn.c', + 'src/spawn.h', + 'src/stash.c', + 'src/stash.h', + 'src/support.h', + 'src/symbols.c', + 'src/symbols.h', + 'src/templates.c', + 'src/templates.h', + 'src/toolbar.c', + 'src/toolbar.h', + 'src/tools.c', + 'src/tools.h', + 'src/sidebar.c', + 'src/sidebar.h', + 'src/ui_utils.c', + 'src/ui_utils.h', + 'src/utils.c', + 'src/utils.h', + gen_src, + win_src, + host_machine.system() == 'windows' ? ['src/win32.c', 'src/win32.h'] : [ 'src/vte.c', 'src/vte.h' ], + soversion: '0', + c_args: geany_cflags + [ '-DG_LOG_DOMAIN="Geany"' ], + include_directories: [iscintilla], + dependencies: [dep_tagmanager, dep_ctags, dep_scintilla] + deps + win_deps, + install: true +) +dep_libgeany = declare_dependency( + link_with: libgeany, + include_directories: [igeany] +) + +executable('geany', + 'src/main.c', + link_with: libgeany, + c_args: geany_cflags + [ '-DG_LOG_DOMAIN="Geany"' ], + dependencies: deps, + build_rpath: meson.build_root(), + install_rpath: '$ORIGIN/../' + get_option('libdir'), + install: true +) + +i18n = import('i18n') + +desktop_file = 'geany.desktop' +desktop_output_file = i18n.merge_file( + type: 'desktop', + input: desktop_file + '.in', + output: desktop_file, + po_dir: 'po', + install: true, + install_dir: join_paths(get_option('datadir'), 'applications') +) + +subdir('po') +subdir('data') +subdir('doc') +subdir('icons') +subdir('plugins') +subdir('tests') + +install_data('COPYING', rename: 'GPL-2') +install_data( + 'scintilla/License.txt', + 'scintilla/lexilla/License.txt', + rename: [ + 'ScintillaLicense.txt', + 'LexillaLicense.txt' + ], + install_dir: cdata.get('GEANY_DOC_DIR') +) +misc = [ + 'AUTHORS', + 'COPYING', + 'ChangeLog', + 'NEWS', + 'README', + 'THANKS', + 'TODO' +] +install_data(misc, install_dir: cdata.get('GEANY_DOC_DIR')) +if host_machine.system() == 'windows' +misc_rename = [ + 'Authors.txt', + 'Changelog.txt', + 'Copying.txt', + 'Readme.txt', + 'News.txt', + 'Thanks.txt', + 'Todo.txt' +] +install_data(misc, install_dir: prefix, rename: misc_rename) +endif diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000000..c0bdd85e23 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,8 @@ +option('html-docs', type : 'feature', description : 'enable to generate HTML documentation using rst2html') +option('pdf-docs', type : 'feature', description : 'enable to generate PDF documentation using rst2pdf') +option('vte', type : 'boolean', description : 'enable if you want virtual terminal support') +option('plugins', type : 'boolean', description : 'enable if you want plugin support') +option('api-docs', type : 'feature', description : 'enable to generate API documentation using Doxygen') +option('gtkdoc', type : 'boolean', description : 'enable to generate gtk-doc compatible headers for the API') +option('python-command', type: 'string', description: 'the default Python command') +option('socket', type: 'boolean', description: 'enable if you want to detect a running instance') diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 44cf3ff9ee..5460ca5a28 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -43,7 +43,7 @@ saveactions_la_SOURCES = saveactions.c filebrowser_la_SOURCES = filebrowser.c splitwindow_la_SOURCES = splitwindow.c -demoplugin_la_CFLAGS = -DG_LOG_DOMAIN=\""Demoplugin"\" -DLOCALEDIR=\""$(LOCALEDIR)"\" +demoplugin_la_CFLAGS = -DG_LOG_DOMAIN=\""Demoplugin"\" demoproxy_la_CFLAGS = -DG_LOG_DOMAIN=\""Demoproxy"\" classbuilder_la_CFLAGS = -DG_LOG_DOMAIN=\""Classbuilder"\" htmlchars_la_CFLAGS = -DG_LOG_DOMAIN=\""HTMLChars"\" @@ -64,10 +64,9 @@ splitwindow_la_LIBADD = $(top_builddir)/src/libgeany.la $(GTK_LIBS) endif # PLUGINS if MINGW -# FIXME: why is this define different than the non-MINGW one? -AM_CPPFLAGS = -DGEANY_DATADIR=\"data\" +AM_CPPFLAGS = -DGEANY_DATADIR=\"data\" -DGEANY_LOCALEDIR=\"\" else -AM_CPPFLAGS = -DDATADIR=\"$(datadir)\" +AM_CPPFLAGS = -DGEANY_DATADIR=\"$(datadir)\" -DGEANY_LOCALEDIR=\""$(localedir)"\" endif AM_CPPFLAGS += \ diff --git a/plugins/classbuilder.c b/plugins/classbuilder.c index 6db036b12e..a5d382a455 100644 --- a/plugins/classbuilder.c +++ b/plugins/classbuilder.c @@ -31,7 +31,7 @@ GeanyData *geany_data; PLUGIN_VERSION_CHECK(GEANY_API_VERSION) -PLUGIN_SET_INFO(_("Class Builder"), _("Creates source files for new class types."), VERSION, +PLUGIN_SET_INFO(_("Class Builder"), _("Creates source files for new class types."), PACKAGE_VERSION, "Alexander Rodin, Ondrej Donek, the Geany developer team") diff --git a/plugins/demoplugin.c b/plugins/demoplugin.c index 171a5113c3..15d4ef6fa1 100644 --- a/plugins/demoplugin.c +++ b/plugins/demoplugin.c @@ -30,6 +30,9 @@ * - it will be loaded at next startup. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include "geanyplugin.h" /* plugin API, always comes first */ #include "Scintilla.h" /* for the SCNotification struct */ @@ -216,7 +219,7 @@ static void demo_cleanup(GeanyPlugin *plugin, gpointer data) void geany_load_module(GeanyPlugin *plugin) { /* main_locale_init() must be called for your package before any localization can be done */ - main_locale_init(LOCALEDIR, GETTEXT_PACKAGE); + main_locale_init(GEANY_LOCALEDIR, GETTEXT_PACKAGE); plugin->info->name = _("Demo"); plugin->info->description = _("Example plugin."); plugin->info->version = "0.4"; diff --git a/plugins/export.c b/plugins/export.c index c9d1f13d87..1d5e813a12 100644 --- a/plugins/export.c +++ b/plugins/export.c @@ -33,8 +33,8 @@ GeanyData *geany_data; PLUGIN_VERSION_CHECK(GEANY_API_VERSION) -PLUGIN_SET_INFO(_("Export"), _("Exports the current file into different formats."), VERSION, - _("The Geany developer team")) +PLUGIN_SET_INFO(_("Export"), _("Exports the current file into different formats."), + PACKAGE_VERSION, _("The Geany developer team")) static GtkWidget *main_menu_item = NULL; @@ -50,7 +50,7 @@ static GtkWidget *main_menu_item = NULL; \n\ {export_filename}\n\ \n\ - \n\ + \n\ \n\