Problem: Some runtime files no longer spark joy.
Solution: Kondo the place up.
Still sparks _some_ joy (moved to new `runtime/scripts` folder):
* `macros/less.*`
* `mswin.vim`
* `tools/emoji_list.lua`
No longer sparks joy (removed):
* `macmap.vim` (gvimrc file; not useful in Nvim)
* `tools/check_colors.vim` (no longer useful with new default colorscheme and treesitter)
* `macros/editexisting.vim` (throws error on current Nvim)
* `macros/justify.vim` (obsolete shim for `packadd! justify`)
* `macros/matchit.vim` (same)
* `macros/shellmenu.vim` (same)
* `macros/swapmous.vim` (same)
- Consistently use the variable CMAKE_BUILD_TYPE to select build type.
- Remove broken `doc_html` target.
- Remove swap files created by oldtest when cleaning.
- Only rerun `lintdoc` if any documentation files has changed.
- remove "ran-" prefix from touch files as it's redundant since the
they're already in the directory named `touches`.
- Include `contrib` when formatting with `make formatlua`.
- Use TARGET_FILE generator expression instead of assuming the
executable location.
- reuse logic that determines whether to use lua or luajit.
- add translations to the `nvim` target.
Makefile improvements:
- rename variable `CMAKE_PRG` to `CMAKE` to make it more consistent with
the builtin `MAKE` variable.
- stop propagating flags to generator. Users should use cmake for
non-standard use cases.
- remove `+` prefix from targets. If the user for whatever reason wants
to dry-run a target then they should be able to.
This distinction is important for correct dependency management, as the
nvim binary is used to create some runtime files. The nvim binary (and
the target to build it) is thus called `nvim_bin` and the target to
build all of nvim (binary+runtime) is called `nvim`.
- Use `#pragma once` for `cmake.config/config.h.in`
- Remove unused variable `CACHED_GENERATED_DIR`
- Reorganize and sort variables
- Introduce `STYLUA_DIRS` variable to ensure the `formatlua` and
`lintlua-stylua` operates on the same files.
- Adjust variable scope to avoid using hacky directory properties.
- Add more necessary runtime files as test dependencies
- add EXTERNALPROJECT_OPTIONS variable to main build
- use `REQUIRED` keyword for IWYU.
- remove check_c_compiler_flag checks when `ENABLE_COMPILER_SUGGESTIONS`
is `ON`. If we explicitly enable it then we probably want it to give
an error if it doesn't exist, rather than silently skip it.
- Move dependency interface libraries to their find module and use them
as a pseudo-imported target.
- Remove BUSTED_OUTPUT_TYPE. It's not used and we can reintroduce it
again if something similar is needed.
- Use LINK_OPTIONS intead of LINK_FLAGS when generating the `--version`
output.
The benefits are primarily being able to use FetchContent, which allows
for a more flexible dependency handling. Other various quality-of-life
features such as `-B` and `-S` flags are also included.
This also removes broken `--version` generation as it does not work for
version 3.10 and 3.11 due to the `JOIN` generator expression.
Reference: https://github.com/neovim/neovim/issues/24004
This one generates a runtime/ file instead of a source file.
But otherwise it works the same like all other generators.
It has the same prerequisites (shared and mpack modules, etc), and,
importantly, it uses results from the source generators.
The odd location makes it easy to overlook when refactoring generators
(like I did last time, lol)
Currently files to install in runtime/ is detected by recursive glob
pattern which has two problems:
- cmake needs to do a of work at config time and
build/runtime/cmake_install.cmake becomes HUGE (2.5MB, biggest config file)
- we need to explicitly specify each file suffix used in the entire
runtime, which is duplication of information.
These globs specify every single file in a subdirectory.
Thus, we can just install every runtime/ subdirectory as a single
install command. Furthermore, at the top-level, only .vim and .lua files
need to be installed.
Further possible refactor: we could move files which does not belong
in $PREFIX/runtime out of $REPO/runtime. Then runtime could be installed
with a single install_helper(DIRECTORY ...) command.
- Use DIRECTORY instead of PATH in get_filename_component
- Use COMPILE_OPTIONS instead of COMPILE_FLAGS. COMPILE_FLAGS is treated
as a single string while COMPILE_OPTIONS is a list, meaning that cmake
will take care of any escaping and quoting automatically.
Install the icon of the application in the hicolor XDG icon theme;
this way it can be properly loaded by XDG menus in the currently set
XDG icon theme, without looking in the legacy pixmaps location.
This avoids generating the tags files all the time, and makes `make
install` with `CMAKE_INSTALL_MESSAGE=LAZY` much more silent in general.
Using `copy_if_different` instead of `remove` + `copy_directory` might
be good on top, but is a) not really necessary anymore and b) would not
sync removed files.
For this `file(COPY` could be used, but would require to re-run cmake on
changed input files then.
Only remove the directory contents. If the directory itself is removed,
then `sudo make install` creates a root-owned …/doc/ directory. That
breaks the next non-root build.
This was an accident of 0b1904d835.
Note: the following does not work, because it misses renamed help files
(which would no longer be in the build-tree definition)
COMMAND ${CMAKE_COMMAND} -E remove ${BUILDDOCFILES} ${GENERATED_HELP_TAGS}
With `xdg-*` utilities CMAKE_INSTALL_PREFIX is incorrectly ignored.
Taken from [nvim-qt][1]. For some reason it only checks for !APPLE.
[1]: b26596d164/src/gui/CMakeLists.txt (L48-L55)
Closes#3689
cmake: Add `desktop-install` and `icon-install` targets. `runtime`
target will trigger them.
Specification:
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys
Icons are stored system-wide in /usr/share/applications or user wide at
/usr/share/icons/hicolor/scalable/apps and can be overriden in ~/.local/share/icons
nvim.desktop file can be installed system wide or in
~/.local/share/applications/
To test without an installer:
$ xdg-desktop-menu install --novendor runtime/nvim.desktop
$ xdg-icon-resource install --novendor --mode user --size 64 contrib/nvim-icon.png
Once it is installed, you can test with gtk-launch if installed or
dmenu/rofi (drun mode)
This was more trouble than it is worth:
- remove_directory fails if doc/ is not owned by the user
- some devs build in-tree, then deleting doc/ breaks the build
- `make install` isn't affected by the stale files at all: the tags are
built before install-time
So, reverting this change means only that devs who use a build/
directory will need to delete build/runtime/doc/ on the occasion that we
rename a doc file.
If a help file is renamed, stale help files in the build workspace will
cause duplicate tags (which causes the build to fail). To avoid this,
always delete build/runtime/doc/ before building helptags.
Specify that the ${GENERATED_HELP_TAGS} "command" (output) depends on
`helptags` so that it always regenerates the doc/ tags. (cmake "targets"
always run, whereas "commands" are contingent on their dependencies. But
we don't define doc/ dependencies because they are circular.)
Declare dependency in terms of directory, rather than individual doc
files to avoid target dependency cycles. This still maintains install
targets at doc file level.
I see that problem fixed by #2801 was resurrected by making help tags file
generated in a more direct way. This fixes the hang without using the empty
file.