Compare commits
190 Commits
v0.8.1
...
release-0.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6ec04e590f | ||
![]() |
a7f4d0a782 | ||
![]() |
44205fe516 | ||
![]() |
4cd0ee49af | ||
![]() |
229e14c5ad | ||
![]() |
37b3fc493c | ||
![]() |
ad84bbbd13 | ||
![]() |
5190f82a52 | ||
![]() |
ce7df6759c | ||
![]() |
56834f4552 | ||
![]() |
1dfd7a4e77 | ||
![]() |
8ddeac7cf9 | ||
![]() |
4ad97a51b3 | ||
![]() |
2053f579a6 | ||
![]() |
c8c96de310 | ||
![]() |
567bb36edf | ||
![]() |
68d2bb4070 | ||
![]() |
4a12e40066 | ||
![]() |
403e653903 | ||
![]() |
a25607a2bc | ||
![]() |
d9521c71d1 | ||
![]() |
49a9fb2d98 | ||
![]() |
5baa99944a | ||
![]() |
da57f37ddc | ||
![]() |
df487f798d | ||
![]() |
1353369fbb | ||
![]() |
0cede3b9df | ||
![]() |
b8da4303f4 | ||
![]() |
bb14e22795 | ||
![]() |
7e6877b9d2 | ||
![]() |
92e8808d77 | ||
![]() |
d7d55fa358 | ||
![]() |
a4d1ef3128 | ||
![]() |
202666b1b7 | ||
![]() |
3dfb9b7f5c | ||
![]() |
10cb481d7c | ||
![]() |
90a37f9890 | ||
![]() |
7eaeb07c1c | ||
![]() |
4e402ae548 | ||
![]() |
003b8daa8a | ||
![]() |
44d0c6572b | ||
![]() |
b7c0c8cde8 | ||
![]() |
dbe4270db7 | ||
![]() |
29d74cf526 | ||
![]() |
6eff8d6d86 | ||
![]() |
e8ee673392 | ||
![]() |
9077e4e655 | ||
![]() |
9b2fc224d8 | ||
![]() |
3eb251c76f | ||
![]() |
535fb9488c | ||
![]() |
b477afa3ea | ||
![]() |
71e2c49b17 | ||
![]() |
175892fa37 | ||
![]() |
790f6089e9 | ||
![]() |
b0eedceab4 | ||
![]() |
059107f424 | ||
![]() |
dca69c90d4 | ||
![]() |
0d230d3f01 | ||
![]() |
a59bade869 | ||
![]() |
f2b465232d | ||
![]() |
b3d754ccd7 | ||
![]() |
e820c6d7c3 | ||
![]() |
cf9c097f34 | ||
![]() |
3942a3f5d0 | ||
![]() |
c0224b59da | ||
![]() |
a05da1c05a | ||
![]() |
17299b302c | ||
![]() |
2fe25ad06c | ||
![]() |
6349ec9e7c | ||
![]() |
7266150eff | ||
![]() |
40e13c8d95 | ||
![]() |
38928b5cc2 | ||
![]() |
18e0d64666 | ||
![]() |
d78447481c | ||
![]() |
e2915709b0 | ||
![]() |
cd7ac0eb29 | ||
![]() |
433f3067a0 | ||
![]() |
30ae06c8fe | ||
![]() |
777d415da8 | ||
![]() |
f70e0832b1 | ||
![]() |
ee210b0f74 | ||
![]() |
512a8197c8 | ||
![]() |
79ca64a1ef | ||
![]() |
2ebc76b226 | ||
![]() |
41709831ae | ||
![]() |
fdd5178581 | ||
![]() |
ed9e6d19ab | ||
![]() |
05ce04e994 | ||
![]() |
351b5969c1 | ||
![]() |
fe42dea674 | ||
![]() |
f15d6094fc | ||
![]() |
5243cb8a4b | ||
![]() |
bf4df2a629 | ||
![]() |
3cea4d6de9 | ||
![]() |
05f6883ee2 | ||
![]() |
1dba6cf8f0 | ||
![]() |
0c9d666205 | ||
![]() |
fc4e4b38b2 | ||
![]() |
bd3bb128c0 | ||
![]() |
d317cb2322 | ||
![]() |
1496f4212b | ||
![]() |
f0f63502ce | ||
![]() |
df19f086ba | ||
![]() |
0e10b17164 | ||
![]() |
6768784feb | ||
![]() |
2146a48587 | ||
![]() |
b43eed7d91 | ||
![]() |
ec40fef0af | ||
![]() |
811ee04030 | ||
![]() |
9876db1aa5 | ||
![]() |
1677548ebc | ||
![]() |
0dc5bcd072 | ||
![]() |
3a1e8ef881 | ||
![]() |
cb1b4bbeae | ||
![]() |
7af873f9d5 | ||
![]() |
479f41aa89 | ||
![]() |
01d0d2ce64 | ||
![]() |
f3ffb73b18 | ||
![]() |
4afadaf9d1 | ||
![]() |
107694acdc | ||
![]() |
58dd142090 | ||
![]() |
8b63e3dc6d | ||
![]() |
7d4ab102a6 | ||
![]() |
31307c3877 | ||
![]() |
4e4e185405 | ||
![]() |
aba7cb0613 | ||
![]() |
56d05076f8 | ||
![]() |
496e786cad | ||
![]() |
0377973769 | ||
![]() |
35075dcc22 | ||
![]() |
9e040acfa3 | ||
![]() |
28c08fdbe3 | ||
![]() |
37b82b513c | ||
![]() |
8a23b8ed29 | ||
![]() |
7990fa4a17 | ||
![]() |
ca3ef915ce | ||
![]() |
0b8faccade | ||
![]() |
b7a5278249 | ||
![]() |
e28799f2d8 | ||
![]() |
c4690565c7 | ||
![]() |
15b8036f90 | ||
![]() |
7f08e3282f | ||
![]() |
3b4881afc2 | ||
![]() |
1e28068d0d | ||
![]() |
203b088d75 | ||
![]() |
f179729789 | ||
![]() |
e502e8106a | ||
![]() |
7567d2195a | ||
![]() |
a10a904b8f | ||
![]() |
3868c8db6f | ||
![]() |
d165289055 | ||
![]() |
f3587babfd | ||
![]() |
631393a712 | ||
![]() |
08cd391047 | ||
![]() |
508c8a597e | ||
![]() |
ffd46b7688 | ||
![]() |
2a6198319f | ||
![]() |
8d4fbcb5b1 | ||
![]() |
b80ef0de2f | ||
![]() |
14a5b6b8d4 | ||
![]() |
89260ea5d6 | ||
![]() |
ef43e7d1f6 | ||
![]() |
9e5cef945a | ||
![]() |
aff05c5730 | ||
![]() |
fa7d8c333f | ||
![]() |
d916d2f876 | ||
![]() |
f7e2ad7915 | ||
![]() |
7f8faac39e | ||
![]() |
0302c351e7 | ||
![]() |
0298652c30 | ||
![]() |
1a84384487 | ||
![]() |
91a326f474 | ||
![]() |
e8e8827868 | ||
![]() |
82782ba593 | ||
![]() |
36b9f5edce | ||
![]() |
a111b048d2 | ||
![]() |
148e225231 | ||
![]() |
106fcd1e90 | ||
![]() |
27c52616de | ||
![]() |
c8f01db8f6 | ||
![]() |
3ee089ebf4 | ||
![]() |
0f811afc96 | ||
![]() |
555ded8e82 | ||
![]() |
98ecc6a74c | ||
![]() |
30800ea73b | ||
![]() |
c3623fcda6 | ||
![]() |
1041cc7ccb | ||
![]() |
dcaaeec8a4 | ||
![]() |
c68d9321e7 | ||
![]() |
b5953d4484 |
40
.builds/freebsd.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
image: freebsd/latest
|
||||
|
||||
packages:
|
||||
- cmake
|
||||
- gmake
|
||||
- ninja
|
||||
- libtool
|
||||
- automake
|
||||
- pkgconf
|
||||
- unzip
|
||||
- wget
|
||||
- gettext
|
||||
- python
|
||||
- libffi
|
||||
- gdb
|
||||
|
||||
sources:
|
||||
- https://github.com/neovim/neovim
|
||||
|
||||
environment:
|
||||
SOURCEHUT: 1
|
||||
LANG: en_US.UTF-8
|
||||
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
|
||||
|
||||
tasks:
|
||||
- build-deps: |
|
||||
cd neovim
|
||||
gmake deps
|
||||
- build: |
|
||||
cd neovim
|
||||
gmake CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" nvim
|
||||
- functionaltest: |
|
||||
cd neovim
|
||||
gmake functionaltest
|
||||
- unittest: |
|
||||
cd neovim
|
||||
gmake unittest
|
||||
- oldtest: |
|
||||
cd neovim
|
||||
gmake oldtest
|
44
.builds/openbsd.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
# sourcehut CI: https://builds.sr.ht/~jmk/neovim
|
||||
|
||||
image: openbsd/latest
|
||||
|
||||
packages:
|
||||
- autoconf-2.71
|
||||
- automake-1.16.3
|
||||
- cmake
|
||||
- gettext-runtime
|
||||
- gettext-tools
|
||||
- gmake
|
||||
- libtool
|
||||
- ninja
|
||||
- unzip-6.0p14
|
||||
- gdb
|
||||
|
||||
sources:
|
||||
- https://github.com/neovim/neovim
|
||||
|
||||
environment:
|
||||
SOURCEHUT: 1
|
||||
LC_CTYPE: en_US.UTF-8
|
||||
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
|
||||
|
||||
tasks:
|
||||
- build-deps: |
|
||||
export AUTOCONF_VERSION=2.71
|
||||
export AUTOMAKE_VERSION=1.16
|
||||
mkdir neovim/.deps
|
||||
cd neovim/.deps
|
||||
cmake -G Ninja ../third-party/
|
||||
cmake --build . --config RelWithDebInfo
|
||||
- build: |
|
||||
mkdir neovim/build
|
||||
cd neovim/build
|
||||
cmake -G Ninja $CMAKE_EXTRA_FLAGS ..
|
||||
cmake --build . --config RelWithDebInfo
|
||||
./bin/nvim --version
|
||||
- functionaltest: |
|
||||
cd neovim/build
|
||||
cmake --build . --config RelWithDebInfo --target functionaltest
|
||||
- oldtest: |
|
||||
cd neovim
|
||||
gmake oldtest
|
29
.cirrus.yml
@@ -1,29 +0,0 @@
|
||||
env:
|
||||
CIRRUS_CLONE_DEPTH: '2'
|
||||
LANG: en_US.UTF-8
|
||||
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
|
||||
|
||||
freebsd_task:
|
||||
name: FreeBSD
|
||||
only_if: $BRANCH != "master"
|
||||
freebsd_instance:
|
||||
image_family: freebsd-13-1
|
||||
timeout_in: 30m
|
||||
install_script:
|
||||
- pkg update -f
|
||||
- pkg install -y cmake gmake ninja libtool automake pkgconf unzip wget gettext python libffi git
|
||||
build_deps_script:
|
||||
- gmake deps
|
||||
build_script:
|
||||
- gmake CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" nvim
|
||||
workaround_script:
|
||||
# Run tests as user "cirrus" instead of root. This is required for the
|
||||
# permission-related tests to work correctly.
|
||||
- pw useradd cirrus -m
|
||||
- chown -R cirrus:cirrus .
|
||||
functionaltest_script:
|
||||
- sudo -u cirrus gmake functionaltest
|
||||
unittest_script:
|
||||
- sudo -u cirrus gmake unittest
|
||||
oldtest_script:
|
||||
- sudo -u cirrus gmake oldtest
|
@@ -36,32 +36,5 @@ BraceWrapping:
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
PointerAlignment: Right
|
||||
SortIncludes: true
|
||||
SortIncludes: false
|
||||
Cpp11BracedListStyle: false
|
||||
IncludeCategories:
|
||||
- Regex: '<[/[:alnum:].]+>'
|
||||
Priority: 0
|
||||
- Regex: '^"(nvim|vim)/'
|
||||
Priority: 1
|
||||
SortPriority: 1
|
||||
CaseSensitive: false
|
||||
AlignConsecutiveMacros: AcrossEmptyLines
|
||||
IndentPPDirectives: AfterHash
|
||||
SpaceBeforeParens: ControlStatementsExceptControlMacros
|
||||
PPIndentWidth: 1
|
||||
ForEachMacros:
|
||||
- FOR_ALL_AUEVENTS
|
||||
- FOR_ALL_AUPATS_IN_EVENT
|
||||
- FOR_ALL_BUFFERS
|
||||
- FOR_ALL_BUFFERS_BACKWARDS
|
||||
- FOR_ALL_FRAMES
|
||||
- FOR_ALL_QFL_ITEMS
|
||||
- FOR_ALL_SIGNS_IN_BUF
|
||||
- FOR_ALL_TABS
|
||||
- FOR_ALL_TAB_WINDOWS
|
||||
- FOR_ALL_WINDOWS_IN_TAB
|
||||
- RBUFFER_EACH
|
||||
- RBUFFER_EACH_REVERSE
|
||||
- RBUFFER_UNTIL_EMPTY
|
||||
- RBUFFER_UNTIL_FULL
|
||||
- kl_iter
|
||||
|
@@ -6,6 +6,7 @@ indent_size = 2
|
||||
tab_width = 8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
|
||||
[*.{c,h,in,lua}]
|
||||
max_line_length = 100
|
||||
|
@@ -47,16 +47,7 @@ a68faed02dc8e37b8f10da14dc02e33e6ed93947
|
||||
ee031eb5256bb83e0d6add2bae6fd943a4186ffe
|
||||
69e11b58b4db0952f11a5ff85aa7150b5f5b8db8
|
||||
271bb32855853b011fceaf0ad2f829bce66b2a19
|
||||
aefdc6783cb77f09786542c90901a9e7120bea42
|
||||
aa4f9c5341f5280f16cce0630ea54b84eef717b3
|
||||
0adc66171a355a12494d87ebb767d509540c7ef9
|
||||
93f24403f8cc760ff47979c596976b53a8b16358
|
||||
1ffd527c837fb2465c9659273bbe5447a1352db2
|
||||
2498e9feb025361576603a0101c86393d211e31e
|
||||
|
||||
# typos
|
||||
d238b8f6003d34cae7f65ff7585b48a2cd9449fb
|
||||
4547137aaff32b20172870a549d3a28a3c7adf1c
|
||||
|
||||
# generated docs
|
||||
ea333badd24f691c753d8048f911d1db349bc2cd
|
||||
|
16
.gitattributes
vendored
@@ -1,16 +1,6 @@
|
||||
*.h.in linguist-language=C
|
||||
*.c.in linguist-language=C
|
||||
*CMakeLists.txt linguist-language=CMake
|
||||
|
||||
runtime/doc/* linguist-documentation
|
||||
|
||||
src/xdiff/** linguist-vendored
|
||||
src/cjson/** linguist-vendored
|
||||
src/unicode/** linguist-vendored
|
||||
|
||||
*.h linguist-language=C
|
||||
src/nvim/testdir/test42.in diff
|
||||
|
||||
.github/ export-ignore
|
||||
.github/ export-ignore
|
||||
.travis.yml export-ignore
|
||||
codecov.yml export-ignore
|
||||
.builds/ export-ignore
|
||||
.builds/ export-ignore
|
||||
|
6
.github/labeler.yml
vendored
@@ -13,13 +13,12 @@
|
||||
- src/nvim/lua/treesitter.*
|
||||
- runtime/lua/vim/treesitter.lua
|
||||
- runtime/lua/vim/treesitter/*
|
||||
- runtime/queries/**/*
|
||||
|
||||
"diagnostic":
|
||||
- runtime/lua/vim/diagnostic.lua
|
||||
|
||||
"dependencies":
|
||||
- cmake.deps/**/*
|
||||
- third-party/**/*
|
||||
|
||||
"spell":
|
||||
- src/nvim/spell*
|
||||
@@ -28,6 +27,8 @@
|
||||
- src/nvim/terminal.*
|
||||
|
||||
"column":
|
||||
- src/nvim/mark.h
|
||||
- src/nvim/mark.c
|
||||
- src/nvim/sign*
|
||||
|
||||
"folds":
|
||||
@@ -38,7 +39,6 @@
|
||||
|
||||
"documentation":
|
||||
- all: ["runtime/doc/*"]
|
||||
- all: ["**/*.md"]
|
||||
|
||||
"clipboard":
|
||||
- runtime/autoload/provider/clipboard.vim
|
||||
|
11
.github/scripts/reviews.js
vendored
@@ -9,16 +9,15 @@ module.exports = async ({github, context}) => {
|
||||
const reviewers = new Set()
|
||||
if (labels.includes('api')) {
|
||||
reviewers.add("bfredl")
|
||||
reviewers.add("gpanders")
|
||||
reviewers.add("muniter")
|
||||
}
|
||||
|
||||
if (labels.includes('build')) {
|
||||
reviewers.add("jamessan")
|
||||
reviewers.add("justinmk")
|
||||
}
|
||||
|
||||
if (labels.includes('ci')) {
|
||||
reviewers.add("dundargoc")
|
||||
reviewers.add("jamessan")
|
||||
}
|
||||
|
||||
@@ -55,14 +54,18 @@ module.exports = async ({github, context}) => {
|
||||
reviewers.add("gpanders")
|
||||
}
|
||||
|
||||
if (labels.includes('gui')) {
|
||||
reviewers.add("glacambre")
|
||||
reviewers.add("smolck")
|
||||
}
|
||||
|
||||
if (labels.includes('lsp')) {
|
||||
reviewers.add("mfussenegger")
|
||||
reviewers.add("glepnir")
|
||||
reviewers.add("mjlbach")
|
||||
}
|
||||
|
||||
if (labels.includes('treesitter')) {
|
||||
reviewers.add("bfredl")
|
||||
reviewers.add("clason")
|
||||
reviewers.add("vigoux")
|
||||
}
|
||||
|
||||
|
2
.github/workflows/api-docs-check.yml
vendored
@@ -1,6 +1,7 @@
|
||||
name: Missing API docs
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
branches-ignore:
|
||||
- 'marvim/api-doc-update**'
|
||||
paths:
|
||||
@@ -10,6 +11,7 @@ on:
|
||||
|
||||
jobs:
|
||||
call-regen-api-docs:
|
||||
if: github.event.pull_request.draft == false
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
14
.github/workflows/api-docs.yml
vendored
@@ -21,24 +21,23 @@ on:
|
||||
|
||||
jobs:
|
||||
regen-api-docs:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
# Fetch depth 0 is required if called through workflow_call. In order
|
||||
# to create a PR we need to access other branches, which requires a
|
||||
# full clone.
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen python3 python3-msgpack luajit
|
||||
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y python3 luajit
|
||||
conda install -c conda-forge doxygen=1.9.2 msgpack-python
|
||||
echo "$CONDA/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Setup git config
|
||||
run: |
|
||||
@@ -59,7 +58,8 @@ jobs:
|
||||
run: |
|
||||
echo "Job failed, run ./scripts/gen_vimdoc.py and commit your doc changes"
|
||||
echo "The doc generation produces the following changes:"
|
||||
git diff --color --exit-code
|
||||
git --no-pager diff
|
||||
exit 1
|
||||
|
||||
- name: Automatic PR
|
||||
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && !inputs.check_only }}
|
||||
|
10
.github/workflows/backport.yml
vendored
@@ -2,6 +2,8 @@ name: Backport
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [closed, labeled]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
jobs:
|
||||
backport:
|
||||
permissions:
|
||||
@@ -12,16 +14,20 @@ jobs:
|
||||
github.repository_owner == 'neovim' && (
|
||||
github.event_name == 'pull_request_target' &&
|
||||
github.event.pull_request.merged
|
||||
) || (
|
||||
github.event_name == 'issue_comment' &&
|
||||
github.event.issue.pull_request &&
|
||||
contains(github.event.comment.body, '/backport')
|
||||
)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
# required to find all branches
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Create backport PRs
|
||||
uses: zeebe-io/backport-action@v0.0.8
|
||||
uses: zeebe-io/backport-action@v0.0.7
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github_workspace: ${{ github.workspace }}
|
||||
|
215
.github/workflows/ci.yml
vendored
@@ -5,6 +5,7 @@ on:
|
||||
- 'master'
|
||||
- 'release-[0-9]+.[0-9]+'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release-[0-9]+.[0-9]+'
|
||||
@@ -18,136 +19,18 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
CC: gcc
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup common environment variables
|
||||
run: ./.github/workflows/env.sh lint
|
||||
|
||||
- name: Install apt packages
|
||||
run: |
|
||||
sudo add-apt-repository ppa:neovim-ppa/stable
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
autoconf \
|
||||
automake \
|
||||
build-essential \
|
||||
cmake \
|
||||
flake8 \
|
||||
gettext \
|
||||
libluajit-5.1-dev \
|
||||
libmsgpack-dev \
|
||||
libtermkey-dev \
|
||||
libtool-bin \
|
||||
libtree-sitter-dev \
|
||||
libunibilium-dev \
|
||||
libuv1-dev \
|
||||
libvterm-dev \
|
||||
locales \
|
||||
lua-busted \
|
||||
lua-check \
|
||||
lua-filesystem \
|
||||
lua-inspect \
|
||||
lua-lpeg \
|
||||
lua-luv-dev \
|
||||
lua-nvim \
|
||||
luajit \
|
||||
ninja-build \
|
||||
pkg-config
|
||||
|
||||
- name: Cache uncrustify
|
||||
id: cache-uncrustify
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ env.CACHE_UNCRUSTIFY }}
|
||||
key: ${{ env.UNCRUSTIFY_VERSION }}
|
||||
|
||||
- name: Clone uncrustify
|
||||
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: uncrustify/uncrustify
|
||||
ref: ${{ env.UNCRUSTIFY_VERSION }}
|
||||
path: uncrustify
|
||||
|
||||
- name: Install uncrustify
|
||||
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
source_dir=uncrustify
|
||||
build_dir=uncrustify/build
|
||||
cmake -S $source_dir -B $build_dir -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build $build_dir
|
||||
mkdir -p $HOME/.cache
|
||||
cp $build_dir/uncrustify ${{ env.CACHE_UNCRUSTIFY }}
|
||||
|
||||
- name: Cache artifacts
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
${{ env.CACHE_NVIM_DEPS_DIR }}
|
||||
key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!cmake.deps/**CMakeLists.txt') }}-${{ github.base_ref }}
|
||||
|
||||
- name: Build third-party deps
|
||||
run: ./ci/before_script.sh
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: lintstylua
|
||||
uses: JohnnyMorganz/stylua-action@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --check runtime/
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: lintlua
|
||||
run: make lintlua
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: lintpy
|
||||
run: make lintpy
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: lintsh
|
||||
run: make lintsh
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: uncrustify
|
||||
run: |
|
||||
${{ env.CACHE_UNCRUSTIFY }} -c ./src/uncrustify.cfg -q --replace --no-backup $(find ./src/nvim -name "*.[ch]")
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: suggester / uncrustify
|
||||
uses: reviewdog/action-suggester@v1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tool_name: uncrustify
|
||||
cleanup: false
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: check uncrustify
|
||||
run: |
|
||||
git diff --color --exit-code
|
||||
|
||||
- name: Cache dependencies
|
||||
run: ./ci/before_cache.sh
|
||||
|
||||
lintc:
|
||||
# This job tests two things: it lints the code but also builds neovim using
|
||||
# system dependencies instead of bundled dependencies. This is to make sure
|
||||
# we are able to build neovim without pigeonholing ourselves into specifics
|
||||
# of the bundled dependencies.
|
||||
|
||||
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
||||
if: (github.event_name == 'pull_request' && github.base_ref == 'master' && !github.event.pull_request.draft) || (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
CC: gcc
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup common environment variables
|
||||
run: ./.github/workflows/env.sh lint
|
||||
@@ -160,8 +43,11 @@ jobs:
|
||||
autoconf \
|
||||
automake \
|
||||
build-essential \
|
||||
ccache \
|
||||
cmake \
|
||||
flake8 \
|
||||
gettext \
|
||||
gperf \
|
||||
libluajit-5.1-dev \
|
||||
libmsgpack-dev \
|
||||
libtermkey-dev \
|
||||
@@ -183,25 +69,38 @@ jobs:
|
||||
pkg-config
|
||||
|
||||
- name: Cache artifacts
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
${{ env.CACHE_NVIM_DEPS_DIR }}
|
||||
key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!cmake.deps/**CMakeLists.txt') }}-${{ github.base_ref }}
|
||||
~/.ccache
|
||||
key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!third-party/**CMakeLists.txt') }}-${{ github.base_ref }}
|
||||
|
||||
- name: Build third-party deps
|
||||
- name: Build third-party
|
||||
run: ./ci/before_script.sh
|
||||
|
||||
- name: Build nvim
|
||||
run: ./ci/run_tests.sh build_nvim
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: lintc
|
||||
run: make lintc
|
||||
name: clint-full
|
||||
run: ./ci/run_lint.sh clint-full
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: lualint
|
||||
run: ./ci/run_lint.sh lualint
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: pylint
|
||||
run: ./ci/run_lint.sh pylint
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: shlint
|
||||
run: ./ci/run_lint.sh shlint
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: check-single-includes
|
||||
run: make check-single-includes
|
||||
run: ./ci/run_lint.sh check-single-includes
|
||||
|
||||
- name: Cache dependencies
|
||||
run: ./ci/before_cache.sh
|
||||
@@ -220,20 +119,18 @@ jobs:
|
||||
cc: clang-13
|
||||
runner: ubuntu-20.04
|
||||
os: linux
|
||||
- flavor: uchar
|
||||
cc: gcc
|
||||
runner: ubuntu-20.04
|
||||
os: linux
|
||||
- cc: clang
|
||||
runner: macos-11
|
||||
runner: macos-10.15
|
||||
os: osx
|
||||
- cc: clang
|
||||
runner: macos-11.0
|
||||
os: osx
|
||||
|
||||
# functionaltest-lua is our dumping ground for non-mainline configurations.
|
||||
# The functionaltest-lua test two things simultaneously:
|
||||
# 1. Check that the tests pass with PUC Lua instead of LuaJIT.
|
||||
# 2. Use as oldest/minimum versions of dependencies/build tools we
|
||||
# still explicitly support so we don't accidentally rely on
|
||||
# features that is only available on later versions.
|
||||
# 3. No treesitter parsers installed.
|
||||
- flavor: functionaltest-lua
|
||||
cc: gcc
|
||||
runner: ubuntu-20.04
|
||||
@@ -241,11 +138,12 @@ jobs:
|
||||
cmake: minimum_required
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 45
|
||||
if: github.event.pull_request.draft == false
|
||||
env:
|
||||
CC: ${{ matrix.cc }}
|
||||
CI_OS_NAME: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup common environment variables
|
||||
run: ./.github/workflows/env.sh ${{ matrix.flavor }}
|
||||
@@ -254,7 +152,7 @@ jobs:
|
||||
if: matrix.os == 'linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential cmake cpanminus cscope gcc-multilib gdb gettext language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
|
||||
sudo apt-get install -y autoconf automake build-essential ccache cmake cpanminus cscope gcc-multilib gdb gettext gperf language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
|
||||
|
||||
- name: Install minimum required version of cmake
|
||||
if: matrix.cmake == 'minimum_required'
|
||||
@@ -286,19 +184,20 @@ jobs:
|
||||
if: matrix.os == 'osx'
|
||||
run: |
|
||||
brew update --quiet
|
||||
brew install automake cpanminus ninja
|
||||
brew install automake ccache cpanminus ninja
|
||||
|
||||
- name: Setup interpreter packages
|
||||
run: ./ci/install.sh
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
${{ env.CACHE_NVIM_DEPS_DIR }}
|
||||
key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'cmake.deps/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
|
||||
~/.ccache
|
||||
key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
|
||||
|
||||
- name: Build third-party deps
|
||||
- name: Build third-party
|
||||
run: ./ci/before_script.sh
|
||||
|
||||
- name: Build
|
||||
@@ -326,33 +225,25 @@ jobs:
|
||||
windows:
|
||||
runs-on: windows-2019
|
||||
timeout-minutes: 45
|
||||
if: github.event.pull_request.draft == false
|
||||
env:
|
||||
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
||||
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
||||
CMAKE_BUILD_TYPE: "RelWithDebInfo"
|
||||
name: windows (MSVC_64)
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/cache@v3
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config: [ MINGW_64-gcov, MSVC_64 ]
|
||||
name: windows (${{ matrix.config }})
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.DEPS_BUILD_DIR }}
|
||||
key: ${{ hashFiles('cmake.deps\**') }}
|
||||
key: ${{ matrix.config }}-${{ hashFiles('third-party\**') }}
|
||||
|
||||
- name: Build deps
|
||||
run: .\ci\build.ps1 -BuildDeps
|
||||
|
||||
- name: Build nvim
|
||||
run: .\ci\build.ps1 -Build
|
||||
|
||||
- name: Install test deps
|
||||
continue-on-error: false
|
||||
run: .\ci\build.ps1 -EnsureTestDeps
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: Run tests
|
||||
run: .\ci\build.ps1 -Test
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: Run old tests
|
||||
run: .\ci\build.ps1 -TestOld
|
||||
- name: Run CI
|
||||
run: powershell ci\build.ps1
|
||||
env:
|
||||
CONFIGURATION: ${{ matrix.config }}
|
||||
|
42
.github/workflows/codeql-analysis.yml
vendored
@@ -1,42 +0,0 @@
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '42 0 * * 0'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'cpp', 'python' ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup common environment variables
|
||||
run: ./.github/workflows/env.sh
|
||||
|
||||
- name: Install apt packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential cmake cpanminus cscope gcc-multilib gdb gettext language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
|
||||
- if: matrix.language == 'cpp'
|
||||
run: make
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
2
.github/workflows/commitlint.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.pull_request.draft == false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
8
.github/workflows/coverity-scan.yml
vendored
@@ -1,19 +1,19 @@
|
||||
name: Coverity
|
||||
on:
|
||||
schedule:
|
||||
- cron: '10 0 * * *' # Run every day at 00:10
|
||||
- cron: '0 10 * * 1' # Run every Monday at 00:10
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
scan:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
|
||||
sudo apt-get install -y autoconf automake build-essential cmake gettext gperf libtool-bin locales ninja-build pkg-config unzip
|
||||
|
||||
- name: Download Coverity
|
||||
run: |
|
||||
|
16
.github/workflows/env.sh
vendored
@@ -8,6 +8,8 @@ $HOME/.local/bin
|
||||
EOF
|
||||
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
CACHE_ENABLE=true
|
||||
CI_TARGET=tests
|
||||
CI_BUILD_DIR=$GITHUB_WORKSPACE
|
||||
BUILD_DIR=$GITHUB_WORKSPACE/build
|
||||
DEPS_BUILD_DIR=$HOME/nvim-deps
|
||||
@@ -17,11 +19,13 @@ NVIM_LOG_FILE=$GITHUB_WORKSPACE/build/.nvimlog
|
||||
VALGRIND_LOG=$GITHUB_WORKSPACE/build/log/valgrind-%p.log
|
||||
CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps
|
||||
CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker
|
||||
CACHE_UNCRUSTIFY=$HOME/.cache/uncrustify
|
||||
UNCRUSTIFY_VERSION=uncrustify-0.75.0
|
||||
CCACHE_BASEDIR=$GITHUB_WORKSPACE
|
||||
CCACHE_COMPRESS=1
|
||||
CCACHE_SLOPPINESS=time_macros,file_macro
|
||||
CCACHE_DIR=$HOME/.ccache
|
||||
EOF
|
||||
|
||||
DEPS_CMAKE_FLAGS=
|
||||
DEPS_CMAKE_FLAGS=-DUSE_BUNDLED_GPERF=OFF
|
||||
FUNCTIONALTEST=functionaltest
|
||||
BUILD_FLAGS="CMAKE_FLAGS=-DCI_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$HOME/nvim-install -DBUSTED_OUTPUT_TYPE=nvim -DDEPS_PREFIX=$HOME/nvim-deps/usr -DMIN_LOG_LEVEL=3"
|
||||
|
||||
@@ -39,11 +43,6 @@ EOF
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
|
||||
CLANG_SANITIZER=TSAN
|
||||
EOF
|
||||
;;
|
||||
uchar)
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
BUILD_UCHAR=1
|
||||
EOF
|
||||
;;
|
||||
lint)
|
||||
@@ -52,6 +51,7 @@ EOF
|
||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUV=ON"
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
USE_BUNDLED=OFF
|
||||
CI_TARGET=lint
|
||||
EOF
|
||||
;;
|
||||
functionaltest-lua)
|
||||
|
4
.github/workflows/labeler.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/labeler@v4
|
||||
- uses: actions/labeler@main
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
sync-labels: ""
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
- name: 'Request reviewers'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
|
5
.github/workflows/notes.md
vendored
@@ -21,9 +21,8 @@ ${NVIM_VERSION}
|
||||
### macOS
|
||||
|
||||
1. Download **nvim-macos.tar.gz**
|
||||
2. Run `xattr -c ./nvim-macos.tar.gz` (to avoid "unknown developer" warning)
|
||||
3. Extract: `tar xzvf nvim-macos.tar.gz`
|
||||
4. Run `./nvim-macos/bin/nvim`
|
||||
2. Extract: `tar xzvf nvim-macos.tar.gz`
|
||||
3. Run `./nvim-macos/bin/nvim`
|
||||
|
||||
### Linux (x64)
|
||||
|
||||
|
139
.github/workflows/release.yml
vendored
@@ -13,21 +13,21 @@ on:
|
||||
- v[0-9]+.[0-9]+.[0-9]+
|
||||
|
||||
# Build on the oldest supported images, so we have broader compatibility
|
||||
# Build with gcc-10 to prevent triggering #14150 (default is still gcc-9 on 20.04)
|
||||
# Upgrade to gcc-11 to prevent it from using its builtins (#14150)
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-18.04
|
||||
outputs:
|
||||
version: ${{ steps.build.outputs.version }}
|
||||
release: ${{ steps.build.outputs.release }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
|
||||
sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin locales ninja-build pkg-config unzip
|
||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
|
||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||
@@ -35,60 +35,52 @@ jobs:
|
||||
- name: Build release
|
||||
id: build
|
||||
run: |
|
||||
CC=gcc-10 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH="
|
||||
CC=gcc-11 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH="
|
||||
printf '::set-output name=version::%s\n' "$(./build/bin/nvim --version | head -n 3 | sed -z 's/\n/%0A/g')"
|
||||
printf '::set-output name=release::%s\n' "$(./build/bin/nvim --version | head -n 1)"
|
||||
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install
|
||||
cd "$GITHUB_WORKSPACE/build/"
|
||||
cpack -C $NVIM_BUILD_TYPE
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: nvim-linux64
|
||||
path: |
|
||||
build/nvim-linux64.tar.gz
|
||||
build/nvim-linux64.deb
|
||||
path: build/nvim-linux64.tar.gz
|
||||
retention-days: 1
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: nvim-linux64
|
||||
path: build/nvim-linux64.deb
|
||||
retention-days: 1
|
||||
|
||||
appimage:
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
image: ubuntu:18.04
|
||||
options: --privileged # Privileged mode is needed to load fuse module.
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Prepare container
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y software-properties-common
|
||||
add-apt-repository -y ppa:ubuntu-toolchain-r/test # For gcc-10.
|
||||
add-apt-repository -y ppa:git-core/ppa # For git>=2.18.
|
||||
apt-get update
|
||||
apt-get install -y git gcc-10
|
||||
apt-get install -y fuse libfuse2 # For linuxdeploy.
|
||||
# Workaround for https://github.com/actions/checkout/issues/766.
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin locales ninja-build pkg-config unzip
|
||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||
run: CC=gcc-10 make appimage-latest
|
||||
run: CC=gcc-11 make appimage-latest
|
||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||
run: CC=gcc-10 make appimage-nightly
|
||||
- uses: actions/upload-artifact@v3
|
||||
run: CC=gcc-11 make appimage-nightly
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: appimage
|
||||
path: |
|
||||
build/bin/nvim.appimage
|
||||
build/bin/nvim.appimage.zsync
|
||||
path: build/bin/nvim.appimage
|
||||
retention-days: 1
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: appimage
|
||||
path: build/bin/nvim.appimage.zsync
|
||||
retention-days: 1
|
||||
|
||||
macOS:
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install brew packages
|
||||
@@ -124,19 +116,16 @@ jobs:
|
||||
OSX_FLAGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_ARCHITECTURES=arm64\;x86_64"
|
||||
make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \
|
||||
CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH= $OSX_FLAGS" \
|
||||
DEPS_CMAKE_FLAGS="$OSX_FLAGS"
|
||||
DEPS_CMAKE_FLAGS="$OSX_FLAGS -DUSE_BUNDLED_GPERF=OFF"
|
||||
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-macos" install
|
||||
cd "$GITHUB_WORKSPACE/build/"
|
||||
# Make sure we build everything for M1 as well
|
||||
for macho in bin/* lib/nvim/parser/*.so
|
||||
do
|
||||
lipo -info "$macho" | grep -q arm64 || exit 1
|
||||
done
|
||||
cpack -C "$NVIM_BUILD_TYPE"
|
||||
- name: Create package
|
||||
run: |
|
||||
cd "$GITHUB_WORKSPACE/build/release"
|
||||
tar cfz nvim-macos.tar.gz nvim-macos
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: nvim-macos
|
||||
path: build/nvim-macos.tar.gz
|
||||
path: build/release/nvim-macos.tar.gz
|
||||
retention-days: 1
|
||||
|
||||
windows:
|
||||
@@ -144,7 +133,6 @@ jobs:
|
||||
env:
|
||||
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
||||
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
||||
CMAKE_BUILD_TYPE: "RelWithDebInfo"
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
@@ -152,38 +140,41 @@ jobs:
|
||||
archive: nvim-win64
|
||||
name: windows (${{ matrix.config }})
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Build deps
|
||||
run: .\ci\build.ps1 -BuildDeps
|
||||
- name: build package
|
||||
run: .\ci\build.ps1 -Package
|
||||
- uses: actions/upload-artifact@v3
|
||||
- run: powershell ci\build.ps1 -NoTests
|
||||
env:
|
||||
CONFIGURATION: ${{ matrix.config }}
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ matrix.archive }}
|
||||
path: |
|
||||
build/${{ matrix.archive }}.msi
|
||||
build/${{ matrix.archive }}.zip
|
||||
path: build/${{ matrix.archive }}.zip
|
||||
retention-days: 1
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ matrix.archive }}
|
||||
path: build/${{ matrix.archive }}.msi
|
||||
retention-days: 1
|
||||
|
||||
publish:
|
||||
needs: [linux, appimage, macOS, windows]
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
# Must perform checkout first, since it deletes the target directory
|
||||
# before running, and would therefore delete the downloaded artifacts
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y gettext-base
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gettext-base
|
||||
|
||||
- if: github.event_name == 'workflow_dispatch'
|
||||
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
||||
@@ -194,12 +185,16 @@ jobs:
|
||||
TAG_NAME=${{ github.ref }}
|
||||
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
|
||||
- if: env.TAG_NAME == 'nightly'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
(echo 'SUBJECT=Nvim development (prerelease) build';
|
||||
echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV
|
||||
gh release delete nightly --yes || true
|
||||
git push origin :nightly || true
|
||||
- if: env.TAG_NAME != 'nightly'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
(echo 'SUBJECT=Nvim release build';
|
||||
echo 'PRERELEASE=') >> $GITHUB_ENV
|
||||
@@ -238,6 +233,7 @@ jobs:
|
||||
echo "SHA_WIN_64_MSI=$(cat nvim-win64.msi.sha256sum)" >> $GITHUB_ENV
|
||||
- name: Publish release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NVIM_VERSION: ${{ needs.linux.outputs.version }}
|
||||
DEBUG: api
|
||||
run: |
|
||||
@@ -246,30 +242,3 @@ jobs:
|
||||
if [ "$TAG_NAME" != "nightly" ]; then
|
||||
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
||||
fi
|
||||
publish-winget:
|
||||
needs: publish
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||
name: Publish stable
|
||||
uses: vedantmgoyal2009/winget-releaser@latest
|
||||
with:
|
||||
identifier: Neovim.Neovim
|
||||
release-tag: ${{ github.event.inputs.tag_name || github.ref }}
|
||||
token: ${{ secrets.WINGET_TOKEN }}
|
||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||
name: Get nightly version
|
||||
id: get-version
|
||||
run: |
|
||||
Invoke-WebRequest https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.msi -OutFile setup.msi
|
||||
Install-Module -Name 'Carbon.Windows.Installer' -Force
|
||||
$VERSION = (Get-CMsi (Resolve-Path .\setup.msi).Path).ProductVersion
|
||||
echo "::set-output name=version::$VERSION"
|
||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||
name: Publish nightly
|
||||
uses: vedantmgoyal2009/winget-releaser@latest
|
||||
with:
|
||||
identifier: Neovim.Neovim.Nightly
|
||||
version: ${{ steps.get-version.outputs.version }}
|
||||
release-tag: nightly
|
||||
token: ${{ secrets.WINGET_TOKEN }}
|
||||
|
@@ -8,7 +8,7 @@ jobs:
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
- name: 'Remove reviewers'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
|
2
.github/workflows/reviews.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
- name: 'Request reviewers'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
|
6
.github/workflows/vim-patches.yml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
|
||||
jobs:
|
||||
update-vim-patches:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
@@ -14,11 +14,11 @@ jobs:
|
||||
VERSION_BRANCH: marvim/ci-version-update
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
repository: vim/vim
|
||||
path: ${{ env.VIM_SOURCE_DIR }}
|
||||
|
2
.gitignore
vendored
@@ -73,5 +73,3 @@ tags
|
||||
|
||||
# vim patches
|
||||
/vim-*.patch
|
||||
|
||||
/CMakeUserPresets.json
|
||||
|
@@ -28,13 +28,6 @@ read_globals = {
|
||||
|
||||
globals = {
|
||||
"vim.g",
|
||||
"vim.b",
|
||||
"vim.w",
|
||||
"vim.o",
|
||||
"vim.bo",
|
||||
"vim.wo",
|
||||
"vim.go",
|
||||
"vim.env"
|
||||
}
|
||||
|
||||
exclude_files = {
|
||||
|
7
.mailmap
@@ -8,15 +8,13 @@ Anmol Sethi <hi@nhooyr.io> <nhooyr@users.noreply.github.com>
|
||||
BK1603 <chouhan.shreyansh2702@gmail.com> Shreyansh Chouhan
|
||||
Billy Su <g4691821@gmail.com> Billy SU
|
||||
Billy Vong <billyvg@gmail.com> <billyvg@users.noreply.github.com>
|
||||
bfredl <bjorn.linse@gmail.com>
|
||||
Björn Linse <bjorn.linse@gmail.com> bfredl
|
||||
Carlos Hernandez <carlos@techbyte.ca> <hurricanehrndz@users.noreply.github.com>
|
||||
Chris Kipp <ckipp@pm.me> ckipp01
|
||||
Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de>
|
||||
Cédric Barreteau <> <cbarrete@users.noreply.github.com>
|
||||
Dan Aloni <alonid@gmail.com> <dan@kernelim.com>
|
||||
Daniel Hahler <git@thequod.de> <github@thequod.de>
|
||||
dundargoc <gocdundar@gmail.com> <33953936+dundargoc@users.noreply.github.com>
|
||||
dundargoc <gocdundar@gmail.com> Dundar Goc
|
||||
Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima
|
||||
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
|
||||
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
|
||||
@@ -54,7 +52,6 @@ Jurica Bradaric <jbradaric@gmail.com> <jbradaric@users.noreply.github.com>
|
||||
Jurica Bradaric <jbradaric@gmail.com> <jurica.bradaric@avl.com>
|
||||
KillTheMule <KillTheMule@users.noreply.github.com> <github@pipsfrank.de>
|
||||
Kwon-Young Choi <kwon-young.choi@hotmail.fr> Kwon-Young
|
||||
Lewis Russell <lewis6991@gmail.com> <me@lewisr.dev>
|
||||
Lucas Hoffmann <l-m-h@web.de> <lucc@posteo.de>
|
||||
Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com>
|
||||
Marco Hinz <mh.codebro@gmail.com> <mh.codebro+github@gmail.com>
|
||||
@@ -95,7 +92,7 @@ Steven Sojka <Steven.Sojka@tdameritrade.com> <steelsojka@gmail.com>
|
||||
Steven Sojka <steelsojka@gmail.com> <steelsojka@users.noreply.github.com>
|
||||
TJ DeVries <devries.timothyj@gmail.com> <timothydvrs1234@gmail.com>
|
||||
Thomas Fehér <thomas.feher@yahoo.de> <thomasfeher@web.de>
|
||||
Thomas Vigouroux <thomas.vigouroux@protonmail.com> <tomvig38@gmail.com> <39092278+vigoux@users.noreply.github.com>
|
||||
Thomas Vigouroux <tomvig38@gmail.com> <39092278+vigoux@users.noreply.github.com>
|
||||
Utkarsh Maheshwari <UtkarshME96@gmail.com> UTkarsh Maheshwari
|
||||
Utkarsh Maheshwari <utkarshme96@gmail.com> <UtkarshME96@gmail.com>
|
||||
VVKot <volodymyr.kot.ua@gmail.com> Volodymyr Kot
|
||||
|
@@ -1,6 +0,0 @@
|
||||
column_width = 100
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferSingle"
|
||||
call_parentheses = "Always"
|
@@ -1,3 +0,0 @@
|
||||
/scripts
|
||||
/src
|
||||
/test
|
220
.travis.yml
Normal file
@@ -0,0 +1,220 @@
|
||||
dist: bionic
|
||||
|
||||
language: c
|
||||
|
||||
env:
|
||||
global:
|
||||
# Encrypted environment variables, see
|
||||
# http://docs.travis-ci.com/user/encryption-keys/
|
||||
#
|
||||
# SNAP_SECRET_KEY: generated by:
|
||||
# travis encrypt SNAP_SECRET_KEY=xx --add
|
||||
# https://github.com/neovim/neovim/pull/11428
|
||||
# snapcraft key expires after 1 year. Steps to refresh it:
|
||||
# 1. snapcraft enable-ci travis --refresh
|
||||
# 2. mv .snapcraft/travis_snapcraft.cfg ci/snap/travis_snapcraft.cfg
|
||||
# 3. Copy after_success command to ci/snap/deploy.sh from .travis.yml
|
||||
# 4. Undo changes to .travis.yml
|
||||
- secure: hd0qn2u8ABbJg5Bx4pBRcUQbKYFmcSHoecyHIPTCnGJT+NI41Bvm/IkN/N5DhBF+LbD3Q2nmR/dzI5H/dqS7RxMFvEx1DuFLendFHHX3MYf0AuKpXYY3gwgMTmqx8p/v6srlU7RBGWNGzHCWqksAem+EIWCe3I7WvfdKo1/DV/Y=
|
||||
|
||||
- PATH="$HOME/.local/bin:$PATH"
|
||||
# Set "false" to force rebuild of third-party dependencies.
|
||||
- CACHE_ENABLE=true
|
||||
# Build directory for Neovim.
|
||||
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
||||
# Build directory for third-party dependencies.
|
||||
- DEPS_BUILD_DIR="$HOME/nvim-deps"
|
||||
# Install directory for Neovim.
|
||||
- INSTALL_PREFIX="$HOME/nvim-install"
|
||||
# Log directory for Clang sanitizers and Valgrind.
|
||||
- LOG_DIR="$BUILD_DIR/log"
|
||||
# Nvim log file.
|
||||
- NVIM_LOG_FILE="$BUILD_DIR/.nvimlog"
|
||||
# Default CMake flags.
|
||||
- CMAKE_FLAGS="-DCI_BUILD=ON
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
|
||||
-DBUSTED_OUTPUT_TYPE=nvim
|
||||
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
|
||||
-DMIN_LOG_LEVEL=3"
|
||||
- DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_GPERF=OFF"
|
||||
# Environment variables for Clang sanitizers.
|
||||
- ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan"
|
||||
- TSAN_OPTIONS="log_path=$LOG_DIR/tsan"
|
||||
- UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
|
||||
# Environment variables for Valgrind.
|
||||
- VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
|
||||
- CACHE_NVIM_DEPS_DIR="$HOME/.cache/nvim-deps"
|
||||
# If this file exists, the cache is valid (compile was successful).
|
||||
- CACHE_MARKER="$CACHE_NVIM_DEPS_DIR/.ci_cache_marker"
|
||||
# default target name for functional tests
|
||||
- FUNCTIONALTEST=functionaltest
|
||||
- CI_TARGET=tests
|
||||
# Environment variables for ccache
|
||||
- CCACHE_COMPRESS=1
|
||||
- CCACHE_SLOPPINESS=time_macros,file_macro
|
||||
- CCACHE_BASEDIR="$TRAVIS_BUILD_DIR"
|
||||
- CI_OS_NAME="$TRAVIS_OS_NAME"
|
||||
|
||||
anchors:
|
||||
envs: &common-job-env
|
||||
# Do not fall back to cache for "master" for PR on "release" branch:
|
||||
# adds the target branch to the cache key.
|
||||
FOR_TRAVIS_CACHE=v1-$TRAVIS_BRANCH
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages: &common-apt-packages
|
||||
- apport
|
||||
- autoconf
|
||||
- automake
|
||||
- build-essential
|
||||
- clang
|
||||
- cmake
|
||||
- cpanminus
|
||||
- cscope
|
||||
- gcc-multilib
|
||||
- gdb
|
||||
- gperf
|
||||
- language-pack-tr
|
||||
- libtool-bin
|
||||
- locales
|
||||
- ninja-build
|
||||
- pkg-config
|
||||
- unzip
|
||||
- valgrind
|
||||
- xclip
|
||||
homebrew:
|
||||
update: true
|
||||
casks:
|
||||
- powershell
|
||||
packages:
|
||||
- ccache
|
||||
- cpanminus
|
||||
- ninja
|
||||
- perl
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- name: gcc-coverage (gcc 9)
|
||||
os: linux
|
||||
compiler: gcc-9
|
||||
env:
|
||||
- GCOV=gcov-9
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||
- GCOV_ERROR_FILE="/tmp/libgcov-errors.log"
|
||||
- USE_LUACOV=1
|
||||
- BUSTED_ARGS="--coverage"
|
||||
- *common-job-env
|
||||
addons:
|
||||
snaps:
|
||||
- name: powershell
|
||||
confinement: classic
|
||||
apt:
|
||||
sources:
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
packages:
|
||||
- *common-apt-packages
|
||||
- gcc-9
|
||||
- name: gcc-functionaltest-lua
|
||||
os: linux
|
||||
compiler: gcc
|
||||
env:
|
||||
- FUNCTIONALTEST=functionaltest-lua
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
|
||||
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
|
||||
- *common-job-env
|
||||
- name: gcc-32bit
|
||||
os: linux
|
||||
# Travis creates a cache per compiler. Set a different value here to
|
||||
# store 32-bit dependencies in a separate cache.
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_32BIT=ON
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
|
||||
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
|
||||
- *common-job-env
|
||||
- name: big-endian
|
||||
os: linux
|
||||
arch: s390x
|
||||
compiler: gcc
|
||||
env:
|
||||
- FUNCTIONALTEST=functionaltest-lua
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
|
||||
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
|
||||
- *common-job-env
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- *common-apt-packages
|
||||
- gettext
|
||||
- python-pip
|
||||
- python3-pip
|
||||
- python-setuptools
|
||||
- python3-setuptools
|
||||
- python-dev
|
||||
- python3-dev
|
||||
- if: type != pull_request
|
||||
name: snap
|
||||
os: linux
|
||||
env:
|
||||
- LC_ALL: C.UTF-8
|
||||
- LANG: C.UTF-8
|
||||
- SNAPCRAFT_ENABLE_SILENT_REPORT: y
|
||||
- SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
|
||||
- SNAPCRAFT_BUILD_ENVIRONMENT: lxd
|
||||
addons:
|
||||
snaps:
|
||||
- name: snapcraft
|
||||
channel: stable
|
||||
classic: true
|
||||
- name: http
|
||||
- name: transfer
|
||||
- name: lxd
|
||||
channel: stable
|
||||
# Override default before_install, before_cache.
|
||||
before_install: /bin/true
|
||||
before_cache: /bin/true
|
||||
install: ci/snap/install.sh
|
||||
before_script: echo "Building snap..."
|
||||
script: ci/snap/script.sh
|
||||
after_success: ci/snap/after_success.sh
|
||||
deploy:
|
||||
skip_cleanup: true
|
||||
provider: script
|
||||
script: ci/snap/deploy.sh
|
||||
on:
|
||||
branch: master
|
||||
allow_failures:
|
||||
- env:
|
||||
- LC_ALL: C.UTF-8
|
||||
- LANG: C.UTF-8
|
||||
- SNAPCRAFT_ENABLE_SILENT_REPORT: y
|
||||
- SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
|
||||
- SNAPCRAFT_BUILD_ENVIRONMENT: lxd
|
||||
fast_finish: true
|
||||
|
||||
before_install: ci/before_install.sh
|
||||
install: ci/install.sh
|
||||
before_script: ci/before_script.sh
|
||||
script: ci/script.sh
|
||||
before_cache: ci/before_cache.sh
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /^release-\d+\.\d+$/
|
||||
|
||||
cache:
|
||||
apt: true
|
||||
ccache: true
|
||||
directories:
|
||||
- "$CACHE_NVIM_DEPS_DIR"
|
||||
|
||||
git:
|
||||
quiet: true
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/b5c38c99f9677aa3d031
|
186
CMakeLists.txt
@@ -1,12 +1,17 @@
|
||||
# CMAKE REFERENCE
|
||||
# intro: https://codingnest.com/basic-cmake/
|
||||
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
|
||||
# pitfalls: https://izzys.casa/2019/02/everything-you-never-wanted-to-know-about-cmake/
|
||||
|
||||
# Version should match the tested CMAKE_URL in .github/workflows/ci.yml.
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(nvim C)
|
||||
|
||||
if(POLICY CMP0065)
|
||||
cmake_policy(SET CMP0065 NEW)
|
||||
endif()
|
||||
if(POLICY CMP0060)
|
||||
cmake_policy(SET CMP0060 NEW)
|
||||
endif()
|
||||
if(POLICY CMP0075)
|
||||
cmake_policy(SET CMP0075 NEW)
|
||||
endif()
|
||||
@@ -16,9 +21,6 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
|
||||
# We don't support building in-tree.
|
||||
include(PreventInTreeBuilds)
|
||||
include(Util)
|
||||
|
||||
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches)
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
@@ -28,7 +30,7 @@ if(DEFINED ENV{DEPS_BUILD_DIR})
|
||||
# pkg-config 29.2 has a bug on OpenBSD which causes it to drop any paths that
|
||||
# *contain* system include paths. To avoid this, we prefix what would be
|
||||
# "/usr/include" as "/_usr/include".
|
||||
# This check is also performed in the cmake.deps/CMakeLists.txt and in the
|
||||
# This check is also performed in the third-party/CMakeLists.txt and in the
|
||||
# else clause following here.
|
||||
# https://github.com/neovim/neovim/pull/14745#issuecomment-860201794
|
||||
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/_usr" CACHE PATH "Path prefix for finding dependencies")
|
||||
@@ -60,7 +62,7 @@ else()
|
||||
-DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
|
||||
-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||
${PROJECT_SOURCE_DIR}/cmake.deps
|
||||
${PROJECT_SOURCE_DIR}/third-party
|
||||
WORKING_DIRECTORY ${DEPS_BUILD_DIR})
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} --build ${DEPS_BUILD_DIR}
|
||||
@@ -97,7 +99,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
# Work around some old, broken detection by CMake for knowing when to use the
|
||||
# isystem flag. Apple's compilers have supported this for quite some time
|
||||
# now.
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
|
||||
endif()
|
||||
endif()
|
||||
@@ -122,22 +124,32 @@ endif()
|
||||
|
||||
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
set_default_buildtype()
|
||||
# Build type.
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
message(STATUS "CMAKE_BUILD_TYPE not specified, default is 'Debug'")
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build" FORCE)
|
||||
else()
|
||||
message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
set(DEBUG 1)
|
||||
else()
|
||||
set(DEBUG 0)
|
||||
endif()
|
||||
# Set available build types for CMake GUIs.
|
||||
# Other build types can still be set by -DCMAKE_BUILD_TYPE=...
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
|
||||
# If not in a git repo (e.g., a tarball) these tokens define the complete
|
||||
# version string, else they are combined with the result of `git describe`.
|
||||
set(NVIM_VERSION_MAJOR 0)
|
||||
set(NVIM_VERSION_MINOR 8)
|
||||
set(NVIM_VERSION_PATCH 1)
|
||||
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||
set(NVIM_VERSION_MINOR 7)
|
||||
set(NVIM_VERSION_PATCH 3)
|
||||
set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers
|
||||
|
||||
# API level
|
||||
set(NVIM_API_LEVEL 10) # Bump this after any API change.
|
||||
set(NVIM_API_LEVEL 9) # Bump this after any API change.
|
||||
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
||||
set(NVIM_API_PRERELEASE false)
|
||||
|
||||
@@ -171,7 +183,7 @@ if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
|
||||
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
check_c_compiler_flag(-Og HAS_OG_FLAG)
|
||||
else()
|
||||
set(HAS_OG_FLAG 0)
|
||||
@@ -274,7 +286,7 @@ if(MSVC)
|
||||
# XXX: /W4 gives too many warnings. #3241
|
||||
add_compile_options(/W3)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
add_definitions(-DMSWIN)
|
||||
add_definitions(-DWIN32)
|
||||
else()
|
||||
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
|
||||
@@ -321,7 +333,6 @@ endif()
|
||||
if(MINGW)
|
||||
# Use POSIX compatible stdio in Mingw
|
||||
add_definitions(-D__USE_MINGW_ANSI_STDIO)
|
||||
add_definitions(-DMSWIN)
|
||||
endif()
|
||||
if(WIN32)
|
||||
# Windows Vista is the minimum supported version
|
||||
@@ -367,7 +378,7 @@ option(CI_BUILD "CI, extra flags will be set" OFF)
|
||||
if(CI_BUILD)
|
||||
message(STATUS "CI build enabled")
|
||||
add_compile_options(-Werror)
|
||||
if(DEFINED ENV{BUILD_UCHAR})
|
||||
if(DEFINED ENV{BUILD_32BIT})
|
||||
# Get some test coverage for unsigned char
|
||||
add_compile_options(-funsigned-char)
|
||||
endif()
|
||||
@@ -402,7 +413,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT P
|
||||
"${CMAKE_MODULE_LINKER_FLAGS} -image_base 100000000")
|
||||
endif()
|
||||
|
||||
include_directories("${PROJECT_BINARY_DIR}/cmake.config")
|
||||
include_directories("${PROJECT_BINARY_DIR}/config")
|
||||
include_directories("${PROJECT_SOURCE_DIR}/src")
|
||||
|
||||
find_package(LibUV 1.28.0 REQUIRED)
|
||||
@@ -446,11 +457,11 @@ if(TS_HAS_SET_ALLOCATOR)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_ALLOCATOR")
|
||||
endif()
|
||||
|
||||
# The unit test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
|
||||
# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
|
||||
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
|
||||
|
||||
if(PREFER_LUA)
|
||||
find_package(Lua 5.1 EXACT REQUIRED)
|
||||
find_package(Lua 5.1 REQUIRED)
|
||||
set(LUA_PREFERRED_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
|
||||
set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES})
|
||||
# Passive (not REQUIRED): if LUAJIT_FOUND is not set, nvim-test is skipped.
|
||||
@@ -499,13 +510,18 @@ if(FEAT_TUI)
|
||||
add_definitions(-DNVIM_UNIBI_HAS_VAR_FROM)
|
||||
endif()
|
||||
|
||||
find_package(LibTermkey 0.22 REQUIRED)
|
||||
find_package(LibTermkey 0.18 REQUIRED)
|
||||
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
find_package(LIBVTERM 0.3 REQUIRED)
|
||||
find_package(LIBVTERM 0.1 REQUIRED)
|
||||
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
|
||||
|
||||
if(WIN32)
|
||||
find_package(Winpty 0.4.3 REQUIRED)
|
||||
include_directories(SYSTEM ${WINPTY_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
option(CLANG_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
|
||||
option(CLANG_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
|
||||
option(CLANG_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
|
||||
@@ -575,7 +591,11 @@ endif()
|
||||
|
||||
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
|
||||
|
||||
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
|
||||
if(DEBUG)
|
||||
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" OFF)
|
||||
else()
|
||||
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
|
||||
endif()
|
||||
|
||||
if(COMPILE_LUA AND NOT WIN32)
|
||||
if(PREFER_LUA)
|
||||
@@ -605,78 +625,17 @@ if(NOT BUSTED_OUTPUT_TYPE)
|
||||
set(BUSTED_OUTPUT_TYPE "nvim")
|
||||
endif()
|
||||
|
||||
#
|
||||
# Lint
|
||||
#
|
||||
find_program(LUACHECK_PRG luacheck)
|
||||
find_program(STYLUA_PRG stylua)
|
||||
find_program(FLAKE8_PRG flake8)
|
||||
find_program(UNCRUSTIFY_PRG uncrustify)
|
||||
find_program(SHELLCHECK_PRG shellcheck)
|
||||
|
||||
add_glob_targets(
|
||||
REQUIRED
|
||||
TARGET lintlua-luacheck
|
||||
COMMAND ${LUACHECK_PRG}
|
||||
FLAGS -q
|
||||
GLOB_DIRS runtime/ scripts/ src/ test/
|
||||
GLOB_PAT *.lua
|
||||
TOUCH_STRATEGY SINGLE
|
||||
)
|
||||
|
||||
add_glob_targets(
|
||||
TARGET lintlua-stylua
|
||||
COMMAND ${STYLUA_PRG}
|
||||
FLAGS --color=always --check
|
||||
GLOB_DIRS runtime/
|
||||
GLOB_PAT *.lua
|
||||
TOUCH_STRATEGY SINGLE
|
||||
)
|
||||
|
||||
add_custom_target(lintlua)
|
||||
add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
|
||||
find_program(GPERF_PRG gperf)
|
||||
|
||||
include(InstallHelpers)
|
||||
add_glob_targets(
|
||||
TARGET lintpy
|
||||
COMMAND ${FLAKE8_PRG}
|
||||
FLAGS --max-line-length 100
|
||||
GLOB_DIRS contrib scripts src test
|
||||
GLOB_PAT *.py
|
||||
TOUCH_STRATEGY SINGLE
|
||||
)
|
||||
|
||||
add_glob_targets(
|
||||
TARGET lintsh
|
||||
COMMAND ${SHELLCHECK_PRG}
|
||||
FILES scripts/vim-patch.sh
|
||||
TOUCH_STRATEGY SINGLE
|
||||
)
|
||||
|
||||
add_custom_target(lintcommit
|
||||
COMMAND ${PROJECT_BINARY_DIR}/bin/nvim -u NONE -es -c [[lua require('scripts.lintcommit').main({trace=false})]]
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
VERBATIM)
|
||||
add_dependencies(lintcommit nvim)
|
||||
|
||||
add_custom_target(lint)
|
||||
add_dependencies(lint check-single-includes lintc lintlua lintpy lintsh lintcommit lintuncrustify)
|
||||
|
||||
#
|
||||
# Format
|
||||
#
|
||||
add_custom_target(formatlua
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D FORMAT_PRG=${STYLUA_PRG}
|
||||
-D LANG=lua
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/Format.cmake
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
|
||||
add_custom_target(format)
|
||||
add_dependencies(format formatc formatlua)
|
||||
|
||||
file(GLOB MANPAGES
|
||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
man/nvim.1)
|
||||
install_helper(
|
||||
FILES ${CMAKE_SOURCE_DIR}/src/man/nvim.1
|
||||
FILES ${MANPAGES}
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||
|
||||
#
|
||||
@@ -686,7 +645,7 @@ install_helper(
|
||||
add_subdirectory(src/nvim)
|
||||
get_directory_property(NVIM_VERSION_CFLAGS DIRECTORY src/nvim DEFINITION NVIM_VERSION_CFLAGS)
|
||||
add_subdirectory(test/includes)
|
||||
add_subdirectory(cmake.config)
|
||||
add_subdirectory(config)
|
||||
add_subdirectory(test/functional/fixtures) # compile test programs
|
||||
add_subdirectory(runtime)
|
||||
get_directory_property(GENERATED_HELP_TAGS DIRECTORY runtime DEFINITION GENERATED_HELP_TAGS)
|
||||
@@ -712,6 +671,17 @@ if(BUSTED_PRG)
|
||||
set(FUNCTIONALTEST_PREREQS nvim printenv-test printargs-test shell-test pwsh-test streams-test tty-test ${GENERATED_HELP_TAGS})
|
||||
set(BENCHMARK_PREREQS nvim tty-test)
|
||||
|
||||
# Useful for automated build systems, if they want to manually run the tests.
|
||||
add_custom_target(unittest-prereqs
|
||||
DEPENDS ${UNITTEST_PREREQS})
|
||||
set_target_properties(unittest-prereqs PROPERTIES FOLDER test)
|
||||
|
||||
add_custom_target(functionaltest-prereqs
|
||||
DEPENDS ${FUNCTIONALTEST_PREREQS})
|
||||
|
||||
add_custom_target(benchmark-prereqs
|
||||
DEPENDS ${BENCHMARK_PREREQS})
|
||||
|
||||
check_lua_module(${LUA_PRG} "ffi" LUA_HAS_FFI)
|
||||
if(LUA_HAS_FFI)
|
||||
add_custom_target(unittest
|
||||
@@ -737,11 +707,11 @@ if(BUSTED_PRG)
|
||||
set(TEST_LIBNVIM_PATH "")
|
||||
endif()
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/test/cmakeconfig/paths.lua.in
|
||||
${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua.gen)
|
||||
${CMAKE_SOURCE_DIR}/test/config/paths.lua.in
|
||||
${CMAKE_BINARY_DIR}/test/config/paths.lua.gen)
|
||||
file(GENERATE
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua
|
||||
INPUT ${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua.gen)
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua
|
||||
INPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua.gen)
|
||||
|
||||
add_custom_target(functionaltest
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
@@ -756,7 +726,8 @@ if(BUSTED_PRG)
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
||||
${TEST_TARGET_ARGS})
|
||||
set_target_properties(functionaltest PROPERTIES FOLDER test)
|
||||
set_target_properties(functionaltest functionaltest-prereqs
|
||||
PROPERTIES FOLDER test)
|
||||
|
||||
add_custom_target(benchmark
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
@@ -771,7 +742,7 @@ if(BUSTED_PRG)
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||
DEPENDS ${BENCHMARK_PREREQS}
|
||||
${TEST_TARGET_ARGS})
|
||||
set_target_properties(benchmark PROPERTIES FOLDER test)
|
||||
set_target_properties(benchmark benchmark-prereqs PROPERTIES FOLDER test)
|
||||
endif()
|
||||
|
||||
if(BUSTED_LUA_PRG)
|
||||
@@ -791,9 +762,28 @@ if(BUSTED_LUA_PRG)
|
||||
set_target_properties(functionaltest-lua PROPERTIES FOLDER test)
|
||||
endif()
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/UninstallHelper.cmake)
|
||||
if(LUACHECK_PRG)
|
||||
add_custom_target(lualint
|
||||
COMMAND ${LUACHECK_PRG} -q runtime/ scripts/ src/ test/
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
else()
|
||||
add_custom_target(lualint false
|
||||
COMMENT "lualint: LUACHECK_PRG not defined")
|
||||
endif()
|
||||
|
||||
|
||||
#add uninstall target
|
||||
if(NOT TARGET uninstall)
|
||||
configure_file(
|
||||
"cmake/UninstallHelper.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake)
|
||||
endif()
|
||||
|
||||
|
||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
add_subdirectory(cmake.packaging)
|
||||
add_subdirectory(packaging)
|
||||
endif()
|
||||
|
@@ -1,95 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "base",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "default",
|
||||
"displayName": "RelWithDebInfo",
|
||||
"description": "Enables optimizations (-Og or -O2) with debug information",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
||||
},
|
||||
"inherits": [
|
||||
"base"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "debug",
|
||||
"displayName": "Debug",
|
||||
"description": "Disables optimizations (-O0), enables debug information",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
},
|
||||
"inherits": [
|
||||
"base"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "release",
|
||||
"displayName": "Release",
|
||||
"description": "Same as RelWithDebInfo, but disables debug information",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
},
|
||||
"inherits": [
|
||||
"base"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "windows-default",
|
||||
"displayName": "Windows x64 RelWithDebInfo",
|
||||
"description": "Sets Ninja generator, enables optimizations with debug information for x64",
|
||||
"generator": "Ninja",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
||||
},
|
||||
"architecture": {
|
||||
"value": "x64",
|
||||
"strategy": "external"
|
||||
},
|
||||
"vendor": {
|
||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
||||
"hostOS": [
|
||||
"Windows"
|
||||
]
|
||||
}
|
||||
},
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
},
|
||||
"inherits": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "default",
|
||||
"configurePreset": "default"
|
||||
},
|
||||
{
|
||||
"name": "debug",
|
||||
"configurePreset": "debug"
|
||||
},
|
||||
{
|
||||
"name": "release",
|
||||
"configurePreset": "release"
|
||||
},
|
||||
{
|
||||
"name": "windows-default",
|
||||
"configurePreset": "windows-default",
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
151
CONTRIBUTING.md
@@ -10,11 +10,8 @@ low-risk/isolated tasks:
|
||||
- Try a [complexity:low] issue.
|
||||
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
|
||||
[Coverity](#coverity).
|
||||
- [Improve documentation](#documenting)
|
||||
- [Merge a Vim patch] (requires strong familiarity with Vim)
|
||||
- NOTE: read the above link before sending improvements to "runtime files" (anything in `runtime/`).
|
||||
- Vimscript and documentation files are (mostly) maintained by [Vim](https://github.com/vim/vim), not Nvim.
|
||||
- Lua files are maintained by Nvim.
|
||||
- [Improve documentation][wiki-contribute-help]
|
||||
- [Merge a Vim patch] (familiarity with Vim is *strongly* recommended)
|
||||
|
||||
Reporting problems
|
||||
------------------
|
||||
@@ -33,9 +30,9 @@ Reporting problems
|
||||
Developer guidelines
|
||||
--------------------
|
||||
|
||||
- Read [:help dev](https://neovim.io/doc/user/develop.html#dev) if you are working on Nvim core.
|
||||
- Read [:help dev-ui](https://neovim.io/doc/user/develop.html#dev-ui) if you are developing a UI.
|
||||
- Read [:help dev-api-client](https://neovim.io/doc/user/develop.html#dev-api-client) if you are developing an API client.
|
||||
- Read `:help dev` if you are working on Nvim core.
|
||||
- Read `:help dev-ui` if you are developing a UI.
|
||||
- Read `:help dev-api-client` if you are developing an API client.
|
||||
- Install `ninja` for faster builds of Nvim.
|
||||
```
|
||||
sudo apt-get install ninja-build
|
||||
@@ -50,19 +47,21 @@ Pull requests (PRs)
|
||||
- Your PR must include [test coverage][run-tests].
|
||||
- Avoid cosmetic changes to unrelated files in the same commit.
|
||||
- Use a [feature branch][git-feature-branch] instead of the master branch.
|
||||
- Use a _rebase workflow_ for small PRs.
|
||||
- After addressing review comments, it's fine to force-push.
|
||||
- Use a _merge workflow_ (as opposed to "rebase") for big, high-risk PRs.
|
||||
- Use a **rebase workflow** for small PRs.
|
||||
- After addressing review comments, it's fine to rebase and force-push.
|
||||
- Use a **merge workflow** for big, high-risk PRs.
|
||||
- Merge `master` into your PR when there are conflicts or when master
|
||||
introduces breaking changes.
|
||||
- Use the `ri` git alias:
|
||||
```
|
||||
[alias]
|
||||
ri = "!sh -c 't=\"${1:-master}\"; s=\"${2:-HEAD}\"; mb=\"$(git merge-base \"$t\" \"$s\")\"; if test \"x$mb\" = x ; then o=\"$t\"; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\"; if test \"x$lm\" = x ; then o=\"$mb\"; else o=\"$lm\"; fi; fi; test $# -gt 0 && shift; test $# -gt 0 && shift; git rebase --interactive \"$o\" \"$@\"'"
|
||||
```
|
||||
This avoids unnecessary rebases yet still allows you to combine related
|
||||
commits, separate monolithic commits, etc.
|
||||
- Do not edit commits that come before the merge commit.
|
||||
|
||||
### Merging to master
|
||||
|
||||
For maintainers: when a PR is ready to merge to master,
|
||||
|
||||
- prefer _Squash Merge_ for "single-commit PRs" (when the PR has only one meaningful commit).
|
||||
- prefer _Merge_ for "multi-commit PRs" (when the PR has multiple meaningful commits).
|
||||
- During a squash/fixup, use `exec make -C build unittest` between each
|
||||
pick/edit/reword.
|
||||
|
||||
### Stages: Draft and Ready for review
|
||||
|
||||
@@ -93,7 +92,7 @@ the VCS/git logs more valuable. The general structure of a commit message is:
|
||||
```
|
||||
|
||||
- Prefix the commit subject with one of these [_types_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json):
|
||||
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch`, `dist`
|
||||
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch`, `chore`
|
||||
- You can **ignore this for "fixup" commits** or any commits you expect to be squashed.
|
||||
- Append optional scope to _type_ such as `(lsp)`, `(treesitter)`, `(float)`, …
|
||||
- _Description_ shouldn't start with a capital letter or end in a period.
|
||||
@@ -112,7 +111,7 @@ the VCS/git logs more valuable. The general structure of a commit message is:
|
||||
|
||||
### Automated builds (CI)
|
||||
|
||||
Each pull request must pass the automated builds on [Cirrus CI] and [GitHub Actions].
|
||||
Each pull request must pass the automated builds on [sourcehut] and [GitHub Actions].
|
||||
|
||||
- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
|
||||
will fail the build.
|
||||
@@ -126,7 +125,20 @@ Each pull request must pass the automated builds on [Cirrus CI] and [GitHub Acti
|
||||
- The [lint](#lint) build checks modified lines _and their immediate
|
||||
neighbors_, to encourage incrementally updating the legacy style to meet our
|
||||
[style](#style). (See [#3174][3174] for background.)
|
||||
- CI for FreeBSD runs on [Cirrus CI].
|
||||
- CI for freebsd and openbsd runs on [sourcehut].
|
||||
- To get a backtrace on freebsd (after connecting via ssh):
|
||||
```sh
|
||||
sudo pkg install tmux # If you want tmux.
|
||||
lldb build/bin/nvim -c nvim.core
|
||||
|
||||
# To get a full backtrace:
|
||||
# 1. Rebuild with debug info.
|
||||
rm -rf nvim.core build
|
||||
gmake CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCI_BUILD=ON -DMIN_LOG_LEVEL=3" nvim
|
||||
# 2. Run the failing test to generate a new core file.
|
||||
TEST_FILE=test/functional/foo.lua gmake functionaltest
|
||||
lldb build/bin/nvim -c nvim.core
|
||||
```
|
||||
|
||||
### Clang scan-build
|
||||
|
||||
@@ -206,11 +218,6 @@ You can lint a single file (but this will _not_ exclude legacy errors):
|
||||
|
||||
### Style
|
||||
|
||||
- You can format files by using:
|
||||
```
|
||||
make format
|
||||
```
|
||||
This will format changed Lua and C files with all appropriate flags set.
|
||||
- Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match
|
||||
the [style-guide]. To use the Nvim `gq` command with `uncrustify`:
|
||||
```
|
||||
@@ -233,61 +240,15 @@ You can lint a single file (but this will _not_ exclude legacy errors):
|
||||
```
|
||||
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
```
|
||||
|
||||
- Recommendation is to use **[clangd]**.
|
||||
Can use the maintained config in [nvim-lspconfig/clangd].
|
||||
- Use **[universal-ctags](https://github.com/universal-ctags/ctags).**
|
||||
("Exuberant ctags", the typical `ctags` binary provided by your distro, is
|
||||
unmaintained and won't recognize many function signatures in Neovim source.)
|
||||
- Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim).
|
||||
- If using [lua-language-server], symlink `contrib/luarc.json` into the
|
||||
- If using [lua-language-server][], symlink `contrib/luarc.json` into the
|
||||
project root:
|
||||
|
||||
$ ln -s contrib/luarc.json .luarc.json
|
||||
|
||||
### Includes
|
||||
|
||||
For managing includes in C files, use [include-what-you-use].
|
||||
|
||||
- [Install include-what-you-use][include-what-you-use-install]
|
||||
- Run with:
|
||||
```
|
||||
make CMAKE_EXTRA_FLAGS=-DCMAKE_C_INCLUDE_WHAT_YOU_USE=include-what-you-use | tee iwyu.txt
|
||||
```
|
||||
|
||||
See [#549][549] for more details.
|
||||
|
||||
Documenting
|
||||
-----------
|
||||
|
||||
Many parts of the `:help` documentation are autogenerated from C or Lua docstrings using the `./scripts/gen_vimdoc.py` script.
|
||||
You can filter the regeneration based on the target (api, lua, or lsp), or the file you changed, that need a doc refresh using `./scripts/gen_vimdoc.py -t <target>`.
|
||||
|
||||
## Lua docstrings
|
||||
|
||||
Lua documentation uses a subset of [EmmyLua] annotations. A rough outline of a function documentation is
|
||||
|
||||
```lua
|
||||
--- {Brief}
|
||||
---
|
||||
--- {Long explanation}
|
||||
---
|
||||
---@param arg1 type {description}
|
||||
---@param arg2 type {description}
|
||||
{...}
|
||||
---
|
||||
---@return type {description}
|
||||
```
|
||||
|
||||
If possible, always add type information (`table`, `string`, `number`, ...). Multiple valid types are separated by a bar (`string|table`). Indicate optional parameters via `type|nil`.
|
||||
|
||||
If a function in your Lua module should not be documented (e.g. internal function or local function), you should set the doc comment to:
|
||||
|
||||
```
|
||||
---@private
|
||||
```
|
||||
|
||||
Mark functions that are deprecated as
|
||||
```
|
||||
---@deprecated
|
||||
```
|
||||
|
||||
Reviewing
|
||||
---------
|
||||
@@ -305,36 +266,30 @@ commits in the feature branch which aren't in the `master` branch; `-p`
|
||||
shows each commit's diff. To show the whole surrounding function of a change
|
||||
as context, use the `-W` argument as well.
|
||||
|
||||
[549]: https://github.com/neovim/neovim/issues/549
|
||||
[1820]: https://github.com/neovim/neovim/pull/1820
|
||||
[3174]: https://github.com/neovim/neovim/issues/3174
|
||||
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
|
||||
[Cirrus CI]: https://cirrus-ci.com/github/neovim/neovim
|
||||
[Clang report]: https://neovim.io/doc/reports/clang/
|
||||
[GitHub Actions]: https://github.com/neovim/neovim/actions
|
||||
[clangd]: https://clangd.llvm.org
|
||||
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
|
||||
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
|
||||
[conventional_commits]: https://www.conventionalcommits.org
|
||||
[EmmyLua]: https://github.com/sumneko/lua-language-server/wiki/Annotations
|
||||
[gcc-warnings]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||
[gh]: https://cli.github.com/
|
||||
[git-bisect]: http://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git
|
||||
[git-feature-branch]: https://www.atlassian.com/git/tutorials/comparing-workflows
|
||||
[git-history-filtering]: https://www.atlassian.com/git/tutorials/git-log/filtering-the-commit-history
|
||||
[git-history-rewriting]: http://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
|
||||
[git-rebasing]: http://git-scm.com/book/en/v2/Git-Branching-Rebasing
|
||||
[github-issues]: https://github.com/neovim/neovim/issues
|
||||
[include-what-you-use-install]: https://github.com/include-what-you-use/include-what-you-use#how-to-install
|
||||
[include-what-you-use]: https://github.com/include-what-you-use/include-what-you-use#using-with-cmake
|
||||
[lua-language-server]: https://github.com/sumneko/lua-language-server/
|
||||
[1820]: https://github.com/neovim/neovim/pull/1820
|
||||
[gh]: https://cli.github.com/
|
||||
[conventional_commits]: https://www.conventionalcommits.org
|
||||
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
|
||||
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
|
||||
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
|
||||
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
|
||||
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
|
||||
[3174]: https://github.com/neovim/neovim/issues/3174
|
||||
[sourcehut]: https://builds.sr.ht/~jmk
|
||||
[GitHub Actions]: https://github.com/neovim/neovim/actions
|
||||
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
|
||||
[Clang report]: https://neovim.io/doc/reports/clang/
|
||||
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
|
||||
[master error list]: https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json
|
||||
[nvim-lspconfig/clangd]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#clangd
|
||||
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
|
||||
[pr-draft]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
|
||||
[pr-ready]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
|
||||
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
|
||||
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
|
||||
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
|
||||
[uncrustify]: http://uncrustify.sourceforge.net/
|
||||
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
|
||||
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
|
||||
[lua-language-server]: https://github.com/sumneko/lua-language-server/
|
||||
|
@@ -8,7 +8,7 @@ Neovim's license follows:
|
||||
====
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
https://www.apache.org/licenses/
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
@@ -196,11 +196,10 @@ The externally maintained libraries used by Neovim are:
|
||||
- libtermkey: MIT license
|
||||
- libuv. Copyright Joyent, Inc. and other Node contributors. Node.js license.
|
||||
- libvterm: MIT license
|
||||
- lua-cjson: MIT license
|
||||
- lua-compat: MIT license
|
||||
- tree-sitter: MIT license
|
||||
- unibilium: LGPL v3
|
||||
- xdiff: LGPL v2
|
||||
- xdiff: LGPL license
|
||||
- lua-cjson: MIT license
|
||||
|
||||
====
|
||||
|
||||
|
91
MAINTAIN.md
@@ -12,23 +12,23 @@ General guidelines
|
||||
* Use automation to solve problems
|
||||
* Never break the API... but sometimes break the UI
|
||||
|
||||
Issue triage
|
||||
------------
|
||||
Ticket triage
|
||||
-------------
|
||||
|
||||
In practice we haven't found a way to forecast more precisely than "next" and
|
||||
"after next". So there are usually one or two (at most) planned milestones:
|
||||
|
||||
* Next bugfix-release (1.0.x)
|
||||
* Next feature-release (1.x.0)
|
||||
- Next bugfix-release (1.0.x)
|
||||
- Next feature-release (1.x.0)
|
||||
|
||||
The forecasting problem might be solved with an explicit priority system (like
|
||||
Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
|
||||
|
||||
* PRs nearing completion.
|
||||
* Issue labels. E.g. the `+plan` label increases the ticket's priority merely
|
||||
- PRs nearing completion.
|
||||
- Issue labels. E.g. the `+plan` label increases the ticket's priority merely
|
||||
for having a plan written down: it is _closer to completion_ than tickets
|
||||
without a plan.
|
||||
* Comment activity or new information.
|
||||
- Comment activity or new information.
|
||||
|
||||
Anything that isn't in the next milestone, and doesn't have a finished PR—is
|
||||
just not something you care very much about, by construction. Post-release you
|
||||
@@ -50,56 +50,49 @@ has a major bug:
|
||||
1. Fix the bug on `master`.
|
||||
2. Cherry-pick the fix to `release-x.y`.
|
||||
3. Cut a release from `release-x.y`.
|
||||
* Run `./scripts/release.sh`
|
||||
* Update (force-push) the remote `stable` tag.
|
||||
* The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13)
|
||||
will update the release assets and force-push to the `stable` tag.
|
||||
- Run `./scripts/release.sh`
|
||||
- Update (force-push) the remote `stable` tag.
|
||||
- The [nightly job](https://github.com/neovim/neovim/blob/master/.github/workflows/release.yml#L4)
|
||||
will update the release assets based on the `stable` tag.
|
||||
|
||||
### Release automation
|
||||
|
||||
Neovim automation includes a [backport bot](https://github.com/zeebe-io/backport-action).
|
||||
Trigger the action by labeling a PR with `backport release-X.Y`. See `.github/workflows/backport.yml`.
|
||||
The neovim repository includes a backport [github action](https://github.com/zeebe-io/backport-action).
|
||||
In order to trigger the action, a PR must be labeled with a label matching the
|
||||
form `backport release-0.X`. If the label is applied before the PR is merged,
|
||||
the backport will be filed automatically against the target branch. Otherwise,
|
||||
comment `\backport` on the merged PR *after* the label has been applied to trigger
|
||||
a backport. Note, the PR must have a description in the issue body, or the backport
|
||||
will fail.
|
||||
|
||||
Third-party dependencies
|
||||
------------------------
|
||||
--------------
|
||||
|
||||
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`.
|
||||
Some can be auto-bumped by `scripts/bump-deps.sh`.
|
||||
These "bundled" dependencies can be updated by bumping their versions in `third-party/CMakeLists.txt`:
|
||||
- [Lua](https://www.lua.org/download.html)
|
||||
- [LuaJIT](https://github.com/LuaJIT/LuaJIT)
|
||||
- [Luv](https://github.com/luvit/luv)
|
||||
- [libtermkey](https://github.com/neovim/libtermkey)
|
||||
- [libuv](https://github.com/libuv/libuv)
|
||||
- [libvterm](http://www.leonerd.org.uk/code/libvterm/)
|
||||
- [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
||||
- [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
||||
|
||||
* [LuaJIT](https://github.com/LuaJIT/LuaJIT)
|
||||
* [Lua](https://www.lua.org/download.html)
|
||||
* [Luv](https://github.com/luvit/luv)
|
||||
* [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
|
||||
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
|
||||
* [libtermkey](https://github.com/neovim/libtermkey)
|
||||
* [libuv](https://github.com/libuv/libuv)
|
||||
* [libvterm](http://www.leonerd.org.uk/code/libvterm/)
|
||||
* [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
||||
* [msys2](https://github.com/msys2/MINGW-packages) (for mingw Windows build)
|
||||
* Changes to mingw can [break our mingw build](https://github.com/msys2/MINGW-packages/issues/9946).
|
||||
* [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
||||
* [unibilium](https://github.com/neovim/unibilium)
|
||||
`scripts/bump-dep.sh` is a script that can automate this process for `LuaJIT`, `Luv`, `libuv` & `tree-sitter`. See usage guide:
|
||||
- Run `./scripts/bump-deps.sh --dep Luv --version 1.43.0-0` to update a dependency.
|
||||
See `./scripts/bump-deps.sh -h` for more detailed usage
|
||||
- Run `./scripts/bump-deps.sh --pr` to create a pr
|
||||
To generate the default PR title and body, the script uses the most recent commit (not in `master`) with prefix `build(deps): `
|
||||
|
||||
### Vendored dependencies
|
||||
These dependencies are "vendored" (inlined), we need to update the sources manually:
|
||||
- [libmpack](https://github.com/libmpack/libmpack)
|
||||
- [xdiff](https://github.com/git/git/tree/master/xdiff)
|
||||
- [lua-cjson](https://github.com/openresty/lua-cjson)
|
||||
- [Klib](https://github.com/attractivechaos/klib)
|
||||
|
||||
These dependencies are "vendored" (inlined), we must update the sources manually:
|
||||
|
||||
* `src/mpack/`: [libmpack](https://github.com/libmpack/libmpack)
|
||||
* send improvements upstream!
|
||||
* `src/xdiff/`: [xdiff](https://github.com/git/git/tree/master/xdiff)
|
||||
* `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson)
|
||||
* `src/nvim/lib/`: [Klib](https://github.com/attractivechaos/klib)
|
||||
* `runtime/lua/vim/inspect.lua`: [inspect.lua](https://github.com/kikito/inspect.lua)
|
||||
* `src/nvim/tui/terminfo_defs.h`: terminfo definitions
|
||||
* Run `scripts/update_terminfo.sh` to update these definitions.
|
||||
* [treesitter parsers](https://github.com/neovim/neovim/blob/fcc24e43e0b5f9d801a01ff2b8f78ce8c16dd551/cmake.deps/CMakeLists.txt#L197-L210)
|
||||
|
||||
### Forks
|
||||
|
||||
We may maintain forks, if we are waiting on upstream changes: https://github.com/neovim/neovim/wiki/Deps
|
||||
We also maintain some forks, particularly for Windows, if we are waiting on upstream changes:
|
||||
https://github.com/neovim/neovim/wiki/Deps
|
||||
|
||||
See also
|
||||
--------
|
||||
|
||||
* https://github.com/neovim/neovim/issues/862
|
||||
* https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
|
||||
- https://github.com/neovim/neovim/issues/862
|
||||
- https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
|
||||
|
79
Makefile
@@ -47,7 +47,13 @@ endif
|
||||
|
||||
ifeq (,$(BUILD_TOOL))
|
||||
ifeq (Ninja,$(CMAKE_GENERATOR))
|
||||
BUILD_TOOL = ninja
|
||||
ifneq ($(shell $(CMAKE_PRG) --help 2>/dev/null | grep Ninja),)
|
||||
BUILD_TOOL = ninja
|
||||
else
|
||||
# User's version of CMake doesn't support Ninja
|
||||
BUILD_TOOL = $(MAKE)
|
||||
CMAKE_GENERATOR := Unix Makefiles
|
||||
endif
|
||||
else
|
||||
BUILD_TOOL = $(MAKE)
|
||||
endif
|
||||
@@ -96,7 +102,7 @@ build/.ran-cmake: | deps
|
||||
cd build && $(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
|
||||
touch $@
|
||||
|
||||
deps: | build/.ran-deps-cmake
|
||||
deps: | build/.ran-third-party-cmake
|
||||
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
||||
+$(BUILD_TOOL) -C $(DEPS_BUILD_DIR)
|
||||
endif
|
||||
@@ -104,12 +110,12 @@ endif
|
||||
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
||||
$(DEPS_BUILD_DIR):
|
||||
mkdir -p "$@"
|
||||
build/.ran-deps-cmake:: $(DEPS_BUILD_DIR)
|
||||
build/.ran-third-party-cmake:: $(DEPS_BUILD_DIR)
|
||||
cd $(DEPS_BUILD_DIR) && \
|
||||
$(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
|
||||
$(DEPS_CMAKE_FLAGS) $(MAKEFILE_DIR)/cmake.deps
|
||||
$(DEPS_CMAKE_FLAGS) $(MAKEFILE_DIR)/third-party
|
||||
endif
|
||||
build/.ran-deps-cmake::
|
||||
build/.ran-third-party-cmake::
|
||||
mkdir -p build
|
||||
touch $@
|
||||
|
||||
@@ -127,11 +133,50 @@ endif
|
||||
src/nvim/testdir/%.vim: phony_force
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
|
||||
|
||||
functionaltest functionaltest-lua unittest benchmark: | nvim
|
||||
$(BUILD_TOOL) -C build $@
|
||||
build/runtime/doc/tags helptags: | nvim
|
||||
+$(BUILD_TOOL) -C build runtime/doc/tags
|
||||
|
||||
lintlua lintsh lintpy lintuncrustify lintc lintcfull check-single-includes generated-sources lintcommit lint formatc formatlua format: | build/.ran-cmake
|
||||
$(CMAKE_PRG) --build build --target $@
|
||||
# Builds help HTML _and_ checks for invalid help tags.
|
||||
helphtml: | nvim build/runtime/doc/tags
|
||||
+$(BUILD_TOOL) -C build doc_html
|
||||
|
||||
functionaltest: | nvim
|
||||
+$(BUILD_TOOL) -C build functionaltest
|
||||
|
||||
functionaltest-lua: | nvim
|
||||
+$(BUILD_TOOL) -C build functionaltest-lua
|
||||
|
||||
lualint: | build/.ran-cmake deps
|
||||
$(BUILD_TOOL) -C build lualint
|
||||
|
||||
shlint:
|
||||
@shellcheck --version | head -n 2
|
||||
shellcheck scripts/vim-patch.sh
|
||||
|
||||
_opt_shlint:
|
||||
@command -v shellcheck && { $(MAKE) shlint; exit $$?; } \
|
||||
|| echo "SKIP: shlint (shellcheck not found)"
|
||||
|
||||
pylint:
|
||||
flake8 contrib/ scripts/ src/ test/
|
||||
|
||||
# Run pylint only if flake8 is installed.
|
||||
_opt_pylint:
|
||||
@command -v flake8 && { $(MAKE) pylint; exit $$?; } \
|
||||
|| echo "SKIP: pylint (flake8 not found)"
|
||||
|
||||
commitlint:
|
||||
$(NVIM_PRG) -u NONE -es +"lua require('scripts.lintcommit').main({trace=false})"
|
||||
|
||||
_opt_commitlint:
|
||||
@test -x build/bin/nvim && { $(MAKE) commitlint; exit $$?; } \
|
||||
|| echo "SKIP: commitlint (build/bin/nvim not found)"
|
||||
|
||||
unittest: | nvim
|
||||
+$(BUILD_TOOL) -C build unittest
|
||||
|
||||
benchmark: | nvim
|
||||
+$(BUILD_TOOL) -C build benchmark
|
||||
|
||||
test: functionaltest unittest
|
||||
|
||||
@@ -148,6 +193,18 @@ distclean:
|
||||
install: checkprefix nvim
|
||||
+$(BUILD_TOOL) -C build install
|
||||
|
||||
clint: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build clint
|
||||
|
||||
clint-full: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build clint-full
|
||||
|
||||
check-single-includes: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build check-single-includes
|
||||
|
||||
generated-sources: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build generated-sources
|
||||
|
||||
appimage:
|
||||
bash scripts/genappimage.sh
|
||||
|
||||
@@ -157,6 +214,8 @@ appimage:
|
||||
appimage-%:
|
||||
bash scripts/genappimage.sh $*
|
||||
|
||||
lint: check-single-includes clint lualint _opt_pylint _opt_shlint _opt_commitlint
|
||||
|
||||
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
|
||||
# Does not work with "Unix Makefiles".
|
||||
ifeq ($(CMAKE_GENERATOR),Ninja)
|
||||
@@ -167,4 +226,4 @@ $(DEPS_BUILD_DIR)/%: phony_force
|
||||
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
|
||||
endif
|
||||
|
||||
.PHONY: test lintlua lintpy lintsh functionaltest unittest lint lintc clean distclean nvim libnvim cmake deps install appimage checkprefix lintcommit formatc formatlua format
|
||||
.PHONY: test lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix commitlint
|
||||
|
10
README.md
@@ -7,6 +7,7 @@
|
||||
[Twitter](https://twitter.com/Neovim)
|
||||
|
||||
[](https://github.com/neovim/neovim/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush)
|
||||
[](https://codecov.io/gh/neovim/neovim)
|
||||
[](https://scan.coverity.com/projects/2227)
|
||||
[](https://neovim.io/doc/reports/clang)
|
||||
[](https://neovim.io/doc/reports/pvs/PVS-studio.html.d)
|
||||
@@ -62,7 +63,7 @@ After installing the dependencies, run the following command.
|
||||
|
||||
To install to a non-default location:
|
||||
|
||||
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_INSTALL_PREFIX=/full/path/
|
||||
make CMAKE_INSTALL_PREFIX=/full/path/
|
||||
make install
|
||||
|
||||
CMake hints for inspecting the build:
|
||||
@@ -80,10 +81,8 @@ Project layout
|
||||
--------------
|
||||
|
||||
├─ ci/ build automation
|
||||
├─ cmake/ CMake utils
|
||||
├─ cmake.config/ CMake defines
|
||||
├─ cmake.deps/ subproject to fetch and build dependencies (optional)
|
||||
├─ runtime/ plugins and docs
|
||||
├─ cmake/ build scripts
|
||||
├─ runtime/ user plugins/docs
|
||||
├─ src/nvim/ application source code (see src/nvim/README.md)
|
||||
│ ├─ api/ API subsystem
|
||||
│ ├─ eval/ VimL subsystem
|
||||
@@ -94,6 +93,7 @@ Project layout
|
||||
│ ├─ msgpack_rpc/ RPC subsystem
|
||||
│ ├─ os/ low-level platform code
|
||||
│ └─ tui/ built-in UI
|
||||
├─ third-party/ CMake subproject to build dependencies
|
||||
└─ test/ tests (see test/README.md)
|
||||
|
||||
License
|
||||
|
@@ -12,6 +12,11 @@ mkdir -p "${HOME}/.cache"
|
||||
echo "before_cache.sh: cache size"
|
||||
du -chd 1 "${HOME}/.cache" | sort -rh | head -20
|
||||
|
||||
echo "before_cache.sh: ccache stats"
|
||||
ccache -s 2>/dev/null || true
|
||||
# Do not keep ccache stats (uploaded to cache otherwise; reset initially anyway).
|
||||
find "${HOME}/.ccache" -name stats -delete
|
||||
|
||||
# Update the third-party dependency cache only if the build was successful.
|
||||
if ended_successfully && [ -d "${DEPS_BUILD_DIR}" ]; then
|
||||
# Do not cache downloads. They should not be needed with up-to-date deps.
|
||||
|
@@ -16,6 +16,11 @@ if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; the
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "before_script.sh: ccache stats (will be cleared)"
|
||||
ccache -s
|
||||
# Reset ccache stats for real results in before_cache.
|
||||
ccache --zero-stats
|
||||
|
||||
# Compile dependencies.
|
||||
build_deps
|
||||
|
||||
|
232
ci/build.ps1
@@ -1,32 +1,24 @@
|
||||
[CmdletBinding(DefaultParameterSetName = "Build")]
|
||||
param(
|
||||
[Parameter(ParameterSetName="Build")][switch]$Build,
|
||||
[Parameter(ParameterSetName="BuildDeps")][switch]$BuildDeps,
|
||||
[Parameter(ParameterSetName="EnsureTestDeps")][switch]$EnsureTestDeps,
|
||||
[Parameter(ParameterSetName="Package")][switch]$Package,
|
||||
[Parameter(ParameterSetName="Test")][switch]$Test,
|
||||
[Parameter(ParameterSetName="TestOld")][switch]$TestOld
|
||||
)
|
||||
|
||||
param([switch]$NoTests)
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
$projectDir = [System.IO.Path]::GetFullPath("$(Get-Location)")
|
||||
$buildDir = Join-Path -Path $projectDir -ChildPath "build"
|
||||
|
||||
# $env:CMAKE_BUILD_TYPE is ignored by cmake when not using ninja
|
||||
$cmakeBuildType = $(if ($null -ne $env:CMAKE_BUILD_TYPE) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
|
||||
$env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$'
|
||||
$compiler = $Matches.compiler
|
||||
$compileOption = if ($Matches -contains 'option') {$Matches.option} else {''}
|
||||
$bits = $Matches.bits
|
||||
$cmakeBuildType = $(if ($env:CMAKE_BUILD_TYPE -ne $null) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
|
||||
$buildDir = [System.IO.Path]::GetFullPath("$(pwd)")
|
||||
$depsCmakeVars = @{
|
||||
CMAKE_BUILD_TYPE=$cmakeBuildType;
|
||||
CMAKE_BUILD_TYPE = $cmakeBuildType;
|
||||
}
|
||||
$nvimCmakeVars = @{
|
||||
CMAKE_BUILD_TYPE=$cmakeBuildType;
|
||||
CMAKE_BUILD_TYPE = $cmakeBuildType;
|
||||
BUSTED_OUTPUT_TYPE = 'nvim';
|
||||
DEPS_PREFIX=$(if ($null -ne $env:DEPS_PREFIX) {$env:DEPS_PREFIX} else {".deps/usr"});
|
||||
DEPS_PREFIX=$(if ($env:DEPS_PREFIX -ne $null) {$env:DEPS_PREFIX} else {".deps/usr"});
|
||||
}
|
||||
if ($null -eq $env:DEPS_BUILD_DIR) {
|
||||
$env:DEPS_BUILD_DIR = Join-Path -Path $projectDir -ChildPath ".deps"
|
||||
if ($env:DEPS_BUILD_DIR -eq $null) {
|
||||
$env:DEPS_BUILD_DIR = ".deps";
|
||||
}
|
||||
$uploadToCodeCov = $false
|
||||
|
||||
@@ -36,97 +28,150 @@ function exitIfFailed() {
|
||||
}
|
||||
}
|
||||
|
||||
function convertToCmakeArgs($vars) {
|
||||
return $vars.GetEnumerator() | ForEach-Object { "-D$($_.Key)=$($_.Value)" }
|
||||
}
|
||||
|
||||
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
||||
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
|
||||
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | ForEach-Object {
|
||||
$name, $value = $_ -split '=', 2
|
||||
Set-Content env:\"$name" $value
|
||||
}
|
||||
}
|
||||
|
||||
function BuildDeps {
|
||||
|
||||
if (Test-Path -PathType container $env:DEPS_BUILD_DIR) {
|
||||
$cachedBuildTypeStr = $(Get-Content $env:DEPS_BUILD_DIR\CMakeCache.txt | Select-String -Pattern "CMAKE_BUILD_TYPE.*=($cmakeBuildType)")
|
||||
if (-not $cachedBuildTypeStr) {
|
||||
Write-Warning " unable to validate build type from cache dir ${env:DEPS_BUILD_DIR}"
|
||||
}
|
||||
}
|
||||
|
||||
# we currently can't use ninja for cmake.deps, see #19405
|
||||
$depsCmakeGenerator = "Visual Studio 16 2019"
|
||||
$depsCmakeGeneratorPlf = "x64"
|
||||
cmake -S "$projectDir\cmake.deps" -B $env:DEPS_BUILD_DIR -G $depsCmakeGenerator -A $depsCmakeGeneratorPlf $(convertToCmakeArgs($depsCmakeVars)); exitIfFailed
|
||||
|
||||
$depsCmakeNativeToolOptions= @('/verbosity:normal', '/m')
|
||||
cmake --build $env:DEPS_BUILD_DIR --config $cmakeBuildType -- $depsCmakeNativeToolOptions; exitIfFailed
|
||||
}
|
||||
|
||||
function Build {
|
||||
cmake -S $projectDir -B $buildDir $(convertToCmakeArgs($nvimCmakeVars)) -G Ninja; exitIfFailed
|
||||
cmake --build $buildDir --config $cmakeBuildType; exitIfFailed
|
||||
}
|
||||
|
||||
function EnsureTestDeps {
|
||||
& $buildDir\bin\nvim.exe "--version"; exitIfFailed
|
||||
|
||||
# Ensure that the "win32" feature is set.
|
||||
& $buildDir\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"' ; exitIfFailed
|
||||
|
||||
python -m pip install pynvim
|
||||
# Sanity check
|
||||
python -c "import pynvim; print(str(pynvim))"; exitIfFailed
|
||||
|
||||
gem.cmd install --pre neovim
|
||||
Get-Command -CommandType Application neovim-ruby-host.bat; exitIfFailed
|
||||
|
||||
if (-not $NoTests) {
|
||||
node --version
|
||||
npm.cmd --version
|
||||
}
|
||||
|
||||
npm.cmd install -g neovim; exitIfFailed
|
||||
Get-Command -CommandType Application neovim-node-host.cmd; exitIfFailed
|
||||
npm.cmd link neovim
|
||||
if (-Not (Test-Path -PathType container $env:DEPS_BUILD_DIR)) {
|
||||
write-host "cache dir not found: $($env:DEPS_BUILD_DIR)"
|
||||
mkdir $env:DEPS_BUILD_DIR
|
||||
} else {
|
||||
write-host "cache dir $($env:DEPS_BUILD_DIR) size: $(Get-ChildItem $env:DEPS_BUILD_DIR -recurse | Measure-Object -property length -sum | Select -expand sum)"
|
||||
}
|
||||
|
||||
if ($env:USE_LUACOV -eq 1) {
|
||||
& $env:DEPS_PREFIX\luarocks\luarocks.bat install cluacov
|
||||
if ($compiler -eq 'MINGW') {
|
||||
if ($bits -eq 32) {
|
||||
$arch = 'i686'
|
||||
}
|
||||
elseif ($bits -eq 64) {
|
||||
$arch = 'x86_64'
|
||||
}
|
||||
if ($compileOption -eq 'gcov') {
|
||||
$nvimCmakeVars['USE_GCOV'] = 'ON'
|
||||
$uploadToCodecov = $true
|
||||
$env:GCOV = "C:\msys64\mingw$bits\bin\gcov"
|
||||
|
||||
# Setup/build Lua coverage.
|
||||
$env:USE_LUACOV = 1
|
||||
$env:BUSTED_ARGS = "--coverage"
|
||||
}
|
||||
# These are native MinGW builds, but they use the toolchain inside
|
||||
# MSYS2, this allows using all the dependencies and tools available
|
||||
# in MSYS2, but we cannot build inside the MSYS2 shell.
|
||||
$cmakeGenerator = 'Ninja'
|
||||
$cmakeGeneratorArgs = '-v'
|
||||
$mingwPackages = @('ninja', 'cmake', 'diffutils').ForEach({
|
||||
"mingw-w64-$arch-$_"
|
||||
})
|
||||
|
||||
# Add MinGW to the PATH
|
||||
$env:PATH = "C:\msys64\mingw$bits\bin;$env:PATH"
|
||||
|
||||
# Avoid pacman "warning" which causes non-zero return code. https://github.com/open62541/open62541/issues/2068
|
||||
& C:\msys64\usr\bin\mkdir -p /var/cache/pacman/pkg
|
||||
|
||||
# Build third-party dependencies
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Syu" ; exitIfFailed
|
||||
# Update again in case updating pacman changes pacman.conf
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Syu" ; exitIfFailed
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S $mingwPackages" ; exitIfFailed
|
||||
}
|
||||
elseif ($compiler -eq 'MSVC') {
|
||||
$cmakeGeneratorArgs = '/verbosity:normal'
|
||||
$cmakeGenerator = 'Visual Studio 16 2019'
|
||||
}
|
||||
|
||||
if ($compiler -eq 'MSVC') {
|
||||
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
||||
if ($installationPath -and (test-path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
|
||||
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x${bits} -no_logo && set" | foreach-object {
|
||||
$name, $value = $_ -split '=', 2
|
||||
set-content env:\"$name" $value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Test {
|
||||
if (-not $NoTests) {
|
||||
python -m ensurepip
|
||||
python -m pip install pynvim ; exitIfFailed
|
||||
# Sanity check
|
||||
python -c "import pynvim; print(str(pynvim))" ; exitIfFailed
|
||||
|
||||
gem.cmd install --pre neovim
|
||||
Get-Command -CommandType Application neovim-ruby-host.bat
|
||||
|
||||
npm.cmd install -g neovim
|
||||
Get-Command -CommandType Application neovim-node-host.cmd
|
||||
npm.cmd link neovim
|
||||
}
|
||||
|
||||
function convertToCmakeArgs($vars) {
|
||||
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
|
||||
}
|
||||
|
||||
cd $env:DEPS_BUILD_DIR
|
||||
if ($compiler -eq 'MSVC') {
|
||||
if ($bits -eq 32) {
|
||||
cmake -G $cmakeGenerator -A Win32 $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
|
||||
} else {
|
||||
cmake -G $cmakeGenerator -A x64 $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
|
||||
}
|
||||
} else {
|
||||
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
|
||||
}
|
||||
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
|
||||
cd $buildDir
|
||||
|
||||
# Build Neovim
|
||||
mkdir build
|
||||
cd build
|
||||
if ($compiler -eq 'MSVC') {
|
||||
if ($bits -eq 32) {
|
||||
cmake -G $cmakeGenerator -A Win32 $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
|
||||
} else {
|
||||
cmake -G $cmakeGenerator -A x64 $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
|
||||
}
|
||||
} else {
|
||||
cmake -G $cmakeGenerator $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
|
||||
}
|
||||
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
|
||||
.\bin\nvim --version ; exitIfFailed
|
||||
|
||||
# Ensure that the "win32" feature is set.
|
||||
.\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"' ; exitIfFailed
|
||||
|
||||
if ($env:USE_LUACOV -eq 1) {
|
||||
& $env:DEPS_PREFIX\luarocks\luarocks.bat install cluacov
|
||||
}
|
||||
|
||||
if (-not $NoTests) {
|
||||
# Functional tests
|
||||
# The $LastExitCode from MSBuild can't be trusted
|
||||
$failed = $false
|
||||
|
||||
# Run only this test file:
|
||||
# $env:TEST_FILE = "test\functional\foo.lua"
|
||||
cmake --build $buildDir --target functionaltest 2>&1 |
|
||||
ForEach-Object { $failed = $failed -or
|
||||
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 |
|
||||
foreach { $failed = $failed -or
|
||||
$_ -match 'functional tests failed with error'; $_ }
|
||||
|
||||
if ($uploadToCodecov) {
|
||||
if ($env:USE_LUACOV -eq 1) {
|
||||
& $env:DEPS_PREFIX\bin\luacov.bat
|
||||
}
|
||||
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
|
||||
}
|
||||
if ($failed) {
|
||||
exit $LastExitCode
|
||||
}
|
||||
|
||||
if (-not $uploadToCodecov) {
|
||||
return
|
||||
}
|
||||
if ($env:USE_LUACOV -eq 1) {
|
||||
& $env:DEPS_PREFIX\bin\luacov.bat
|
||||
}
|
||||
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
|
||||
}
|
||||
|
||||
function TestOld {
|
||||
# Old tests
|
||||
# Add MSYS to path, required for e.g. `find` used in test scripts.
|
||||
# But would break functionaltests, where its `more` would be used then.
|
||||
$OldPath = $env:PATH
|
||||
$env:PATH = "C:\msys64\usr\bin;$env:PATH"
|
||||
& "C:\msys64\mingw64\bin\mingw32-make.exe" -C $(Convert-Path $projectDir\src\nvim\testdir) VERBOSE=1; exitIfFailed
|
||||
& "C:\msys64\mingw$bits\bin\mingw32-make.exe" -C $(Convert-Path ..\src\nvim\testdir) VERBOSE=1 ; exitIfFailed
|
||||
$env:PATH = $OldPath
|
||||
|
||||
if ($uploadToCodecov) {
|
||||
@@ -134,13 +179,10 @@ function TestOld {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Package {
|
||||
cmake -S $projectDir -B $buildDir $(convertToCmakeArgs($nvimCmakeVars)) -G Ninja; exitIfFailed
|
||||
cmake --build $buildDir --target package; exitIfFailed
|
||||
# Ensure choco's cpack is not in PATH otherwise, it conflicts with CMake's
|
||||
if (Test-Path -Path $env:ChocolateyInstall\bin\cpack.exe) {
|
||||
Remove-Item -Path $env:ChocolateyInstall\bin\cpack.exe -Force
|
||||
}
|
||||
|
||||
if ($PSCmdlet.ParameterSetName) {
|
||||
& (Get-ChildItem "Function:$($PSCmdlet.ParameterSetName)")
|
||||
exit
|
||||
}
|
||||
# Build artifacts
|
||||
cpack -C $cmakeBuildType
|
||||
|
@@ -24,7 +24,9 @@ build_deps() {
|
||||
mkdir -p "${DEPS_BUILD_DIR}"
|
||||
|
||||
# Use cached dependencies if $CACHE_MARKER exists.
|
||||
if test -f "${CACHE_MARKER}"; then
|
||||
if test "${CACHE_ENABLE}" = "false" ; then
|
||||
export CCACHE_RECACHE=1
|
||||
elif test -f "${CACHE_MARKER}" ; then
|
||||
echo "Using third-party dependencies from cache (last update: $(_stat "${CACHE_MARKER}"))."
|
||||
cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_DIR}"
|
||||
fi
|
||||
@@ -33,7 +35,7 @@ build_deps() {
|
||||
# update CMake configuration and update to newer deps versions.
|
||||
cd "${DEPS_BUILD_DIR}"
|
||||
echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
|
||||
CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/cmake.deps/"
|
||||
CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/third-party/"
|
||||
|
||||
if ! top_make; then
|
||||
exit 1
|
||||
|
@@ -5,7 +5,7 @@ set -o pipefail
|
||||
|
||||
# Use default CC to avoid compilation problems when installing Python modules.
|
||||
echo "Install neovim module for Python."
|
||||
CC=cc python3 -m pip -q install --user --upgrade pynvim
|
||||
CC=cc python -m pip -q install --user --upgrade pynvim
|
||||
|
||||
echo "Install neovim RubyGem."
|
||||
gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim
|
||||
|
24
ci/run_lint.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
source "${CI_DIR}/common/build.sh"
|
||||
source "${CI_DIR}/common/suite.sh"
|
||||
|
||||
rm -f "$END_MARKER"
|
||||
|
||||
# Run all tests if no input argument is given
|
||||
if (($# == 0)); then
|
||||
tests=('clint-full' 'lualint' 'pylint' 'shlint' 'check-single-includes')
|
||||
else
|
||||
tests=("$@")
|
||||
fi
|
||||
|
||||
for i in "${tests[@]}"; do
|
||||
make "$i" || fail "$i"
|
||||
done
|
||||
|
||||
end_tests
|
@@ -33,9 +33,3 @@ for i in "${tests[@]}"; do
|
||||
done
|
||||
|
||||
end_tests
|
||||
|
||||
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
|
||||
echo '=== Unexpected gcov errors: ==='
|
||||
cat "${GCOV_ERROR_FILE}"
|
||||
exit 1
|
||||
fi
|
||||
|
12
ci/script.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
ci/run_${CI_TARGET}.sh
|
||||
|
||||
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
|
||||
echo '=== Unexpected gcov errors: ==='
|
||||
cat "${GCOV_ERROR_FILE}"
|
||||
exit 1
|
||||
fi
|
@@ -1,43 +0,0 @@
|
||||
if(WIN32)
|
||||
set(LIBTERMKEY_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/libtermkeyCMakeLists.txt
|
||||
${DEPS_BUILD_DIR}/src/libtermkey/CMakeLists.txt
|
||||
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/libtermkey
|
||||
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
|
||||
# Pass toolchain
|
||||
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}
|
||||
${BUILD_TYPE_STRING}
|
||||
# Hack to avoid -rdynamic in Mingw
|
||||
-DCMAKE_SHARED_LIBRARY_LINK_C_FLAGS=""
|
||||
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
|
||||
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
|
||||
-DUNIBILIUM_INCLUDE_DIRS=${DEPS_INSTALL_DIR}/include
|
||||
-DUNIBILIUM_LIBRARIES=${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}unibilium${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(LIBTERMKEY_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>)
|
||||
set(LIBTERMKEY_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
set(LIBTERMKEY_BUILD_COMMAND "" BUILD_IN_SOURCE 1)
|
||||
set(LIBTERMKEY_INSTALL_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
|
||||
PREFIX=${DEPS_INSTALL_DIR} PKG_CONFIG_PATH=${DEPS_LIB_DIR}/pkgconfig
|
||||
CFLAGS=-fPIC LDFLAGS+=-static ${DEFAULT_MAKE_CFLAGS} install)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(libtermkey
|
||||
PREFIX ${DEPS_BUILD_DIR}
|
||||
URL ${LIBTERMKEY_URL}
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libtermkey
|
||||
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||
-DPREFIX=${DEPS_BUILD_DIR}
|
||||
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libtermkey
|
||||
-DURL=${LIBTERMKEY_URL}
|
||||
-DEXPECTED_SHA256=${LIBTERMKEY_SHA256}
|
||||
-DTARGET=libtermkey
|
||||
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||
CONFIGURE_COMMAND "${LIBTERMKEY_CONFIGURE_COMMAND}"
|
||||
BUILD_COMMAND "${LIBTERMKEY_BUILD_COMMAND}"
|
||||
INSTALL_COMMAND "${LIBTERMKEY_INSTALL_COMMAND}")
|
||||
|
||||
list(APPEND THIRD_PARTY_DEPS libtermkey)
|
@@ -1,26 +0,0 @@
|
||||
ExternalProject_Add(libuv
|
||||
PREFIX ${DEPS_BUILD_DIR}
|
||||
URL ${LIBUV_URL}
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=lib
|
||||
-DBUILD_TESTING=OFF
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DLIBUV_BUILD_SHARED=OFF
|
||||
CMAKE_CACHE_ARGS
|
||||
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libuv
|
||||
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||
-DPREFIX=${DEPS_BUILD_DIR}
|
||||
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libuv
|
||||
-DURL=${LIBUV_URL}
|
||||
-DEXPECTED_SHA256=${LIBUV_SHA256}
|
||||
-DTARGET=libuv
|
||||
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||
PATCH_COMMAND
|
||||
${GIT_EXECUTABLE} -C ${DEPS_BUILD_DIR}/src/libuv init
|
||||
COMMAND ${GIT_EXECUTABLE} -C ${DEPS_BUILD_DIR}/src/libuv apply --ignore-whitespace
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/patches/libuv-disable-shared.patch)
|
||||
|
||||
list(APPEND THIRD_PARTY_DEPS libuv)
|
@@ -1,46 +0,0 @@
|
||||
if(WIN32)
|
||||
set(LIBVTERM_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibvtermCMakeLists.txt
|
||||
${DEPS_BUILD_DIR}/src/libvterm/CMakeLists.txt
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Libvterm-tbl2inc_c.cmake
|
||||
${DEPS_BUILD_DIR}/src/libvterm/tbl2inc_c.cmake
|
||||
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/libvterm
|
||||
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
|
||||
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
|
||||
if(MSVC)
|
||||
list(APPEND LIBVTERM_CONFIGURE_COMMAND "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1}")
|
||||
else()
|
||||
list(APPEND LIBVTERM_CONFIGURE_COMMAND "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} -fPIC")
|
||||
endif()
|
||||
set(LIBVTERM_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>)
|
||||
set(LIBVTERM_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
|
||||
else()
|
||||
set(LIBVTERM_INSTALL_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
|
||||
PREFIX=${DEPS_INSTALL_DIR}
|
||||
CFLAGS=-fPIC
|
||||
LDFLAGS+=-static
|
||||
${DEFAULT_MAKE_CFLAGS}
|
||||
install)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(libvterm
|
||||
PREFIX ${DEPS_BUILD_DIR}
|
||||
URL ${LIBVTERM_URL}
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libvterm
|
||||
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||
-DPREFIX=${DEPS_BUILD_DIR}
|
||||
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libvterm
|
||||
-DURL=${LIBVTERM_URL}
|
||||
-DEXPECTED_SHA256=${LIBVTERM_SHA256}
|
||||
-DTARGET=libvterm
|
||||
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||
BUILD_IN_SOURCE 1
|
||||
CONFIGURE_COMMAND "${LIBVTERM_CONFIGURE_COMMAND}"
|
||||
BUILD_COMMAND "${LIBVTERM_BUILD_COMMAND}"
|
||||
INSTALL_COMMAND "${LIBVTERM_INSTALL_COMMAND}")
|
||||
|
||||
list(APPEND THIRD_PARTY_DEPS libvterm)
|
@@ -1,103 +0,0 @@
|
||||
set(LUV_SRC_DIR ${DEPS_BUILD_DIR}/src/luv)
|
||||
set(LUV_INCLUDE_FLAGS
|
||||
"-I${DEPS_INSTALL_DIR}/include -I${DEPS_INSTALL_DIR}/include/luajit-2.1")
|
||||
|
||||
set(LUV_CONFIGURE_COMMAND_COMMON
|
||||
${CMAKE_COMMAND} ${LUV_SRC_DIR}
|
||||
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
|
||||
${BUILD_TYPE_STRING}
|
||||
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_ALT_SEP}
|
||||
-DLUA_BUILD_TYPE=System
|
||||
-DLUA_COMPAT53_DIR=${DEPS_BUILD_DIR}/src/lua-compat-5.3
|
||||
-DWITH_SHARED_LIBUV=ON
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DBUILD_MODULE=OFF)
|
||||
|
||||
if(USE_BUNDLED_LUAJIT)
|
||||
list(APPEND LUV_CONFIGURE_COMMAND_COMMON -DWITH_LUA_ENGINE=LuaJit)
|
||||
elseif(USE_BUNDLED_LUA)
|
||||
list(APPEND LUV_CONFIGURE_COMMAND_COMMON -DWITH_LUA_ENGINE=Lua)
|
||||
else()
|
||||
find_package(LuaJit)
|
||||
if(LUAJIT_FOUND)
|
||||
list(APPEND LUV_CONFIGURE_COMMAND_COMMON -DWITH_LUA_ENGINE=LuaJit)
|
||||
else()
|
||||
list(APPEND LUV_CONFIGURE_COMMAND_COMMON -DWITH_LUA_ENGINE=Lua)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_LIBUV)
|
||||
set(LUV_CONFIGURE_COMMAND_COMMON
|
||||
${LUV_CONFIGURE_COMMAND_COMMON}
|
||||
-DCMAKE_PREFIX_PATH=${DEPS_INSTALL_DIR}
|
||||
-DLIBUV_LIBRARIES=uv_a)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(LUV_CONFIGURE_COMMAND
|
||||
${LUV_CONFIGURE_COMMAND_COMMON}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
|
||||
# Same as Unix without fPIC
|
||||
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} ${LUV_INCLUDE_FLAGS}"
|
||||
# Make sure we use the same generator, otherwise we may
|
||||
# accidentally end up using different MSVC runtimes
|
||||
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
|
||||
else()
|
||||
set(LUV_CONFIGURE_COMMAND
|
||||
${LUV_CONFIGURE_COMMAND_COMMON}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} ${LUV_INCLUDE_FLAGS} -fPIC")
|
||||
if(CMAKE_GENERATOR MATCHES "Unix Makefiles" AND
|
||||
(CMAKE_SYSTEM_NAME MATCHES ".*BSD" OR CMAKE_SYSTEM_NAME MATCHES "DragonFly"))
|
||||
set(LUV_CONFIGURE_COMMAND ${LUV_CONFIGURE_COMMAND} -DCMAKE_MAKE_PROGRAM=gmake)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(lua-compat-5.3
|
||||
PREFIX ${DEPS_BUILD_DIR}
|
||||
URL ${LUA_COMPAT53_URL}
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua-compat-5.3
|
||||
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||
-DPREFIX=${DEPS_BUILD_DIR}
|
||||
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/lua-compat-5.3
|
||||
-DURL=${LUA_COMPAT53_URL}
|
||||
-DEXPECTED_SHA256=${LUA_COMPAT53_SHA256}
|
||||
-DTARGET=lua-compat-5.3
|
||||
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND "")
|
||||
|
||||
ExternalProject_Add(luv-static
|
||||
PREFIX ${DEPS_BUILD_DIR}
|
||||
DEPENDS lua-compat-5.3
|
||||
URL ${LUV_URL}
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luv
|
||||
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||
-DPREFIX=${DEPS_BUILD_DIR}
|
||||
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/luv
|
||||
-DURL=${LUV_URL}
|
||||
-DEXPECTED_SHA256=${LUV_SHA256}
|
||||
-DTARGET=luv-static
|
||||
# The source is shared with BuildLuarocks (with USE_BUNDLED_LUV).
|
||||
-DSRC_DIR=${DEPS_BUILD_DIR}/src/luv
|
||||
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||
CONFIGURE_COMMAND "${LUV_CONFIGURE_COMMAND}"
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>
|
||||
LIST_SEPARATOR |)
|
||||
|
||||
list(APPEND THIRD_PARTY_DEPS luv-static)
|
||||
if(USE_BUNDLED_LUAJIT)
|
||||
add_dependencies(luv-static luajit)
|
||||
elseif(USE_BUNDLED_LUA)
|
||||
add_dependencies(luv-static lua)
|
||||
endif()
|
||||
if(USE_BUNDLED_LIBUV)
|
||||
add_dependencies(luv-static libuv)
|
||||
endif()
|
@@ -1,42 +0,0 @@
|
||||
set(MSGPACK_CONFIGURE_COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/msgpack
|
||||
-DMSGPACK_BUILD_TESTS=OFF
|
||||
-DMSGPACK_BUILD_EXAMPLES=OFF
|
||||
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_ALT_SEP}
|
||||
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} -fPIC"
|
||||
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
|
||||
|
||||
if(MSVC)
|
||||
# Same as Unix without fPIC
|
||||
set(MSGPACK_CONFIGURE_COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/msgpack
|
||||
-DMSGPACK_BUILD_TESTS=OFF
|
||||
-DMSGPACK_BUILD_EXAMPLES=OFF
|
||||
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
|
||||
${BUILD_TYPE_STRING}
|
||||
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1}"
|
||||
# Make sure we use the same generator, otherwise we may
|
||||
# accidentally end up using different MSVC runtimes
|
||||
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(msgpack
|
||||
PREFIX ${DEPS_BUILD_DIR}
|
||||
URL ${MSGPACK_URL}
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/msgpack
|
||||
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||
-DPREFIX=${DEPS_BUILD_DIR}
|
||||
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/msgpack
|
||||
-DURL=${MSGPACK_URL}
|
||||
-DEXPECTED_SHA256=${MSGPACK_SHA256}
|
||||
-DTARGET=msgpack
|
||||
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||
CONFIGURE_COMMAND "${MSGPACK_CONFIGURE_COMMAND}"
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>
|
||||
LIST_SEPARATOR |)
|
||||
|
||||
list(APPEND THIRD_PARTY_DEPS msgpack)
|
@@ -1,38 +0,0 @@
|
||||
if(MSVC)
|
||||
set(TREESITTER_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/TreesitterCMakeLists.txt
|
||||
${DEPS_BUILD_DIR}/src/tree-sitter/CMakeLists.txt
|
||||
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/tree-sitter/CMakeLists.txt
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
|
||||
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
|
||||
${BUILD_TYPE_STRING}
|
||||
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR})
|
||||
set(TREESITTER_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>)
|
||||
set(TREESITTER_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
|
||||
else()
|
||||
set(TS_CFLAGS "-O3 -Wall -Wextra")
|
||||
set(TREESITTER_BUILD_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER} CFLAGS=${TS_CFLAGS})
|
||||
set(TREESITTER_INSTALL_COMMAND
|
||||
${MAKE_PRG} CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR} install)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(tree-sitter
|
||||
PREFIX ${DEPS_BUILD_DIR}
|
||||
URL ${TREESITTER_URL}
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/tree-sitter
|
||||
INSTALL_DIR ${DEPS_INSTALL_DIR}
|
||||
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||
-DPREFIX=${DEPS_BUILD_DIR}
|
||||
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/tree-sitter
|
||||
-DURL=${TREESITTER_URL}
|
||||
-DEXPECTED_SHA256=${TREESITTER_SHA256}
|
||||
-DTARGET=tree-sitter
|
||||
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||
BUILD_IN_SOURCE 1
|
||||
CONFIGURE_COMMAND "${TREESITTER_CONFIGURE_COMMAND}"
|
||||
BUILD_COMMAND "${TREESITTER_BUILD_COMMAND}"
|
||||
INSTALL_COMMAND "${TREESITTER_INSTALL_COMMAND}")
|
||||
|
||||
list(APPEND THIRD_PARTY_DEPS tree-sitter)
|
@@ -1,28 +0,0 @@
|
||||
function(BuildTSParser LANG TS_URL TS_SHA256 TS_CMAKE_FILE)
|
||||
set(NAME treesitter-${LANG})
|
||||
ExternalProject_Add(${NAME}
|
||||
PREFIX ${DEPS_BUILD_DIR}
|
||||
URL ${TREESITTER_C_URL}
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/${NAME}
|
||||
CMAKE_CACHE_ARGS
|
||||
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
|
||||
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||
-DPREFIX=${DEPS_BUILD_DIR}
|
||||
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/${NAME}
|
||||
-DURL=${TS_URL}
|
||||
-DEXPECTED_SHA256=${TS_SHA256}
|
||||
-DTARGET=${NAME}
|
||||
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/${TS_CMAKE_FILE}
|
||||
${DEPS_BUILD_DIR}/src/${NAME}/CMakeLists.txt
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
|
||||
-DPARSERLANG=${LANG})
|
||||
endfunction()
|
||||
|
||||
BuildTSParser(c ${TREESITTER_C_URL} ${TREESITTER_C_SHA256} TreesitterParserCMakeLists.txt)
|
||||
BuildTSParser(lua ${TREESITTER_LUA_URL} ${TREESITTER_LUA_SHA256} TreesitterParserCMakeLists.txt)
|
||||
BuildTSParser(vim ${TREESITTER_VIM_URL} ${TREESITTER_VIM_SHA256} TreesitterParserCMakeLists.txt)
|
||||
BuildTSParser(help ${TREESITTER_HELP_URL} ${TREESITTER_HELP_SHA256} TreesitterParserCMakeLists.txt)
|
@@ -1,37 +0,0 @@
|
||||
if(WIN32)
|
||||
set(UNIBILIUM_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/UnibiliumCMakeLists.txt
|
||||
${DEPS_BUILD_DIR}/src/unibilium/CMakeLists.txt
|
||||
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/unibilium
|
||||
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
|
||||
# Pass toolchain
|
||||
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}
|
||||
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
|
||||
${BUILD_TYPE_STRING}
|
||||
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
|
||||
set(UNIBILIUM_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>)
|
||||
set(UNIBILIUM_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
|
||||
else()
|
||||
set(UNIBILIUM_BUILD_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
|
||||
PREFIX=${DEPS_INSTALL_DIR} CFLAGS=-fPIC LDFLAGS+=-static
|
||||
BUILD_IN_SOURCE 1)
|
||||
set(UNIBILIUM_INSTALL_COMMAND ${MAKE_PRG} PREFIX=${DEPS_INSTALL_DIR} install)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(unibilium
|
||||
PREFIX ${DEPS_BUILD_DIR}
|
||||
URL ${UNIBILIUM_URL}
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/unibilium
|
||||
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||
-DPREFIX=${DEPS_BUILD_DIR}
|
||||
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/unibilium
|
||||
-DURL=${UNIBILIUM_URL}
|
||||
-DEXPECTED_SHA256=${UNIBILIUM_SHA256}
|
||||
-DTARGET=unibilium
|
||||
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||
CONFIGURE_COMMAND "${UNIBILIUM_CONFIGURE_COMMAND}"
|
||||
BUILD_COMMAND "${UNIBILIUM_BUILD_COMMAND}"
|
||||
INSTALL_COMMAND "${UNIBILIUM_INSTALL_COMMAND}")
|
||||
|
||||
list(APPEND THIRD_PARTY_DEPS unibilium)
|
@@ -1,117 +0,0 @@
|
||||
From 326a1845f924432332071d03d156b7df4af7c46f Mon Sep 17 00:00:00 2001
|
||||
From: Tim Tavlintsev <ttavlintsev@enttec.com>
|
||||
Date: Thu, 21 Jul 2022 16:42:21 +1000
|
||||
Subject: [PATCH] Add CMake option LIBUV_BUILD_SHARED to enable/disable shared
|
||||
library build Fix #3637
|
||||
|
||||
---
|
||||
CMakeLists.txt | 66 +++++++++++++++++++++++++++++---------------------
|
||||
1 file changed, 38 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 2c42c3ff..a8e19980 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -28,6 +28,8 @@ cmake_dependent_option(LIBUV_BUILD_BENCH
|
||||
"Build the benchmarks when building unit tests and we are the root project" ON
|
||||
"LIBUV_BUILD_TESTS" OFF)
|
||||
|
||||
+option(LIBUV_BUILD_SHARED "Build shared lib" ON)
|
||||
+
|
||||
# Qemu Build
|
||||
option(QEMU "build for qemu" OFF)
|
||||
if(QEMU)
|
||||
@@ -390,25 +392,27 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD")
|
||||
list(APPEND uv_test_libraries util)
|
||||
endif()
|
||||
|
||||
-add_library(uv SHARED ${uv_sources})
|
||||
-target_compile_definitions(uv
|
||||
- INTERFACE
|
||||
- USING_UV_SHARED=1
|
||||
- PRIVATE
|
||||
- BUILDING_UV_SHARED=1
|
||||
- ${uv_defines})
|
||||
-target_compile_options(uv PRIVATE ${uv_cflags})
|
||||
-target_include_directories(uv
|
||||
- PUBLIC
|
||||
- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
- PRIVATE
|
||||
- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
|
||||
-if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
|
||||
- target_include_directories(uv PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
|
||||
- set_target_properties(uv PROPERTIES LINKER_LANGUAGE CXX)
|
||||
+if(LIBUV_BUILD_SHARED)
|
||||
+ add_library(uv SHARED ${uv_sources})
|
||||
+ target_compile_definitions(uv
|
||||
+ INTERFACE
|
||||
+ USING_UV_SHARED=1
|
||||
+ PRIVATE
|
||||
+ BUILDING_UV_SHARED=1
|
||||
+ ${uv_defines})
|
||||
+ target_compile_options(uv PRIVATE ${uv_cflags})
|
||||
+ target_include_directories(uv
|
||||
+ PUBLIC
|
||||
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
+ PRIVATE
|
||||
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
|
||||
+ if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
|
||||
+ target_include_directories(uv PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
|
||||
+ set_target_properties(uv PROPERTIES LINKER_LANGUAGE CXX)
|
||||
+ endif()
|
||||
+ target_link_libraries(uv ${uv_libraries})
|
||||
endif()
|
||||
-target_link_libraries(uv ${uv_libraries})
|
||||
|
||||
add_library(uv_a STATIC ${uv_sources})
|
||||
target_compile_definitions(uv_a PRIVATE ${uv_defines})
|
||||
@@ -669,28 +673,34 @@ string(REPLACE ";" " " LIBS "${LIBS}")
|
||||
file(STRINGS configure.ac configure_ac REGEX ^AC_INIT)
|
||||
string(REGEX MATCH "([0-9]+)[.][0-9]+[.][0-9]+" PACKAGE_VERSION "${configure_ac}")
|
||||
set(UV_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
-# The version in the filename is mirroring the behaviour of autotools.
|
||||
-set_target_properties(uv PROPERTIES
|
||||
- VERSION ${UV_VERSION_MAJOR}.0.0
|
||||
- SOVERSION ${UV_VERSION_MAJOR})
|
||||
+
|
||||
set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
|
||||
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
-configure_file(libuv.pc.in libuv.pc @ONLY)
|
||||
configure_file(libuv-static.pc.in libuv-static.pc @ONLY)
|
||||
|
||||
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
||||
-install(FILES ${PROJECT_BINARY_DIR}/libuv.pc ${PROJECT_BINARY_DIR}/libuv-static.pc
|
||||
+install(FILES ${PROJECT_BINARY_DIR}/libuv-static.pc
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
-install(TARGETS uv EXPORT libuvConfig
|
||||
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
install(TARGETS uv_a EXPORT libuvConfig
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
install(EXPORT libuvConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv)
|
||||
|
||||
+if(LIBUV_BUILD_SHARED)
|
||||
+ # The version in the filename is mirroring the behaviour of autotools.
|
||||
+ set_target_properties(uv PROPERTIES
|
||||
+ VERSION ${UV_VERSION_MAJOR}.0.0
|
||||
+ SOVERSION ${UV_VERSION_MAJOR})
|
||||
+ configure_file(libuv.pc.in libuv.pc @ONLY)
|
||||
+ install(FILES ${PROJECT_BINARY_DIR}/libuv.pc
|
||||
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
+ install(TARGETS uv EXPORT libuvConfig
|
||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
+endif()
|
||||
+
|
||||
if(MSVC)
|
||||
set(CMAKE_DEBUG_POSTFIX d)
|
||||
endif()
|
||||
--
|
||||
2.37.0
|
||||
|
@@ -1,13 +0,0 @@
|
||||
if(UNCRUSTIFY_PRG)
|
||||
execute_process(COMMAND uncrustify --version
|
||||
OUTPUT_VARIABLE user_version
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REGEX REPLACE "[A-Za-z_#-]" "" user_version ${user_version})
|
||||
|
||||
file(STRINGS ${CONFIG_FILE} required_version LIMIT_COUNT 1)
|
||||
string(REGEX REPLACE "[A-Za-z_# -]" "" required_version ${required_version})
|
||||
|
||||
if(NOT user_version STREQUAL required_version)
|
||||
message(FATAL_ERROR "Wrong uncrustify version! Required version is ${required_version} but found ${user_version}")
|
||||
endif()
|
||||
endif()
|
@@ -13,7 +13,7 @@ endif()
|
||||
find_path(LIBUV_INCLUDE_DIR uv.h
|
||||
HINTS ${PC_LIBUV_INCLUDEDIR} ${PC_LIBUV_INCLUDE_DIRS})
|
||||
|
||||
list(APPEND LIBUV_NAMES uv_a uv)
|
||||
list(APPEND LIBUV_NAMES uv)
|
||||
|
||||
find_library(LIBUV_LIBRARY NAMES ${LIBUV_NAMES}
|
||||
HINTS ${PC_LIBUV_LIBDIR} ${PC_LIBUV_LIBRARY_DIRS})
|
||||
|
197
cmake/FindLua.cmake
Normal file
@@ -0,0 +1,197 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindLua
|
||||
# -------
|
||||
#
|
||||
#
|
||||
#
|
||||
# Locate Lua library This module defines
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# LUA_FOUND - if false, do not try to link to Lua
|
||||
# LUA_LIBRARIES - both lua and lualib
|
||||
# LUA_INCLUDE_DIR - where to find lua.h
|
||||
# LUA_VERSION_STRING - the version of Lua found
|
||||
# LUA_VERSION_MAJOR - the major version of Lua
|
||||
# LUA_VERSION_MINOR - the minor version of Lua
|
||||
# LUA_VERSION_PATCH - the patch version of Lua
|
||||
#
|
||||
#
|
||||
#
|
||||
# Note that the expected include convention is
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# #include "lua.h"
|
||||
#
|
||||
# and not
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# #include <lua/lua.h>
|
||||
#
|
||||
# This is because, the lua location is not standardized and may exist in
|
||||
# locations other than lua/
|
||||
|
||||
unset(_lua_include_subdirs)
|
||||
unset(_lua_library_names)
|
||||
unset(_lua_append_versions)
|
||||
|
||||
# this is a function only to have all the variables inside go away automatically
|
||||
function(_lua_set_version_vars)
|
||||
set(LUA_VERSIONS5 5.4 5.3 5.2 5.1 5.0)
|
||||
|
||||
if (Lua_FIND_VERSION_EXACT)
|
||||
if (Lua_FIND_VERSION_COUNT GREATER 1)
|
||||
set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR})
|
||||
endif ()
|
||||
elseif (Lua_FIND_VERSION)
|
||||
# once there is a different major version supported this should become a loop
|
||||
if (NOT Lua_FIND_VERSION_MAJOR GREATER 5)
|
||||
if (Lua_FIND_VERSION_COUNT EQUAL 1)
|
||||
set(_lua_append_versions ${LUA_VERSIONS5})
|
||||
else ()
|
||||
foreach (subver IN LISTS LUA_VERSIONS5)
|
||||
if (NOT subver VERSION_LESS ${Lua_FIND_VERSION})
|
||||
list(APPEND _lua_append_versions ${subver})
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
endif ()
|
||||
else ()
|
||||
# once there is a different major version supported this should become a loop
|
||||
set(_lua_append_versions ${LUA_VERSIONS5})
|
||||
endif ()
|
||||
|
||||
list(APPEND _lua_include_subdirs "include/lua" "include")
|
||||
|
||||
foreach (ver IN LISTS _lua_append_versions)
|
||||
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}")
|
||||
list(APPEND _lua_include_subdirs
|
||||
include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
|
||||
include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
||||
include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
||||
)
|
||||
endforeach ()
|
||||
|
||||
set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
|
||||
set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE)
|
||||
endfunction(_lua_set_version_vars)
|
||||
|
||||
function(_lua_check_header_version _hdr_file)
|
||||
# At least 5.[012] have different ways to express the version
|
||||
# so all of them need to be tested. Lua 5.2 defines LUA_VERSION
|
||||
# and LUA_RELEASE as joined by the C preprocessor, so avoid those.
|
||||
file(STRINGS "${_hdr_file}" lua_version_strings
|
||||
REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
|
||||
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
|
||||
if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
|
||||
set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
|
||||
else ()
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
|
||||
if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
|
||||
endif ()
|
||||
string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
|
||||
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
|
||||
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
|
||||
endif ()
|
||||
foreach (ver IN LISTS _lua_append_versions)
|
||||
if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
|
||||
set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE)
|
||||
set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE)
|
||||
set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE)
|
||||
set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
|
||||
return()
|
||||
endif ()
|
||||
endforeach ()
|
||||
endfunction(_lua_check_header_version)
|
||||
|
||||
_lua_set_version_vars()
|
||||
|
||||
if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
|
||||
_lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h")
|
||||
endif ()
|
||||
|
||||
if (NOT LUA_VERSION_STRING)
|
||||
foreach (subdir IN LISTS _lua_include_subdirs)
|
||||
unset(LUA_INCLUDE_PREFIX CACHE)
|
||||
find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
)
|
||||
if (LUA_INCLUDE_PREFIX)
|
||||
_lua_check_header_version("${LUA_INCLUDE_PREFIX}/${subdir}/lua.h")
|
||||
if (LUA_VERSION_STRING)
|
||||
set(LUA_INCLUDE_DIR "${LUA_INCLUDE_PREFIX}/${subdir}")
|
||||
break()
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
unset(_lua_include_subdirs)
|
||||
unset(_lua_append_versions)
|
||||
|
||||
if (LUA_VERSION_STRING)
|
||||
set(_lua_library_names
|
||||
lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}
|
||||
lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
|
||||
lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
|
||||
lua.${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
|
||||
)
|
||||
endif ()
|
||||
|
||||
find_library(LUA_LIBRARY
|
||||
NAMES ${_lua_library_names} lua
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATH_SUFFIXES lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
)
|
||||
unset(_lua_library_names)
|
||||
|
||||
if (LUA_LIBRARY)
|
||||
# include the math library for Unix
|
||||
if (UNIX AND NOT APPLE AND NOT BEOS)
|
||||
find_library(LUA_MATH_LIBRARY m)
|
||||
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
|
||||
|
||||
# include dl library for statically-linked Lua library
|
||||
get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
|
||||
if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
|
||||
list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
# For Windows and Mac, don't need to explicitly include the math library
|
||||
else ()
|
||||
set(LUA_LIBRARIES "${LUA_LIBRARY}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
|
||||
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
|
||||
VERSION_VAR LUA_VERSION_STRING)
|
||||
|
||||
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY)
|
10
cmake/FindWinpty.cmake
Normal file
@@ -0,0 +1,10 @@
|
||||
include(LibFindMacros)
|
||||
|
||||
find_path(WINPTY_INCLUDE_DIR winpty.h)
|
||||
set(WINPTY_INCLUDE_DIRS ${WINPTY_INCLUDE_DIR})
|
||||
|
||||
find_library(WINPTY_LIBRARY winpty)
|
||||
find_program(WINPTY_AGENT_EXE winpty-agent.exe)
|
||||
set(WINPTY_LIBRARIES ${WINPTY_LIBRARY})
|
||||
|
||||
find_package_handle_standard_args(Winpty DEFAULT_MSG WINPTY_LIBRARY WINPTY_INCLUDE_DIR)
|
@@ -1,67 +0,0 @@
|
||||
# Returns a list of all files that has been changed in current branch compared
|
||||
# to master branch. This includes unstaged, staged and committed files.
|
||||
function(get_changed_files outvar)
|
||||
set(default_branch master)
|
||||
|
||||
execute_process(
|
||||
COMMAND git branch --show-current
|
||||
OUTPUT_VARIABLE current_branch
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
execute_process(
|
||||
COMMAND git merge-base ${default_branch} ${current_branch}
|
||||
OUTPUT_VARIABLE ancestor_commit
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
# Changed files that have been committed
|
||||
execute_process(
|
||||
COMMAND git diff --name-only ${ancestor_commit}...${current_branch}
|
||||
OUTPUT_VARIABLE committed_files
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
separate_arguments(committed_files NATIVE_COMMAND ${committed_files})
|
||||
|
||||
# Unstaged files
|
||||
execute_process(
|
||||
COMMAND git diff --name-only
|
||||
OUTPUT_VARIABLE unstaged_files
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
separate_arguments(unstaged_files NATIVE_COMMAND ${unstaged_files})
|
||||
|
||||
# Staged files
|
||||
execute_process(
|
||||
COMMAND git diff --cached --name-only
|
||||
OUTPUT_VARIABLE staged_files
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
separate_arguments(staged_files NATIVE_COMMAND ${staged_files})
|
||||
|
||||
set(files ${committed_files} ${unstaged_files} ${staged_files})
|
||||
list(REMOVE_DUPLICATES files)
|
||||
|
||||
set(${outvar} "${files}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
get_changed_files(changed_files)
|
||||
|
||||
if(LANG STREQUAL c)
|
||||
list(FILTER changed_files INCLUDE REGEX "\\.[ch]$")
|
||||
list(FILTER changed_files INCLUDE REGEX "^src/nvim/")
|
||||
|
||||
if(changed_files)
|
||||
if(FORMAT_PRG)
|
||||
execute_process(COMMAND ${FORMAT_PRG} -c "src/uncrustify.cfg" --replace --no-backup ${changed_files})
|
||||
else()
|
||||
message(STATUS "Uncrustify not found. Skip formatting C files.")
|
||||
endif()
|
||||
endif()
|
||||
elseif(LANG STREQUAL lua)
|
||||
list(FILTER changed_files INCLUDE REGEX "\\.lua$")
|
||||
list(FILTER changed_files INCLUDE REGEX "^runtime/")
|
||||
|
||||
if(changed_files)
|
||||
if(FORMAT_PRG)
|
||||
execute_process(COMMAND ${FORMAT_PRG} ${changed_files})
|
||||
else()
|
||||
message(STATUS "Stylua not found. Skip formatting lua files.")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
@@ -1,34 +0,0 @@
|
||||
set(NVIM_VERSION
|
||||
"v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}${NVIM_VERSION_PRERELEASE}")
|
||||
|
||||
execute_process(
|
||||
COMMAND git describe --first-parent --dirty --always
|
||||
OUTPUT_VARIABLE GIT_TAG
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE RES)
|
||||
|
||||
if(RES AND NOT RES EQUAL 0)
|
||||
message(STATUS "Using NVIM_VERSION: ${NVIM_VERSION}")
|
||||
file(WRITE "${OUTPUT}" "")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# `git describe` annotates the most recent tagged release; for pre-release
|
||||
# builds we append that to the dev version.
|
||||
if(NVIM_VERSION_PRERELEASE)
|
||||
string(REGEX REPLACE "^v[0-9]+.[0-9]+.[0-9]+-" "" NVIM_VERSION_GIT "${GIT_TAG}")
|
||||
string(REGEX REPLACE "^([0-9]+)-([a-z0-9]+)" "\\1+\\2" NVIM_VERSION_GIT "${NVIM_VERSION_GIT}")
|
||||
set(NVIM_VERSION "${NVIM_VERSION}-${NVIM_VERSION_GIT}")
|
||||
endif()
|
||||
|
||||
set(NVIM_VERSION_STRING "#define NVIM_VERSION_MEDIUM \"${NVIM_VERSION}\"\n")
|
||||
|
||||
string(SHA1 CURRENT_VERSION_HASH "${NVIM_VERSION_STRING}")
|
||||
if(EXISTS ${OUTPUT})
|
||||
file(SHA1 "${OUTPUT}" NVIM_VERSION_HASH)
|
||||
endif()
|
||||
|
||||
if(NOT "${NVIM_VERSION_HASH}" STREQUAL "${CURRENT_VERSION_HASH}")
|
||||
message(STATUS "Using NVIM_VERSION: ${NVIM_VERSION}")
|
||||
file(WRITE "${OUTPUT}" "${NVIM_VERSION_STRING}")
|
||||
endif()
|
2
cmake/InstallClintErrors.cmake
Normal file
@@ -0,0 +1,2 @@
|
||||
file(GLOB_RECURSE JSON_FILES *.json)
|
||||
file(COPY ${JSON_FILES} DESTINATION "${TARGET}")
|
@@ -45,7 +45,7 @@ function(create_install_dir_with_perms)
|
||||
while(NOT EXISTS \$ENV{DESTDIR}\${_current_dir} AND NOT \${_prev_dir} STREQUAL \${_current_dir})
|
||||
list(APPEND _parent_dirs \${_current_dir})
|
||||
set(_prev_dir \${_current_dir})
|
||||
get_filename_component(_current_dir \${_current_dir} DIRECTORY)
|
||||
get_filename_component(_current_dir \${_current_dir} PATH)
|
||||
endwhile()
|
||||
|
||||
if(_parent_dirs)
|
||||
|
@@ -2,9 +2,7 @@
|
||||
set(ENV{LC_ALL} "en_US.UTF-8")
|
||||
|
||||
if(POLICY CMP0012)
|
||||
# Avoid policy warning due to CI=true. This is needed even if the main
|
||||
# project has already set this policy as policy settings are reset when using
|
||||
# the cmake script mode (-P).
|
||||
# Handle CI=true, without dev warnings.
|
||||
cmake_policy(SET CMP0012 NEW)
|
||||
endif()
|
||||
|
||||
@@ -13,7 +11,6 @@ set(ENV{NVIM_RPLUGIN_MANIFEST} ${BUILD_DIR}/Xtest_rplugin_manifest)
|
||||
set(ENV{XDG_CONFIG_HOME} ${BUILD_DIR}/Xtest_xdg/config)
|
||||
set(ENV{XDG_DATA_HOME} ${BUILD_DIR}/Xtest_xdg/share)
|
||||
unset(ENV{XDG_DATA_DIRS})
|
||||
unset(ENV{NVIM}) # Clear $NVIM in case tests are running from Nvim. #11009
|
||||
|
||||
if(NOT DEFINED ENV{NVIM_LOG_FILE})
|
||||
set(ENV{NVIM_LOG_FILE} ${BUILD_DIR}/.nvimlog)
|
||||
@@ -53,8 +50,8 @@ if(DEFINED ENV{TEST_FILTER_OUT} AND NOT "$ENV{TEST_FILTER_OUT}" STREQUAL "")
|
||||
list(APPEND BUSTED_ARGS --filter-out $ENV{TEST_FILTER_OUT})
|
||||
endif()
|
||||
|
||||
# TMPDIR: for helpers.tmpname() and Nvim tempname().
|
||||
set(ENV{TMPDIR} "${BUILD_DIR}/Xtest_tmpdir")
|
||||
# TMPDIR: use relative test path (for parallel test runs / isolation).
|
||||
set(ENV{TMPDIR} "${BUILD_DIR}/Xtest_tmpdir/${TEST_PATH}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory $ENV{TMPDIR})
|
||||
|
||||
# HISTFILE: do not write into user's ~/.bash_history
|
||||
|
@@ -1,13 +0,0 @@
|
||||
if(NOT EXISTS "${CMAKE_BINARY_DIR}/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: ${CMAKE_BINARY_DIR}/install_manifest.txt")
|
||||
endif()
|
||||
|
||||
file(STRINGS "${CMAKE_BINARY_DIR}/install_manifest.txt" files)
|
||||
foreach(file ${files})
|
||||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
|
||||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
file(REMOVE $ENV{DESTDIR}${file})
|
||||
else()
|
||||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
||||
endif()
|
||||
endforeach()
|
21
cmake/UninstallHelper.cmake.in
Normal file
@@ -0,0 +1,21 @@
|
||||
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
endif()
|
||||
|
||||
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
foreach(file ${files})
|
||||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
|
||||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
exec_program(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
if(NOT "${rm_retval}" STREQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
||||
endif()
|
||||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
||||
endif()
|
||||
endforeach()
|
185
cmake/Util.cmake
@@ -1,185 +0,0 @@
|
||||
# Defines a target that depends on FILES and the files found by globbing
|
||||
# when using GLOB_PAT and GLOB_DIRS. The target will rerun if any files it
|
||||
# depends on has changed. Which files the target will run the command on
|
||||
# depends on the value of TOUCH_STRATEGY.
|
||||
#
|
||||
# Options:
|
||||
# REQUIRED - Abort if COMMAND doesn't exist.
|
||||
#
|
||||
# Single value arguments:
|
||||
# TARGET - Name of the target
|
||||
# COMMAND - Path of the command to be run
|
||||
# GLOB_PAT - Glob pattern to use. Only used if GLOB_DIRS is specified
|
||||
# TOUCH_STRATEGY - Specify touch strategy, meaning decide how to group files
|
||||
# and connect them to a specific touch file.
|
||||
#
|
||||
# For example, let us say we have file A and B and that we create a touch file
|
||||
# for each of them, TA and TB. This would essentially make file A and B
|
||||
# independent of each other, meaning that if I change file A and run the
|
||||
# target, then the target will only run its commands for file A and ignore
|
||||
# file B.
|
||||
#
|
||||
# Another example: let's say we have file A and B, but now we create only a
|
||||
# single touch file T for both of them. This would mean that if I change
|
||||
# either file A or B, then the target will run its commands on both A and B.
|
||||
# Meaning that even if I only change file A, the target will still run
|
||||
# commands on both A and B.
|
||||
#
|
||||
# The more touch files we create for a target, the fewer commands we'll need
|
||||
# to rerun, and by extension, the more time we'll save. Unfortunately, the
|
||||
# more touch files we create the more intermediary targets will be created,
|
||||
# one for each touch file. This makes listing all targets with
|
||||
# `cmake --build build --target help` less useful since each touch file will
|
||||
# be listed. The tradeoff that needs to be done here is between performance
|
||||
# and "discoverability". As a general guideline: the more popular a target is
|
||||
# and the more time it takes to run it, the more granular you want your touch
|
||||
# files to be. Conversely, if a target rarely needs to be run or if it's fast,
|
||||
# then you should create fewer targets.
|
||||
#
|
||||
# Possible values for TOUCH_STRATEGY:
|
||||
# "SINGLE": create a single touch file for all files.
|
||||
# "PER_FILE": create a touch file for each file. Defaults to this if
|
||||
# TOUCH_STRATEGY isn't specified.
|
||||
# "PER_DIR": create a touch file for each directory.
|
||||
#
|
||||
# List arguments:
|
||||
# FLAGS - List of flags to use after COMMAND
|
||||
# FILES - List of files to use COMMAND on. It's possible to combine this
|
||||
# with GLOB_PAT and GLOB_DIRS; the files found by globbing will
|
||||
# simple be added to FILES
|
||||
# GLOB_DIRS - The directories to recursively search for files with extension
|
||||
# GLOB_PAT
|
||||
#
|
||||
function(add_glob_targets)
|
||||
cmake_parse_arguments(ARG
|
||||
"REQUIRED"
|
||||
"TARGET;COMMAND;GLOB_PAT;TOUCH_STRATEGY"
|
||||
"FLAGS;FILES;GLOB_DIRS"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
if(NOT ARG_COMMAND)
|
||||
add_custom_target(${ARG_TARGET})
|
||||
if(ARG_REQUIRED)
|
||||
add_custom_command(TARGET ${ARG_TARGET}
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "${ARG_TARGET}: ${ARG_COMMAND} not found"
|
||||
COMMAND false)
|
||||
else()
|
||||
add_custom_command(TARGET ${ARG_TARGET}
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "${ARG_TARGET} SKIP: ${ARG_COMMAND} not found")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
|
||||
foreach(gd ${ARG_GLOB_DIRS})
|
||||
file(GLOB_RECURSE globfiles ${PROJECT_SOURCE_DIR}/${gd}/${ARG_GLOB_PAT})
|
||||
list(APPEND ARG_FILES ${globfiles})
|
||||
endforeach()
|
||||
|
||||
if(NOT ARG_TOUCH_STRATEGY)
|
||||
set(ARG_TOUCH_STRATEGY PER_FILE)
|
||||
endif()
|
||||
set(POSSIBLE_TOUCH_STRATEGIES SINGLE PER_FILE PER_DIR)
|
||||
if(NOT ARG_TOUCH_STRATEGY IN_LIST POSSIBLE_TOUCH_STRATEGIES)
|
||||
message(FATAL_ERROR "Unrecognized value for TOUCH_STRATEGY: ${ARG_TOUCH_STRATEGY}")
|
||||
endif()
|
||||
|
||||
if(ARG_TOUCH_STRATEGY STREQUAL SINGLE)
|
||||
set(touch_file ${TOUCHES_DIR}/ran-${ARG_TARGET})
|
||||
add_custom_command(
|
||||
OUTPUT ${touch_file}
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${touch_file}
|
||||
COMMAND ${ARG_COMMAND} ${ARG_FLAGS} ${ARG_FILES}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
DEPENDS ${ARG_FILES})
|
||||
list(APPEND touch_list ${touch_file})
|
||||
elseif(ARG_TOUCH_STRATEGY STREQUAL PER_FILE)
|
||||
set(touch_dir ${TOUCHES_DIR}/${ARG_TARGET})
|
||||
file(MAKE_DIRECTORY ${touch_dir})
|
||||
foreach(f ${ARG_FILES})
|
||||
string(REGEX REPLACE "^${PROJECT_SOURCE_DIR}/" "" tf ${f})
|
||||
string(REGEX REPLACE "[/.]" "-" tf ${tf})
|
||||
set(touch_file ${touch_dir}/ran-${tf})
|
||||
add_custom_command(
|
||||
OUTPUT ${touch_file}
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${touch_file}
|
||||
COMMAND ${ARG_COMMAND} ${ARG_FLAGS} ${f}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
DEPENDS ${f})
|
||||
list(APPEND touch_list ${touch_file})
|
||||
endforeach()
|
||||
elseif(ARG_TOUCH_STRATEGY STREQUAL PER_DIR)
|
||||
set(touch_dirs)
|
||||
foreach(f ${ARG_FILES})
|
||||
get_filename_component(out ${f} DIRECTORY)
|
||||
list(APPEND touch_dirs ${out})
|
||||
endforeach()
|
||||
list(REMOVE_DUPLICATES touch_dirs)
|
||||
|
||||
foreach(touch_dir ${touch_dirs})
|
||||
set(relevant_files)
|
||||
foreach(f ${ARG_FILES})
|
||||
get_filename_component(out ${f} DIRECTORY)
|
||||
if(${touch_dir} STREQUAL ${out})
|
||||
list(APPEND relevant_files ${f})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(td ${TOUCHES_DIR}/${ARG_TARGET})
|
||||
file(MAKE_DIRECTORY ${td})
|
||||
string(REGEX REPLACE "^${PROJECT_SOURCE_DIR}/" "" tf ${touch_dir})
|
||||
string(REGEX REPLACE "[/.]" "-" tf ${tf})
|
||||
set(touch_file ${td}/ran-${tf})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${touch_file}
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${touch_file}
|
||||
COMMAND ${ARG_COMMAND} ${ARG_FLAGS} ${relevant_files}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
DEPENDS ${relevant_files})
|
||||
list(APPEND touch_list ${touch_file})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
add_custom_target(${ARG_TARGET} DEPENDS ${touch_list})
|
||||
endfunction()
|
||||
|
||||
# Set default build type to Debug. Also limit the list of allowable build types
|
||||
# to the ones defined in variable allowableBuildTypes.
|
||||
#
|
||||
# The correct way to specify build type (for example Release) for
|
||||
# single-configuration generators (Make and Ninja) is to run
|
||||
#
|
||||
# cmake -B build -D CMAKE_BUILD_TYPE=Release
|
||||
# cmake --build build
|
||||
#
|
||||
# while for multi-configuration generators (Visual Studio, Xcode and Ninja
|
||||
# Multi-Config) is to run
|
||||
#
|
||||
# cmake -B build
|
||||
# cmake --build build --config Release
|
||||
#
|
||||
# Passing CMAKE_BUILD_TYPE for multi-config generators will now not only
|
||||
# not be used, but also generate a warning for the user.
|
||||
function(set_default_buildtype)
|
||||
set(allowableBuildTypes Debug Release MinSizeRel RelWithDebInfo)
|
||||
|
||||
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(isMultiConfig)
|
||||
set(CMAKE_CONFIGURATION_TYPES ${allowableBuildTypes} PARENT_SCOPE)
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
message(WARNING "CMAKE_BUILD_TYPE specified which is ignored on \
|
||||
multi-configuration generators. Defaulting to Debug build type.")
|
||||
endif()
|
||||
else()
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${allowableBuildTypes}")
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
message(STATUS "CMAKE_BUILD_TYPE not specified, default is 'Debug'")
|
||||
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build" FORCE)
|
||||
elseif(NOT CMAKE_BUILD_TYPE IN_LIST allowableBuildTypes)
|
||||
message(FATAL_ERROR "Invalid build type: ${CMAKE_BUILD_TYPE}")
|
||||
else()
|
||||
message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
7
cmake/i386-linux-gnu.toolchain.cmake
Normal file
@@ -0,0 +1,7 @@
|
||||
set(CMAKE_SYSTEM_PROCESSOR i386)
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_VERSION gnu)
|
||||
if(NOT ${CMAKE_C_COMPILER})
|
||||
set(CMAKE_C_COMPILER gcc)
|
||||
endif()
|
||||
set(CMAKE_C_COMPILER_ARG1 "-m32")
|
@@ -5,13 +5,12 @@ include(CheckIncludeFiles)
|
||||
include(CheckCSourceRuns)
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
check_type_size("int" SIZEOF_INT LANGUAGE C)
|
||||
check_type_size("long" SIZEOF_LONG LANGUAGE C)
|
||||
check_type_size("intmax_t" SIZEOF_INTMAX_T LANGUAGE C)
|
||||
check_type_size("int32_t" SIZEOF_INT32_T LANGUAGE C)
|
||||
check_type_size("size_t" SIZEOF_SIZE_T LANGUAGE C)
|
||||
check_type_size("long long" SIZEOF_LONG_LONG LANGUAGE C)
|
||||
check_type_size("void *" SIZEOF_VOID_PTR LANGUAGE C)
|
||||
check_type_size("int" SIZEOF_INT)
|
||||
check_type_size("long" SIZEOF_LONG)
|
||||
check_type_size("intmax_t" SIZEOF_INTMAX_T)
|
||||
check_type_size("size_t" SIZEOF_SIZE_T)
|
||||
check_type_size("long long" SIZEOF_LONG_LONG)
|
||||
check_type_size("void *" SIZEOF_VOID_PTR)
|
||||
|
||||
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
|
||||
|
||||
@@ -128,14 +127,14 @@ endif()
|
||||
|
||||
# generate configuration header and update include directories
|
||||
configure_file (
|
||||
"${PROJECT_SOURCE_DIR}/cmake.config/config.h.in"
|
||||
"${PROJECT_BINARY_DIR}/cmake.config/auto/config.h"
|
||||
"${PROJECT_SOURCE_DIR}/config/config.h.in"
|
||||
"${PROJECT_BINARY_DIR}/config/auto/config.h"
|
||||
)
|
||||
|
||||
# generate version definitions
|
||||
configure_file (
|
||||
"${PROJECT_SOURCE_DIR}/cmake.config/versiondef.h.in"
|
||||
"${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h"
|
||||
"${PROJECT_SOURCE_DIR}/config/versiondef.h.in"
|
||||
"${PROJECT_BINARY_DIR}/config/auto/versiondef.h"
|
||||
)
|
||||
|
||||
# generate pathdef.c
|
||||
@@ -158,6 +157,6 @@ elseif (EXISTS ${HOSTNAME_PROG})
|
||||
endif()
|
||||
|
||||
configure_file (
|
||||
"${PROJECT_SOURCE_DIR}/cmake.config/pathdef.c.in"
|
||||
"${PROJECT_BINARY_DIR}/cmake.config/auto/pathdef.c"
|
||||
"${PROJECT_SOURCE_DIR}/config/pathdef.c.in"
|
||||
"${PROJECT_BINARY_DIR}/config/auto/pathdef.c"
|
||||
ESCAPE_QUOTES)
|
@@ -3,12 +3,8 @@
|
||||
|
||||
#cmakedefine DEBUG
|
||||
|
||||
#cmakedefine SIZEOF_INT @SIZEOF_INT@
|
||||
#cmakedefine SIZEOF_INTMAX_T @SIZEOF_INTMAX_T@
|
||||
#cmakedefine SIZEOF_INT32_T @SIZEOF_INT32_T@
|
||||
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
|
||||
#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
|
||||
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
|
||||
#define SIZEOF_INT @SIZEOF_INT@
|
||||
#define SIZEOF_LONG @SIZEOF_LONG@
|
||||
|
||||
#if @SIZEOF_VOID_PTR@ == 8
|
||||
#define ARCH_64
|
||||
@@ -16,7 +12,7 @@
|
||||
#define ARCH_32
|
||||
#endif
|
||||
|
||||
#cmakedefine PROJECT_NAME "@PROJECT_NAME@"
|
||||
#define PROJECT_NAME "@PROJECT_NAME@"
|
||||
|
||||
#cmakedefine HAVE__NSGETENVIRON
|
||||
#cmakedefine HAVE_FD_CLOEXEC
|
31
contrib/YouCompleteMe/README.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# YouCompleteMe Integration
|
||||
|
||||
## What is this?
|
||||
|
||||
This provides the code necessary to configure vim's YCM plugin to provide C
|
||||
semantic support (completion, go-to-definition, etc) for developers working on
|
||||
the Neovim project.
|
||||
|
||||
## Installation
|
||||
|
||||
### Step 1
|
||||
|
||||
Install [YouCompleteMe](https://github.com/Valloric/YouCompleteMe).
|
||||
|
||||
### Step 2
|
||||
|
||||
```bash
|
||||
cp contrib/YouCompleteMe/ycm_extra_conf.py .ycm_extra_conf.py
|
||||
echo .ycm_extra_conf.py >> .git/info/exclude
|
||||
make
|
||||
```
|
||||
|
||||
Tip: to improve source code navigation, add something like this to your nvim
|
||||
configuration:
|
||||
|
||||
```vim
|
||||
au FileType c,cpp nnoremap <buffer> <c-]> :YcmCompleter GoTo<CR>
|
||||
```
|
||||
|
||||
And use `ctrl+]` when the cursor is positioned in a symbol to quickly jump to a
|
||||
definition or declaration.
|
65
contrib/YouCompleteMe/ycm_extra_conf.py
Normal file
@@ -0,0 +1,65 @@
|
||||
# .ycm_extra_conf.py for nvim source code.
|
||||
import os
|
||||
import ycm_core
|
||||
|
||||
|
||||
def DirectoryOfThisScript():
|
||||
return os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
def GetDatabase():
|
||||
compilation_database_folder = os.path.join(DirectoryOfThisScript(),
|
||||
'build')
|
||||
if os.path.exists(compilation_database_folder):
|
||||
return ycm_core.CompilationDatabase(compilation_database_folder)
|
||||
return None
|
||||
|
||||
|
||||
def GetCompilationInfoForFile(filename):
|
||||
database = GetDatabase()
|
||||
if not database:
|
||||
return None
|
||||
return database.GetCompilationInfoForFile(filename)
|
||||
|
||||
|
||||
# It seems YCM does not resolve directories correctly. This function will
|
||||
# adjust paths in the compiler flags to be absolute
|
||||
def FixDirectories(args, compiler_working_dir):
|
||||
def adjust_path(path):
|
||||
return os.path.abspath(os.path.join(compiler_working_dir, path))
|
||||
|
||||
adjust_next_arg = False
|
||||
new_args = []
|
||||
for arg in args:
|
||||
if adjust_next_arg:
|
||||
arg = adjust_path(arg)
|
||||
adjust_next_arg = False
|
||||
else:
|
||||
for dir_flag in ['-I', '-isystem', '-o', '-c']:
|
||||
if arg.startswith(dir_flag):
|
||||
if arg != dir_flag:
|
||||
# flag and path are concatenated in same arg
|
||||
path = arg[len(dir_flag):]
|
||||
new_path = adjust_path(path)
|
||||
arg = '{0}{1}'.format(dir_flag, new_path)
|
||||
else:
|
||||
# path is specified in next argument
|
||||
adjust_next_arg = True
|
||||
new_args.append(arg)
|
||||
return new_args
|
||||
|
||||
|
||||
def FlagsForFile(filename):
|
||||
compilation_info = GetCompilationInfoForFile(filename)
|
||||
if not compilation_info:
|
||||
return None
|
||||
# Add flags not needed for clang-the-binary,
|
||||
# but needed for libclang-the-library (YCM uses this last one).
|
||||
flags = FixDirectories((list(compilation_info.compiler_flags_)
|
||||
if compilation_info.compiler_flags_
|
||||
else []), compilation_info.compiler_working_dir_)
|
||||
extra_flags = ['-Wno-newline-eof']
|
||||
return {
|
||||
'flags': flags + extra_flags,
|
||||
'do_cache': True
|
||||
}
|
@@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Helper script to build and run neovim with Address Sanitizer enabled.
|
||||
# You may read more information in src/nvim/README.md in the section "Build
|
||||
# with ASAN".
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
root_path=$(git rev-parse --show-toplevel)
|
||||
log_path=$(mktemp -d)
|
||||
export CC='clang'
|
||||
|
||||
# Change to detect_leaks=1 to detect memory leaks (slower).
|
||||
export ASAN_OPTIONS="detect_leaks=0:log_path=$log_path/asan"
|
||||
|
||||
# Show backtraces in the logs.
|
||||
export UBSAN_OPTIONS="print_stacktrace=1"
|
||||
|
||||
make -C "$root_path" CMAKE_EXTRA_FLAGS="-DCLANG_ASAN_UBSAN=ON"
|
||||
VIMRUNTIME="$root_path"/runtime "$root_path"/build/bin/nvim
|
||||
|
||||
# Need to manually reset terminal to avoid mangled output, nvim does not
|
||||
# properly restore the terminal when it crashes.
|
||||
tput reset
|
||||
|
||||
for i in "$log_path"/*; do
|
||||
cat "$i"
|
||||
done
|
757
contrib/doxygen/customdoxygen.css
Normal file
@@ -0,0 +1,757 @@
|
||||
|
||||
/*
|
||||
* Title, should be H1
|
||||
*/
|
||||
|
||||
.title {
|
||||
font-family: 'Lato', sans-serif;
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0 0;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.multicol {
|
||||
-moz-column-gap: 1em;
|
||||
-webkit-column-gap: 1em;
|
||||
-moz-column-count: 3;
|
||||
-webkit-column-count: 3;
|
||||
}
|
||||
|
||||
|
||||
div.qindex, div.navtab {
|
||||
background-color: #EBEFF6;
|
||||
border: 1px solid #A3B4D7;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.line {
|
||||
font-family: monospace, fixed;
|
||||
min-height: 13px;
|
||||
line-height: 1.0;
|
||||
text-wrap: unrestricted;
|
||||
white-space: -moz-pre-wrap; /* Moz */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
white-space: pre-wrap; /* CSS3 */
|
||||
word-wrap: break-word; /* IE 5.5+ */
|
||||
text-indent: -53px;
|
||||
padding-left: 53px;
|
||||
padding-bottom: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
span.lineno {
|
||||
padding-right: 4px;
|
||||
text-align: right;
|
||||
border-right: 2px solid #0F0;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
/* @group Code Colorization */
|
||||
|
||||
span.keyword {
|
||||
color: #008000
|
||||
}
|
||||
|
||||
span.keywordtype {
|
||||
color: #604020
|
||||
}
|
||||
|
||||
span.keywordflow {
|
||||
color: #e08000
|
||||
}
|
||||
|
||||
span.comment {
|
||||
color: #800000
|
||||
}
|
||||
|
||||
span.preprocessor {
|
||||
color: #806020
|
||||
}
|
||||
|
||||
span.stringliteral {
|
||||
color: #002080
|
||||
}
|
||||
|
||||
span.charliteral {
|
||||
color: #008080
|
||||
}
|
||||
|
||||
span.vhdldigit {
|
||||
color: #ff00ff
|
||||
}
|
||||
|
||||
span.vhdlchar {
|
||||
color: #000000
|
||||
}
|
||||
|
||||
span.vhdlkeyword {
|
||||
color: #700070
|
||||
}
|
||||
|
||||
span.vhdllogic {
|
||||
color: #ff0000
|
||||
}
|
||||
|
||||
blockquote {
|
||||
background-color: #F7F8FB;
|
||||
border-left: 2px solid #9CAFD4;
|
||||
margin: 0 24px 0 4px;
|
||||
padding: 0 12px 0 16px;
|
||||
}
|
||||
|
||||
/* @end */
|
||||
|
||||
hr {
|
||||
height: 0px;
|
||||
border: none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
dl {
|
||||
padding: 0 0 0 10px;
|
||||
}
|
||||
|
||||
/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */
|
||||
dl.section {
|
||||
margin-left: 0px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
dl.note {
|
||||
margin-left:-7px;
|
||||
padding-left: 3px;
|
||||
border-left:4px solid;
|
||||
border-color: #D0C000;
|
||||
}
|
||||
|
||||
dl.warning, dl.attention {
|
||||
margin-left:-7px;
|
||||
padding-left: 3px;
|
||||
border-left:4px solid;
|
||||
border-color: #FF0000;
|
||||
}
|
||||
|
||||
dl.pre, dl.post, dl.invariant {
|
||||
margin-left:-7px;
|
||||
padding-left: 3px;
|
||||
border-left:4px solid;
|
||||
border-color: #00D000;
|
||||
}
|
||||
|
||||
dl.deprecated {
|
||||
margin-left:-7px;
|
||||
padding-left: 3px;
|
||||
border-left:4px solid;
|
||||
border-color: #505050;
|
||||
}
|
||||
|
||||
dl.todo {
|
||||
margin-left:-7px;
|
||||
padding-left: 3px;
|
||||
border-left:4px solid;
|
||||
border-color: #00C0E0;
|
||||
}
|
||||
|
||||
dl.test {
|
||||
margin-left:-7px;
|
||||
padding-left: 3px;
|
||||
border-left:4px solid;
|
||||
border-color: #3030E0;
|
||||
}
|
||||
|
||||
dl.bug {
|
||||
margin-left:-7px;
|
||||
padding-left: 3px;
|
||||
border-left:4px solid;
|
||||
border-color: #C08050;
|
||||
}
|
||||
|
||||
dl.section dd {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
/* tooltip related style info */
|
||||
|
||||
.ttc {
|
||||
position: absolute;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#powerTip {
|
||||
cursor: default;
|
||||
white-space: nowrap;
|
||||
background-color: white;
|
||||
border: 1px solid gray;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
box-shadow: 1px 1px 7px gray;
|
||||
display: none;
|
||||
font-size: smaller;
|
||||
max-width: 80%;
|
||||
opacity: 0.9;
|
||||
padding: 1ex 1em 1em;
|
||||
position: absolute;
|
||||
z-index: 2147483647;
|
||||
}
|
||||
|
||||
#powerTip div.ttdoc {
|
||||
color: grey;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
#powerTip div.ttname a {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#powerTip div.ttname {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#powerTip div.ttdeci {
|
||||
color: #006318;
|
||||
}
|
||||
|
||||
#powerTip div {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
font: 12px/16px Roboto,sans-serif;
|
||||
}
|
||||
|
||||
#powerTip:before, #powerTip:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#powerTip.n:after, #powerTip.n:before,
|
||||
#powerTip.s:after, #powerTip.s:before,
|
||||
#powerTip.w:after, #powerTip.w:before,
|
||||
#powerTip.e:after, #powerTip.e:before,
|
||||
#powerTip.ne:after, #powerTip.ne:before,
|
||||
#powerTip.se:after, #powerTip.se:before,
|
||||
#powerTip.nw:after, #powerTip.nw:before,
|
||||
#powerTip.sw:after, #powerTip.sw:before {
|
||||
border: solid transparent;
|
||||
content: " ";
|
||||
height: 0;
|
||||
width: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#powerTip.n:after, #powerTip.s:after,
|
||||
#powerTip.w:after, #powerTip.e:after,
|
||||
#powerTip.nw:after, #powerTip.ne:after,
|
||||
#powerTip.sw:after, #powerTip.se:after {
|
||||
border-color: rgba(255, 255, 255, 0);
|
||||
}
|
||||
|
||||
#powerTip.n:before, #powerTip.s:before,
|
||||
#powerTip.w:before, #powerTip.e:before,
|
||||
#powerTip.nw:before, #powerTip.ne:before,
|
||||
#powerTip.sw:before, #powerTip.se:before {
|
||||
border-color: rgba(128, 128, 128, 0);
|
||||
}
|
||||
|
||||
#powerTip.n:after, #powerTip.n:before,
|
||||
#powerTip.ne:after, #powerTip.ne:before,
|
||||
#powerTip.nw:after, #powerTip.nw:before {
|
||||
top: 100%;
|
||||
}
|
||||
|
||||
#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after {
|
||||
border-top-color: #ffffff;
|
||||
border-width: 10px;
|
||||
margin: 0px -10px;
|
||||
}
|
||||
#powerTip.n:before {
|
||||
border-top-color: #808080;
|
||||
border-width: 11px;
|
||||
margin: 0px -11px;
|
||||
}
|
||||
#powerTip.n:after, #powerTip.n:before {
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
#powerTip.nw:after, #powerTip.nw:before {
|
||||
right: 14px;
|
||||
}
|
||||
|
||||
#powerTip.ne:after, #powerTip.ne:before {
|
||||
left: 14px;
|
||||
}
|
||||
|
||||
#powerTip.s:after, #powerTip.s:before,
|
||||
#powerTip.se:after, #powerTip.se:before,
|
||||
#powerTip.sw:after, #powerTip.sw:before {
|
||||
bottom: 100%;
|
||||
}
|
||||
|
||||
#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after {
|
||||
border-bottom-color: #ffffff;
|
||||
border-width: 10px;
|
||||
margin: 0px -10px;
|
||||
}
|
||||
|
||||
#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before {
|
||||
border-bottom-color: #808080;
|
||||
border-width: 11px;
|
||||
margin: 0px -11px;
|
||||
}
|
||||
|
||||
#powerTip.s:after, #powerTip.s:before {
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
#powerTip.sw:after, #powerTip.sw:before {
|
||||
right: 14px;
|
||||
}
|
||||
|
||||
#powerTip.se:after, #powerTip.se:before {
|
||||
left: 14px;
|
||||
}
|
||||
|
||||
#powerTip.e:after, #powerTip.e:before {
|
||||
left: 100%;
|
||||
}
|
||||
#powerTip.e:after {
|
||||
border-left-color: #ffffff;
|
||||
border-width: 10px;
|
||||
top: 50%;
|
||||
margin-top: -10px;
|
||||
}
|
||||
#powerTip.e:before {
|
||||
border-left-color: #808080;
|
||||
border-width: 11px;
|
||||
top: 50%;
|
||||
margin-top: -11px;
|
||||
}
|
||||
|
||||
#powerTip.w:after, #powerTip.w:before {
|
||||
right: 100%;
|
||||
}
|
||||
#powerTip.w:after {
|
||||
border-right-color: #ffffff;
|
||||
border-width: 10px;
|
||||
top: 50%;
|
||||
margin-top: -10px;
|
||||
}
|
||||
#powerTip.w:before {
|
||||
border-right-color: #808080;
|
||||
border-width: 11px;
|
||||
top: 50%;
|
||||
margin-top: -11px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Centered container for all content
|
||||
*/
|
||||
|
||||
div.contents,
|
||||
div.header > *,
|
||||
ul.tablist,
|
||||
.navpath ul {
|
||||
margin:0 15px;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
div.contents,
|
||||
div.header > *,
|
||||
ul.tablist,
|
||||
.navpath ul {
|
||||
margin: 0 auto;
|
||||
width: 90%;
|
||||
max-width: 1200px;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* padding inside content
|
||||
*/
|
||||
|
||||
div.contents > * {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
@media (min-width: 568px) {
|
||||
div.contents > h2,
|
||||
div.contents > div.textblock,
|
||||
div.contents > div.memitem,
|
||||
div.contents > table.memberdecls h2,
|
||||
div.contents > p {
|
||||
padding-top: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
div.contents h2 {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
div.summary {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*
|
||||
* Tabs
|
||||
*
|
||||
* Based on doxygen tabs.css
|
||||
*/
|
||||
|
||||
.tabs, .tabs2, .tabs3 {
|
||||
width: 100%;
|
||||
background-color: #f4f4f4;
|
||||
border-top: solid 1px #ececec;
|
||||
}
|
||||
|
||||
.tablist {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: table;
|
||||
}
|
||||
|
||||
.tablist li {
|
||||
float: left;
|
||||
display: table-cell;
|
||||
line-height: 36px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.tablist a {
|
||||
display: block;
|
||||
padding: 0 30px 0 0;
|
||||
}
|
||||
|
||||
.tabs3 .tablist a {
|
||||
padding: 0 20px 0 0;
|
||||
}
|
||||
|
||||
.tablist li.current a {
|
||||
color: #54a23d;
|
||||
}
|
||||
|
||||
/*
|
||||
* Navpath
|
||||
*/
|
||||
|
||||
.navpath ul
|
||||
{
|
||||
padding:20px 0px;
|
||||
}
|
||||
|
||||
.navpath li
|
||||
{
|
||||
list-style-type:none;
|
||||
padding-right: 10px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.navpath li.navelem a
|
||||
{
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.navpath li.navelem:before {
|
||||
content: "/";
|
||||
color: #777;
|
||||
}
|
||||
|
||||
/*
|
||||
* Member
|
||||
*
|
||||
* Styles for detailed member documentation
|
||||
*/
|
||||
|
||||
.memitem {
|
||||
border-top: solid 1px #c9c9c9;
|
||||
}
|
||||
|
||||
.memname {
|
||||
font-weight: bold;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
td.memname {
|
||||
color: #54a23d;
|
||||
}
|
||||
|
||||
.memname td {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.memproto, dl.reflist dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.memdoc, dl.reflist dd {
|
||||
}
|
||||
|
||||
/*
|
||||
* Parameters
|
||||
*/
|
||||
|
||||
.paramkey {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.paramtype {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.paramname {
|
||||
color: #aa0e0e;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.paramname em {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.params, .retval, .exception, .tparams {
|
||||
margin-left: 0px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.params td {
|
||||
padding-right: 1em;
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
|
||||
.params .paramname, .retval .paramname {
|
||||
font-weight: bold;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.params .paramtype {
|
||||
font-style: italic;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/*
|
||||
* Inline Label etc.
|
||||
*/
|
||||
|
||||
table.mlabels {
|
||||
border-spacing: 0px;
|
||||
}
|
||||
|
||||
td.mlabels-left {
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
td.mlabels-right {
|
||||
vertical-align: bottom;
|
||||
padding: 0px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
span.mlabels {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Member Descriptions
|
||||
*/
|
||||
|
||||
table.memberdecls {
|
||||
font-family: monospace;
|
||||
border-spacing: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.memSeparator {
|
||||
line-height: 1px;
|
||||
margin: 0px;
|
||||
padding: 0 0 0.2em 0;
|
||||
}
|
||||
|
||||
.memItemLeft, .memTemplItemLeft {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.memItemRight {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.memTemplParams {
|
||||
color: #4665A2;
|
||||
white-space: nowrap;
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fieldtable (Enums)
|
||||
*/
|
||||
|
||||
.fieldtable td, .fieldtable th {
|
||||
padding: 0 1em 0.2em 0;
|
||||
}
|
||||
|
||||
.fieldtable td.fieldtype, .fieldtable td.fieldname {
|
||||
white-space: nowrap;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/*
|
||||
* Directory
|
||||
*/
|
||||
|
||||
.directory table {
|
||||
border-collapse:collapse;
|
||||
}
|
||||
|
||||
.directory td {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.directory td.entry {
|
||||
white-space: nowrap;
|
||||
padding-right: 6px;
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
.directory td.entry a {
|
||||
outline:none;
|
||||
}
|
||||
|
||||
.directory td.entry a img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.directory td.desc {
|
||||
width: 100%;
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
.directory tr.even {
|
||||
padding-left: 6px;
|
||||
}
|
||||
|
||||
.directory img {
|
||||
vertical-align: -30%;
|
||||
}
|
||||
|
||||
.directory .levels {
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.directory .levels span {
|
||||
cursor: pointer;
|
||||
padding-left: 2px;
|
||||
padding-right: 2px;
|
||||
color: #3c92d1;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
color: #9CAFD4;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
font-size: 80%;
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-family: Arial, Helvetica;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
height: 14px;
|
||||
width: 16px;
|
||||
display: inline-block;
|
||||
background-color: #54a23d;
|
||||
color: white;
|
||||
text-align: center;
|
||||
border-radius: 4px;
|
||||
margin-left: 2px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.icona {
|
||||
width: 24px;
|
||||
height: 22px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.iconfopen {
|
||||
width: 24px;
|
||||
height: 18px;
|
||||
margin-bottom: 4px;
|
||||
background-image:url('ftv2folderopen.png');
|
||||
background-position: 0px 0px;
|
||||
background-repeat: repeat-y;
|
||||
vertical-align:top;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.iconfclosed {
|
||||
width: 24px;
|
||||
height: 18px;
|
||||
margin-bottom: 4px;
|
||||
background-image:url('ftv2folderclosed.png');
|
||||
background-position: 0px 0px;
|
||||
background-repeat: repeat-y;
|
||||
vertical-align:top;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.icondoc {
|
||||
width: 24px;
|
||||
height: 18px;
|
||||
margin-bottom: 4px;
|
||||
background-image:url('ftv2doc.png');
|
||||
background-position: 0px -1px;
|
||||
background-repeat: repeat-y;
|
||||
vertical-align:top;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Data Structure Index
|
||||
*
|
||||
* Hardcoded style attribute
|
||||
*/
|
||||
|
||||
.contents > table[style] {
|
||||
margin: 20px auto !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* Search Box
|
||||
*/
|
||||
|
||||
#MSearchBox {
|
||||
right: 4%;
|
||||
}
|
||||
|
||||
@media print
|
||||
{
|
||||
#top { display: none; }
|
||||
#side-nav { display: none; }
|
||||
#nav-path { display: none; }
|
||||
body { overflow:visible; }
|
||||
h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
|
||||
.summary { display: none; }
|
||||
.memitem { page-break-inside: avoid; }
|
||||
#doc-content
|
||||
{
|
||||
margin-left:0 !important;
|
||||
height:auto !important;
|
||||
width:auto !important;
|
||||
overflow:inherit;
|
||||
display:inline;
|
||||
}
|
||||
}
|
||||
|
777
contrib/doxygen/extra.css
Normal file
@@ -0,0 +1,777 @@
|
||||
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */
|
||||
|
||||
/**
|
||||
* 1. Set default font family to sans-serif.
|
||||
* 2. Prevent iOS text size adjust after orientation change, without disabling
|
||||
* user zoom.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-family: sans-serif; /* 1 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove default margin.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* HTML5 display definitions
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Correct `block` display not defined in IE 8/9.
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
main,
|
||||
nav,
|
||||
section,
|
||||
summary {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct `inline-block` display not defined in IE 8/9.
|
||||
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
|
||||
*/
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
progress,
|
||||
video {
|
||||
display: inline-block; /* 1 */
|
||||
vertical-align: baseline; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent modern browsers from displaying `audio` without controls.
|
||||
* Remove excess height in iOS 5 devices.
|
||||
*/
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address `[hidden]` styling not present in IE 8/9.
|
||||
* Hide the `template` element in IE, Safari, and Firefox < 22.
|
||||
*/
|
||||
|
||||
[hidden],
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Links
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the gray background color from active links in IE 10.
|
||||
*/
|
||||
|
||||
a {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Improve readability when focused and also mouse hovered in all browsers.
|
||||
*/
|
||||
|
||||
a:active,
|
||||
a:hover {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
/* Text-level semantics
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 8/9, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: 1px dotted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in Safari 5 and Chrome.
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address variable `h1` font-size and margin within `section` and `article`
|
||||
* contexts in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 8/9.
|
||||
*/
|
||||
|
||||
mark {
|
||||
background: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent and variable font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
/* Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove border when inside `a` element in IE 8/9.
|
||||
*/
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct overflow displayed oddly in IE 9.
|
||||
*/
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Grouping content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address margin not present in IE 8/9 and Safari 5.
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address differences between Firefox and other browsers.
|
||||
*/
|
||||
|
||||
hr {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Contain overflow in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address odd `em`-unit font size rendering in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/* Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Known limitation: by default, Chrome and Safari on OS X allow very limited
|
||||
* styling of `select`, unless a `border` property is set.
|
||||
*/
|
||||
|
||||
/**
|
||||
* 1. Correct color not being inherited.
|
||||
* Known issue: affects color of disabled elements.
|
||||
* 2. Correct font properties not being inherited.
|
||||
* 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
color: inherit; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
margin: 0; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Address `overflow` set to `hidden` in IE 8/9/10.
|
||||
*/
|
||||
|
||||
button {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent `text-transform` inheritance for `button` and `select`.
|
||||
* All other form control elements do not inherit `text-transform` values.
|
||||
* Correct `button` style inheritance in Firefox, IE 8+, and Opera
|
||||
* Correct `select` style inheritance in Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
||||
* and `video` controls.
|
||||
* 2. Correct inability to style clickable `input` types in iOS.
|
||||
* 3. Improve usability and consistency of cursor style between image-type
|
||||
* `input` and others.
|
||||
*/
|
||||
|
||||
button,
|
||||
html input[type="button"], /* 1 */
|
||||
input[type="reset"],
|
||||
input[type="submit"] {
|
||||
-webkit-appearance: button; /* 2 */
|
||||
cursor: pointer; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-set default cursor for disabled elements.
|
||||
*/
|
||||
|
||||
button[disabled],
|
||||
html input[disabled] {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and border in Firefox 4+.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
|
||||
* the UA stylesheet.
|
||||
*/
|
||||
|
||||
input {
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
/**
|
||||
* It's recommended that you don't attempt to style these elements.
|
||||
* Firefox's implementation doesn't respect box-sizing, padding, or width.
|
||||
*
|
||||
* 1. Address box sizing set to `content-box` in IE 8/9/10.
|
||||
* 2. Remove excess padding in IE 8/9/10.
|
||||
*/
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
|
||||
* `font-size` values of the `input`, it causes the cursor style of the
|
||||
* decrement button to change from `default` to `text`.
|
||||
*/
|
||||
|
||||
input[type="number"]::-webkit-inner-spin-button,
|
||||
input[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
|
||||
* 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
|
||||
* (include `-moz` to future-proof).
|
||||
*/
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box; /* 2 */
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
|
||||
* Safari (but not Chrome) clips the cancel button when the search input has
|
||||
* padding (and `textfield` appearance).
|
||||
*/
|
||||
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
input[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define consistent border, margin, and padding.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #c0c0c0;
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct `color` not being inherited in IE 8/9.
|
||||
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
|
||||
*/
|
||||
|
||||
legend {
|
||||
border: 0; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove default vertical scrollbar in IE 8/9.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Don't inherit the `font-weight` (applied by a rule above).
|
||||
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
|
||||
*/
|
||||
|
||||
optgroup {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Tables
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove most spacing between table cells.
|
||||
*/
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
td,
|
||||
th {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* neovim.io/css/main.css */
|
||||
|
||||
* {
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-size: 15px;
|
||||
line-height: 1.4;
|
||||
color: #444;
|
||||
background-color: #fbfbfb;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
body {
|
||||
font-size: 17px;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
color: #3c92d1;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
color: #54a23d;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
h2 {
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
h3 {
|
||||
/* color: #54a23d; */
|
||||
}
|
||||
|
||||
blockquote {
|
||||
border-left: 5px solid #eeeeee;
|
||||
margin-left: 0;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Content container
|
||||
*
|
||||
* Centered container for all content
|
||||
*/
|
||||
|
||||
.container {
|
||||
margin: 0 15px;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
.container {
|
||||
margin: 0 auto;
|
||||
width: 90%;
|
||||
max-width: 1200px;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Navbar
|
||||
*
|
||||
* Logo and navigation at the top of the page
|
||||
*/
|
||||
|
||||
.navbar {
|
||||
padding: 12px 0;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
.navbar {
|
||||
padding-top: 30px;
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 120px;
|
||||
position: relative;
|
||||
top: 4px;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
.logo {
|
||||
width: 180px;
|
||||
}
|
||||
}
|
||||
|
||||
.site-nav {
|
||||
display: none;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
.site-nav {
|
||||
display: block;
|
||||
float: right;
|
||||
}
|
||||
.site-nav ul {
|
||||
list-style: none;
|
||||
}
|
||||
.site-nav li {
|
||||
display: inline-block;
|
||||
margin-top: 5px;
|
||||
margin-left: 20px;
|
||||
font-size: 18px;
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Masthead
|
||||
*
|
||||
* Big intro billboard
|
||||
*/
|
||||
|
||||
.masthead {
|
||||
border-top: solid 1px #ececec;
|
||||
border-bottom: solid 1px #ececec;
|
||||
text-align: center;
|
||||
padding: 20px 12px;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
.masthead {
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.masthead .container {
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
.masthead .container {
|
||||
width: 568px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
.masthead h1 {
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
.masthead h1 {
|
||||
font-size: 40px;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
}
|
||||
|
||||
.masthead .lead {
|
||||
font-weight: 900;
|
||||
color: #54a23d;
|
||||
font-family: 'Lato', sans-serif;
|
||||
font-size: 16px;
|
||||
font-weight: 900;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
.masthead .lead {
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Columns
|
||||
*
|
||||
* Two columns utilizing the golden ratio
|
||||
*/
|
||||
|
||||
.col-wide,
|
||||
.col-narrow {
|
||||
display: block;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
.col-wide {
|
||||
display: table-cell;
|
||||
width: 61.8%;
|
||||
vertical-align: top;
|
||||
}
|
||||
.col-narrow {
|
||||
display: table-cell;
|
||||
width: 38.2%;
|
||||
padding-left: 6%;
|
||||
vertical-align: top;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Front page
|
||||
*
|
||||
* Big section blocks for the front page
|
||||
*/
|
||||
|
||||
.front-section {
|
||||
padding: 8px 0;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
.front-section {
|
||||
padding-top: 30px;
|
||||
padding-bottom: 30px;
|
||||
display: table;
|
||||
width: 100%;
|
||||
}
|
||||
.front-section h2:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.front-section.shaded {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
/*
|
||||
* FAQs
|
||||
*
|
||||
* Formatted as a definition list
|
||||
*/
|
||||
|
||||
.faqs dt {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.faqs dd {
|
||||
color: #777;
|
||||
font-size: 15px;
|
||||
margin-left: 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Buttons
|
||||
*
|
||||
* Fun to click
|
||||
*/
|
||||
|
||||
.btn {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
background-color: #3c92d1;
|
||||
color: #fff;
|
||||
font-family: 'Lato', sans-serif;
|
||||
border-radius: 4px;
|
||||
padding: 15px 30px;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
background-color: #3889c4;
|
||||
}
|
||||
|
||||
.btn.full-width {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sponsors
|
||||
*
|
||||
* Callout-style box
|
||||
*/
|
||||
.sponsors {
|
||||
background-color: #f5f5f5;
|
||||
padding: 5px 20px;
|
||||
border-radius: 4px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.sponsors h3 {
|
||||
color: #54a23d;
|
||||
}
|
||||
|
||||
.first-level-sponsor {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.first-level-sponsor img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.second-level-sponsors {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.second-level-sponsors td {
|
||||
width: 50%;
|
||||
padding: 12px 0;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.second-level-sponsors img {
|
||||
width: 80%;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
.second-level-sponsor img {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Footer
|
||||
*
|
||||
* Links, legalese, etc.
|
||||
*/
|
||||
|
||||
footer .container {
|
||||
border-top: solid 1px #ececec;
|
||||
padding: 20px 0 50px;
|
||||
font-size: 12px;
|
||||
color: #777;
|
||||
}
|
||||
@media (min-width: 568px) {
|
||||
footer .container {
|
||||
font-size: 14px;
|
||||
display: table;
|
||||
}
|
||||
}
|
||||
|
||||
footer a {
|
||||
color: #444;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Misc
|
||||
*
|
||||
* Odds 'n ends
|
||||
*/
|
||||
|
||||
.light {
|
||||
color: #777;
|
||||
}
|
||||
|
||||
.light a {
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.small {
|
||||
font-size: 70%;
|
||||
}
|
||||
|
||||
/*
|
||||
* Newsletter CSS
|
||||
*/
|
||||
|
||||
.newsletter h1 {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
23
contrib/doxygen/footer.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!-- HTML footer for doxygen 1.8.6-->
|
||||
<!-- start footer part -->
|
||||
<!--BEGIN GENERATE_TREEVIEW-->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
$navpath
|
||||
<li class="footer">$generatedby
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
|
||||
</ul>
|
||||
</div>
|
||||
<!--END GENERATE_TREEVIEW-->
|
||||
<!--BEGIN !GENERATE_TREEVIEW-->
|
||||
<footer>
|
||||
<div class="container">
|
||||
$generatedby
|
||||
<a href="http://www.doxygen.org/index.html">Doxygen</a>
|
||||
$doxygenversion
|
||||
</div>
|
||||
</footer>
|
||||
<!--END !GENERATE_TREEVIEW-->
|
||||
</body>
|
||||
</html>
|
36
contrib/doxygen/header.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<!-- HTML header for doxygen 1.8.6-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen $doxygenversion"/>
|
||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
||||
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
||||
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
||||
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
||||
$treeview
|
||||
$search
|
||||
$mathjax
|
||||
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
||||
$extrastylesheet
|
||||
<link href="http://fonts.googleapis.com/css?family=Lato:400,700,900" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
<!--BEGIN TITLEAREA-->
|
||||
<header class="navbar">
|
||||
<div class="container">
|
||||
<nav class="site-nav">
|
||||
<ul>
|
||||
<li><a href="http://neovim.io/">Neovim Home</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<a href="$relpath^index.html">
|
||||
<img src="$relpath^$projectlogo" class="logo" alt="Neovim Dev-Doc">
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<!--END TITLEAREA-->
|
||||
<!-- end header part -->
|
BIN
contrib/doxygen/logo-devdoc.png
Normal file
After Width: | Height: | Size: 27 KiB |
12
contrib/flake.lock
generated
@@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1659877975,
|
||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
||||
"lastModified": 1644229661,
|
||||
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
||||
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -17,11 +17,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1662019588,
|
||||
"narHash": "sha256-oPEjHKGGVbBXqwwL+UjsveJzghWiWV0n9ogo1X6l4cw=",
|
||||
"lastModified": 1646254136,
|
||||
"narHash": "sha256-8nQx02tTzgYO21BP/dy5BCRopE8OwE8Drsw98j+Qoaw=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "2da64a81275b68fdad38af669afeda43d401e94b",
|
||||
"rev": "3e072546ea98db00c2364b81491b893673267827",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@@ -8,131 +8,126 @@
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
{
|
||||
overlay = final: prev: rec {
|
||||
neovim-unwrapped = prev.neovim-unwrapped.override ({
|
||||
libvterm-neovim = prev.libvterm-neovim.overrideAttrs (old: {
|
||||
version = "0.3";
|
||||
src = builtins.fetchTarball {
|
||||
url = "https://www.leonerd.org.uk/code/libvterm/libvterm-0.3.tar.gz";
|
||||
sha256 = "0zg6sn5brwrnqaab883pdj0l2swk5askbbwbdam0zq55ikbrzgar";
|
||||
};
|
||||
overlay = final: prev:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${prev.system};
|
||||
in
|
||||
rec {
|
||||
neovim = pkgs.neovim-unwrapped.overrideAttrs (oa: {
|
||||
version = "master";
|
||||
src = ../.;
|
||||
});
|
||||
});
|
||||
|
||||
neovim = final.neovim-unwrapped.overrideAttrs (oa: {
|
||||
version = "master";
|
||||
src = ../.;
|
||||
# a development binary to help debug issues
|
||||
neovim-debug = let
|
||||
stdenv = if pkgs.stdenv.isLinux then pkgs.llvmPackages_latest.stdenv else pkgs.stdenv;
|
||||
in
|
||||
((neovim.override {
|
||||
lua = pkgs.luajit;
|
||||
inherit stdenv;
|
||||
}).overrideAttrs (oa: {
|
||||
|
||||
buildInputs = oa.buildInputs
|
||||
++ final.lib.optionals final.stdenv.isDarwin
|
||||
(with final.darwin.apple_sdk.frameworks; [ CoreServices ]);
|
||||
});
|
||||
dontStrip = true;
|
||||
NIX_CFLAGS_COMPILE = " -ggdb -Og";
|
||||
|
||||
# a development binary to help debug issues
|
||||
neovim-debug = let
|
||||
stdenv = if final.stdenv.isLinux then
|
||||
final.llvmPackages_latest.stdenv
|
||||
else
|
||||
final.stdenv;
|
||||
in ((neovim.override {
|
||||
lua = final.luajit;
|
||||
inherit stdenv;
|
||||
}).overrideAttrs (oa: {
|
||||
cmakeBuildType = "Debug";
|
||||
cmakeFlags = oa.cmakeFlags ++ [
|
||||
"-DMIN_LOG_LEVEL=0"
|
||||
];
|
||||
|
||||
dontStrip = true;
|
||||
NIX_CFLAGS_COMPILE = " -ggdb -Og";
|
||||
disallowedReferences = [];
|
||||
}));
|
||||
|
||||
cmakeBuildType = "Debug";
|
||||
cmakeFlags = oa.cmakeFlags ++ [ "-DMIN_LOG_LEVEL=0" ];
|
||||
|
||||
disallowedReferences = [ ];
|
||||
}));
|
||||
|
||||
# for neovim developers, beware of the slow binary
|
||||
neovim-developer = let luacheck = final.luaPackages.luacheck;
|
||||
in (neovim-debug.override ({
|
||||
doCheck = final.stdenv.isLinux;
|
||||
})).overrideAttrs (oa: {
|
||||
cmakeFlags = oa.cmakeFlags ++ [
|
||||
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
|
||||
"-DMIN_LOG_LEVEL=0"
|
||||
"-DENABLE_LTO=OFF"
|
||||
] ++ final.lib.optionals final.stdenv.isLinux [
|
||||
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
|
||||
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
|
||||
"-DCLANG_ASAN_UBSAN=ON"
|
||||
];
|
||||
});
|
||||
};
|
||||
} // flake-utils.lib.eachDefaultSystem (system:
|
||||
# for neovim developers, beware of the slow binary
|
||||
neovim-developer =
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
luacheck = pkgs.luaPackages.luacheck;
|
||||
in
|
||||
(neovim-debug.override ({ doCheck = pkgs.stdenv.isLinux; })).overrideAttrs (oa: {
|
||||
cmakeFlags = oa.cmakeFlags ++ [
|
||||
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
|
||||
"-DMIN_LOG_LEVEL=0"
|
||||
"-DENABLE_LTO=OFF"
|
||||
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
|
||||
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
|
||||
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
|
||||
"-DCLANG_ASAN_UBSAN=ON"
|
||||
];
|
||||
});
|
||||
};
|
||||
} //
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
overlays = [ self.overlay ];
|
||||
inherit system;
|
||||
};
|
||||
|
||||
lua = pkgs.lua5_1;
|
||||
|
||||
pythonEnv = pkgs.python3.withPackages (ps: [
|
||||
pythonEnv = pkgs.python3.withPackages(ps: [
|
||||
ps.msgpack
|
||||
ps.flake8 # for 'make pylint'
|
||||
ps.flake8 # for 'make pylint'
|
||||
]);
|
||||
in {
|
||||
in
|
||||
rec {
|
||||
|
||||
packages = with pkgs; {
|
||||
default = neovim;
|
||||
inherit neovim neovim-debug neovim-developer;
|
||||
};
|
||||
|
||||
checks = {
|
||||
pylint = pkgs.runCommand "pylint" {
|
||||
pylint = pkgs.runCommandNoCC "pylint" {
|
||||
nativeBuildInputs = [ pythonEnv ];
|
||||
preferLocalBuild = true;
|
||||
} "make -C ${./..} pylint > $out";
|
||||
} "make -C ${./..} pylint > $out";
|
||||
|
||||
shlint = pkgs.runCommand "shlint" {
|
||||
shlint = pkgs.runCommandNoCC "shlint" {
|
||||
nativeBuildInputs = [ pkgs.shellcheck ];
|
||||
preferLocalBuild = true;
|
||||
} "make -C ${./..} shlint > $out";
|
||||
} "make -C ${./..} shlint > $out";
|
||||
};
|
||||
|
||||
# kept for backwards-compatibility
|
||||
defaultPackage = pkgs.neovim;
|
||||
|
||||
devShells = {
|
||||
default = pkgs.neovim-developer.overrideAttrs (oa: {
|
||||
apps = {
|
||||
nvim = flake-utils.lib.mkApp { drv = pkgs.neovim; name = "nvim"; };
|
||||
nvim-debug = flake-utils.lib.mkApp { drv = pkgs.neovim-debug; name = "nvim"; };
|
||||
};
|
||||
|
||||
buildInputs = with pkgs;
|
||||
oa.buildInputs ++ [
|
||||
defaultApp = apps.nvim;
|
||||
|
||||
devShell = let
|
||||
in
|
||||
pkgs.neovim-developer.overrideAttrs(oa: {
|
||||
|
||||
buildInputs = with pkgs; oa.buildInputs ++ [
|
||||
cmake
|
||||
lua.pkgs.luacheck
|
||||
sumneko-lua-language-server
|
||||
pythonEnv
|
||||
include-what-you-use # for scripts/check-includes.py
|
||||
jq # jq for scripts/vim-patch.sh -r
|
||||
shellcheck # for `make shlint`
|
||||
doxygen # for script/gen_vimdoc.py
|
||||
doxygen # for script/gen_vimdoc.py
|
||||
clang-tools # for clangd to find the correct headers
|
||||
];
|
||||
|
||||
shellHook = oa.shellHook + ''
|
||||
export NVIM_PYTHON_LOG_LEVEL=DEBUG
|
||||
export NVIM_LOG_FILE=/tmp/nvim.log
|
||||
export ASAN_SYMBOLIZER_PATH=${pkgs.llvm_11}/bin/llvm-symbolizer
|
||||
shellHook = oa.shellHook + ''
|
||||
export NVIM_PYTHON_LOG_LEVEL=DEBUG
|
||||
export NVIM_LOG_FILE=/tmp/nvim.log
|
||||
export ASAN_SYMBOLIZER_PATH=${pkgs.llvm_11}/bin/llvm-symbolizer
|
||||
|
||||
# ASAN_OPTIONS=detect_leaks=1
|
||||
export ASAN_OPTIONS="log_path=./test.log:abort_on_error=1"
|
||||
export UBSAN_OPTIONS=print_stacktrace=1
|
||||
mkdir -p build/runtime/parser
|
||||
# nvim looks into CMAKE_INSTALL_DIR. Hack to avoid errors
|
||||
# when running the functionaltests
|
||||
mkdir -p outputs/out/share/nvim/syntax
|
||||
touch outputs/out/share/nvim/syntax/syntax.vim
|
||||
# ASAN_OPTIONS=detect_leaks=1
|
||||
export ASAN_OPTIONS="log_path=./test.log:abort_on_error=1"
|
||||
export UBSAN_OPTIONS=print_stacktrace=1
|
||||
mkdir -p build/runtime/parser
|
||||
# nvim looks into CMAKE_INSTALL_DIR. Hack to avoid errors
|
||||
# when running the functionaltests
|
||||
mkdir -p outputs/out/share/nvim/syntax
|
||||
touch outputs/out/share/nvim/syntax/syntax.vim
|
||||
|
||||
# for treesitter functionaltests
|
||||
mkdir -p runtime/parser
|
||||
cp -f ${pkgs.tree-sitter.builtGrammars.tree-sitter-c}/parser runtime/parser/c.so
|
||||
'';
|
||||
});
|
||||
};
|
||||
});
|
||||
# for treesitter functionaltests
|
||||
mkdir -p runtime/parser
|
||||
cp -f ${pkgs.tree-sitter.builtGrammars.tree-sitter-c}/parser runtime/parser/c.so
|
||||
'';
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -5,7 +5,6 @@
|
||||
"globals": [
|
||||
"vim",
|
||||
"describe",
|
||||
"pending",
|
||||
"it",
|
||||
"before_each",
|
||||
"after_each",
|
||||
|
18
contrib/vim-addon-local-vimrc/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# vim-addon-local-vimrc
|
||||
|
||||
## Installation
|
||||
|
||||
### Step 1
|
||||
|
||||
Install [vim-addon-local-vimrc](https://github.com/MarcWeber/vim-addon-local-vimrc).
|
||||
For example with [Vundle](https://github.com/MarcWeber/vim-addon-local-vimrc):
|
||||
```vim
|
||||
Bundle 'MarcWeber/vim-addon-local-vimrc'
|
||||
```
|
||||
|
||||
### Step 2
|
||||
|
||||
```bash
|
||||
cp vimrc ../../.vimrc
|
||||
echo .vimrc >> ../../.git/info/exclude
|
||||
```
|
11
contrib/vim-addon-local-vimrc/vimrc
Normal file
@@ -0,0 +1,11 @@
|
||||
set modelines=0
|
||||
|
||||
augroup LOCAL_SETUP
|
||||
autocmd!
|
||||
autocmd BufRead,BufNewFile *.h set filetype=c
|
||||
autocmd FileType c setlocal expandtab
|
||||
autocmd FileType c setlocal shiftwidth=2
|
||||
autocmd FileType c setlocal softtabstop=2
|
||||
autocmd FileType c setlocal textwidth=80
|
||||
autocmd FileType c setlocal comments=:///,://
|
||||
augroup end
|
@@ -188,7 +188,7 @@ loading plugins is also skipped.
|
||||
Use
|
||||
.Ar shada
|
||||
instead of the default
|
||||
.Pa ~/.local/state/nvim/shada/main.shada .
|
||||
.Pa ~/.local/share/nvim/shada/main.shada .
|
||||
If
|
||||
.Ar shada
|
||||
is
|
||||
@@ -200,8 +200,7 @@ Skip loading plugins.
|
||||
Implied by
|
||||
.Cm -u NONE .
|
||||
.It Fl -clean
|
||||
Start Nvim with "factory defaults" (no user config and plugins, no shada).
|
||||
.Ic ":help --clean"
|
||||
Mimic a fresh install of Nvim. Skip loading non-builtin plugins and shada (viminfo) file.
|
||||
.It Fl o Ns Op Ar N
|
||||
Open
|
||||
.Ar N
|
||||
@@ -327,7 +326,7 @@ Print version information and exit.
|
||||
.Sh ENVIRONMENT
|
||||
.Bl -tag -width Fl
|
||||
.It Ev NVIM_LOG_FILE
|
||||
Low-level log file, usually found at ~/.local/state/nvim/log.
|
||||
Low-level log file, usually found at ~/.cache/nvim/log.
|
||||
:help $NVIM_LOG_FILE
|
||||
.It Ev VIM
|
||||
Used to locate user files, such as init.vim.
|
||||
@@ -341,19 +340,11 @@ Path to the user-local configuration directory, see
|
||||
Defaults to
|
||||
.Pa ~/.config .
|
||||
:help xdg
|
||||
.It Ev XDG_STATE_HOME
|
||||
Like
|
||||
.Ev XDG_CONFIG_HOME ,
|
||||
but used to store data not generally edited by the user,
|
||||
namely swap, backup, and ShaDa files.
|
||||
Defaults to
|
||||
.Pa ~/.local/state .
|
||||
:help xdg
|
||||
.It Ev XDG_DATA_HOME
|
||||
Like
|
||||
.Ev XDG_CONFIG_HOME ,
|
||||
but used to store data not generally edited by the user,
|
||||
things like runtime files.
|
||||
namely swap, backup, and ShaDa files.
|
||||
Defaults to
|
||||
.Pa ~/.local/share .
|
||||
:help xdg
|
@@ -1,6 +1,8 @@
|
||||
<CPackWiXPatch>
|
||||
<!-- Fragment ID is from: <your build dir>/_CPack_Packages/win64/WIX/files.wxs -->
|
||||
<CPackWiXFragment Id="CM_CP_bin.nvim.exe">
|
||||
<!-- Note: if we were to specify Value='[INSTALL_ROOT]\bin' - with a backslash, the installer will still
|
||||
use a forward slash in the path. -->
|
||||
<Environment
|
||||
Id='UpdatePath'
|
||||
Name='PATH'
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
@@ -75,10 +75,8 @@ add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
|
||||
)
|
||||
|
||||
|
||||
# TODO: This doesn't work. wait for "nvim -l" to land?
|
||||
add_custom_target(doc_html
|
||||
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
|
||||
-V1 -es --clean -c "lua require('scripts.gen_help_html').gen('./build/runtime/doc', './build/doc_html', nil, 'todo_commit_id')" -c "0cq"
|
||||
COMMAND make html
|
||||
DEPENDS
|
||||
${GENERATED_HELP_TAGS}
|
||||
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
|
||||
@@ -119,16 +117,16 @@ endif()
|
||||
globrecurse_wrapper(RUNTIME_PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR} *.awk *.sh *.bat)
|
||||
|
||||
foreach(PROG ${RUNTIME_PROGRAMS})
|
||||
get_filename_component(BASEDIR ${PROG} DIRECTORY)
|
||||
get_filename_component(BASEDIR ${PROG} PATH)
|
||||
install_helper(PROGRAMS ${PROG}
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/${BASEDIR})
|
||||
endforeach()
|
||||
|
||||
globrecurse_wrapper(RUNTIME_FILES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
*.vim *.lua *.scm *.dict *.py *.rb *.ps *.spl *.tutor *.tutor.json)
|
||||
*.vim *.lua *.dict *.py *.rb *.ps *.spl *.tutor *.tutor.json)
|
||||
|
||||
foreach(F ${RUNTIME_FILES})
|
||||
get_filename_component(BASEDIR ${F} DIRECTORY)
|
||||
get_filename_component(BASEDIR ${F} PATH)
|
||||
install_helper(FILES ${F}
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/${BASEDIR})
|
||||
endforeach()
|
||||
|
@@ -1,95 +0,0 @@
|
||||
" Support for bitbake indenting, see runtime/indent/bitbake.vim
|
||||
|
||||
function s:is_bb_python_func_def(lnum)
|
||||
let stack = synstack(a:lnum, 1)
|
||||
if len(stack) == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
return synIDattr(stack[0], "name") == "bbPyFuncDef"
|
||||
endfunction
|
||||
|
||||
function bitbake#Indent(lnum)
|
||||
if !has('syntax_items')
|
||||
return -1
|
||||
endif
|
||||
|
||||
let stack = synstack(a:lnum, 1)
|
||||
if len(stack) == 0
|
||||
return -1
|
||||
endif
|
||||
|
||||
let name = synIDattr(stack[0], "name")
|
||||
|
||||
" TODO: support different styles of indentation for assignments. For now,
|
||||
" we only support like this:
|
||||
" VAR = " \
|
||||
" value1 \
|
||||
" value2 \
|
||||
" "
|
||||
"
|
||||
" i.e. each value indented by shiftwidth(), with the final quote " completely unindented.
|
||||
if name == "bbVarValue"
|
||||
" Quote handling is tricky. kernel.bbclass has this line for instance:
|
||||
" EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" " HOSTCPP="${BUILD_CPP}""
|
||||
" Instead of trying to handle crazy cases like that, just assume that a
|
||||
" double-quote on a line by itself (following an assignment) means the
|
||||
" user is closing the assignment, and de-dent.
|
||||
if getline(a:lnum) =~ '^\s*"$'
|
||||
return 0
|
||||
endif
|
||||
|
||||
let prevstack = synstack(a:lnum - 1, 1)
|
||||
if len(prevstack) == 0
|
||||
return -1
|
||||
endif
|
||||
|
||||
let prevname = synIDattr(prevstack[0], "name")
|
||||
|
||||
" Only indent if there was actually a continuation character on
|
||||
" the previous line, to avoid misleading indentation.
|
||||
let prevlinelastchar = synIDattr(synID(a:lnum - 1, col([a:lnum - 1, "$"]) - 1, 1), "name")
|
||||
let prev_continued = prevlinelastchar == "bbContinue"
|
||||
|
||||
" Did the previous line introduce an assignment?
|
||||
if index(["bbVarDef", "bbVarFlagDef"], prevname) != -1
|
||||
if prev_continued
|
||||
return shiftwidth()
|
||||
endif
|
||||
endif
|
||||
|
||||
if !prev_continued
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Autoindent can take it from here
|
||||
return -1
|
||||
endif
|
||||
|
||||
if index(["bbPyDefRegion", "bbPyFuncRegion"], name) != -1
|
||||
let ret = python#GetIndent(a:lnum, function('s:is_bb_python_func_def'))
|
||||
" Should normally always be indented by at least one shiftwidth; but allow
|
||||
" return of -1 (defer to autoindent) or -2 (force indent to 0)
|
||||
if ret == 0
|
||||
return shiftwidth()
|
||||
elseif ret == -2
|
||||
return 0
|
||||
endif
|
||||
return ret
|
||||
endif
|
||||
|
||||
" TODO: GetShIndent doesn't detect tasks prepended with 'fakeroot'
|
||||
" Need to submit a patch upstream to Vim to provide an extension point.
|
||||
" Unlike the Python indenter, the Sh indenter is way too large to copy and
|
||||
" modify here.
|
||||
if name == "bbShFuncRegion"
|
||||
return GetShIndent()
|
||||
endif
|
||||
|
||||
" TODO:
|
||||
" + heuristics for de-denting out of a bbPyDefRegion? e.g. when the user
|
||||
" types an obvious BB keyword like addhandler or addtask, or starts
|
||||
" writing a shell task. Maybe too hard to implement...
|
||||
|
||||
return -1
|
||||
endfunction
|
117
runtime/autoload/dist/ft.vim
vendored
@@ -1,7 +1,7 @@
|
||||
" Vim functions for file type detection
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2022 Apr 13
|
||||
" Last Change: 2022 Apr 06
|
||||
|
||||
" These functions are moved here from runtime/filetype.vim to make startup
|
||||
" faster.
|
||||
@@ -78,30 +78,22 @@ func dist#ft#FTbas()
|
||||
|
||||
" most frequent FreeBASIC-specific keywords in distro files
|
||||
let fb_keywords = '\c^\s*\%(extern\|var\|enum\|private\|scope\|union\|byref\|operator\|constructor\|delete\|namespace\|public\|property\|with\|destructor\|using\)\>\%(\s*[:=(]\)\@!'
|
||||
let fb_preproc = '\c^\s*\%(' ..
|
||||
\ '#\s*\a\+\|' ..
|
||||
\ 'option\s\+\%(byval\|dynamic\|escape\|\%(no\)\=gosub\|nokeyword\|private\|static\)\>\|' ..
|
||||
\ '\%(''\|rem\)\s*\$lang\>\|' ..
|
||||
\ 'def\%(byte\|longint\|short\|ubyte\|uint\|ulongint\|ushort\)\>' ..
|
||||
\ '\)'
|
||||
let fb_preproc = '\c^\s*\%(#\a\+\|option\s\+\%(byval\|dynamic\|escape\|\%(no\)\=gosub\|nokeyword\|private\|static\)\>\)'
|
||||
let fb_comment = "^\\s*/'"
|
||||
" OPTION EXPLICIT, without the leading underscore, is common to many dialects
|
||||
let qb64_preproc = '\c^\s*\%($\a\+\|option\s\+\%(_explicit\|_\=explicitarray\)\>\)'
|
||||
|
||||
for lnum in range(1, min([line("$"), 100]))
|
||||
let line = getline(lnum)
|
||||
if line =~ s:ft_visual_basic_content
|
||||
setf vb
|
||||
return
|
||||
elseif line =~ fb_preproc || line =~ fb_comment || line =~ fb_keywords
|
||||
setf freebasic
|
||||
return
|
||||
elseif line =~ qb64_preproc
|
||||
setf qb64
|
||||
return
|
||||
endif
|
||||
endfor
|
||||
setf basic
|
||||
let lines = getline(1, min([line("$"), 100]))
|
||||
|
||||
if match(lines, fb_preproc) > -1 || match(lines, fb_comment) > -1 || match(lines, fb_keywords) > -1
|
||||
setf freebasic
|
||||
elseif match(lines, qb64_preproc) > -1
|
||||
setf qb64
|
||||
elseif match(lines, s:ft_visual_basic_content) > -1
|
||||
setf vb
|
||||
else
|
||||
setf basic
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTbtm()
|
||||
@@ -139,23 +131,6 @@ func dist#ft#FTcfg()
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTcls()
|
||||
if exists("g:filetype_cls")
|
||||
exe "setf " .. g:filetype_cls
|
||||
return
|
||||
endif
|
||||
|
||||
if getline(1) =~ '^%'
|
||||
setf tex
|
||||
elseif getline(1)[0] == '#' && getline(1) =~ 'rexx'
|
||||
setf rexx
|
||||
elseif getline(1) == 'VERSION 1.0 CLASS'
|
||||
setf vb
|
||||
else
|
||||
setf st
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTlpc()
|
||||
if exists("g:lpc_syntax_for_c")
|
||||
let lnum = 1
|
||||
@@ -348,7 +323,7 @@ func dist#ft#FTidl()
|
||||
setf idl
|
||||
endfunc
|
||||
|
||||
" Distinguish between "default", Prolog and Cproto prototype file. */
|
||||
" Distinguish between "default" and Cproto prototype file. */
|
||||
func dist#ft#ProtoCheck(default)
|
||||
" Cproto files have a comment in the first line and a function prototype in
|
||||
" the second line, it always ends in ";". Indent files may also have
|
||||
@@ -358,14 +333,7 @@ func dist#ft#ProtoCheck(default)
|
||||
if getline(2) =~ '.;$'
|
||||
setf cpp
|
||||
else
|
||||
" recognize Prolog by specific text in the first non-empty line
|
||||
" require a blank after the '%' because Perl uses "%list" and "%translate"
|
||||
let l = getline(nextnonblank(1))
|
||||
if l =~ '\<prolog\>' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-'
|
||||
setf prolog
|
||||
else
|
||||
exe 'setf ' .. a:default
|
||||
endif
|
||||
exe 'setf ' . a:default
|
||||
endif
|
||||
endfunc
|
||||
|
||||
@@ -466,9 +434,9 @@ func dist#ft#FTmm()
|
||||
setf nroff
|
||||
endfunc
|
||||
|
||||
" Returns true if file content looks like LambdaProlog module
|
||||
" Returns true if file content looks like LambdaProlog
|
||||
func IsLProlog()
|
||||
" skip apparent comments and blank lines, what looks like
|
||||
" skip apparent comments and blank lines, what looks like
|
||||
" LambdaProlog comment may be RAPID header
|
||||
let l = nextnonblank(1)
|
||||
while l > 0 && l < line('$') && getline(l) =~ '^\s*%' " LambdaProlog comment
|
||||
@@ -526,14 +494,12 @@ func dist#ft#FTinc()
|
||||
" headers so assume POV-Ray
|
||||
elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? s:ft_pascal_keywords
|
||||
setf pascal
|
||||
elseif lines =~# '\<\%(require\|inherit\)\>' || lines =~# '[A-Z][A-Za-z0-9_:${}]*\s\+\%(??\|[?:+]\)\?= '
|
||||
setf bitbake
|
||||
else
|
||||
call dist#ft#FTasmsyntax()
|
||||
if exists("b:asmsyntax")
|
||||
exe "setf " . fnameescape(b:asmsyntax)
|
||||
exe "setf " . fnameescape(b:asmsyntax)
|
||||
else
|
||||
setf pov
|
||||
setf pov
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -856,44 +822,6 @@ func dist#ft#FTperl()
|
||||
return 0
|
||||
endfunc
|
||||
|
||||
" LambdaProlog and Standard ML signature files
|
||||
func dist#ft#FTsig()
|
||||
if exists("g:filetype_sig")
|
||||
exe "setf " .. g:filetype_sig
|
||||
return
|
||||
endif
|
||||
|
||||
let lprolog_comment = '^\s*\%(/\*\|%\)'
|
||||
let lprolog_keyword = '^\s*sig\s\+\a'
|
||||
let sml_comment = '^\s*(\*'
|
||||
let sml_keyword = '^\s*\%(signature\|structure\)\s\+\a'
|
||||
|
||||
let line = getline(nextnonblank(1))
|
||||
|
||||
if line =~ lprolog_comment || line =~# lprolog_keyword
|
||||
setf lprolog
|
||||
elseif line =~ sml_comment || line =~# sml_keyword
|
||||
setf sml
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" This function checks the first 100 lines of files matching "*.sil" to
|
||||
" resolve detection between Swift Intermediate Language and SILE.
|
||||
func dist#ft#FTsil()
|
||||
for lnum in range(1, [line('$'), 100]->min())
|
||||
let line = getline(lnum)
|
||||
if line =~ '^\s*[\\%]'
|
||||
setf sile
|
||||
return
|
||||
elseif line =~ '^\s*\S'
|
||||
setf sil
|
||||
return
|
||||
endif
|
||||
endfor
|
||||
" no clue, default to "sil"
|
||||
setf sil
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTsys()
|
||||
if exists("g:filetype_sys")
|
||||
exe "setf " .. g:filetype_sys
|
||||
@@ -1064,23 +992,20 @@ func dist#ft#FTtf()
|
||||
setf tf
|
||||
endfunc
|
||||
|
||||
let s:ft_krl_header = '\&\w+'
|
||||
" Determine if a *.src file is Kuka Robot Language
|
||||
func dist#ft#FTsrc()
|
||||
let ft_krl_def_or_deffct = '%(global\s+)?def%(fct)?>'
|
||||
if exists("g:filetype_src")
|
||||
exe "setf " .. g:filetype_src
|
||||
elseif getline(nextnonblank(1)) =~? '\v^\s*%(' .. s:ft_krl_header .. '|' .. ft_krl_def_or_deffct .. ')'
|
||||
elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|\%(global\s\+\)\?def\>\)'
|
||||
setf krl
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Determine if a *.dat file is Kuka Robot Language
|
||||
func dist#ft#FTdat()
|
||||
let ft_krl_defdat = 'defdat>'
|
||||
if exists("g:filetype_dat")
|
||||
exe "setf " .. g:filetype_dat
|
||||
elseif getline(nextnonblank(1)) =~? '\v^\s*%(' .. s:ft_krl_header .. '|' .. ft_krl_defdat .. ')'
|
||||
elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|defdat\>\)'
|
||||
setf krl
|
||||
endif
|
||||
endfunc
|
||||
|
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: FreeBASIC
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2022 June 24
|
||||
" Last Change: 2021 Mar 16
|
||||
|
||||
" Dialects can be one of fb, qb, fblite, or deprecated
|
||||
" Precedence is forcelang > #lang > lang
|
||||
@@ -18,16 +18,17 @@ function! freebasic#GetDialect() abort
|
||||
|
||||
" override with #lang directive or metacommand
|
||||
|
||||
let skip = "has('syntax_items') && synIDattr(synID(line('.'), col('.'), 1), 'name') =~ 'Comment$'"
|
||||
let pat = '\c^\s*\%(#\s*lang\s\+\|''\s*$lang\s*:\s*\)"\([^"]*\)"'
|
||||
|
||||
let save_cursor = getcurpos()
|
||||
call cursor(1, 1)
|
||||
let lnum = search(pat, 'cn')
|
||||
let lnum = search(pat, 'n', '', '', skip)
|
||||
call setpos('.', save_cursor)
|
||||
|
||||
if lnum
|
||||
let word = matchlist(getline(lnum), pat)[1]
|
||||
if word =~? '\<\%(fb\|deprecated\|fblite\|qb\)\>'
|
||||
if word =~? '\%(fb\|deprecated\|fblite\|qb\)'
|
||||
let dialect = word
|
||||
else
|
||||
echomsg "freebasic#GetDialect: Invalid lang, found '" .. word .. "' at line " .. lnum .. " " .. getline(lnum)
|
||||
|
@@ -171,11 +171,6 @@ function! s:get_healthcheck(plugin_names) abort
|
||||
for v in values(healthchecks)
|
||||
let output[v[0]] = v[1:]
|
||||
endfor
|
||||
try
|
||||
" vim.health is not a healthcheck, skip it
|
||||
call remove(output, 'vim')
|
||||
catch
|
||||
endtry
|
||||
return output
|
||||
endfunction
|
||||
|
||||
|
@@ -45,7 +45,7 @@ function! s:check_config() abort
|
||||
let shadafile = empty(&shada) ? &shada : substitute(matchstr(
|
||||
\ split(&shada, ',')[-1], '^n.\+'), '^n', '', '')
|
||||
let shadafile = empty(&shadafile) ? empty(shadafile) ?
|
||||
\ stdpath('state').'/shada/main.shada' : expand(shadafile)
|
||||
\ stdpath('data').'/shada/main.shada' : expand(shadafile)
|
||||
\ : &shadafile ==# 'NONE' ? '' : &shadafile
|
||||
if !empty(shadafile) && empty(glob(shadafile))
|
||||
" Since this may be the first time neovim has been run, we will try to
|
||||
@@ -144,16 +144,6 @@ function! s:check_performance() abort
|
||||
\ ['Install a different Nvim package, or rebuild with `CMAKE_BUILD_TYPE=RelWithDebInfo`.',
|
||||
\ s:suggest_faq])
|
||||
endif
|
||||
|
||||
" check for slow shell invocation
|
||||
let slow_cmd_time = 1.5
|
||||
let start_time = reltime()
|
||||
call system('echo')
|
||||
let elapsed_time = reltimefloat(reltime(start_time))
|
||||
if elapsed_time > slow_cmd_time
|
||||
call health#report_warn(
|
||||
\ 'Slow shell invocation (took '.printf('%.2f', elapsed_time).' seconds).')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_tmux_option(option) abort
|
||||
@@ -235,7 +225,7 @@ function! s:check_tmux() abort
|
||||
endif
|
||||
|
||||
" check for RGB capabilities
|
||||
let info = system(['tmux', 'show-messages', '-JT'])
|
||||
let info = system(['tmux', 'server-info'])
|
||||
let has_tc = stridx(info, " Tc: (flag) true") != -1
|
||||
let has_rgb = stridx(info, " RGB: (flag) true") != -1
|
||||
if !has_tc && !has_rgb
|
||||
|
@@ -203,7 +203,7 @@ function! s:version_info(python) abort
|
||||
let nvim_path = s:trim(s:system([
|
||||
\ a:python, '-c',
|
||||
\ 'import sys; ' .
|
||||
\ 'sys.path = [p for p in sys.path if p != ""]; ' .
|
||||
\ 'sys.path = list(filter(lambda x: x != "", sys.path)); ' .
|
||||
\ 'import neovim; print(neovim.__file__)']))
|
||||
if s:shell_error || empty(nvim_path)
|
||||
return [python_version, 'unable to load neovim Python module', pypi_version,
|
||||
@@ -615,10 +615,10 @@ function! s:check_node() abort
|
||||
return
|
||||
endif
|
||||
|
||||
if !executable('node') || (!executable('npm') && !executable('yarn') && !executable('pnpm'))
|
||||
if !executable('node') || (!executable('npm') && !executable('yarn'))
|
||||
call health#report_warn(
|
||||
\ '`node` and `npm` (or `yarn`, `pnpm`) must be in $PATH.',
|
||||
\ ['Install Node.js and verify that `node` and `npm` (or `yarn`, `pnpm`) commands work.'])
|
||||
\ '`node` and `npm` (or `yarn`) must be in $PATH.',
|
||||
\ ['Install Node.js and verify that `node` and `npm` (or `yarn`) commands work.'])
|
||||
return
|
||||
endif
|
||||
let node_v = get(split(s:system(['node', '-v']), "\n"), 0, '')
|
||||
@@ -634,22 +634,15 @@ function! s:check_node() abort
|
||||
|
||||
let [host, err] = provider#node#Detect()
|
||||
if empty(host)
|
||||
call health#report_warn('Missing "neovim" npm (or yarn, pnpm) package.',
|
||||
call health#report_warn('Missing "neovim" npm (or yarn) package.',
|
||||
\ ['Run in shell: npm install -g neovim',
|
||||
\ 'Run in shell (if you use yarn): yarn global add neovim',
|
||||
\ 'Run in shell (if you use pnpm): pnpm install -g neovim',
|
||||
\ 'You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim'])
|
||||
return
|
||||
endif
|
||||
call health#report_info('Nvim node.js host: '. host)
|
||||
|
||||
let manager = 'npm'
|
||||
if executable('yarn')
|
||||
let manager = 'yarn'
|
||||
elseif executable('pnpm')
|
||||
let manager = 'pnpm'
|
||||
endif
|
||||
|
||||
let manager = executable('npm') ? 'npm' : 'yarn'
|
||||
let latest_npm_cmd = has('win32') ?
|
||||
\ 'cmd /c '. manager .' info neovim --json' :
|
||||
\ manager .' info neovim --json'
|
||||
@@ -680,10 +673,9 @@ function! s:check_node() abort
|
||||
\ printf('Package "neovim" is out-of-date. Installed: %s, latest: %s',
|
||||
\ current_npm, latest_npm),
|
||||
\ ['Run in shell: npm install -g neovim',
|
||||
\ 'Run in shell (if you use yarn): yarn global add neovim',
|
||||
\ 'Run in shell (if you use pnpm): pnpm install -g neovim'])
|
||||
\ 'Run in shell (if you use yarn): yarn global add neovim'])
|
||||
else
|
||||
call health#report_ok('Latest "neovim" npm/yarn/pnpm package is installed: '. current_npm)
|
||||
call health#report_ok('Latest "neovim" npm/yarn package is installed: '. current_npm)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
530
runtime/autoload/man.vim
Normal file
@@ -0,0 +1,530 @@
|
||||
" Maintainer: Anmol Sethi <hi@nhooyr.io>
|
||||
|
||||
if exists('s:loaded_man')
|
||||
finish
|
||||
endif
|
||||
let s:loaded_man = 1
|
||||
|
||||
let s:find_arg = '-w'
|
||||
let s:localfile_arg = v:true " Always use -l if possible. #6683
|
||||
|
||||
function! man#init() abort
|
||||
try
|
||||
" Check for -l support.
|
||||
call s:get_page(s:get_path('', 'man'))
|
||||
catch /command error .*/
|
||||
let s:localfile_arg = v:false
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! man#open_page(count, mods, ...) abort
|
||||
if a:0 > 2
|
||||
call s:error('too many arguments')
|
||||
return
|
||||
elseif a:0 == 0
|
||||
let ref = &filetype ==# 'man' ? expand('<cWORD>') : expand('<cword>')
|
||||
if empty(ref)
|
||||
call s:error('no identifier under cursor')
|
||||
return
|
||||
endif
|
||||
elseif a:0 ==# 1
|
||||
let ref = a:1
|
||||
else
|
||||
" Combine the name and sect into a manpage reference so that all
|
||||
" verification/extraction can be kept in a single function.
|
||||
" If a:2 is a reference as well, that is fine because it is the only
|
||||
" reference that will match.
|
||||
let ref = a:2.'('.a:1.')'
|
||||
endif
|
||||
try
|
||||
let [sect, name] = s:extract_sect_and_name_ref(ref)
|
||||
if a:count >= 0
|
||||
let sect = string(a:count)
|
||||
endif
|
||||
let path = s:verify_exists(sect, name)
|
||||
let [sect, name] = s:extract_sect_and_name_path(path)
|
||||
catch
|
||||
call s:error(v:exception)
|
||||
return
|
||||
endtry
|
||||
|
||||
let [l:buf, l:save_tfu] = [bufnr(), &tagfunc]
|
||||
try
|
||||
setlocal tagfunc=man#goto_tag
|
||||
let l:target = l:name . '(' . l:sect . ')'
|
||||
if a:mods !~# 'tab' && s:find_man()
|
||||
execute 'silent keepalt tag' l:target
|
||||
else
|
||||
execute 'silent keepalt' a:mods 'stag' l:target
|
||||
endif
|
||||
call s:set_options(v:false)
|
||||
finally
|
||||
call setbufvar(l:buf, '&tagfunc', l:save_tfu)
|
||||
endtry
|
||||
|
||||
let b:man_sect = sect
|
||||
endfunction
|
||||
|
||||
" Called when a man:// buffer is opened.
|
||||
function! man#read_page(ref) abort
|
||||
try
|
||||
let [sect, name] = s:extract_sect_and_name_ref(a:ref)
|
||||
let path = s:verify_exists(sect, name)
|
||||
let [sect, name] = s:extract_sect_and_name_path(path)
|
||||
let page = s:get_page(path)
|
||||
catch
|
||||
call s:error(v:exception)
|
||||
return
|
||||
endtry
|
||||
let b:man_sect = sect
|
||||
call s:put_page(page)
|
||||
endfunction
|
||||
|
||||
" Handler for s:system() function.
|
||||
function! s:system_handler(jobid, data, event) dict abort
|
||||
if a:event is# 'stdout' || a:event is# 'stderr'
|
||||
let self[a:event] .= join(a:data, "\n")
|
||||
else
|
||||
let self.exit_code = a:data
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Run a system command and timeout after 30 seconds.
|
||||
function! s:system(cmd, ...) abort
|
||||
let opts = {
|
||||
\ 'stdout': '',
|
||||
\ 'stderr': '',
|
||||
\ 'exit_code': 0,
|
||||
\ 'on_stdout': function('s:system_handler'),
|
||||
\ 'on_stderr': function('s:system_handler'),
|
||||
\ 'on_exit': function('s:system_handler'),
|
||||
\ }
|
||||
let jobid = jobstart(a:cmd, opts)
|
||||
|
||||
if jobid < 1
|
||||
throw printf('command error %d: %s', jobid, join(a:cmd))
|
||||
endif
|
||||
|
||||
let res = jobwait([jobid], 30000)
|
||||
if res[0] == -1
|
||||
try
|
||||
call jobstop(jobid)
|
||||
throw printf('command timed out: %s', join(a:cmd))
|
||||
catch /^Vim(call):E900:/
|
||||
endtry
|
||||
elseif res[0] == -2
|
||||
throw printf('command interrupted: %s', join(a:cmd))
|
||||
endif
|
||||
if opts.exit_code != 0
|
||||
throw printf("command error (%d) %s: %s", jobid, join(a:cmd), substitute(opts.stderr, '\_s\+$', '', &gdefault ? '' : 'g'))
|
||||
endif
|
||||
|
||||
return opts.stdout
|
||||
endfunction
|
||||
|
||||
function! s:set_options(pager) abort
|
||||
setlocal filetype=man
|
||||
setlocal noswapfile buftype=nofile bufhidden=hide
|
||||
setlocal nomodified readonly nomodifiable
|
||||
if a:pager
|
||||
nnoremap <silent> <buffer> <nowait> q :lclose<CR>:q<CR>
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_page(path) abort
|
||||
" Disable hard-wrap by using a big $MANWIDTH (max 1000 on some systems #9065).
|
||||
" Soft-wrap: ftplugin/man.vim sets wrap/breakindent/….
|
||||
" Hard-wrap: driven by `man`.
|
||||
let manwidth = !get(g:, 'man_hardwrap', 1) ? 999 : (empty($MANWIDTH) ? winwidth(0) : $MANWIDTH)
|
||||
" Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db).
|
||||
" http://comments.gmane.org/gmane.editors.vim.devel/29085
|
||||
" Set MAN_KEEP_FORMATTING so Debian man doesn't discard backspaces.
|
||||
let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'MAN_KEEP_FORMATTING=1', 'man']
|
||||
return s:system(cmd + (s:localfile_arg ? ['-l', a:path] : [a:path]))
|
||||
endfunction
|
||||
|
||||
function! s:put_page(page) abort
|
||||
setlocal modifiable noreadonly noswapfile
|
||||
silent keepjumps %delete _
|
||||
silent put =a:page
|
||||
while getline(1) =~# '^\s*$'
|
||||
silent keepjumps 1delete _
|
||||
endwhile
|
||||
" XXX: nroff justifies text by filling it with whitespace. That interacts
|
||||
" badly with our use of $MANWIDTH=999. Hack around this by using a fixed
|
||||
" size for those whitespace regions.
|
||||
silent! keeppatterns keepjumps %s/\s\{199,}/\=repeat(' ', 10)/g
|
||||
1
|
||||
lua require("man").highlight_man_page()
|
||||
call s:set_options(v:false)
|
||||
endfunction
|
||||
|
||||
function! man#show_toc() abort
|
||||
let bufname = bufname('%')
|
||||
let info = getloclist(0, {'winid': 1})
|
||||
if !empty(info) && getwinvar(info.winid, 'qf_toc') ==# bufname
|
||||
lopen
|
||||
return
|
||||
endif
|
||||
|
||||
let toc = []
|
||||
let lnum = 2
|
||||
let last_line = line('$') - 1
|
||||
while lnum && lnum < last_line
|
||||
let text = getline(lnum)
|
||||
if text =~# '^\%( \{3\}\)\=\S.*$'
|
||||
call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum, 'text': text})
|
||||
endif
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
endwhile
|
||||
|
||||
call setloclist(0, toc, ' ')
|
||||
call setloclist(0, [], 'a', {'title': 'Man TOC'})
|
||||
lopen
|
||||
let w:qf_toc = bufname
|
||||
endfunction
|
||||
|
||||
" attempt to extract the name and sect out of 'name(sect)'
|
||||
" otherwise just return the largest string of valid characters in ref
|
||||
function! s:extract_sect_and_name_ref(ref) abort
|
||||
if a:ref[0] ==# '-' " try ':Man -pandoc' with this disabled.
|
||||
throw 'manpage name cannot start with ''-'''
|
||||
endif
|
||||
let ref = matchstr(a:ref, '[^()]\+([^()]\+)')
|
||||
if empty(ref)
|
||||
let name = matchstr(a:ref, '[^()]\+')
|
||||
if empty(name)
|
||||
throw 'manpage reference cannot contain only parentheses'
|
||||
endif
|
||||
return ['', s:spaces_to_underscores(name)]
|
||||
endif
|
||||
let left = split(ref, '(')
|
||||
" see ':Man 3X curses' on why tolower.
|
||||
" TODO(nhooyr) Not sure if this is portable across OSs
|
||||
" but I have not seen a single uppercase section.
|
||||
return [tolower(split(left[1], ')')[0]), s:spaces_to_underscores(left[0])]
|
||||
endfunction
|
||||
|
||||
" replace spaces in a man page name with underscores
|
||||
" intended for PostgreSQL, which has man pages like 'CREATE_TABLE(7)';
|
||||
" while editing SQL source code, it's nice to visually select 'CREATE TABLE'
|
||||
" and hit 'K', which requires this transformation
|
||||
function! s:spaces_to_underscores(str)
|
||||
return substitute(a:str, ' ', '_', 'g')
|
||||
endfunction
|
||||
|
||||
function! s:get_path(sect, name) abort
|
||||
" Some man implementations (OpenBSD) return all available paths from the
|
||||
" search command. Previously, this function would simply select the first one.
|
||||
"
|
||||
" However, some searches will report matches that are incorrect:
|
||||
" man -w strlen may return string.3 followed by strlen.3, and therefore
|
||||
" selecting the first would get us the wrong page. Thus, we must find the
|
||||
" first matching one.
|
||||
"
|
||||
" There's yet another special case here. Consider the following:
|
||||
" If you run man -w strlen and string.3 comes up first, this is a problem. We
|
||||
" should search for a matching named one in the results list.
|
||||
" However, if you search for man -w clock_gettime, you will *only* get
|
||||
" clock_getres.2, which is the right page. Searching the resuls for
|
||||
" clock_gettime will no longer work. In this case, we should just use the
|
||||
" first one that was found in the correct section.
|
||||
"
|
||||
" Finally, we can avoid relying on -S or -s here since they are very
|
||||
" inconsistently supported. Instead, call -w with a section and a name.
|
||||
if empty(a:sect)
|
||||
let results = split(s:system(['man', s:find_arg, a:name]))
|
||||
else
|
||||
let results = split(s:system(['man', s:find_arg, a:sect, a:name]))
|
||||
endif
|
||||
|
||||
if empty(results)
|
||||
return ''
|
||||
endif
|
||||
|
||||
" find any that match the specified name
|
||||
let namematches = filter(copy(results), 'fnamemodify(v:val, ":t") =~ a:name')
|
||||
let sectmatches = []
|
||||
|
||||
if !empty(namematches) && !empty(a:sect)
|
||||
let sectmatches = filter(copy(namematches), 'fnamemodify(v:val, ":e") == a:sect')
|
||||
endif
|
||||
|
||||
return substitute(get(sectmatches, 0, get(namematches, 0, results[0])), '\n\+$', '', '')
|
||||
endfunction
|
||||
|
||||
" s:verify_exists attempts to find the path to a manpage
|
||||
" based on the passed section and name.
|
||||
"
|
||||
" 1. If the passed section is empty, b:man_default_sects is used.
|
||||
" 2. If manpage could not be found with the given sect and name,
|
||||
" then another attempt is made with b:man_default_sects.
|
||||
" 3. If it still could not be found, then we try again without a section.
|
||||
" 4. If still not found but $MANSECT is set, then we try again with $MANSECT
|
||||
" unset.
|
||||
"
|
||||
" This function is careful to avoid duplicating a search if a previous
|
||||
" step has already done it. i.e if we use b:man_default_sects in step 1,
|
||||
" then we don't do it again in step 2.
|
||||
function! s:verify_exists(sect, name) abort
|
||||
let sect = a:sect
|
||||
|
||||
if empty(sect)
|
||||
" no section specified, so search with b:man_default_sects
|
||||
if exists('b:man_default_sects')
|
||||
let sects = split(b:man_default_sects, ',')
|
||||
for sec in sects
|
||||
try
|
||||
let res = s:get_path(sec, a:name)
|
||||
if !empty(res)
|
||||
return res
|
||||
endif
|
||||
catch /^command error (/
|
||||
endtry
|
||||
endfor
|
||||
endif
|
||||
else
|
||||
" try with specified section
|
||||
try
|
||||
let res = s:get_path(sect, a:name)
|
||||
if !empty(res)
|
||||
return res
|
||||
endif
|
||||
catch /^command error (/
|
||||
endtry
|
||||
|
||||
" try again with b:man_default_sects
|
||||
if exists('b:man_default_sects')
|
||||
let sects = split(b:man_default_sects, ',')
|
||||
for sec in sects
|
||||
try
|
||||
let res = s:get_path(sec, a:name)
|
||||
if !empty(res)
|
||||
return res
|
||||
endif
|
||||
catch /^command error (/
|
||||
endtry
|
||||
endfor
|
||||
endif
|
||||
endif
|
||||
|
||||
" if none of the above worked, we will try with no section
|
||||
try
|
||||
let res = s:get_path('', a:name)
|
||||
if !empty(res)
|
||||
return res
|
||||
endif
|
||||
catch /^command error (/
|
||||
endtry
|
||||
|
||||
" if that still didn't work, we will check for $MANSECT and try again with it
|
||||
" unset
|
||||
if !empty($MANSECT)
|
||||
try
|
||||
let MANSECT = $MANSECT
|
||||
call setenv('MANSECT', v:null)
|
||||
let res = s:get_path('', a:name)
|
||||
if !empty(res)
|
||||
return res
|
||||
endif
|
||||
catch /^command error (/
|
||||
finally
|
||||
call setenv('MANSECT', MANSECT)
|
||||
endtry
|
||||
endif
|
||||
|
||||
" finally, if that didn't work, there is no hope
|
||||
throw 'no manual entry for ' . a:name
|
||||
endfunction
|
||||
|
||||
" Extracts the name/section from the 'path/name.sect', because sometimes the actual section is
|
||||
" more specific than what we provided to `man` (try `:Man 3 App::CLI`).
|
||||
" Also on linux, name seems to be case-insensitive. So for `:Man PRIntf`, we
|
||||
" still want the name of the buffer to be 'printf'.
|
||||
function! s:extract_sect_and_name_path(path) abort
|
||||
let tail = fnamemodify(a:path, ':t')
|
||||
if a:path =~# '\.\%([glx]z\|bz2\|lzma\|Z\)$' " valid extensions
|
||||
let tail = fnamemodify(tail, ':r')
|
||||
endif
|
||||
let sect = matchstr(tail, '\.\zs[^.]\+$')
|
||||
let name = matchstr(tail, '^.\+\ze\.')
|
||||
return [sect, name]
|
||||
endfunction
|
||||
|
||||
function! s:find_man() abort
|
||||
let l:win = 1
|
||||
while l:win <= winnr('$')
|
||||
let l:buf = winbufnr(l:win)
|
||||
if getbufvar(l:buf, '&filetype', '') ==# 'man'
|
||||
execute l:win.'wincmd w'
|
||||
return 1
|
||||
endif
|
||||
let l:win += 1
|
||||
endwhile
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:error(msg) abort
|
||||
redraw
|
||||
echohl ErrorMsg
|
||||
echon 'man.vim: ' a:msg
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
" see s:extract_sect_and_name_ref on why tolower(sect)
|
||||
function! man#complete(arg_lead, cmd_line, cursor_pos) abort
|
||||
let args = split(a:cmd_line)
|
||||
let cmd_offset = index(args, 'Man')
|
||||
if cmd_offset > 0
|
||||
" Prune all arguments up to :Man itself. Otherwise modifier commands like
|
||||
" :tab, :vertical, etc. would lead to a wrong length.
|
||||
let args = args[cmd_offset:]
|
||||
endif
|
||||
let l = len(args)
|
||||
if l > 3
|
||||
return
|
||||
elseif l ==# 1
|
||||
let name = ''
|
||||
let sect = ''
|
||||
elseif a:arg_lead =~# '^[^()]\+([^()]*$'
|
||||
" cursor (|) is at ':Man printf(|' or ':Man 1 printf(|'
|
||||
" The later is is allowed because of ':Man pri<TAB>'.
|
||||
" It will offer 'priclass.d(1m)' even though section is specified as 1.
|
||||
let tmp = split(a:arg_lead, '(')
|
||||
let name = tmp[0]
|
||||
let sect = tolower(get(tmp, 1, ''))
|
||||
return s:complete(sect, '', name)
|
||||
elseif args[1] !~# '^[^()]\+$'
|
||||
" cursor (|) is at ':Man 3() |' or ':Man (3|' or ':Man 3() pri|'
|
||||
" or ':Man 3() pri |'
|
||||
return
|
||||
elseif l ==# 2
|
||||
if empty(a:arg_lead)
|
||||
" cursor (|) is at ':Man 1 |'
|
||||
let name = ''
|
||||
let sect = tolower(args[1])
|
||||
else
|
||||
" cursor (|) is at ':Man pri|'
|
||||
if a:arg_lead =~# '\/'
|
||||
" if the name is a path, complete files
|
||||
" TODO(nhooyr) why does this complete the last one automatically
|
||||
return glob(a:arg_lead.'*', 0, 1)
|
||||
endif
|
||||
let name = a:arg_lead
|
||||
let sect = ''
|
||||
endif
|
||||
elseif a:arg_lead !~# '^[^()]\+$'
|
||||
" cursor (|) is at ':Man 3 printf |' or ':Man 3 (pr)i|'
|
||||
return
|
||||
else
|
||||
" cursor (|) is at ':Man 3 pri|'
|
||||
let name = a:arg_lead
|
||||
let sect = tolower(args[1])
|
||||
endif
|
||||
return s:complete(sect, sect, name)
|
||||
endfunction
|
||||
|
||||
function! s:get_paths(sect, name, do_fallback) abort
|
||||
" callers must try-catch this, as some `man` implementations don't support `s:find_arg`
|
||||
try
|
||||
let mandirs = join(split(s:system(['man', s:find_arg]), ':\|\n'), ',')
|
||||
let paths = globpath(mandirs, 'man?/'.a:name.'*.'.a:sect.'*', 0, 1)
|
||||
try
|
||||
" Prioritize the result from verify_exists as it obeys b:man_default_sects.
|
||||
let first = s:verify_exists(a:sect, a:name)
|
||||
let paths = filter(paths, 'v:val !=# first')
|
||||
let paths = [first] + paths
|
||||
catch
|
||||
endtry
|
||||
return paths
|
||||
catch
|
||||
if !a:do_fallback
|
||||
throw v:exception
|
||||
endif
|
||||
|
||||
" Fallback to a single path, with the page we're trying to find.
|
||||
try
|
||||
return [s:verify_exists(a:sect, a:name)]
|
||||
catch
|
||||
return []
|
||||
endtry
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! s:complete(sect, psect, name) abort
|
||||
let pages = s:get_paths(a:sect, a:name, v:false)
|
||||
" We remove duplicates in case the same manpage in different languages was found.
|
||||
return uniq(sort(map(pages, 's:format_candidate(v:val, a:psect)'), 'i'))
|
||||
endfunction
|
||||
|
||||
function! s:format_candidate(path, psect) abort
|
||||
if a:path =~# '\.\%(pdf\|in\)$' " invalid extensions
|
||||
return
|
||||
endif
|
||||
let [sect, name] = s:extract_sect_and_name_path(a:path)
|
||||
if sect ==# a:psect
|
||||
return name
|
||||
elseif sect =~# a:psect.'.\+$'
|
||||
" We include the section if the user provided section is a prefix
|
||||
" of the actual section.
|
||||
return name.'('.sect.')'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Called when Nvim is invoked as $MANPAGER.
|
||||
function! man#init_pager() abort
|
||||
" https://github.com/neovim/neovim/issues/6828
|
||||
let og_modifiable = &modifiable
|
||||
setlocal modifiable
|
||||
|
||||
if getline(1) =~# '^\s*$'
|
||||
silent keepjumps 1delete _
|
||||
else
|
||||
keepjumps 1
|
||||
endif
|
||||
lua require("man").highlight_man_page()
|
||||
" Guess the ref from the heading (which is usually uppercase, so we cannot
|
||||
" know the correct casing, cf. `man glDrawArraysInstanced`).
|
||||
let ref = substitute(matchstr(getline(1), '^[^)]\+)'), ' ', '_', 'g')
|
||||
try
|
||||
let b:man_sect = s:extract_sect_and_name_ref(ref)[0]
|
||||
catch
|
||||
let b:man_sect = ''
|
||||
endtry
|
||||
if -1 == match(bufname('%'), 'man:\/\/') " Avoid duplicate buffers, E95.
|
||||
execute 'silent file man://'.tolower(fnameescape(ref))
|
||||
endif
|
||||
|
||||
call s:set_options(v:true)
|
||||
let &l:modifiable = og_modifiable
|
||||
endfunction
|
||||
|
||||
function! man#goto_tag(pattern, flags, info) abort
|
||||
let [l:sect, l:name] = s:extract_sect_and_name_ref(a:pattern)
|
||||
|
||||
let l:paths = s:get_paths(l:sect, l:name, v:true)
|
||||
let l:structured = []
|
||||
|
||||
for l:path in l:paths
|
||||
let [l:sect, l:name] = s:extract_sect_and_name_path(l:path)
|
||||
let l:structured += [{
|
||||
\ 'name': l:name,
|
||||
\ 'title': l:name . '(' . l:sect . ')'
|
||||
\ }]
|
||||
endfor
|
||||
|
||||
if &cscopetag
|
||||
" return only a single entry so we work well with :cstag (#11675)
|
||||
let l:structured = l:structured[:0]
|
||||
endif
|
||||
|
||||
return map(l:structured, {
|
||||
\ _, entry -> {
|
||||
\ 'name': entry.name,
|
||||
\ 'filename': 'man://' . entry.title,
|
||||
\ 'cmd': '1'
|
||||
\ }
|
||||
\ })
|
||||
endfunction
|
||||
|
||||
call man#init()
|