Port to the meson build system.
Benefits are blazing fast builds and more user friendly configuration. This is promised by meson and I would agree in the case of Geany.
This is a work-in-progress. I have ported only the GTK3 build (GTK2 about to be phased out anyway) and didn't test OSX or Windows yet. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2761
-- Commit Summary --
* Initial meson.build * Support l18n * Support plugins * Support generating geany.pc * Simplified installing data * Install some extra files that are renamed in the process * fixes for 1.36 * missing files to git * update for 1.38/2.0 * add build dirs to .gitignore
-- File Changes --
M .gitignore (2) A config.h.meson (340) A data/meson.build (17) A meson.build (629) A meson_options.txt (2) M plugins/Makefile.am (7) M plugins/classbuilder.c (2) M plugins/demoplugin.c (5) M plugins/export.c (8) M plugins/filebrowser.c (4) M plugins/htmlchars.c (4) A plugins/meson.build (27) M plugins/saveactions.c (2) M plugins/splitwindow.c (2) A po/meson.build (7) A scripts/gen-signallist.sh (6) M src/libmain.c (4) M src/templates.c (2) M src/utils.c (2)
-- Patch Links --
https://github.com/geany/geany/pull/2761.patch https://github.com/geany/geany/pull/2761.diff
@techee can you help with the OSX parts? I can try to enable travis builds but I don't have access to a running OSX system.
@kugel- pushed 1 commit.
2bd80676b9d75783aa24aa8c63376c2f06a03afb travis for meson
@kugel- pushed 1 commit.
cf411fc5c7f3e32bea78f3e32431bca84f09652b Fix travis
@kugel- pushed 1 commit.
b3d157714e29e733ccbc067412f46debd7048fb0 meson 0.45 compat and -O2
@b4n @eht16 @codebrainz Any interested? If not I might just merge this, since Autotools support is not affected and I would like to see if we can get frictionless Windows builds.
I don't know Meson and didn't review the Meson related changes. But the rest looks OK, I guess preferring `PACKAGE_VERSION` over `VERSION` is better for Meson and doesn't matter for Autotools?
Would it help for the Windows part to merge it first?
Well I don't like to spend even more time on it while it's unclear whether it's going to be merged or not. In that sense, yes it helps because I have no fear that the time is wasted.
Needs to update docs describing how to use the meson build system with Geany, otherwise nobody will use it because its not documented.
README HACKING INSTALL geany.txt
all cover various parts of autofools and need meson instructions too. Suggest you cover it in detail (commands, options, prefixes, and other stuff those docs cover) in one place, then refer to that from the others. That will avoid issues of inconsistent and missing information in different places.
Fresh clone, applied your PR.
``` cd /home/lex/geany-meson/geany meson --prefix=/home/lex/geany-meson build meson compile -C build meson install -C build ```
Warning while compiling makes geany.pc unusable
``` meson.build:82: WARNING: The variable(s) 'DEPENDENCIES', 'VERSION', 'datadir', 'datarootdir', 'exec_prefix', 'includedir', 'libdir', 'localedir', 'prefix' in the input file 'geany.pc.in' are not present in the given configuration data. ```
Won't run after install ``` ./geany: error while loading shared libraries: libgeany.so.0: cannot open shared object file: No such file or directory ```
Should be at least working in a basic manner before merge.
Seems meson installs .so files to `$PREFIX/lib/x86_64-linux-gnu` not `$PREFIX/lib`. Linking from `$PREFIX/lib/libgeany.so.0` works, but needs to be fixed properly.
Interesting. What OS are you running? I'm on Arch linux, and it installs to $PREFIX/lib and runs fine.
I guess ld-linux does not pick up $PREFIX/lib/x86_64-linux-gnu for non-standard $PREFIXes by default. Is there any configuration around this?
Thanks for the test!
Sorry, Linux Mint 20 meson 0.54
Possibly needs DT_RUNPATH set correctly, presumably thats why ld-linux looks in $PREFIX/lib since I have no LD_LIBRARY_PATH set.
@elextr commented on this pull request.
- 'src/utils.h',
+ 'src/vte.c', + 'src/vte.h', + gen_src, + soversion: '0', + c_args: geany_cflags, + include_directories: [iscintilla], + dependencies: [dep_tagmanager, dep_ctags, dep_scintilla] + deps, + install: true) + +executable('geany', 'src/main.c', + link_with: libgeany, + c_args: geany_cflags, + dependencies: [dep_ctags] + deps, + build_rpath: meson.build_root(), + install_rpath: join_paths(prefix, 'lib'),
@kugel- here is why rpath is set to `$PREFIX/lib` but I can't find how in meson docs to find where libraries are installed but clearly its different for different systems but this needs to be set to it (or the install set).
@elextr commented on this pull request.
- 'src/utils.h',
+ 'src/vte.c', + 'src/vte.h', + gen_src, + soversion: '0', + c_args: geany_cflags, + include_directories: [iscintilla], + dependencies: [dep_tagmanager, dep_ctags, dep_scintilla] + deps, + install: true) + +executable('geany', 'src/main.c', + link_with: libgeany, + c_args: geany_cflags, + dependencies: [dep_ctags] + deps, + build_rpath: meson.build_root(), + install_rpath: join_paths(prefix, 'lib'),
Maybe `shared_library()` takes `install-dir:`?
@kugel- pushed 5 commits.
3d73cdd7d30a35adfbb85cf09e9b4cc51bb001c9 fix geany.pc 16249f54708c3f98f5d99589972ffabcaa2e9b5e hopefully fix debian/ubuntu c022ca856713f9d2891e39bf2914946d0be814f6 fix internal dependencies f9765e9a1035aed8b9c63c84cb37529090a6b7f9 tiny cleanup a772beb02032011c6bdbb5da336bb7fe588a0012 mingw workaround (FIXME)
@kugel- pushed 1 commit.
197d264d0a62f35eff5554a7bc68495b9148fff1 truly fix debian/ubuntu
I support @elextr's request for docs, https://github.com/geany/geany/pull/2761#issuecomment-809698447 helped.
On configure, I got: ``` po/meson.build:6:4: ERROR: Problem encountered: /bin/sh: 1: gawk: not found ``` which seems to be a new dependency. As it is just used (AFAIK) to generate a list of names of the available languages, this can done also with a Python oneliner or maybe even with Meson itself?
At the end of the compilation I got a few warnings which might be interesting: ``` msgfmt: ../po/LINGUAS does not exist ../geany.desktop.in:5:0: warning: invalid non-blank line ../geany.desktop.in:6:0: warning: invalid non-blank line ../geany.desktop.in:7:0: warning: invalid non-blank line ../geany.desktop.in:14:0: warning: invalid non-blank line [247/247] Linking target plugins/libsplitwindow.so meson compile -C build 464.85s user 38.27s system 353% cpu 2:22.13 total ``` Tested on ArchLinux and Debian Testing.
For reference, here is my `geany.desktop.in`: ``` [Desktop Entry] Type=Application Version=1.0 _Name=Geany _GenericName=Integrated Development Environment _Comment=A fast and lightweight IDE using GTK+ Exec=geany %F Icon=geany Terminal=false Categories=GTK;Development;IDE;TextEditor; MimeType=text/plain;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;text/x-java;text/x-dsrc;text/x-pascal;text/x-perl;text/x-python;application/x-php;application/x-httpd-php3;application/x-httpd-php4;application/x-httpd-php5;application/xml;text/html;text/css;text/x-sql;text/x-diff; StartupNotify=true _Keywords=Text;Editor; ```
Basic build WFM.
Lots of warnings like: ``` ../src/highlighting.c:1140:3: note: in expansion of macro ‘styleset_case’ 1140 | styleset_case(VERILOG); | ^~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gmacros.h:820:42: warning: division ‘sizeof (HLProperty * {aka struct <anonymous> *}) / sizeof (HLProperty {aka struct <anonymous>})’ does not compute the number of array elements [-Wsizeof-pointer-div] 820 | #define G_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0])) ``` and GTK deprecation warnings.
These don't happen with autotools build, probably missing some compiler options we set somewhere in autotools.
Runtime messages: ``` ** (geany:39502): WARNING **: 12:06:58.868: failed to load icon 'classviewer-var': Icon 'classviewer-var' not present in theme Mint-Y-Dark
** (geany:39502): WARNING **: 12:06:58.868: failed to load icon 'classviewer-method': Icon 'classviewer-method' not present in theme Mint-Y-Dark ```
probably not installing some icons or installing in the wrong place.
Geany plugins with autotools configures against Geany built with meson but fails to build:
``` CC libgeanypluginutils_la-filelist.lo filelist.c:27:10: fatal error: geanyplugin.h: No such file or directory 27 | #include <geanyplugin.h> | ^~~~~~~~~~~~~~~ ```
because meson build of geany did not install anything to `$PREFIX/include/geany`
PS plugins that are in Geany repo build and run, but I can't live without Enricos add-ons :-)
Thanks for your feedback!
This is still a WIP and a lot of stuff is missing. I'll try to fix all of that, but what I want is a clear sign that I won't waste my time because nobody would approve this. I have too much other stuff rotting in PRs already.
but what I want is a clear sign that I won't waste my time because nobody would approve this.
What do you think I'm testing and commenting on it for? Or are you saying I've wasted my time because you won't finish the job.
When its a reasonable replacement for autotools I will merge it even if only for Linux initially, but its not there yet.
Thanks that was the clear sign I was waiting for. Apparently it was not clear enough yet :-) I'll work on it further then.
Btw, I could also offer my own build system, https://github.com/kugel-/kmake/, this replaces Automake by pure (GNU) make. It's a huge improvement over Automake (accurate dependencys, no busted checkouts by badly generated Makefiles and more). But I'm not sure it's truly useful for Geany because Geany's pain is more on the autoconf than on the Automake side and kmake isn't really tested for Windows stuff.
I do use kmake for Peasy though and it's great (and peasy is much more than compiling C files)
@kugel- pushed 3 commits.
887c219d65abaef5468bb99620a73b0f815393a8 define GEANY_DATA_DIR 90ead17dfac30208c70782b56f112979d9d87646 generate geany.pc so that it contains palceholders 2726fb4950096b5f7cfecc6fde40935c03c8868f install headers to allow for G-P
@kugel- pushed 1 commit.
3380d1072edc3c2b6363e7d3250c010dcd4536a3 initial docs
@kugel- pushed 1 commit.
ec88291a8dea2f3bf231933c1d20e89f2ed20488 added missing file
@kugel- pushed 1 commit.
3f26c8820ef6b0e42f5094a291b1db02c24c22c4 rework i18n support to not use wildcard sources
@eht16 In fact, `gawk` is not a new depedency, it's already needed by `geany-i18n-m4`. but I still replaced the offending statement because meson discourages from listing source files via wildcards.
@kugel- pushed 3 commits.
5061b593d08c7b25d57afb632d918b4e0be4c3c2 fixed geany.1 man page 9e8f79e956c00b759f7abd39499397e9c417b10a Doxyfile per Makefile anstat per configure 0168e6feb0d4332d1d12b331700b1595a5d55328 meson: doc completed
@kugel- pushed 1 commit.
104da1196c354096e1566edd2938ee7292282322 meson compat fix
@kugel- pushed 1 commit.
7315a62ee8e9af15b9b3e428ad792cabc3069a9b tests
Not sure if this is ready for re-test but tried it anyway :-).
Had to set `-Dgtkdoc=false`, what tool is needed for that?
Geany plugins now build if configured `--prefix=/home/lex/geany_meson --with-geany-libdir=/home/lex/geany_meson/lib` and install to `$PREFIX/lib/geany` but do not appear in plugin manager.
The plugins that are part of geany are installed in `$PREFIX/lib/x86_64-linux-gnu/geany` and do appear, but geany-plugins won't configure with `--with-geany-libdir=/home/lex/geany_meson/lex/x86_64-linux-gnu`.
So it looks like another mixed up libdir problem.
Still has [classviewer icons](https://github.com/geany/geany/pull/2761#issuecomment-813147411) messages at runtime, added checkbox as reminder.
Geany plugins now build if configured --prefix=/home/lex/geany_meson --with-geany-libdir=/home/lex/geany_meson/lib and install to $PREFIX/lib/geany but do not appear in plugin manager.
You have to use the correct libdir, obviously, i.e. `--with-geany-libdir=/home/lex/geany_meson/lib/x86_64-linux-gnu`. Typically you avoid setting `--with-geany-libdir` and instead point pkg-config to the correct `geany.pc`. Under ubuntu, geany.pc has this line: `libdir=${exec_prefix}/lib/x86_64-linux-gnu`
I configure G-P like this:
`./configure PKG_CONFIG_PATH=/home/kugel/dev/geany.git/build-meson/dest/lib/pkgconfig --prefix=/home/kugel/dev/geany.git/build-meson/dest/`.
IMO, the `PKG_CONFIG_PATH` ought to be enough and the prefix should follow automatically but that's not how G-P configure works currenty
Still has classviewer icons messages at runtime, added checkbox as reminder.
I don't see that; weird, but since I don't do anything to install those yet, I guess there is something missing. Maybe my meson-geany gets the icons from my system-geany from /usr/local/... ?
@kugel- pushed 1 commit.
155a268d6e3912bf062947d8bed346a26f50c11b fix tests and travis
Geany plugins now build if configured --prefix=/home/lex/geany_meson --with-geany-libdir=/home/lex/geany_meson/lib and install to $PREFIX/lib/geany but do not appear in plugin manager.
You have to use the correct libdir, obviously, i.e. --with-geany-libdir=/home/lex/geany_meson/lib/x86_64-linux-gnu. Typically you avoid setting --with-geany-libdir and instead point pkg-config to the correct geany.pc. Under ubuntu, geany.pc has this line: libdir=${exec_prefix}/lib/x86_64-linux-gnu
As I said configuring ` --with-geany-libdir=/home/lex/geany_meson/lib/x86_64-linux-gnu` fails. According to @hyperair when this option was added, this is the "proper" way of configuring this for Debian and derivative systems. But anyway until G-P is mesoned (meson subprojects might be a good fit?) it needs to work.
On this system _all_ the system pkg-configs are under `x86_64-linux-gnu/pkgconfig` so a geany installed to the system would be out of place and not found if it installed in `lib/pkgconfig`.
It seems like there are still things being installed in a mixture of `lib` and `lib/x86_64-linux-gnu` whereas it should all be the latter if thats the system default determined by meson. I guess its hard to notice on your system if `lib` is the default, but the meson build should never force `lib`.
Maybe my meson-geany gets the icons from my system-geany from /usr/local/... ?
The advantage of my habit of _only_ using prefixed geanys and having no system install :-)
The meson build isn't installing `$PREFIX/share/icons` which is likely the problem.
Thanks, I'll check again
Ping.
I fixed the icons and then got distracted. I'm on the libdir issue now
As I said configuring --with-geany-libdir=/home/lex/geany_meson/lib/x86_64-linux-gnu fails.
Can you please paste the exact error message?
@kugel- pushed 2 commits.
0956ad3d1ceaef94d9c2185e2355bdb40a99afdd install icons 73ab535417c5bdaca85ae3116ad88a140825c2d6 fix compile and gaeny.pc location
mentioned on IRC, just FTR
``` checking for GEANY... no configure: error: Package requirements (geany >= 1.29) were not met:
No package 'geany' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. ```
Neat, plugins seems to be working, configures, builds and they show up in PM and at least @eht16's add-ons works (so many todos, sigh) :-)
But icons still not right, at least some icons got installed but the same set of icons got installed in both $PREFIX/share/icons/hicolor/apps and actions whereas autotools puts them in a tree like:
``` $PREFIX/share/icons/hicolor/ 16x16/ apps/ actions/ 24x24/ actions/ 32x32/ apps/ actions/ 48x48/ apps/ actions/ scalable/ apps actions ```
where each apps has the classviewer icons and each actions has the Geany bookcase and save all and close all fallback icons, dunno what happened to 24x24 apps??. There is also an` icon-theme.cache` in hicolor that is not present in the meson one. Are you using the meson gnome module, the end of [this](https://mesonbuild.com/Gnome-module.html#page-description) page talks about creating it?
@elextr commented on this pull request.
+act_icons = {'16x16': actions,
+ '24x24': actions, + '32x32': actions, + '48x48': actions} + +icons_dir = join_paths(get_option('datadir'), 'icons', 'hicolor') +icons_appsdir = join_paths(icons_dir, 'apps') +icons_actionsdir = join_paths(icons_dir, 'actions') + +foreach dir, icons_array : app_icons + foreach icon : icons_array + install_data(join_paths(dir, icon), install_dir: icons_appsdir) + endforeach +endforeach + +foreach dir, icons_array : app_icons
@kugel- shouldn't this be act_icons?
@kugel- pushed 1 commit.
c24146e54a6feb50e5efa2b619c5221c95dbe36e fixup! install icons
@kugel- commented on this pull request.
+act_icons = {'16x16': actions,
+ '24x24': actions, + '32x32': actions, + '48x48': actions} + +icons_dir = join_paths(get_option('datadir'), 'icons', 'hicolor') +icons_appsdir = join_paths(icons_dir, 'apps') +icons_actionsdir = join_paths(icons_dir, 'actions') + +foreach dir, icons_array : app_icons + foreach icon : icons_array + install_data(join_paths(dir, icon), install_dir: icons_appsdir) + endforeach +endforeach + +foreach dir, icons_array : app_icons
yea
icons should be fixed as well
@eht16 In fact, `gawk` is not a new depedency, it's already needed by `geany-i18n-m4`. but I still replaced the offending statement because meson discourages from listing source files via wildcards.
Almost. `geany-i18n-m4` requires `AC_PROG_AWK` which supports also other `awk` variants than `gawk`. I noticed this because the system where I tested the build actually had no `gawk` installed but I was still able to successfully compile Geany with autotools (probably with `mawk` as this is installed on that system). Maybe Meson supports something similar to use either `gawk` or `mawk` depending on what is available, so we could still have the dynamically generated list.
Found a few more issues:
- `$PREFIX/share/geany/filedefs/filetypes.python.in` is installed as is. But it needs to be preprocessed to replace `@PYTHON_COMMAND@`.
- G_LOG_DOMAIN is not set which results in log messages without the source set, e.g.: `17:53:15: (null) INFO : Geany 1.38 (git >= 73ab53541), en_GB.UTF-8`. Log messages should look like: `17:54:09: Geany INFO : Geany 1.38 (git >= 8a30ce2), en_GB.UTF-8`. For the different parts of the code, there are different log domains defined: CTags Classbuilder Demoplugin Demoproxy Export FileBrowser Geany HTMLChars MIO SaveActions SplitWindow Tagmanager
- in the output I found `Running custom install script '/usr/bin/meson --internal gettext install --subdir=po --localedir=share/locale --pkgname=geany --langs=ar@@ast@@be@@bg@@ca@@cs@@da@@de@@el@@en_GB@@es@@et@@eu@@fa@@fi@@fr@@gl@@he@@hi@@hu@@id@@ie@@it@@ja@@kk@@ko@@ku@@lb@@lt@@lv@@mn@@nl@@nn@@pl@@pt@@pt_BR@@ro@@ru@@sk@@sl@@sr@@sv@@tr@@uk@@vi@@zh_CN@@zh_TW'` which looks strange but possibly is fine anyway. At least it seems the language files were probably installed.
- I still have the messages like ``` msgfmt: ../po/LINGUAS does not exist ../geany.desktop.in:5:0: warning: invalid non-blank line ../geany.desktop.in:6:0: warning: invalid non-blank line ../geany.desktop.in:7:0: warning: invalid non-blank line ../geany.desktop.in:14:0: warning: invalid non-blank line ``` I wonder if the missing `../po/LINGUAS` is a problem and what's the consequence. The lines about "warning: invalid non-blank line" seems to be related that Meson is using `gettext` to process the .desktop file where previously `intltool` was used. And the `_Keyword...` syntax is specific for `intltool`. It seems this might be a seperate task like migrating from `intltool` to `gettext` (https://stackoverflow.com/questions/62504873/i18n-merge-file-cant-translate-...). Anyway, we need to handle this in some way as the resulting .desktop file is missing items like "Name", "Comment" and "Keywords".
@kugel- I got merge conflicts on a couple of files so I made a clean clone (and they went away, did you force push something?) and now building geany installs the icons ... except `scaleable`.
With the clean build geany-plugins fails again because it doesn't find pkg-config, works if PKG_CONFIG_PATH is set of course, I'll raise that on G-P and see what @hyperair has to say, maybe its not supposed to follow `--with-geany-libdir`, who knows with these distro rules :confused:
I'll leave the translations to @eht16 since I only speak ASCII :grin:
@kugel- Sorry for the delay on my side - is there anything macOS specific that should be addressed? In general, there should be no problem with meson on macOS - I build all the dependencies of Geany from sources and many of them use meson already and work alright.
@andy5995 commented on this pull request.
+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', true) +cdata.set('HAVE_VTE', get_option('vte')) +cdata.set('HAVE_PLUGINS', get_option('plugins')) +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')) +cdata.set('top_srcdir', meson.source_root()) +cdata.set('top_builddir', meson.build_root()) + +# for geany.pc (adapted from GTK+) +pcconf = cdata
There's [a function that will generate .pc files](https://mesonbuild.com/Pkgconfig-module.html#pkgconfig-module) more automagically...
I wonder if the missing `../po/LINGUAS` is a problem and what's the consequence. The lines about "warning: invalid non-blank line" seems to be related that Meson is using `gettext` to process the .desktop file where previously `intltool` was used. And the `_Keyword...` syntax is specific for `intltool`. It seems this might be a seperate task like migrating from `intltool` to `gettext` (https://stackoverflow.com/questions/62504873/i18n-merge-file-cant-translate-desktop-file). Anyway, we need to handle this in some way as the resulting .desktop file is missing items like "Name", "Comment" and "Keywords".
I think this is what the [i18n.merge_file()](https://mesonbuild.com/i18n-module.html#i18nmerge_file) function was designed for (note the 'type' keyword).
I think this is what the [i18n.merge_file()](https://mesonbuild.com/i18n-module.html#i18nmerge_file) function was designed for (note the 'type' keyword).
Ah.. nevermind. I see you're already using that.
@andy5995 commented on this pull request.
@@ -0,0 +1,714 @@
+project('geany', 'c', 'cpp', version: '1.38')
```suggestion project('geany', 'c', 'cpp', version: '1.38', default_options: 'warning_level=2') ``` https://mesonbuild.com/Builtin-options.html#core-options
@kugel- Finally had some time to try it on macOS but I get the following error:
``` The Meson build system Version: 0.59.0 Source dir: /Users/jhbuild/geany Build dir: /Users/jhbuild/geany/_builddir Build type: native build Project name: geany Project version: 1.38 C compiler for the host machine: /Applications/Xcode.app/Contents/Developer/usr/bin/gcc (clang 12.0.5 "Apple clang version 12.0.5 (clang-1205.0.22.11)") C linker for the host machine: /Applications/Xcode.app/Contents/Developer/usr/bin/gcc ld64 650.9 C++ compiler for the host machine: /Applications/Xcode.app/Contents/Developer/usr/bin/g++ (clang 12.0.5 "Apple clang version 12.0.5 (clang-1205.0.22.11)") C++ linker for the host machine: /Applications/Xcode.app/Contents/Developer/usr/bin/g++ ld64 650.9 Host machine cpu family: x86_64 Host machine cpu: x86_64 Found pkg-config: /Users/jhbuild/gtk/inst/bin/pkg-config (0.29.2) Run-time dependency glib-2.0 found: YES 2.68.0 Run-time dependency gmodule-2.0 found: YES 2.68.0 Run-time dependency gtk+-3.0 found: YES 3.24.30 Has header "dlfcn.h" : YES Has header "errno.h" : YES Has header "fcntl.h" : YES Has header "glob.h" : YES Has header "inttypes.h" : YES Has header "limits.h" : YES Has header "locale.h" : YES Has header "memory.h" : YES Has header "stdint.h" : YES Has header "stdlib.h" : YES Has header "strings.h" : YES Has header "string.h" : YES Has header "stdbool.h" : YES Has header "sys/stat.h" : YES Has header "sys/time.h" : YES Has header "sys/types.h" : YES Has header "unistd.h" : YES Checking for function "gnu_get_libc_version" : NO Checking for function "fnmatch" : YES Checking for function "ftruncate" : YES Checking for function "mkstemp" : YES Checking for function "regcomp" : YES Checking for function "socket" : YES Checking for function "strerror" : YES Checking for function "strstr" : YES Program sh found: YES (/bin/sh) Program cp found: YES (/bin/cp) Program ln found: YES (/bin/ln) Program python3 found: YES (/Users/jhbuild/gtk/inst/bin/python3) Program rst2html found: NO Program rst2pdf found: NO Program git found: YES (/usr/bin/git) Configuring config.h using configuration Configuring geany.pc using configuration Compiler for C supports arguments -fvisibility=hidden: YES Configuring geany.1 using configuration Message: Building from tarball, installing prebuild html Program doxygen found: NO Program ctags/runner.sh found: YES (/Users/jhbuild/geany/tests/ctags/runner.sh) Message: [['COPYING', 'GPL-2']] Program cp found: YES (/bin/cp) Build targets in project: 22
Found ninja-1.8.2 at /Users/jhbuild/.new_local/bin/ninja [1/252] Compiling C++ object libscintilla.a.p/scintilla_lexlib_CharacterSet.cxx.o FAILED: libscintilla.a.p/scintilla_lexlib_CharacterSet.cxx.o /Applications/Xcode.app/Contents/Developer/usr/bin/g++ -Ilibscintilla.a.p -I. -I.. -I../scintilla/include -I../scintilla/src -I../scintilla/lexlib -I/Users/jhbuild/gtk/inst/include/glib-2.0 -I/Users/jhbuild/gtk/inst/lib/glib-2.0/include -I/Users/jhbuild/gtk/inst/include/gtk-3.0 -I/Users/jhbuild/gtk/inst/include/gio-unix-2.0 -I/Users/jhbuild/gtk/inst/include/cairo -I/Users/jhbuild/gtk/inst/include/pango-1.0 -I/Users/jhbuild/gtk/inst/include/harfbuzz -I/Users/jhbuild/gtk/inst/include/fribidi -I/Users/jhbuild/gtk/inst/include/atk-1.0 -I/Users/jhbuild/gtk/inst/include/pixman-1 -I/Users/jhbuild/gtk/inst/include/freetype2 -I/Users/jhbuild/gtk/inst/include/libpng16 -I/Users/jhbuild/gtk/inst/include/gdk-pixbuf-2.0 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/Users/jhbuild/gtk/inst/include -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -O0 -g -O2 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -DHAVE_CONFIG_H=1 -O2 -DGTK -Wno-deprecated-declarations -DGDK_DISABLE_DEPRECATION_WARNINGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 '-DGEANY_PREFIX="/usr/local"' '-DGEANY_INCLUDEDIR="/usr/local/include"' '-DGEANY_LIBDIR="/usr/local/lib"' '-DGEANY_LIBEXECDIR="/usr/local/libexec"' '-DGEANY_DATADIR="/usr/local/share"' '-DGEANY_LOCALEDIR="/usr/local/share/locale"' '-DGEANY_DOCDIR="/usr/local/share/doc"' -DGEANY_PRIVATE -fvisibility=hidden '-DGEANY_EXPORT_SYMBOL=__attribute__((visibility("default")))' -DGEANY_API_SYMBOL=GEANY_EXPORT_SYMBOL -Wno-non-virtual-dtor -DNDEBUG -DSCI_LEXER -DNO_CXX11_REGEX -MD -MQ libscintilla.a.p/scintilla_lexlib_CharacterSet.cxx.o -MF libscintilla.a.p/scintilla_lexlib_CharacterSet.cxx.o.d -o libscintilla.a.p/scintilla_lexlib_CharacterSet.cxx.o -c ../scintilla/lexlib/CharacterSet.cxx In file included from ../scintilla/lexlib/CharacterSet.cxx:12: ../scintilla/lexlib/CharacterSet.h:49:28: warning: rvalue references are a C++11 extension [-Wc++11-extensions] CharacterSet(CharacterSet &&other) noexcept { ^ ../scintilla/lexlib/CharacterSet.h:49:36: error: expected ';' at end of declaration list CharacterSet(CharacterSet &&other) noexcept { ^ ; ../scintilla/lexlib/CharacterSet.h:33:3: error: use of undeclared identifier 'AddString' AddString(initialSet); ^ ../scintilla/lexlib/CharacterSet.h:35:4: error: use of undeclared identifier 'AddString' AddString("abcdefghijklmnopqrstuvwxyz"); ^ ../scintilla/lexlib/CharacterSet.h:37:4: error: use of undeclared identifier 'AddString' AddString("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); ^ ```
Could it be an incorrect C++ standard used for parsing? Also, how do I specify prefix where to install the binaries (`--prefix=` with autoconf)?
With macOS it will be also necessarry to add the configuration option `--enable-mac-integration` - I'll have a look at it once I'm able to build Geany.
@techee you specify the prefix when you initialize the build directory, see https://github.com/geany/geany/pull/2761#issuecomment-809698447
The error looks like g++ is using the wrong standard, @kugel- hasn't specified it and I guess all the rest of us are using a g++ that defaults to at least c++11. In fact the new Julia lexer requires c++17 so you will need a compiler capable of that (see recent changes to travis distro version on geany-plugins to get new enough compilers).
But you can still specify the prefix and other options after the build directory has been initialized. While in the build directory 'meson configure -Dprefix=...'. (Use 'meson configure' to see other config options)
OK, with
``` meson _builddir -Dgtkdoc=false -Dcpp_std=c++17 && ninja -C _builddir -j 1 -v ```
I got a bit further now:
``` [230/252] /Applications/Xcode.app/Contents/Developer/usr/bin/g++ -o libgeany.0.dylib libgeany.0.dylib.p/src_about.c.o libgeany.0.dylib.p/src_build.c.o libgeany.0.dylib.p/src_callbacks.c.o libgeany.0.dylib.p/src_dialogs.c.o libgeany.0.dylib.p/src_document.c.o libgeany.0.dylib.p/src_editor.c.o libgeany.0.dylib.p/src_encodings.c.o libgeany.0.dylib.p/src_filetypes.c.o libgeany.0.dylib.p/src_geanyentryaction.c.o libgeany.0.dylib.p/src_geanymenubuttonaction.c.o libgeany.0.dylib.p/src_geanyobject.c.o libgeany.0.dylib.p/src_geanywraplabel.c.o libgeany.0.dylib.p/src_highlighting.c.o libgeany.0.dylib.p/src_keybindings.c.o libgeany.0.dylib.p/src_keyfile.c.o libgeany.0.dylib.p/src_log.c.o libgeany.0.dylib.p/src_libmain.c.o libgeany.0.dylib.p/src_msgwindow.c.o libgeany.0.dylib.p/src_navqueue.c.o libgeany.0.dylib.p/src_notebook.c.o libgeany.0.dylib.p/src_plugins.c.o libgeany.0.dylib.p/src_pluginutils.c.o libgeany.0.dylib.p/src_prefs.c.o libgeany.0.dylib.p/src_printing.c.o libgeany.0.dylib.p/src_project.c.o libgeany.0.dylib.p/src_sciwrappers.c.o libgeany.0.dylib.p/src_search.c.o libgeany.0.dylib.p/src_socket.c.o libgeany.0.dylib.p/src_spawn.c.o libgeany.0.dylib.p/src_stash.c.o libgeany.0.dylib.p/src_symbols.c.o libgeany.0.dylib.p/src_templates.c.o libgeany.0.dylib.p/src_toolbar.c.o libgeany.0.dylib.p/src_tools.c.o libgeany.0.dylib.p/src_sidebar.c.o libgeany.0.dylib.p/src_ui_utils.c.o libgeany.0.dylib.p/src_utils.c.o libgeany.0.dylib.p/src_vte.c.o -L/Users/jhbuild/gtk/inst/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/Users/jhbuild/gtk/inst/include -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-undefined,error -shared -install_name @rpath/libgeany.0.dylib -compatibility_version 0 -current_version 0 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wl,-headerpad_max_install_names -O2 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk libtagmanager.a libctags.a libscintilla.a /Users/jhbuild/gtk/inst/lib/libglib-2.0.dylib /Users/jhbuild/gtk/inst/lib/libintl.dylib /Users/jhbuild/gtk/inst/lib/libgmodule-2.0.dylib /Users/jhbuild/gtk/inst/lib/libgtk-3.dylib /Users/jhbuild/gtk/inst/lib/libgdk-3.dylib -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,CoreGraphics /Users/jhbuild/gtk/inst/lib/libpangocairo-1.0.dylib /Users/jhbuild/gtk/inst/lib/libpango-1.0.dylib /Users/jhbuild/gtk/inst/lib/libharfbuzz.dylib /Users/jhbuild/gtk/inst/lib/libatk-1.0.dylib /Users/jhbuild/gtk/inst/lib/libcairo-gobject.dylib /Users/jhbuild/gtk/inst/lib/libcairo.dylib /Users/jhbuild/gtk/inst/lib/libgdk_pixbuf-2.0.dylib /Users/jhbuild/gtk/inst/lib/libgio-2.0.dylib /Users/jhbuild/gtk/inst/lib/libgobject-2.0.dylib -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,CoreGraphics -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,CoreGraphics FAILED: libgeany.0.dylib /Applications/Xcode.app/Contents/Developer/usr/bin/g++ -o libgeany.0.dylib libgeany.0.dylib.p/src_about.c.o libgeany.0.dylib.p/src_build.c.o libgeany.0.dylib.p/src_callbacks.c.o libgeany.0.dylib.p/src_dialogs.c.o libgeany.0.dylib.p/src_document.c.o libgeany.0.dylib.p/src_editor.c.o libgeany.0.dylib.p/src_encodings.c.o libgeany.0.dylib.p/src_filetypes.c.o libgeany.0.dylib.p/src_geanyentryaction.c.o libgeany.0.dylib.p/src_geanymenubuttonaction.c.o libgeany.0.dylib.p/src_geanyobject.c.o libgeany.0.dylib.p/src_geanywraplabel.c.o libgeany.0.dylib.p/src_highlighting.c.o libgeany.0.dylib.p/src_keybindings.c.o libgeany.0.dylib.p/src_keyfile.c.o libgeany.0.dylib.p/src_log.c.o libgeany.0.dylib.p/src_libmain.c.o libgeany.0.dylib.p/src_msgwindow.c.o libgeany.0.dylib.p/src_navqueue.c.o libgeany.0.dylib.p/src_notebook.c.o libgeany.0.dylib.p/src_plugins.c.o libgeany.0.dylib.p/src_pluginutils.c.o libgeany.0.dylib.p/src_prefs.c.o libgeany.0.dylib.p/src_printing.c.o libgeany.0.dylib.p/src_project.c.o libgeany.0.dylib.p/src_sciwrappers.c.o libgeany.0.dylib.p/src_search.c.o libgeany.0.dylib.p/src_socket.c.o libgeany.0.dylib.p/src_spawn.c.o libgeany.0.dylib.p/src_stash.c.o libgeany.0.dylib.p/src_symbols.c.o libgeany.0.dylib.p/src_templates.c.o libgeany.0.dylib.p/src_toolbar.c.o libgeany.0.dylib.p/src_tools.c.o libgeany.0.dylib.p/src_sidebar.c.o libgeany.0.dylib.p/src_ui_utils.c.o libgeany.0.dylib.p/src_utils.c.o libgeany.0.dylib.p/src_vte.c.o -L/Users/jhbuild/gtk/inst/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/Users/jhbuild/gtk/inst/include -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-undefined,error -shared -install_name @rpath/libgeany.0.dylib -compatibility_version 0 -current_version 0 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -Wl,-headerpad_max_install_names -O2 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk libtagmanager.a libctags.a libscintilla.a /Users/jhbuild/gtk/inst/lib/libglib-2.0.dylib /Users/jhbuild/gtk/inst/lib/libintl.dylib /Users/jhbuild/gtk/inst/lib/libgmodule-2.0.dylib /Users/jhbuild/gtk/inst/lib/libgtk-3.dylib /Users/jhbuild/gtk/inst/lib/libgdk-3.dylib -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,CoreGraphics /Users/jhbuild/gtk/inst/lib/libpangocairo-1.0.dylib /Users/jhbuild/gtk/inst/lib/libpango-1.0.dylib /Users/jhbuild/gtk/inst/lib/libharfbuzz.dylib /Users/jhbuild/gtk/inst/lib/libatk-1.0.dylib /Users/jhbuild/gtk/inst/lib/libcairo-gobject.dylib /Users/jhbuild/gtk/inst/lib/libcairo.dylib /Users/jhbuild/gtk/inst/lib/libgdk_pixbuf-2.0.dylib /Users/jhbuild/gtk/inst/lib/libgio-2.0.dylib /Users/jhbuild/gtk/inst/lib/libgobject-2.0.dylib -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,CoreGraphics -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,CoreGraphics Undefined symbols for architecture x86_64: "_JuliaParser", referenced from: _BuiltInParsers in libctags.a(ctags_main_parse.c.o) "_lmJulia", referenced from: _Scintilla_LinkLexers in libscintilla.a(scintilla_src_Catalogue.cxx.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. ```
but it seems the julia parser didn't get compiled.
What has probably happened is the meson.build hasn't been updated since the julia parser was merged, and I admit I havn't tested the meson build since then. So it probably just needs the file listed in the meson.build file with the other ctags/parsers files.
Quick explain, meson requires all files to be explicitly listed, it doesn't search to see whats in the directories the way make does. Its how meson gets its speed since it doesn't need to rebuild the ninja files every time. Not a lot of impact with Geany, but huge with things like chromium or llvm etc.
Quick explain, meson requires all files to be explicitly listed, it doesn't search to see whats in the directories the way make does. Its how meson gets its speed since it doesn't need to rebuild the ninja files every time. Not a lot of impact with Geany, but huge with things like chromium or llvm etc.
Sorry, I have to bust that myth.
1) meson doesn't build anything itself, it just generates ninja build scripts. ninja is doing the heavy work 2) make also requires all files to be listed explicitely, by default. GNU make has an extension that allows wildcards that allows to use dynamic source file lists, but that's evaluated at parse-time (basically by shelling out to a "ls dir/*") and doesn't affect the build speed (perhaps unless you have *huge* directories) 3) ninja is not much faster than Make because most of the time is used by the compiler, naturally, especially with C++ code. Ninja has a reduced syntax so parsing ninja files is a bit faster, but at the expense that it's not recommended to write ninja files by hand.
I would expect that an optimized, i.e. non-recursive, as realized with my [kmake](https://github.com/kugel-/kmake/) system, Make build is about the same speed that ninja builds. make can be blazing fast if used properly, i.e. almost all CPU time is measurably used by the compiler.
meson is *much* faster than autoconf, that's true for sure.
Ok fair enough, to be excruciatingly semantically correct, meson is fast because ninja is fast and meson requires files to be listed because ninja does not support directory search, and meson being a sloooow python program `meson build` just invokes ninja and does nothing else, ninja will re-invoke meson if any of the `meson.build` files change.
In fact you can invoke `ninja build` instead of `meson build`, that is how little meson build does when using the ninja backend. :grin:
Sure a makefile written to ninja rules will likely be nearly as fast because those rules are designed to make a fast build system, so except for automatic parallelisation it should be similar because it does much the same stuff (other than automatic include dependency handling and no recursive dependency issues, but they are convenience and accuracy issues, not speed).
And for make you can of course try to guess a suitable `-j` yourself and try to remember to run `make depends` manually when you change includes (unless you use the GNU make extensions, which autofools doesn't).
But almost all makefiles written by humans, and by autofools, and by most other tools, do not meet the ninja rules, and as @kugel- pointed out that is what most comparisons are to. It would be interesting to get benchmarks of ninja and kmake makefiles for a big program like chromium, frankly Geany is just a tiddler[1]. IIUC pre-ninja chromium make would take ages to figure out what to do before it actually started the compiles, which was annoying if you only changed one character :imp:
This lack of search is also important on windows where the file system is slow (by comparison to linux) and makes the visual studio backend work better too.
Anyway @kugel- thanks for fixing the Julia, probably should have prompted when I merged it, but didn't think of it.
[1] tiddler: a thing so small its not worth anything in the context, usually of fish that are thrown back.
Tried to test on Win10 with Msys2; seems to have some issues with the embedded fnmatch/gnu_regex stuff.
* [Configure Output](https://gist.github.com/codebrainz/0fcbfbfb9bd21d4c06ed542ff636ea46#file-con...) * [Build Output](https://gist.github.com/codebrainz/0fcbfbfb9bd21d4c06ed542ff636ea46#file-bui...)
Hmm, @kugel- `cpp_std` isn't a valid named parameter to `shared_library()` (see the configure output @codebrainz posted), it should probably be in the `cpp_args` if you want to apply it to only the Scintilla part of the build. But personally I would add it in `add_project_options()` as per https://mesonbuild.com/howtox.html#set-default-cc-language-version. Might as well make it global, only Scintilla is C++ anyway.
@codebrainz not sure what the problem is, I would have thought g++ 10 would default to c++17, but maybe I'm wrong, does latest git Geany build with autotools on the same system? If it does build maybe the point I posted above will fix it since it meant the standard wasn't explicit?
I got it compiled on macOS with ``` meson _builddir -Dgtkdoc=false -Dcpp_std=c++17 && ninja -C _builddir ``` and Geany installs and runs fine.
The only problem I did run into during the compilation was inside `doc/meson.build` where the `cp` commands take the `-u` parameter which is not supported on macOS (for the compilation I just removed it).
One thing still missing is the support of the gtk-mac-integration library which is used to make GTK applications behave in a more native way. What's missing is the configuration option to enable mac integration and also the detection of the presence of the library like in the autotools m4 file here:
https://github.com/geany/geany/blob/master/m4/geany-mac-integration.m4
When the library is enabled, Geany should link against it and add `osx.h` and `osx.c` to the compilation:
https://github.com/geany/geany/blob/master/src/Makefile.am#L115
@codebrainz not sure what the problem is, I would have thought g++ 10 would default to c++17, but maybe I'm wrong, does latest git Geany build with autotools on the same system?
I think the problem is with fnmatch/gnu_regex libraries which I believe are special for Windows, and possibly just some missing checks/macros to enable them. From the build output, it looks like a bunch of macros are not defined which just cascades into a whole pile of errors. I'm pretty sure Ninja is doing parallel compiles so the output is probably out of order.
It's the same setup I used to build Geany previously, but I didn't try Autotools since pulling latest with the c++17 requirement, though judging by the output, I don't think it has hit that issue (yet).
@codebrainz sorry I didn't look closely enough at it, saw the first error in your build post was Scintilla and assumed it was all C++17 regex issues, but in fact most of them are ctgas errors:
- missing <fnmatch.h> which is the linux glob file match header, but its in ctags/fnmatch - at least some of the missing macros are defined in ctags/gnu_regex/regex_internal.h, didn't check them all
So it looks like the meson.build needs to declare those two directories as includes so the headers will be found, not sure why it works on Linux, possibly its using the system headers of the same name or finding them because they are in the same directory as the file being compiled.
I'm pretty sure Ninja is doing parallel compiles so the output is probably out of order.
Since ninja buffers output, the messages of different compile commands shouldn't be mixed, but yes the order of the compiles may vary.
@codebrainz if you want to test before @kugel- gets to it, in geany/meson.build try making a copy of the `,include_directories: ...` parameter from lines 334 and 346 into the respective `static_library()` functions above those lines.
I did try to tinker with it a bit, but not too much. I'll try other stuff next time I boot into Windows partition.
I realize this is a more-or-less direct port from the Autotools build system, but is it in the scope of this WIP PR to re-organize it to be more Meson-like, or rather to get rid of Autotools-style/cruft?
A few things that stick out:
* Compiling all the things into helper static libs (Scintilla, Ctags, etc) which are not distributed and only used to build the shared libgeany. These could all be built into a single `shared_library` and delimit the source file (directories) in the arguments list with newlines and/or comments. * Checking for C headers which are guaranteed to exist (ex. C99 headers) * Using the built-in Pkgconfig module to generate .pc file * Different `extra_data` filenames for Windows (could be done in the `geany.nsi` script probably) * If we're going to use subdir(), why not subdir() into the `src` dir as well to move the libgeany/geany into a smaller file? Otherwise, maybe all of the things could be done in the same huge source of truth `meson.build` file in the source root directory? * Use the `/` path operator instead of `join_paths()` as well as for other paths where now they're just regular strings. Not sure what's idiomatic. * Is any explicit `rpath` stuff really needed? I only use Meson for small Vala projects, but in my uses it easily handles installing executables linked to shared libraries using correct paths for the distro.
Maybe we could do like?
1. Merge this sort of direct-port PR once ready 2. Do stuff like listed above to Mesonify in a separate PR(s) afterwards 3. Once Meson build is nice and clean and maintainable, rip out Autotools
Agree with @codebrainz suggested path above.
[STOP PRESS, the reason fnmatch and regex work on Linux (and presumably mac) is that they don't get built, the meson configuration finds the system ones and does not build the ctags internal copies]
Use the / path operator instead of join_paths() as well as for other paths where now they're just regular strings. Not sure what's idiomatic.
Probably should be https://mesonbuild.com/Syntax.html#string-path-building but windows seems much less strict about the slash/backslash issue these days.
Personally when using meson I gather filenames locally into variables in the respective directories and let meson take the strain, but @kugel- has wisely avoided putting meson.build files into ctags and scintilla directories which will avoid them being clobbered during updates so some path munging is needed for those.
The RPATH thing might still be needed when a non-system $PREFIX is used, also there was some fiddling needed (see history above) because here libraries live in `/lib/x86_64-linux-gnu` not in `/lib` and meson knows that, whereas the autotools builder puts everything in `/lib` irrespective, so the RPATH needed adjustment.
@codebrainz I simply wanted to have a single meson.build where the import stuff is in. data, icons, po etc is rarely touched and can be in a separate meson.build so they don't create too much noise. But for the main build system work I don't want to constantly jump between build files.
Not putting meson.build into imported code was only a minor aspect but it's another advantage.
Don't build all the things into helper static libs (Scintilla, Ctags, etc) which are not distributed and only used to build the shared libgeany. These could all be built into the single libgeany shared_library directly.
I do that because they (can) have different CFLAGS/CXXFLAGS. You cannot set those per source file. Stuffing everything into one `shared_library` declaration (even mixed C/C++) can possibly be done but has no real advantage.
@kugel- You're doing the work, so it's your call (and can be discussed/refactored later). It just seems weird to have some stuff in subdirs and most stuff in the main file, and then have separate build artifacts, but not in own subdirs/subprojects; basically just seems a little inconsistent. That said, I don't know what's idiomatic in Meson, so feel free to ignore me :)
@codebrainz why doesn't msys2 have fnmatch and regex? It seemed to work for @eht16, maybe its something that can be installed?
@eht16 commented on this pull request.
+# we're using lots of deprecated stuff with gtk3 (often because there is no proper alternative!)
+def_cflags += '-Wno-deprecated-declarations' +def_cflags += '-DGDK_DISABLE_DEPRECATION_WARNINGS' +def_cflags += '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32' +def_cflags += '-DGEANY_PREFIX="@0@"'.format(get_option('prefix')) +foreach d : [ 'includedir', 'libdir', 'libexecdir', 'datadir', 'localedir' ] + def_cflags += '-DGEANY_@0@="@1@"'.format(d.underscorify().to_upper(), join_paths(prefix, get_option(d))) +endforeach +def_cflags += '-DGEANY_DOCDIR="@0@"'.format(join_paths(prefix, get_option('datadir'), 'doc')) + +# 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)"'
The quotes around `__declspec(dllexport)` must be removed otherwise we get syntax errors, without the quotes the code compiles.
Here we go, Meson on MSYS2: https://gist.github.com/eht16/5dc2fdfc79d10176e67aa7439816cf4c
It looks pretty good already, the configure part works well. Good job!
There are a few details on the build stage: - https://github.com/geany/geany/pull/2761#discussion_r700600332 - ENABLE_NLS must be set to 1 , not just defined as well as the other HAVE_* macros (for the bundled "ctags/gnu_regex" library) - __USE_GNU macro must be defined for bundled "ctags/gnu_regex" library (as done in https://github.com/geany/geany/blob/master/ctags/Makefile.am#L197) - something is wrong with include paths for bundled "fnmatch" library, it doesn't find its own header
@eli-schwartz commented on this pull request.
+def_cflags += '-DGDK_DISABLE_DEPRECATION_WARNINGS'
+def_cflags += '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32' +def_cflags += '-DGEANY_PREFIX="@0@"'.format(get_option('prefix')) +foreach d : [ 'includedir', 'libdir', 'libexecdir', 'datadir', 'localedir' ] + def_cflags += '-DGEANY_@0@="@1@"'.format(d.underscorify().to_upper(), join_paths(prefix, get_option(d))) +endforeach +def_cflags += '-DGEANY_DOCDIR="@0@"'.format(join_paths(prefix, get_option('datadir'), 'doc')) + +# 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'
Use the meson kwarg `gnu_symbol_visibility: 'hidden'` on your build targets, and let the declspec define fill in the support gap for Windows (I think everywhere else should support it, really).
- 'scintilla/lexers/LexPerl.cxx',
+ 'scintilla/lexers/LexPowerShell.cxx', + 'scintilla/lexers/LexProps.cxx', + 'scintilla/lexers/LexPython.cxx', + 'scintilla/lexers/LexPO.cxx', + 'scintilla/lexers/LexR.cxx', + 'scintilla/lexers/LexRuby.cxx', + 'scintilla/lexers/LexRust.cxx', + 'scintilla/lexers/LexSmalltalk.cxx', + 'scintilla/lexers/LexSQL.cxx', + 'scintilla/lexers/LexTCL.cxx', + 'scintilla/lexers/LexTxt2tags.cxx', + 'scintilla/lexers/LexVHDL.cxx', + 'scintilla/lexers/LexVerilog.cxx', + 'scintilla/lexers/LexYAML.cxx', + cpp_std: 'c++17',
This is not a valid kwarg, but it is a valid project option. You can add it to default_options in the project() declaration, or override it per target with `override_options: ['cpp_std=c++17']`
@kugel- commented on this pull request.
+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', true) +cdata.set('HAVE_VTE', get_option('vte')) +cdata.set('HAVE_PLUGINS', get_option('plugins')) +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')) +cdata.set('top_srcdir', meson.source_root()) +cdata.set('top_builddir', meson.build_root()) + +# for geany.pc (adapted from GTK+) +pcconf = cdata
Thanks. I'll keep it for now as it seems to work, and is shared with autotools build.
@eli-schwartz commented on this pull request.
+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', true) +cdata.set('HAVE_VTE', get_option('vte')) +cdata.set('HAVE_PLUGINS', get_option('plugins')) +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')) +cdata.set('top_srcdir', meson.source_root()) +cdata.set('top_builddir', meson.build_root()) + +# for geany.pc (adapted from GTK+) +pcconf = cdata
The automagic module is far less verbose than `pcconf.set('DEPENDENCIES', deps_for_pc)` or redefining a variety of already existing variables.
Additionally, the automagic module will create a geany-uninstalled.pc file which can be used to compile third-party software against uninstalled development versions of geany, which may be useful.
@elextr please check the libdir problem again. I compiled in a Ubuntu container and it uses `lib/x86_64-linux-gnu` for both `libgeany.so*` and `pkgconfig/geany.pc`
@kugel- yay, built a new clone, Geany works and nothing in `$PREFIX/lib`. :smile:
Geany-plugins (at least the ones I have dependencies for) built and installed in `lib/x86_64-linux-gnu` except for `pluginutils` that spammed `/lib`, but thats not this PRs problem. At least debugger (which uses pluginutils) works.
So all good I would say.
One thing I did notice that it configured with GTKdoc enabled but I didn't have python3-lxml so the build fails. Maybe lxml should be checked in the configure step.
The python module's find_installation() method accepts the kwarg `modules: ['import_name']` and will report the python installation as not-found if that module is missing.
Since the lxml module is only needed if gtkdoc is enabled it would need to test with/without the module depending on the setting.
@kugel- pushed 1 commit.
def28c256a0e7001f5c4873663a723444c617555 fixes for windows
@kugel- the test fails look like autotools has been broken.
If there's no blocker I'd like to merge it soon. autotools should continue to work for now so this shouldn't break anything anyway.
I'm ok with it being merged if the tests pass after the conflict is fixed (showing autotools does in fact still work)
@kugel- Agree to be merged. Have the macOS problems I mentioned here https://github.com/geany/geany/pull/2761#issuecomment-896355477 been addressed? But there's no problem to do it after this is merged though.
Yea let's address that afterwards. Since I have no mac machine I'll need your help.
What is the purpose of running cp there at all? meson doesn't need it in order to trigger `install: true` -- you can just use `install_data(..., rename: 'new-name')`. And you don't save the custom_target in a variable and add it as an order dependency on another target, so if it actually needs to be present in the build tree then you have no guarantee it will be there.
Failing all that, ninja only runs the cp command when the input is newer than the output, you don't need cp to duplicate that check.
@eli-schwartz requested changes on this pull request.
- ['memcpy', '#include <string.h>'],
+ ['mkstemp', '#include <stdlib.h>'], + ['regcomp', '#include <regex.h>'], + ['socket', '#include <sys/socket.h>'], + ['strerror', '#include <string.h>'], + ['strstr', '#include <string.h>'], + ['wcrtomb', '#include <wchar.h>'], + ['wcscoll', '#include <wchar.h>'], +] + +foreach h : check_headers + define = 'HAVE_' + h.underscorify().to_upper() + if cc.has_header(h) + cdata.set(define, 1) + else + cdata.set(define, false)
Several times you do `cdata.get()` on values that could be either int `1` or bool `false`, and that evaluates to a meson syntax error when trying to check the "truthiness" of an integer. It doesn't build by default for me.
Which systems was this tested on? Seems like a system that has none of: glibc, fnmatch, regcomp (all 3 need to evaluate to false for configuration to pass).
@kugel- commented on this pull request.
- ['memcpy', '#include <string.h>'],
+ ['mkstemp', '#include <stdlib.h>'], + ['regcomp', '#include <regex.h>'], + ['socket', '#include <sys/socket.h>'], + ['strerror', '#include <string.h>'], + ['strstr', '#include <string.h>'], + ['wcrtomb', '#include <wchar.h>'], + ['wcscoll', '#include <wchar.h>'], +] + +foreach h : check_headers + define = 'HAVE_' + h.underscorify().to_upper() + if cc.has_header(h) + cdata.set(define, 1) + else + cdata.set(define, false)
I tested on Windows at last. I'll check.
Very good point. I'll take a look.
@eli-schwartz Yeah, would seem something other than rebase has happened since last tested.
I think it's not yet ready to merge: - it seems this branch contains parts of #2938 ??? - `make distcheck` fails, see log at https://gist.github.com/eht16/792145594d9904e9aa9e8829afbd70f1 - could you rebase onto master to get CI back for this PR? This would probably also uncover the `make distcheck` error - the Meson build fails for me with: `../../home/enrico/projects/geany-meson-kugel/meson.build:155:9: ERROR: Object <[IntegerHolder] holds [int]: 1> of type int does not support the `bool()` operator.`
All tested on current Debian Testing.
@eht16 commented on this pull request.
@@ -78,10 +78,42 @@ and open the online version instead when requested.
Installing from a Git clone +++++++++++++++++++++++++++
-Install Autotools (*automake*, *autoconf* and *libtool*), *intltool*, -and the GLib development files **before** running any of the following -commands, as well as *rst2html* from Docutils (see above for details). -Then, run ``./autogen.sh`` and then follow the instructions for +Using the Meson build system +++++++++++++++++++++++++++++ + +N.B. Meson support is still incomplete and a work-in-progress.
I guess this could be removed before merge?
@eht16 commented on this pull request.
@@ -78,10 +78,42 @@ and open the online version instead when requested.
Installing from a Git clone +++++++++++++++++++++++++++
-Install Autotools (*automake*, *autoconf* and *libtool*), *intltool*, -and the GLib development files **before** running any of the following -commands, as well as *rst2html* from Docutils (see above for details). -Then, run ``./autogen.sh`` and then follow the instructions for +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
I'm no native speaker either but shouldn't it be "choose"?
The "int doesn't have a bool method" issue is the one I pointed out. It's fallout from an attempt to support Windows, which probably only does work on Windows.
@kugel- pushed 1 commit.
7c36b7c4148091223993b299ed2f445df044cce4 fix ci
@elextr commented on this pull request.
@@ -78,10 +78,42 @@ and open the online version instead when requested.
Installing from a Git clone +++++++++++++++++++++++++++
-Install Autotools (*automake*, *autoconf* and *libtool*), *intltool*, -and the GLib development files **before** running any of the following -commands, as well as *rst2html* from Docutils (see above for details). -Then, run ``./autogen.sh`` and then follow the instructions for +Using the Meson build system +++++++++++++++++++++++++++++ + +N.B. Meson support is still incomplete and a work-in-progress.
Perhaps it should say "N.B. Meson support is an initial version for testing" at merge.
Ok, works for me on Linux again, Geany-plugins builds against it.
Only a couple of comments from @eht16 on the docs and the CI to go AFAICT.
@kugel- pushed 1 commit.
3f018df294ffa54e5be2c2127002822e5e567c95 meson: don't use dicttionaries for 18.04 compat
@kugel- pushed 1 commit.
aa68dc31f5c575ea976c1947426e38ca321b147c no meson compile in 18.04
@kugel- pushed 1 commit.
f9824521a1572f220c9289a5717780c7d98d237d fix ci again
@kugel- pushed 1 commit.
ef848a86683b1f11e292d4c7bef705092f190857 fixup! Doxyfile per Makefile anstat per configure
@kugel- pushed 1 commit.
a01ead76e44c91dfb0087bf594eb8ed2447d0ebf fixup! Doxyfile per Makefile anstat per configure
@kugel- pushed 1 commit.
23f8b0c75cc8f1e09b35c96cd65108d26928dc99 fix for pascal
I just pushed a rebase to current master. I'll push a condensed history in the coming days and then merge a few days later, unless anyone speaks up (again, autotools is expected to work as before, so this is just an initial shot to get the ball rolling)
@kugel- pushed 1 commit.
f3cd453d414e70cb64f1f92cbacb53f8b7821fd2 fix ci
Unfortunately, for me it still doesn't work :(.
My full build log is at https://gist.github.com/eht16/9423377071e053555d27ab01838b2846, I just stripped the compiler warnings on C code which is most probably not relevant for the Meson changes.
First, there is a warning when configuring in https://gist.github.com/eht16/9423377071e053555d27ab01838b2846#file-gistfile.... Might be harmless, I cannot judge.
Beginning with https://gist.github.com/eht16/9423377071e053555d27ab01838b2846#file-gistfile... the real errors start. It seems `doxygen` is looking in the build folder for the source files.
In https://gist.github.com/eht16/9423377071e053555d27ab01838b2846#file-gistfile..., the `scripts/gen-api-gtkdoc.py` script is looked up in a hardcoded path `../` which obviously only works if one builds in a sub directory of the source tree but cannot work in full out of source tree builds.
I don't think we should merge this PR at this stage.
@eli-schwartz requested changes on this pull request.
- custom_target('doxygen.stamp',
+ input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + custom_target('gtkdoc headers', + input : [doxy_xml], + output: ['geany-gtkdoc.h', 'geany-sciwrappers-gtkdoc.h'], + command: [python, '../scripts/gen-api-gtkdoc.py', join_paths(meson.current_build_dir(), 'xml'), '-d', '.', '-o', '@OUTPUT0@', '--sci-output', '@OUTPUT1@'],
This is utterly wrong, then. :p
Please use `command: [find_program('scripts/gen-api-gtkdoc.py'), ......]` since find_program will make the script path be actually correct, and also for the record it handles scripts with shebangs for you for windows/Linux portability.
@@ -0,0 +1,128 @@
+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')
Please specify `check: false`, because meson recently starts warning that the default is, unexpectedly, false and may change in future versions of meson.
Better yet, if your minimum version of meson allows it, use the `fs` module to check whether files exist without running external processes. :)
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
Meson's command kwarg does not accept shell commands, only execve() commands. If you need the former, use `['sh', '-c', '...']` or a python script.
I will check the feedback, thanks.
But I don't think this must be gettinf perfect. Autotools is still the default and the meson build can be improved on master.
But I don't think this must be gettinf perfect. Autotools is still the default and the meson build can be improved on master.
I agree on not getting perfect but it should work at least :D.
@kugel- commented on this pull request.
@@ -0,0 +1,128 @@
+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')
I'm aiming to be compatible to Ubuntu 18.04, meaning meson 0.45. That has bitten a few times already ;-)
@kugel- commented on this pull request.
- custom_target('doxygen.stamp',
+ input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + custom_target('gtkdoc headers', + input : [doxy_xml], + output: ['geany-gtkdoc.h', 'geany-sciwrappers-gtkdoc.h'], + command: [python, '../scripts/gen-api-gtkdoc.py', join_paths(meson.current_build_dir(), 'xml'), '-d', '.', '-o', '@OUTPUT0@', '--sci-output', '@OUTPUT1@'],
I thought `../scripts/gen-api-gtkdoc.py` would be relative to the `doc/` folder where this meson.build is located. But for commands it seems to be relative to the build directory.
I also do 'install_data("../scintilla/…")` further down in the same meson.build and that seems to work.
@eli-schwartz commented on this pull request.
@@ -0,0 +1,128 @@
+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')
Argh... :p
It isn't the most recent LTS anymore, but well, if you need to support that still, I guess there is nothing to be done.
@kugel- commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
Thinking about it, I think I don't actually need the stamp file as the `custom_target` object can be used as a dependency itself. Inherited from Makefile.am where the stamp file ensures proper ordering.
@eli-schwartz commented on this pull request.
- custom_target('doxygen.stamp',
+ input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + custom_target('gtkdoc headers', + input : [doxy_xml], + output: ['geany-gtkdoc.h', 'geany-sciwrappers-gtkdoc.h'], + command: [python, '../scripts/gen-api-gtkdoc.py', join_paths(meson.current_build_dir(), 'xml'), '-d', '.', '-o', '@OUTPUT0@', '--sci-output', '@OUTPUT1@'],
When you run `cd builddir/ && ninja`, ninja is being run from the build directory.
And then a ninja rule contains the literal string `../scripts/gen-api-gtkdoc.py`, as you wrote.
find_program() will indeed make it relative to the doc/ folder where this meson.build is located, because find_program converts strings (passed as argv1 to the python executable) into found programs. Thus, the current working directory of the ***python*** program is the build directory.
`install_data()` accepts a str object and interprets it as a file path, hence install_data() converts strings into found resources and makes them relative to meson.build.
So does any other meson function where the context of the function specifies that the string argument should be interpreted as files/directories.
Again, this is not the case for `command`, which specifies that the first element `python` of the command is a file (program) and the remaining elements of the command such as `'../scripts/gen-api-gtkdoc.py'` are unknown and unknowable strings passed without modification.
Those unknown and unknowable strings, `'../'` included, are then interpreted by the python program, which happens to assume they represent a filepath.
@kugel- commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
Grr, https://github.com/mesonbuild/meson/issues/2320
@eli-schwartz commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
Does it output to its own directory exclusively created by doxygen?
Because in another project of mine we have a doxygen custom_target which defines `output: 'man3'`and that works as far as meson/ninja is concerned. Even though the output is a directory node rather than a file node, it is an output without "/" in the name, and ninja can recognize when a directory is "up to date".
Doxygen... so fun.
@kugel- commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
If directories as output works then we're green, I'll try
@kugel- commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
No, does not work. The gtkdoc header is not regenerated if doxygen re-runs to generate $builddir/xml/*.xml. The timestamp of the xml directory isn't updated by the re-run of doxygen.
@kugel- commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
Also, meson can be a PITA. It seems that I cannot use a `declare_dependency()` object in the `depends:` kwarg of `custom_target()`
@elextr commented on this pull request.
@@ -0,0 +1,128 @@
+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')
@kugel- whilst its nice to support 18.04 as @eli-schwartz pointed out it is not longer the current LTS, but it is still in standard support until early next year. But since this PR is a forward looking maybe we can skip the last year of 18.04 and move to 20.04 which has Meson 0.54 IIUC (unless you need 18.04 yourself of course :-).
Also, it may not be idiomatic, but in subdirectory `meson.build`s I always use `name = files("xxx")` to give a name to any file in the subdir that I need outside the subdir, that handles source/build and paths and all that stuff :-)
@eli-schwartz commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
Ah yes... we don't then depend on those man3 pages, we just install them directly.
In that case, your best bet would seem to be a python script `['foo.py', '@OUTPUT@', doxygen, '@INPUT@']` that runs `sys.argv[2:]` and then updates the mtime of the stamp file.
@eli-schwartz commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
Also regarding the declare_dependency, a declare_dependency is a way of producing a custom defined pkg-config style `dependency()` object, hence why it can also expose c_args and link_args, which have no meaning to a custom_target.
You can just list the files directly as custom_target `depends: `
@kugel- commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
You can just list the files directly as custom_target depends:
No, I can't :( `depends: [files(…), libgeany],` -> `ERROR: custom_target keyword argument 'depends' was of type array[File | SharedLibrary] but should have been array[BuildTarget | CustomTarget]`
I'm also unable to specify the extra C files as input `input: [doxyfile_gi] + files(…),` -> `[2/14] /usr/bin/sh -c 'doxygen @INPUT0@ && touch doc/doxygen.stamp'`
(INPUT0 should just use the first input file)
@eli-schwartz commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
Apologies, I meant `depend_files: `
@kugel- commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
OK. `depend_files` seems to work, but not my shell wrapper: `@OUTPUT@` is not substituted when `command: [sh, '-c', 'doxygen @INPUT@ && touch @OUTPUT@'],` is run: `/usr/bin/sh -c 'doxygen doc/Doxyfile && touch @OUTPUT@'`
@eli-schwartz commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
Please do not pass arguments by embedding them inside a shell script. There is no `shellquote('@OUTPUT@')`, you cannot guarantee it has a shell-safe name like that.
Instead, use ```meson command: [sh, '-c', 'doxygen "$1" && touch "$2"', '_argv0', '@INPUT@', '@OUTPUT@'], ```
Which will safely pass the filenames as command line *arguments*, and allow the shell to reference those filenames using variables, since variables can be safely quoted regardless of their content.
This *also* means that meson has a much more accurate understanding of how to replace those strings.
Specifically, you cannot replace both INPUT and OUTPUT in the *same* string. https://github.com/mesonbuild/meson/issues/1864
@kugel- commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
Thanks, your shell magic works.
This all shows me why I don't actually like meson.
@eli-schwartz commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
As a matter of curiosity, why is this the fault of meson rather than the fault of embedding shell scripts as data?
```meson command: [sh, '-c', 'doxygen @INPUT@ && touch @OUTPUT@'], ```
is inherently broken, because what happens if `@INPUT@` or `@OUTPUT@` have spaces in them? Or any of a number of other character sequences that would break a shell script?
@kugel- commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
Then let it be `command: [sh, '-c', 'doxygen "@INPUT@" && touch "@OUTPUT@"'],`
Anyway, the root problem is that I can't specify output files in subdirectories, this is the only reason for the stamp file (and shell wrapper) at all. And the discussion on mesonbuild/meson#2320 doesn't look like meson cares much about users.
@kugel- pushed 1 commit.
a851b086debdade2e390e9481160ea3a49ac0dc6 fix doxygen and some indentation
@eli-schwartz commented on this pull request.
- dep_doxygen = declare_dependency(sources: ['plugins.dox',
+ 'pluginsignals.c', + 'pluginsymbols.c', + 'stash-example.c', + 'stash-gui-example.c']) + + custom_target('doxygen.stamp', + input: dox, + output: ['doxygen.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'], + depends: libgeany, + build_by_default: true) + doxy_xml = custom_target('doxygen-gi.stamp', + input: doxgi, + output: ['doxygen-gi.stamp'], + command: [doxygen, '@INPUT@', '&&', 'touch', '@OUTPUT@'],
The `"` character is one of the "would break a shell script" characters I mentioned.
The root problem of specifying output files in subdirectories is a legitimate point, which nevertheless (fortunately?) does not affect the majority of use cases. For unrelated reasons, I actually do want to add a doxygen function to meson, which *would* be able to do behind the scenes stuff and track output files in subdirectories...
Interesting. GH action actually merges the PR before running the build. My branch doesn't contain the GDScript changes. I'll rebase when I squash the commits.
@kugel- pushed 1 commit.
d11bf9b75cba9b8c7bacf452edeeb8f2d6cdefe5 Port to the meson build system.
@kugel- pushed 3 commits.
2cfe9576b2beee5279e819724e894d0ce721255a Prepare for meson build system 8f23cec02ab5f8e3ddef0dd0aa1e377ed5dbbda5 Add build directories to gitignore 62cad6ab82a0c99eb5df9ccc34a82115678b5644 Port to the meson build system.
@kugel- pushed 1 commit.
0cb84fd74c07c75cb06e96591e398ee375e18795 Port to the meson build system.
@kugel- pushed 3 commits.
9c02dfb26a957c748688edf8a67be400204e186c Prepare for meson build system 9b7f22997e4fb882979610ede318f4278f576a98 Add build directories to gitignore c8e90be62de79cf35f2cf116f1bc00bb9307b0f0 Port to the meson build system.
@eli-schwartz commented on this pull request.
@@ -20,6 +20,8 @@ Makefile.in
/ABOUT-NLS /aclocal.m4 /autom4te.cache +/build/ +/build-*/
Incidentally this is NOT necessary, because a builddir can be named anything (and you don't even match the recommended one which is `builddir/`.
Meanwhile Meson itself always knows which directory you create as a builddir, so it just creates the file `builddir/.gitignore` with the contents `*` for you. :)
+# 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') +python = find_program('python3') +# These two are truly optional +rst2html = find_program('rst2html', required: false) +rst2pdf = find_program('rst2pdf', required: false) +git = find_program('git', required: false) +if git.found() + ret = run_command(git, 'rev-parse', '--short', '--revs-only', 'HEAD', check: false)
I think you probably don't want this to be `check: false` because in the bizarro case that git errors out here you don't want this to be set to an empty string, though you might indeed want to check that the filesystem entry `.git` exists rather than assuming the current directory is a git checkout simply because git is installed.
The empty string is not the same as your current fallback of `-1`.
@kugel- pushed 3 commits.
8a9d915b3ff0e46c0264c8914a50975fe2f63f60 Prepare for meson build system 588c8fb11a8f4606c8a354e6b421a0d64cf85575 Add build directories to gitignore e9feb67332b17af85dc7eaa54cd7e2d69aa10b39 Port to the meson build system.
@kugel- commented on this pull request.
@@ -20,6 +20,8 @@ Makefile.in
/ABOUT-NLS /aclocal.m4 /autom4te.cache +/build/ +/build-*/
Maybe not necessary, but it doesn't hurt either. I use build directories for other purposes than meson (e.g. autotools build) in which cases no .gitignore is created.
@kugel- commented on this pull request.
+# 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') +python = find_program('python3') +# These two are truly optional +rst2html = find_program('rst2html', required: false) +rst2pdf = find_program('rst2pdf', required: false) +git = find_program('git', required: false) +if git.found() + ret = run_command(git, 'rev-parse', '--short', '--revs-only', 'HEAD', check: false)
fixed
@eli-schwartz commented on this pull request.
@@ -20,6 +20,8 @@ Makefile.in
/ABOUT-NLS /aclocal.m4 /autom4te.cache +/build/ +/build-*/
But the purpose of this PR is to migrate from autotools to meson, right? So presumably you don't need that anymore...
@elextr commented on this pull request.
@@ -20,6 +20,8 @@ Makefile.in
/ABOUT-NLS /aclocal.m4 /autom4te.cache +/build/ +/build-*/
There is going to be an overlap period similar to other projects migration.
@kugel- commented on this pull request.
@@ -20,6 +20,8 @@ Makefile.in
/ABOUT-NLS /aclocal.m4 /autom4te.cache +/build/ +/build-*/
You're free to build using meson exclusively but I'm not that far yet and don't want to remove Autotools right now.
I'm also not convinced that meson is the best build system out there (but it's undoubtedly a massive improvement).
@kugel- commented on this pull request.
@@ -0,0 +1,128 @@
+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')
Alright, convinced. 20.04 has 0.53 and that's the minimum required meson now.
Any further objects, or good to merge now? Will merge in a few days if nobody speaks up.
Would love to give it a last test, but as I can't its silence from me. And thanks for all the effort of doing this.
It looks pretty good now! Here my full build log: https://gist.github.com/eht16/b38c656d6f2edab62832f181248108c1
Findings: - there is a deprecation notice in https://gist.github.com/eht16/b38c656d6f2edab62832f181248108c1#file-gistfile... but I guess we could keep it for now - Plugins failed to compile first because meson installs geany.pc and the rest of the libs in `$prefix/lib/x86_64-linux-gnu`. I'm not sure if this is OK or not, at least it is different from autotools. With `./configure --prefix=/tmp/install-meson --with-geany-libdir=/tmp/install-meson/lib/x86_64-linux-gnu` Plugins compiled fine. - some files are not or in different locations installed compared to autotools. I added a list of differences in installed files in https://gist.github.com/eht16/b38c656d6f2edab62832f181248108c1#file-differen.... - I did *not* test on Windows, we can do this post-merge
I'd say we should sort out the install differences but then good to merge.
The notice of future deprecation can be safely ignored as long as you aren't bumping your minimum requirements.
The issue with `$prefix/lib/x86_64-linux-gnu` is because there's a Debian quirk. For both autotools and meson, the default if not specified is `--libdir=lib`, however, only with Meson that default changes to the directory output by `dpkg-architecture -qDEB_HOST_MULTIARCH`.
With autotools, the official debian package for geany instead just passes an option to `./configure --libdir='${prefix}lib/x86_64-linux-gnu .....` because they really, really, really want all projects to use that directory.
The user specified value `--libdir=lib` will always override that. But apparently it's considered a bad idea on Debian.
Plugins failed to compile first because meson installs geany.pc and the rest of the libs in $prefix/lib/x86_64-linux-gnu. I'm not sure if this is OK or not, at least it is different from autotools. With ./configure --prefix=/tmp/install-meson --with-geany-libdir=/tmp/install-meson/lib/x86_64-linux-gnu Plugins compiled fine.
Correct, as @eli-schwartz said, on Debians and derivatives the "correct" place is the architecture specific directory `lib/x86_64-linux-gnu`, not in basic `lib`. I expect this is because Debian builds for x86_64 and also ARM and IBM and they need to be separated. So in this case the meson build is more correct than the autotools build and should stay as it is.
So the parts of the @eht16 install diff that relate to this should not be changed.
Do we need to install the `share/doc/geany` files? (noting the licenses are installed in `share/geany`) They are not much use post build. Also note that the fact that the Lexilla license is missing from the Autotools build is a bug that should be fixed #3126.
The Tango icons has only (geany-save-all), why does _only_ this icon have an additional version? Looks more like a bug in the standard build to me.
@kugel- I thought we had fixed the missing scalable icons?
@kugel- pushed 1 commit.
7f6341be030bdf46cd38b3b5e04649483c9d358d fix some installation diferences to Autotools
I think I resolved most differences. Left is that we don't call `gtk-update-icon-cache` and Scintilla's Compat.h
```diff --- 1 2022-02-19 00:09:57.208958194 +0100 +++ 2 2022-02-19 00:20:39.484275455 +0100 @@ -21,7 +21,6 @@ ./include/geany/pluginutils.h ./include/geany/prefs.h ./include/geany/project.h -./include/geany/scintilla/Compat.h ./include/geany/scintilla/SciLexer.h ./include/geany/scintilla/Scintilla.h ./include/geany/scintilla/Scintilla.iface @@ -41,20 +40,13 @@ ./include/geany/toolbar.h ./include/geany/ui_utils.h ./include/geany/utils.h -./lib/geany/classbuilder.la ./lib/geany/classbuilder.so -./lib/geany/export.la ./lib/geany/export.so -./lib/geany/filebrowser.la ./lib/geany/filebrowser.so -./lib/geany/htmlchars.la ./lib/geany/htmlchars.so -./lib/geany/saveactions.la ./lib/geany/saveactions.so -./lib/geany/splitwindow.la ./lib/geany/splitwindow.so -./lib/libgeany.la -./lib/libgeany.so.0.0.0 +./lib/libgeany.so.0 ./lib/pkgconfig/geany.pc ./share/applications/geany.desktop ./share/doc/geany/AUTHORS @@ -82,6 +74,7 @@ ./share/doc/geany/html/images/pref_dialog_vte.png ./share/doc/geany/html/images/replace_dialog.png ./share/doc/geany/html/index.html +./share/doc/geany/LexillaLicense.txt ./share/doc/geany/manual.txt ./share/doc/geany/NEWS ./share/doc/geany/README @@ -214,6 +207,7 @@ ./share/icons/hicolor/24x24/actions/geany-build.png ./share/icons/hicolor/24x24/actions/geany-close-all.png ./share/icons/hicolor/24x24/actions/geany-save-all.png +./share/icons/hicolor/24x24/apps/geany.png ./share/icons/hicolor/32x32/actions/geany-build.png ./share/icons/hicolor/32x32/actions/geany-close-all.png ./share/icons/hicolor/32x32/actions/geany-save-all.png @@ -222,7 +216,6 @@ ./share/icons/hicolor/48x48/actions/geany-close-all.png ./share/icons/hicolor/48x48/actions/geany-save-all.png ./share/icons/hicolor/48x48/apps/geany.png -./share/icons/hicolor/icon-theme.cache ./share/icons/hicolor/scalable/actions/geany-build.svg ./share/icons/hicolor/scalable/actions/geany-close-all.svg ./share/icons/hicolor/scalable/actions/geany-save-all.svg @@ -231,7 +224,6 @@ ./share/icons/Tango/24x24/actions/geany-save-all.png ./share/icons/Tango/32x32/actions/geany-save-all.png ./share/icons/Tango/48x48/actions/geany-save-all.png -./share/icons/Tango/icon-theme.cache ./share/icons/Tango/scalable/actions/geany-save-all.svg ./share/locale/ar/LC_MESSAGES/geany.mo ./share/locale/ast/LC_MESSAGES/geany.mo
@kugel- pushed 7 commits.
404d1823d1778eca2b984111b7b1d9689726e921 Prepare for meson build system 54430389b89952808724559ef0e94d4d042fba85 Add build directories to gitignore 4a6c933f514565e79e2492262f16f6f3cec166b0 Port to the meson build system. 84d703e0a71887537baf70dd7c9d0557d2929a9d fix some installation diferences to Autotools 4a7f9824910eef63bd76ad774cd2567af5d5bc47 Add asciidoc 18a7999611110638b75ac9662e83fcdca14eb1d4 install geany.png@24x24 also for Automake 6f4630f2ef932e0a03726b2ec79a75595bde66a8 install LexillaLicense.txt also for Automake
Regarding gtk-update-icon-cache, this is not supported in the minimum meson version. Recently such funtionality (to run scripts after installation within the install directory) was added to the gnome module, see https://github.com/mesonbuild/meson/issues/8268
Does anyone know the impact of running this program (or more specifically, of not running it). My understanding is that packagers don't need it (because they usually set DESTDIR to install the binaries to a staging directory, from where the actual package is created) and run gtk-update-icon-cache as part of the package installation. But what's the impact for custom installation, e.g with prefix = /usr/local or something under $HOME ?
With DESTDIR set, the `post_install()` commands do not get run, because they are undesirable (they create cache files which conflict with the installed system).
With DESTDIR ***not*** set, some cache files do not get created, with the consequence that as far as the programs reading and relying on the cache are concerned, those icons don't exist. At least on first installation -- the index IIRC mostly contains the names of each available icon and what sizes they are available for. So applications that need those icons still have to read them, but the cache file means that one (mmapped) file is the only file that needs to be read from disk to known whether an icon is available, and where, across 16 different sizes and 13 different categories.
So you definitely want to run it. Before the Meson function got added, many projects would copy around a mostly identical `post_install.py` script which exited early `if 'DESTDIR' in os.environ`, and then ran each applicable post-installation command.
You can either do that, or only support interactive user installations on Meson 0.57 by hiding that `post_install()` behind a meson version check:
```meson if meson.version().version_compare('>=0.57.0') gnome_mod.post_install(gtk_update_icon_cache: true) else warning('too old version of meson detected, you may need to run `gtk-update-icon-cache` yourself after installing') # checking a deprecated script into git was opted against # meson.add_install_script('scripts/post_install.py') endif ```
Thanks for the insights. I'm still not sure what's the impact specifically for *geany*. I don't know what badness happens if you run geany without creating the icon cache (I haven't noticed any issues with my local) testing. We don't install lots of images at all (4 per size), maybe not worth?
Is "using the cache" something that's handled transparently by GTK or should there be some specific code inside Geany to support that cache file? I don't know about such code but maybe I just didn't came across yet.
IIUC not updating the cache means that updates to the icons may not be seen by GTK because it caches the icons in a directly mmapable form and does not read the icon file after that.
It should be automatic without Geany doing anything for icons that are cached.
Anything that runs gtk-update-icon-cache will do a full global re-cache, so as long as it is run at least once since you install geany to a live system, it will be fine.
Again, the risk of not running it is that cache lookups think it doesn't exist. So, what constitutes a cache lookup? Well, it is built into gtk, you're not supposed to have to think about it. :) Basically any function Gtk offers for looking up icons for you by name rather than absolute filepath. See e.g. gtk_icon_* or gtk_image_*, glade GtkImage* stuff...
gtk-update-icon-cache will do a full global re-cache
Ok, so geany needs to run gtk-update-icon-cache every time because its always possible its icons have been cached by another app.
Mind you Geany doesn't change its icons much (ever) and newer systems (like Mint) have icons for most of the Geany ones in their themes, so the Geany ones shouldn't be needed.
So the risk is when installing into a shared prefix where someone else already created the cache, like `/usr/local`? If the cache does not exist (e.g. when installing into a Geany-specific prefix) it'll be fine because GTK will do a full lookup, right?
Given that, and that autotools is still there and this generally does not affect packages (who set DESTDIR and must a find different solution anyway), I think I would go @eli-schwartz suggestion in https://github.com/geany/geany/pull/2761#issuecomment-1046137818 except perhaps printing the exact command that's needed. With time meson 0.57 will propagate to the systems. If that's not sufficient we can find a solution later on.
Hm `gnome.post_install()` seems to use gtk4-update-icon-cache which seems inappropriate for us, no?
@kugel- pushed 1 commit.
d51f334e9bcb73ce9341f91bf68a2e1ca6d6111e Run gtk_update_icon_cache only on newer meson
It uses whichever one is installed and available, the format of the cache files is the same either way so either tool is a drop-in replacement for the other.
Some vendors just ship the one from gtk4 and provide a symlink for the gtk3 name, because it is effectively the same completely standalone program (it doesn't even link to libgtk. The build system statically links it to libgtk, but it doesn't include any gtk headers).
Alright, unless anyone objects I will merge the the current state in a few days.
@kugel- pushed 3 commits.
bbb2c49599f1ac57e25c4aed94bb8f4e5bddd2bc Prepare for meson build system 83a63c12ca8e0c40071f64d90ae9ac4bf3c586cb Add build directories to gitignore 90414c1a9ec3a3cb4f2b716ae30635f0c5d07be3 Port to the meson build system.
@kugel- pushed 1 commit.
c31892063a3eb27a47934422b8b7a0bd05e11575 use meson features
@kugel- pushed 1 commit.
1179f18fd52a6c1c9fdb5067425d26e88d3f6587 fixup! use meson features
@kugel- pushed 3 commits.
c7bebb895ac425d9e0a8c15bdbf85a2548322a97 fixup! Prepare for meson build system 74e1d6d4cd247248fce417e8b25eea51b29c2b7d no config.h.meson 33ac301fe9ec732aff7ecaa4b0d332edc70e45e4 fix HAVE_DECL___ENVIRON and HAVE_DECL__NSGETENVIRON
@techee Can you please have a specific look at [33ac301](https://github.com/geany/geany/pull/2761/commits/33ac301fe9ec732aff7ecaa4b0d...) ? Is it OK to do it this way? My understanding of the comment is that the actual values of the defines is irrelevant.
@techee Can you please have a specific look at [33ac301](https://github.com/geany/geany/pull/2761/commits/33ac301fe9ec732aff7ecaa4b0d...) ? Is it OK to do it this way? My understanding of the comment is that the actual values of the defines is irrelevant.
I think so, yeah. I believe whatever compiles and makes unit tests pass is OK (I haven't tried yet though). Also the comment in configure.ac may be invalid now because something has changed in uctags in the meantime and these macros don't need to be defined any more.
Well they are used in Geanys tree in ctags main.c. We do compile that file but I don't know how's it used.
@kugel- pushed 3 commits.
0dcea51e5d83a723f58d5506fc12f366bf6ae5bc Prepare for meson build system 831dc814e3542808c640a0acf0459b42907b7b5b Add build directories to gitignore d0575f5c908531027bd1c5fbedbcfe5a3802fff7 Port to the meson build system.
Made some minor changes for Doxygen and added some header/function checks that were missing from meson.
I think I'm ready to merge this now and will do so tomorrow unless anyone complains.
Complain :smile: There have been a number of changes since anyone but you tried it. You shouldn't do a Neil and only give one days notice for people to look at them and test.
Whilst in theory its safe since autotools should still work, this touches a number of the autotools files as well. Since it passes CI its ok on Ubuntu, leaving a couple of weekends for other distro users to test it and for it to be tested with plugins is sensible.
Alright. One more week, then. Please have a look everyone.
Just gave it a quick shot, with the same tests as last time: build and install Geany, build and install G-P against the previously built Geany and compare file system differences.
The complete boring results are in https://gist.github.com/eht16/673f850caf4d4989b3c3a53b6748d754.
It looks much better now: - the differences in installed Geany files between Autotools and Meson are much smaller - G-P compiles and installs
However, there are still issues: - G-P installs into `/tmp/meson-install/lib/geany` but Geany's plugins are installed to `/tmp/meson-install/lib/x86_64-linux-gnu/geany` and Geany also looks only in its path, i.e. we still have a problem with the `x86_64-linux-gnu` part - there are still file system differences: - `share/icons/hicolor/24x24/apps/geany.png` is installed by Meson but not by Autotools, might be fine but why? - `share/doc/geany/LexillaLicense.txt` is missing with Autotools but already known and Lex created an issue for it - `share/icons/Tango/icon-theme.cache` is missing with Meson but probably harmless - Meson adds the `x86_64-linux-gnu` in LIBDIR. Might be correct and fine but G-P should notice and use it then
Do you use this PR for the autotools build? The first commit of this PR extends the autotools build a bit (for example 24x24 geany.png and LexillaLicense.txt)
gtk theme cache requires very recent meson, see previous discussion.
The libdir story is really messy, will have a look.
From @elextr's comment above:
Correct, as @eli-schwartz said, on Debians and derivatives the "correct" place is the architecture specific directory `lib/x86_64-linux-gnu`, not in basic `lib`. I expect this is because Debian builds for x86_64 and also ARM and IBM and they need to be separated. So in this case the meson build is more correct than the autotools build and should stay as it is.
My comment which is being referred to:
The issue with `$prefix/lib/x86_64-linux-gnu` is because there's a Debian quirk. For both autotools and meson, the default if not specified is `--libdir=lib`, however, only with Meson that default changes on systems where dpkg is installed and the debian release file is found in /etc, to the directory output by `dpkg-architecture -qDEB_HOST_MULTIARCH`.
With autotools, the official debian package for geany instead just passes an option to `./configure --libdir='${prefix}/lib/x86_64-linux-gnu .....` because they really, really, really want all projects to use that directory.
The user specified value `--libdir=lib` will always override that. But apparently it's considered a bad idea on Debian.
- `share/icons/Tango/icon-theme.cache` is missing with Meson but probably harmless
In autotools this is: https://github.com/geany/geany/blob/41624c411702d29834da0ff926f3c9f7c895bb47...
In meson this is: https://github.com/geany/geany/pull/2761/files#diff-d1e552a6e8f531b9bf5c39ef...
```meson 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 ```
Note that to correctly handle `if test -z "$(DESTDIR)";` in meson you need those Meson 0.57 features, or you need to add a custom python script. There is some existing discussion about that in this PR here: https://github.com/geany/geany/pull/2761#issuecomment-1046495333
Do you use this PR for the autotools build? The first commit of this PR extends the autotools build a bit (for example 24x24 geany.png and LexillaLicense.txt)
My autotools build was with current GIT master from Geany directly. Just tried again from the meson branch and then the file differences are related to the `x86_64-linux-gnu` infix. So it's all fine, great!
gtk theme cache requires very recent meson, see previous discussion.
I'm using Meson from Debian Testing: 0.61.2
The libdir story is really messy, will have a look.
I don't mind the final path at all. If it's all in `lib/x86_64-linux-gnu` this is probably fine. I just think, G-P with Autotools should then also use the same path, otherwise Geany won't find the installed plugins.
I tried following the meson instructions in the `README` (what read the instructions??) and it works!!! :rocket:
For me plugins configures, compiles and add-ons works!!! (only one that I use :-) with `./autogen.sh --prefix=/home/lex/geany-meson --with-geany-libdir=/home/lex/geany-meson/lib/x86_64-linux-gnu`.
@eli-schwartz the `--with-geany-libdir` was introduced to geany-plugins autotools build by the Geany Debian package maintainer because it was supposedly the "standard" way of doing things there instead of using `--libdir`.
But the statement in the Geany `README` ``` 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`
```
is incomplete on Debian and derivates. I suggest something like:
``` 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`
Meson will use the distro's preferred library location (eg `$prefix/lib/x86_64-linux-gnu` on Debian) or `$prefix/lib`.
Note, the Geany plugins autotools build assumes `$prefix/lib` so if your distro uses a different location geany plugins must be built with the `--with-geany-libdir=` set to the libdir used by the meson build. ```
The Geany autotools build also seems to work after this PR is applied.
So I'm ok with it.
PS thank you to @kugel- for the persistence and effort of getting this far even if I kept throwing out the anchor from time to time :smile:
I tried following the meson instructions in the `README` (what read the instructions??) and it works!!! rocket
For me plugins configures, compiles and add-ons works!!! (only one that I use :-) with `./autogen.sh --prefix=/home/lex/geany-meson --with-geany-libdir=/home/lex/geany-meson/lib/x86_64-linux-gnu`.
Oh, I didn't try this yet and yes, it seems to be the trick (and pretty obvious after Lex has revealed it :D). Sorry for not seeing this myself.
@kugel- when you are at @elextr's README suggestion, there are also two minor README code comments open which you could you check?
Apart from that, I would like to agree with Lex: seems good to go and thanks for your efforts and patience!
I mentioned earlier here, I always configure G-P only by poiting it to geany's pkg-config file, that selects prefix and libdir correctly in my experience.
`./configure PKG_CONFIG_PATH=/home/lex/geany-meson/lib/x86_64-linux-gnu/pkgconfig` or whatever that is on Ubuntu.
Merged #2761 into master.
github-comments@lists.geany.org