Compare commits
145 Commits
release-0.
...
v0.7.2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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-0.21p1
|
||||||
|
- gettext-tools-0.21p1
|
||||||
|
- gmake
|
||||||
|
- libtool
|
||||||
|
- ninja-1.10.2p0
|
||||||
|
- 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
|
BeforeElse: false
|
||||||
IndentBraces: false
|
IndentBraces: false
|
||||||
PointerAlignment: Right
|
PointerAlignment: Right
|
||||||
SortIncludes: true
|
SortIncludes: false
|
||||||
Cpp11BracedListStyle: 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
|
tab_width = 8
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
charset = utf-8
|
||||||
|
|
||||||
[*.{c,h,in,lua}]
|
[*.{c,h,in,lua}]
|
||||||
max_line_length = 100
|
max_line_length = 100
|
||||||
|
@@ -47,16 +47,7 @@ a68faed02dc8e37b8f10da14dc02e33e6ed93947
|
|||||||
ee031eb5256bb83e0d6add2bae6fd943a4186ffe
|
ee031eb5256bb83e0d6add2bae6fd943a4186ffe
|
||||||
69e11b58b4db0952f11a5ff85aa7150b5f5b8db8
|
69e11b58b4db0952f11a5ff85aa7150b5f5b8db8
|
||||||
271bb32855853b011fceaf0ad2f829bce66b2a19
|
271bb32855853b011fceaf0ad2f829bce66b2a19
|
||||||
aefdc6783cb77f09786542c90901a9e7120bea42
|
|
||||||
aa4f9c5341f5280f16cce0630ea54b84eef717b3
|
|
||||||
0adc66171a355a12494d87ebb767d509540c7ef9
|
|
||||||
93f24403f8cc760ff47979c596976b53a8b16358
|
|
||||||
1ffd527c837fb2465c9659273bbe5447a1352db2
|
|
||||||
2498e9feb025361576603a0101c86393d211e31e
|
|
||||||
|
|
||||||
# typos
|
# typos
|
||||||
d238b8f6003d34cae7f65ff7585b48a2cd9449fb
|
d238b8f6003d34cae7f65ff7585b48a2cd9449fb
|
||||||
4547137aaff32b20172870a549d3a28a3c7adf1c
|
4547137aaff32b20172870a549d3a28a3c7adf1c
|
||||||
|
|
||||||
# generated docs
|
|
||||||
ea333badd24f691c753d8048f911d1db349bc2cd
|
|
||||||
|
12
.gitattributes
vendored
@@ -1,15 +1,5 @@
|
|||||||
*.h.in linguist-language=C
|
*.h 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
|
|
||||||
|
|
||||||
src/nvim/testdir/test42.in diff
|
src/nvim/testdir/test42.in diff
|
||||||
|
|
||||||
.github/ export-ignore
|
.github/ export-ignore
|
||||||
.travis.yml export-ignore
|
.travis.yml export-ignore
|
||||||
codecov.yml export-ignore
|
codecov.yml export-ignore
|
||||||
|
6
.github/labeler.yml
vendored
@@ -13,13 +13,12 @@
|
|||||||
- src/nvim/lua/treesitter.*
|
- src/nvim/lua/treesitter.*
|
||||||
- runtime/lua/vim/treesitter.lua
|
- runtime/lua/vim/treesitter.lua
|
||||||
- runtime/lua/vim/treesitter/*
|
- runtime/lua/vim/treesitter/*
|
||||||
- runtime/queries/**/*
|
|
||||||
|
|
||||||
"diagnostic":
|
"diagnostic":
|
||||||
- runtime/lua/vim/diagnostic.lua
|
- runtime/lua/vim/diagnostic.lua
|
||||||
|
|
||||||
"dependencies":
|
"dependencies":
|
||||||
- cmake.deps/**/*
|
- third-party/**/*
|
||||||
|
|
||||||
"spell":
|
"spell":
|
||||||
- src/nvim/spell*
|
- src/nvim/spell*
|
||||||
@@ -28,6 +27,8 @@
|
|||||||
- src/nvim/terminal.*
|
- src/nvim/terminal.*
|
||||||
|
|
||||||
"column":
|
"column":
|
||||||
|
- src/nvim/mark.h
|
||||||
|
- src/nvim/mark.c
|
||||||
- src/nvim/sign*
|
- src/nvim/sign*
|
||||||
|
|
||||||
"folds":
|
"folds":
|
||||||
@@ -38,7 +39,6 @@
|
|||||||
|
|
||||||
"documentation":
|
"documentation":
|
||||||
- all: ["runtime/doc/*"]
|
- all: ["runtime/doc/*"]
|
||||||
- all: ["**/*.md"]
|
|
||||||
|
|
||||||
"clipboard":
|
"clipboard":
|
||||||
- runtime/autoload/provider/clipboard.vim
|
- runtime/autoload/provider/clipboard.vim
|
||||||
|
11
.github/scripts/reviews.js
vendored
@@ -9,16 +9,15 @@ module.exports = async ({github, context}) => {
|
|||||||
const reviewers = new Set()
|
const reviewers = new Set()
|
||||||
if (labels.includes('api')) {
|
if (labels.includes('api')) {
|
||||||
reviewers.add("bfredl")
|
reviewers.add("bfredl")
|
||||||
|
reviewers.add("gpanders")
|
||||||
reviewers.add("muniter")
|
reviewers.add("muniter")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (labels.includes('build')) {
|
if (labels.includes('build')) {
|
||||||
reviewers.add("jamessan")
|
reviewers.add("jamessan")
|
||||||
reviewers.add("justinmk")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (labels.includes('ci')) {
|
if (labels.includes('ci')) {
|
||||||
reviewers.add("dundargoc")
|
|
||||||
reviewers.add("jamessan")
|
reviewers.add("jamessan")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,14 +54,18 @@ module.exports = async ({github, context}) => {
|
|||||||
reviewers.add("gpanders")
|
reviewers.add("gpanders")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (labels.includes('gui')) {
|
||||||
|
reviewers.add("glacambre")
|
||||||
|
reviewers.add("smolck")
|
||||||
|
}
|
||||||
|
|
||||||
if (labels.includes('lsp')) {
|
if (labels.includes('lsp')) {
|
||||||
reviewers.add("mfussenegger")
|
reviewers.add("mfussenegger")
|
||||||
reviewers.add("glepnir")
|
reviewers.add("mjlbach")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (labels.includes('treesitter')) {
|
if (labels.includes('treesitter')) {
|
||||||
reviewers.add("bfredl")
|
reviewers.add("bfredl")
|
||||||
reviewers.add("clason")
|
|
||||||
reviewers.add("vigoux")
|
reviewers.add("vigoux")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
.github/workflows/api-docs-check.yml
vendored
@@ -1,6 +1,7 @@
|
|||||||
name: Missing API docs
|
name: Missing API docs
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
branches-ignore:
|
branches-ignore:
|
||||||
- 'marvim/api-doc-update**'
|
- 'marvim/api-doc-update**'
|
||||||
paths:
|
paths:
|
||||||
@@ -10,6 +11,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
call-regen-api-docs:
|
call-regen-api-docs:
|
||||||
|
if: github.event.pull_request.draft == false
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
16
.github/workflows/api-docs.yml
vendored
@@ -21,24 +21,23 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
regen-api-docs:
|
regen-api-docs:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-20.04
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
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
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
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
|
- name: Setup git config
|
||||||
run: |
|
run: |
|
||||||
@@ -52,14 +51,15 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git checkout -b ${DOC_BRANCH}
|
git checkout -b ${DOC_BRANCH}
|
||||||
python3 scripts/gen_vimdoc.py
|
python3 scripts/gen_vimdoc.py
|
||||||
printf 'UPDATED_DOCS=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
|
printf '::set-output name=UPDATED_DOCS::%s\n' $([ -z "$(git diff)" ]; echo $?)
|
||||||
|
|
||||||
- name: FAIL, PR has not committed doc changes
|
- name: FAIL, PR has not committed doc changes
|
||||||
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && inputs.check_only }}
|
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && inputs.check_only }}
|
||||||
run: |
|
run: |
|
||||||
echo "Job failed, run ./scripts/gen_vimdoc.py and commit your doc changes"
|
echo "Job failed, run ./scripts/gen_vimdoc.py and commit your doc changes"
|
||||||
echo "The doc generation produces the following changes:"
|
echo "The doc generation produces the following changes:"
|
||||||
git diff --color --exit-code
|
git --no-pager diff
|
||||||
|
exit 1
|
||||||
|
|
||||||
- name: Automatic PR
|
- name: Automatic PR
|
||||||
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && !inputs.check_only }}
|
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && !inputs.check_only }}
|
||||||
|
10
.github/workflows/backport.yml
vendored
@@ -2,6 +2,8 @@ name: Backport
|
|||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [closed, labeled]
|
types: [closed, labeled]
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
jobs:
|
jobs:
|
||||||
backport:
|
backport:
|
||||||
permissions:
|
permissions:
|
||||||
@@ -12,16 +14,20 @@ jobs:
|
|||||||
github.repository_owner == 'neovim' && (
|
github.repository_owner == 'neovim' && (
|
||||||
github.event_name == 'pull_request_target' &&
|
github.event_name == 'pull_request_target' &&
|
||||||
github.event.pull_request.merged
|
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
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
# required to find all branches
|
# required to find all branches
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Create backport PRs
|
- name: Create backport PRs
|
||||||
uses: zeebe-io/backport-action@v0.0.8
|
uses: zeebe-io/backport-action@v0.0.7
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
github_workspace: ${{ github.workspace }}
|
github_workspace: ${{ github.workspace }}
|
||||||
|
215
.github/workflows/ci.yml
vendored
@@ -5,6 +5,7 @@ on:
|
|||||||
- 'master'
|
- 'master'
|
||||||
- 'release-[0-9]+.[0-9]+'
|
- 'release-[0-9]+.[0-9]+'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
- 'release-[0-9]+.[0-9]+'
|
- 'release-[0-9]+.[0-9]+'
|
||||||
@@ -18,136 +19,18 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
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
|
# 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
|
# system dependencies instead of bundled dependencies. This is to make sure
|
||||||
# we are able to build neovim without pigeonholing ourselves into specifics
|
# we are able to build neovim without pigeonholing ourselves into specifics
|
||||||
# of the bundled dependencies.
|
# 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
|
runs-on: ubuntu-20.04
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
env:
|
env:
|
||||||
CC: gcc
|
CC: gcc
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setup common environment variables
|
- name: Setup common environment variables
|
||||||
run: ./.github/workflows/env.sh lint
|
run: ./.github/workflows/env.sh lint
|
||||||
@@ -160,8 +43,11 @@ jobs:
|
|||||||
autoconf \
|
autoconf \
|
||||||
automake \
|
automake \
|
||||||
build-essential \
|
build-essential \
|
||||||
|
ccache \
|
||||||
cmake \
|
cmake \
|
||||||
|
flake8 \
|
||||||
gettext \
|
gettext \
|
||||||
|
gperf \
|
||||||
libluajit-5.1-dev \
|
libluajit-5.1-dev \
|
||||||
libmsgpack-dev \
|
libmsgpack-dev \
|
||||||
libtermkey-dev \
|
libtermkey-dev \
|
||||||
@@ -183,25 +69,38 @@ jobs:
|
|||||||
pkg-config
|
pkg-config
|
||||||
|
|
||||||
- name: Cache artifacts
|
- name: Cache artifacts
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
${{ env.CACHE_NVIM_DEPS_DIR }}
|
${{ 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
|
run: ./ci/before_script.sh
|
||||||
|
|
||||||
- name: Build nvim
|
- name: Build nvim
|
||||||
run: ./ci/run_tests.sh build_nvim
|
run: ./ci/run_tests.sh build_nvim
|
||||||
|
|
||||||
- if: "!cancelled()"
|
- if: "!cancelled()"
|
||||||
name: lintc
|
name: clint-full
|
||||||
run: make lintc
|
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()"
|
- if: "!cancelled()"
|
||||||
name: check-single-includes
|
name: check-single-includes
|
||||||
run: make check-single-includes
|
run: ./ci/run_lint.sh check-single-includes
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
run: ./ci/before_cache.sh
|
run: ./ci/before_cache.sh
|
||||||
@@ -220,20 +119,18 @@ jobs:
|
|||||||
cc: clang-13
|
cc: clang-13
|
||||||
runner: ubuntu-20.04
|
runner: ubuntu-20.04
|
||||||
os: linux
|
os: linux
|
||||||
- flavor: uchar
|
|
||||||
cc: gcc
|
|
||||||
runner: ubuntu-20.04
|
|
||||||
os: linux
|
|
||||||
- cc: clang
|
- cc: clang
|
||||||
runner: macos-11
|
runner: macos-10.15
|
||||||
|
os: osx
|
||||||
|
- cc: clang
|
||||||
|
runner: macos-11.0
|
||||||
os: osx
|
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.
|
# 1. Check that the tests pass with PUC Lua instead of LuaJIT.
|
||||||
# 2. Use as oldest/minimum versions of dependencies/build tools we
|
# 2. Use as oldest/minimum versions of dependencies/build tools we
|
||||||
# still explicitly support so we don't accidentally rely on
|
# still explicitly support so we don't accidentally rely on
|
||||||
# features that is only available on later versions.
|
# features that is only available on later versions.
|
||||||
# 3. No treesitter parsers installed.
|
|
||||||
- flavor: functionaltest-lua
|
- flavor: functionaltest-lua
|
||||||
cc: gcc
|
cc: gcc
|
||||||
runner: ubuntu-20.04
|
runner: ubuntu-20.04
|
||||||
@@ -241,11 +138,12 @@ jobs:
|
|||||||
cmake: minimum_required
|
cmake: minimum_required
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
|
if: github.event.pull_request.draft == false
|
||||||
env:
|
env:
|
||||||
CC: ${{ matrix.cc }}
|
CC: ${{ matrix.cc }}
|
||||||
CI_OS_NAME: ${{ matrix.os }}
|
CI_OS_NAME: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setup common environment variables
|
- name: Setup common environment variables
|
||||||
run: ./.github/workflows/env.sh ${{ matrix.flavor }}
|
run: ./.github/workflows/env.sh ${{ matrix.flavor }}
|
||||||
@@ -254,7 +152,7 @@ jobs:
|
|||||||
if: matrix.os == 'linux'
|
if: matrix.os == 'linux'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
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
|
- name: Install minimum required version of cmake
|
||||||
if: matrix.cmake == 'minimum_required'
|
if: matrix.cmake == 'minimum_required'
|
||||||
@@ -286,19 +184,20 @@ jobs:
|
|||||||
if: matrix.os == 'osx'
|
if: matrix.os == 'osx'
|
||||||
run: |
|
run: |
|
||||||
brew update --quiet
|
brew update --quiet
|
||||||
brew install automake cpanminus ninja
|
brew install automake ccache cpanminus ninja
|
||||||
|
|
||||||
- name: Setup interpreter packages
|
- name: Setup interpreter packages
|
||||||
run: ./ci/install.sh
|
run: ./ci/install.sh
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
${{ env.CACHE_NVIM_DEPS_DIR }}
|
${{ 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
|
run: ./ci/before_script.sh
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
@@ -326,33 +225,25 @@ jobs:
|
|||||||
windows:
|
windows:
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
|
if: github.event.pull_request.draft == false
|
||||||
env:
|
env:
|
||||||
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
||||||
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', 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:
|
with:
|
||||||
path: ${{ env.DEPS_BUILD_DIR }}
|
path: ${{ env.DEPS_BUILD_DIR }}
|
||||||
key: ${{ hashFiles('cmake.deps\**') }}
|
key: ${{ matrix.config }}-${{ hashFiles('third-party\**') }}
|
||||||
|
|
||||||
- name: Build deps
|
- name: Run CI
|
||||||
run: .\ci\build.ps1 -BuildDeps
|
run: powershell ci\build.ps1
|
||||||
|
env:
|
||||||
- name: Build nvim
|
CONFIGURATION: ${{ matrix.config }}
|
||||||
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
|
|
||||||
|
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
|
runs-on: ubuntu-latest
|
||||||
if: github.event.pull_request.draft == false
|
if: github.event.pull_request.draft == false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
8
.github/workflows/coverity-scan.yml
vendored
@@ -1,19 +1,19 @@
|
|||||||
name: Coverity
|
name: Coverity
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '10 0 * * *' # Run every day at 00:10
|
- cron: '0 10 * * 1' # Run every Monday at 00:10
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
scan:
|
scan:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
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
|
- name: Download Coverity
|
||||||
run: |
|
run: |
|
||||||
|
16
.github/workflows/env.sh
vendored
@@ -8,6 +8,8 @@ $HOME/.local/bin
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<EOF >> "$GITHUB_ENV"
|
cat <<EOF >> "$GITHUB_ENV"
|
||||||
|
CACHE_ENABLE=true
|
||||||
|
CI_TARGET=tests
|
||||||
CI_BUILD_DIR=$GITHUB_WORKSPACE
|
CI_BUILD_DIR=$GITHUB_WORKSPACE
|
||||||
BUILD_DIR=$GITHUB_WORKSPACE/build
|
BUILD_DIR=$GITHUB_WORKSPACE/build
|
||||||
DEPS_BUILD_DIR=$HOME/nvim-deps
|
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
|
VALGRIND_LOG=$GITHUB_WORKSPACE/build/log/valgrind-%p.log
|
||||||
CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps
|
CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps
|
||||||
CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker
|
CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker
|
||||||
CACHE_UNCRUSTIFY=$HOME/.cache/uncrustify
|
CCACHE_BASEDIR=$GITHUB_WORKSPACE
|
||||||
UNCRUSTIFY_VERSION=uncrustify-0.75.0
|
CCACHE_COMPRESS=1
|
||||||
|
CCACHE_SLOPPINESS=time_macros,file_macro
|
||||||
|
CCACHE_DIR=$HOME/.ccache
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
DEPS_CMAKE_FLAGS=
|
DEPS_CMAKE_FLAGS=-DUSE_BUNDLED_GPERF=OFF
|
||||||
FUNCTIONALTEST=functionaltest
|
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"
|
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"
|
cat <<EOF >> "$GITHUB_ENV"
|
||||||
TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
|
TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
|
||||||
CLANG_SANITIZER=TSAN
|
CLANG_SANITIZER=TSAN
|
||||||
EOF
|
|
||||||
;;
|
|
||||||
uchar)
|
|
||||||
cat <<EOF >> "$GITHUB_ENV"
|
|
||||||
BUILD_UCHAR=1
|
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
lint)
|
lint)
|
||||||
@@ -52,6 +51,7 @@ EOF
|
|||||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUV=ON"
|
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUV=ON"
|
||||||
cat <<EOF >> "$GITHUB_ENV"
|
cat <<EOF >> "$GITHUB_ENV"
|
||||||
USE_BUNDLED=OFF
|
USE_BUNDLED=OFF
|
||||||
|
CI_TARGET=lint
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
functionaltest-lua)
|
functionaltest-lua)
|
||||||
|
4
.github/workflows/labeler.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/labeler@v4
|
- uses: actions/labeler@main
|
||||||
with:
|
with:
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
sync-labels: ""
|
sync-labels: ""
|
||||||
@@ -40,7 +40,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
- name: 'Request reviewers'
|
- name: 'Request reviewers'
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
|
5
.github/workflows/notes.md
vendored
@@ -21,9 +21,8 @@ ${NVIM_VERSION}
|
|||||||
### macOS
|
### macOS
|
||||||
|
|
||||||
1. Download **nvim-macos.tar.gz**
|
1. Download **nvim-macos.tar.gz**
|
||||||
2. Run `xattr -c ./nvim-macos.tar.gz` (to avoid "unknown developer" warning)
|
2. Extract: `tar xzvf nvim-macos.tar.gz`
|
||||||
3. Extract: `tar xzvf nvim-macos.tar.gz`
|
3. Run `./nvim-macos/bin/nvim`
|
||||||
4. Run `./nvim-macos/bin/nvim`
|
|
||||||
|
|
||||||
### Linux (x64)
|
### Linux (x64)
|
||||||
|
|
||||||
|
147
.github/workflows/release.yml
vendored
@@ -13,21 +13,21 @@ on:
|
|||||||
- v[0-9]+.[0-9]+.[0-9]+
|
- v[0-9]+.[0-9]+.[0-9]+
|
||||||
|
|
||||||
# Build on the oldest supported images, so we have broader compatibility
|
# 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:
|
jobs:
|
||||||
linux:
|
linux:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-18.04
|
||||||
outputs:
|
outputs:
|
||||||
version: ${{ steps.build.outputs.version }}
|
version: ${{ steps.build.outputs.version }}
|
||||||
release: ${{ steps.build.outputs.release }}
|
release: ${{ steps.build.outputs.release }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
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')
|
- 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
|
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')
|
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||||
@@ -35,62 +35,52 @@ jobs:
|
|||||||
- name: Build release
|
- name: Build release
|
||||||
id: build
|
id: build
|
||||||
run: |
|
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 'version<<END\n' >> $GITHUB_OUTPUT
|
printf '::set-output name=version::%s\n' "$(./build/bin/nvim --version | head -n 3 | sed -z 's/\n/%0A/g')"
|
||||||
./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT
|
printf '::set-output name=release::%s\n' "$(./build/bin/nvim --version | head -n 1)"
|
||||||
printf 'END\n' >> $GITHUB_OUTPUT
|
|
||||||
printf 'release=%s\n' "$(./build/bin/nvim --version | head -n 1)" >> $GITHUB_OUTPUT
|
|
||||||
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install
|
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install
|
||||||
cd "$GITHUB_WORKSPACE/build/"
|
cd "$GITHUB_WORKSPACE/build/"
|
||||||
cpack -C $NVIM_BUILD_TYPE
|
cpack -C $NVIM_BUILD_TYPE
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: nvim-linux64
|
name: nvim-linux64
|
||||||
path: |
|
path: build/nvim-linux64.tar.gz
|
||||||
build/nvim-linux64.tar.gz
|
retention-days: 1
|
||||||
build/nvim-linux64.deb
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: nvim-linux64
|
||||||
|
path: build/nvim-linux64.deb
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
appimage:
|
appimage:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-18.04
|
||||||
container:
|
|
||||||
image: ubuntu:18.04
|
|
||||||
options: --privileged # Privileged mode is needed to load fuse module.
|
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare container
|
- uses: actions/checkout@v2
|
||||||
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
|
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
sudo apt-get update
|
||||||
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')
|
- 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')
|
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||||
run: CC=gcc-10 make appimage-nightly
|
run: CC=gcc-11 make appimage-nightly
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: appimage
|
name: appimage
|
||||||
path: |
|
path: build/bin/nvim.appimage
|
||||||
build/bin/nvim.appimage
|
retention-days: 1
|
||||||
build/bin/nvim.appimage.zsync
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: appimage
|
||||||
|
path: build/bin/nvim.appimage.zsync
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
macOS:
|
macOS:
|
||||||
runs-on: macos-11
|
runs-on: macos-11
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Install brew packages
|
- name: Install brew packages
|
||||||
@@ -118,7 +108,6 @@ jobs:
|
|||||||
brew uninstall $(brew uses --installed --recursive gettext)
|
brew uninstall $(brew uses --installed --recursive gettext)
|
||||||
brew unlink gettext
|
brew unlink gettext
|
||||||
ln -sf "$(brew --prefix)/opt/$(readlink "${GETTEXT_PREFIX}")/bin"/* /usr/local/bin/
|
ln -sf "$(brew --prefix)/opt/$(readlink "${GETTEXT_PREFIX}")/bin"/* /usr/local/bin/
|
||||||
ln -sf "$(brew --prefix)/opt/$(readlink "${GETTEXT_PREFIX}")/include"/* /usr/local/include/
|
|
||||||
rm -f "$GETTEXT_PREFIX"
|
rm -f "$GETTEXT_PREFIX"
|
||||||
- name: Build release
|
- name: Build release
|
||||||
run: |
|
run: |
|
||||||
@@ -126,19 +115,16 @@ jobs:
|
|||||||
OSX_FLAGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_ARCHITECTURES=arm64\;x86_64"
|
OSX_FLAGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_ARCHITECTURES=arm64\;x86_64"
|
||||||
make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \
|
make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \
|
||||||
CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH= $OSX_FLAGS" \
|
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
|
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-macos" install
|
||||||
cd "$GITHUB_WORKSPACE/build/"
|
- name: Create package
|
||||||
# Make sure we build everything for M1 as well
|
run: |
|
||||||
for macho in bin/* lib/nvim/parser/*.so
|
cd "$GITHUB_WORKSPACE/build/release"
|
||||||
do
|
tar cfz nvim-macos.tar.gz nvim-macos
|
||||||
lipo -info "$macho" | grep -q arm64 || exit 1
|
|
||||||
done
|
|
||||||
cpack -C "$NVIM_BUILD_TYPE"
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: nvim-macos
|
name: nvim-macos
|
||||||
path: build/nvim-macos.tar.gz
|
path: build/release/nvim-macos.tar.gz
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
@@ -146,7 +132,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
||||||
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
||||||
CMAKE_BUILD_TYPE: "RelWithDebInfo"
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
@@ -154,38 +139,41 @@ jobs:
|
|||||||
archive: nvim-win64
|
archive: nvim-win64
|
||||||
name: windows (${{ matrix.config }})
|
name: windows (${{ matrix.config }})
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Build deps
|
- run: powershell ci\build.ps1 -NoTests
|
||||||
run: .\ci\build.ps1 -BuildDeps
|
env:
|
||||||
- name: build package
|
CONFIGURATION: ${{ matrix.config }}
|
||||||
run: .\ci\build.ps1 -Package
|
- uses: actions/upload-artifact@v2
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.archive }}
|
name: ${{ matrix.archive }}
|
||||||
path: |
|
path: build/${{ matrix.archive }}.zip
|
||||||
build/${{ matrix.archive }}.msi
|
retention-days: 1
|
||||||
build/${{ matrix.archive }}.zip
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.archive }}
|
||||||
|
path: build/${{ matrix.archive }}.msi
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
needs: [linux, appimage, macOS, windows]
|
needs: [linux, appimage, macOS, windows]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
env:
|
env:
|
||||||
GH_REPO: ${{ github.repository }}
|
GH_REPO: ${{ github.repository }}
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
# Must perform checkout first, since it deletes the target directory
|
# Must perform checkout first, since it deletes the target directory
|
||||||
# before running, and would therefore delete the downloaded artifacts
|
# 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
|
- 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'
|
- if: github.event_name == 'workflow_dispatch'
|
||||||
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
||||||
@@ -196,12 +184,16 @@ jobs:
|
|||||||
TAG_NAME=${{ github.ref }}
|
TAG_NAME=${{ github.ref }}
|
||||||
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
|
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
|
||||||
- if: env.TAG_NAME == 'nightly'
|
- if: env.TAG_NAME == 'nightly'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
(echo 'SUBJECT=Nvim development (prerelease) build';
|
(echo 'SUBJECT=Nvim development (prerelease) build';
|
||||||
echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV
|
echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV
|
||||||
gh release delete nightly --yes || true
|
gh release delete nightly --yes || true
|
||||||
git push origin :nightly || true
|
git push origin :nightly || true
|
||||||
- if: env.TAG_NAME != 'nightly'
|
- if: env.TAG_NAME != 'nightly'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
(echo 'SUBJECT=Nvim release build';
|
(echo 'SUBJECT=Nvim release build';
|
||||||
echo 'PRERELEASE=') >> $GITHUB_ENV
|
echo 'PRERELEASE=') >> $GITHUB_ENV
|
||||||
@@ -240,6 +232,7 @@ jobs:
|
|||||||
echo "SHA_WIN_64_MSI=$(cat nvim-win64.msi.sha256sum)" >> $GITHUB_ENV
|
echo "SHA_WIN_64_MSI=$(cat nvim-win64.msi.sha256sum)" >> $GITHUB_ENV
|
||||||
- name: Publish release
|
- name: Publish release
|
||||||
env:
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
NVIM_VERSION: ${{ needs.linux.outputs.version }}
|
NVIM_VERSION: ${{ needs.linux.outputs.version }}
|
||||||
DEBUG: api
|
DEBUG: api
|
||||||
run: |
|
run: |
|
||||||
@@ -248,31 +241,3 @@ jobs:
|
|||||||
if [ "$TAG_NAME" != "nightly" ]; then
|
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/*
|
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
||||||
fi
|
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@v1
|
|
||||||
with:
|
|
||||||
identifier: Neovim.Neovim
|
|
||||||
release-tag: ${{ github.event.inputs.tag_name || github.ref_name }}
|
|
||||||
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
|
|
||||||
"version=$VERSION" >> $env:GITHUB_OUTPUT
|
|
||||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
|
||||||
name: Publish nightly
|
|
||||||
uses: vedantmgoyal2009/winget-releaser@v1
|
|
||||||
with:
|
|
||||||
identifier: Neovim.Neovim.Nightly
|
|
||||||
version: ${{ steps.get-version.outputs.version }}
|
|
||||||
release-tag: nightly
|
|
||||||
token: ${{ secrets.WINGET_TOKEN }}
|
|
||||||
|
@@ -8,7 +8,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
- name: 'Remove reviewers'
|
- name: 'Remove reviewers'
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
|
2
.github/workflows/reviews.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
- name: 'Request reviewers'
|
- name: 'Request reviewers'
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
|
10
.github/workflows/vim-patches.yml
vendored
@@ -5,7 +5,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-vim-patches:
|
update-vim-patches:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
@@ -14,11 +14,11 @@ jobs:
|
|||||||
VERSION_BRANCH: marvim/ci-version-update
|
VERSION_BRANCH: marvim/ci-version-update
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
repository: vim/vim
|
repository: vim/vim
|
||||||
path: ${{ env.VIM_SOURCE_DIR }}
|
path: ${{ env.VIM_SOURCE_DIR }}
|
||||||
@@ -40,8 +40,8 @@ jobs:
|
|||||||
id: update-version
|
id: update-version
|
||||||
run: |
|
run: |
|
||||||
git checkout -b ${VERSION_BRANCH}
|
git checkout -b ${VERSION_BRANCH}
|
||||||
nvim -V1 -es -i NONE +'luafile scripts/vimpatch.lua' +q
|
nvim -i NONE -u NONE --headless +'luafile scripts/vimpatch.lua' +q
|
||||||
printf 'NEW_PATCHES=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
|
printf '::set-output name=NEW_PATCHES::%s\n' $([ -z "$(git diff)" ]; echo $?)
|
||||||
|
|
||||||
- name: Automatic PR
|
- name: Automatic PR
|
||||||
if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }}
|
if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }}
|
||||||
|
2
.gitignore
vendored
@@ -73,5 +73,3 @@ tags
|
|||||||
|
|
||||||
# vim patches
|
# vim patches
|
||||||
/vim-*.patch
|
/vim-*.patch
|
||||||
|
|
||||||
/CMakeUserPresets.json
|
|
||||||
|
@@ -28,13 +28,6 @@ read_globals = {
|
|||||||
|
|
||||||
globals = {
|
globals = {
|
||||||
"vim.g",
|
"vim.g",
|
||||||
"vim.b",
|
|
||||||
"vim.w",
|
|
||||||
"vim.o",
|
|
||||||
"vim.bo",
|
|
||||||
"vim.wo",
|
|
||||||
"vim.go",
|
|
||||||
"vim.env"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exclude_files = {
|
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
|
BK1603 <chouhan.shreyansh2702@gmail.com> Shreyansh Chouhan
|
||||||
Billy Su <g4691821@gmail.com> Billy SU
|
Billy Su <g4691821@gmail.com> Billy SU
|
||||||
Billy Vong <billyvg@gmail.com> <billyvg@users.noreply.github.com>
|
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>
|
Carlos Hernandez <carlos@techbyte.ca> <hurricanehrndz@users.noreply.github.com>
|
||||||
Chris Kipp <ckipp@pm.me> ckipp01
|
Chris Kipp <ckipp@pm.me> ckipp01
|
||||||
Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de>
|
Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de>
|
||||||
Cédric Barreteau <> <cbarrete@users.noreply.github.com>
|
Cédric Barreteau <> <cbarrete@users.noreply.github.com>
|
||||||
Dan Aloni <alonid@gmail.com> <dan@kernelim.com>
|
Dan Aloni <alonid@gmail.com> <dan@kernelim.com>
|
||||||
Daniel Hahler <git@thequod.de> <github@thequod.de>
|
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
|
Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima
|
||||||
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
|
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
|
||||||
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
|
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>
|
Jurica Bradaric <jbradaric@gmail.com> <jurica.bradaric@avl.com>
|
||||||
KillTheMule <KillTheMule@users.noreply.github.com> <github@pipsfrank.de>
|
KillTheMule <KillTheMule@users.noreply.github.com> <github@pipsfrank.de>
|
||||||
Kwon-Young Choi <kwon-young.choi@hotmail.fr> Kwon-Young
|
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@posteo.de>
|
||||||
Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com>
|
Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com>
|
||||||
Marco Hinz <mh.codebro@gmail.com> <mh.codebro+github@gmail.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>
|
Steven Sojka <steelsojka@gmail.com> <steelsojka@users.noreply.github.com>
|
||||||
TJ DeVries <devries.timothyj@gmail.com> <timothydvrs1234@gmail.com>
|
TJ DeVries <devries.timothyj@gmail.com> <timothydvrs1234@gmail.com>
|
||||||
Thomas Fehér <thomas.feher@yahoo.de> <thomasfeher@web.de>
|
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> UTkarsh Maheshwari
|
||||||
Utkarsh Maheshwari <utkarshme96@gmail.com> <UtkarshME96@gmail.com>
|
Utkarsh Maheshwari <utkarshme96@gmail.com> <UtkarshME96@gmail.com>
|
||||||
VVKot <volodymyr.kot.ua@gmail.com> Volodymyr Kot
|
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
|
196
CMakeLists.txt
@@ -1,12 +1,17 @@
|
|||||||
# CMAKE REFERENCE
|
# CMAKE REFERENCE
|
||||||
# intro: https://codingnest.com/basic-cmake/
|
# intro: https://codingnest.com/basic-cmake/
|
||||||
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
|
# 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.
|
# Version should match the tested CMAKE_URL in .github/workflows/ci.yml.
|
||||||
cmake_minimum_required(VERSION 3.10)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
project(nvim C)
|
project(nvim C)
|
||||||
|
|
||||||
|
if(POLICY CMP0065)
|
||||||
|
cmake_policy(SET CMP0065 NEW)
|
||||||
|
endif()
|
||||||
|
if(POLICY CMP0060)
|
||||||
|
cmake_policy(SET CMP0060 NEW)
|
||||||
|
endif()
|
||||||
if(POLICY CMP0075)
|
if(POLICY CMP0075)
|
||||||
cmake_policy(SET CMP0075 NEW)
|
cmake_policy(SET CMP0075 NEW)
|
||||||
endif()
|
endif()
|
||||||
@@ -16,9 +21,6 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
|||||||
|
|
||||||
# We don't support building in-tree.
|
# We don't support building in-tree.
|
||||||
include(PreventInTreeBuilds)
|
include(PreventInTreeBuilds)
|
||||||
include(Util)
|
|
||||||
|
|
||||||
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches)
|
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
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
|
# 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
|
# *contain* system include paths. To avoid this, we prefix what would be
|
||||||
# "/usr/include" as "/_usr/include".
|
# "/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.
|
# else clause following here.
|
||||||
# https://github.com/neovim/neovim/pull/14745#issuecomment-860201794
|
# https://github.com/neovim/neovim/pull/14745#issuecomment-860201794
|
||||||
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/_usr" CACHE PATH "Path prefix for finding dependencies")
|
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_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
|
||||||
-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
|
-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
|
||||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||||
${PROJECT_SOURCE_DIR}/cmake.deps
|
${PROJECT_SOURCE_DIR}/third-party
|
||||||
WORKING_DIRECTORY ${DEPS_BUILD_DIR})
|
WORKING_DIRECTORY ${DEPS_BUILD_DIR})
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${CMAKE_COMMAND} --build ${DEPS_BUILD_DIR}
|
COMMAND ${CMAKE_COMMAND} --build ${DEPS_BUILD_DIR}
|
||||||
@@ -84,20 +86,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|||||||
# them be included as one of the first places to look for dependencies.
|
# them be included as one of the first places to look for dependencies.
|
||||||
list(APPEND CMAKE_PREFIX_PATH /sw /opt/local)
|
list(APPEND CMAKE_PREFIX_PATH /sw /opt/local)
|
||||||
|
|
||||||
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
|
|
||||||
# fall back to local system version. Needs to be done both here and in cmake.deps.
|
|
||||||
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
|
||||||
execute_process(COMMAND sw_vers -productVersion
|
|
||||||
OUTPUT_VARIABLE MACOS_VERSION
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
|
|
||||||
endif()
|
|
||||||
message("Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
|
||||||
|
|
||||||
# Work around some old, broken detection by CMake for knowing when to use the
|
# 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
|
# isystem flag. Apple's compilers have supported this for quite some time
|
||||||
# now.
|
# now.
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
|
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -122,22 +114,32 @@ endif()
|
|||||||
|
|
||||||
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
|
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)
|
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
set(DEBUG 1)
|
set(DEBUG 1)
|
||||||
else()
|
else()
|
||||||
set(DEBUG 0)
|
set(DEBUG 0)
|
||||||
endif()
|
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
|
# 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`.
|
# version string, else they are combined with the result of `git describe`.
|
||||||
set(NVIM_VERSION_MAJOR 0)
|
set(NVIM_VERSION_MAJOR 0)
|
||||||
set(NVIM_VERSION_MINOR 8)
|
set(NVIM_VERSION_MINOR 7)
|
||||||
set(NVIM_VERSION_PATCH 4)
|
set(NVIM_VERSION_PATCH 2)
|
||||||
set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers
|
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||||
|
|
||||||
# API level
|
# 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_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
||||||
set(NVIM_API_PRERELEASE false)
|
set(NVIM_API_PRERELEASE false)
|
||||||
|
|
||||||
@@ -171,7 +173,7 @@ if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
|
|||||||
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
check_c_compiler_flag(-Og HAS_OG_FLAG)
|
check_c_compiler_flag(-Og HAS_OG_FLAG)
|
||||||
else()
|
else()
|
||||||
set(HAS_OG_FLAG 0)
|
set(HAS_OG_FLAG 0)
|
||||||
@@ -269,12 +271,11 @@ int main(void)
|
|||||||
}
|
}
|
||||||
" HAVE_BUILTIN_ADD_OVERFLOW)
|
" HAVE_BUILTIN_ADD_OVERFLOW)
|
||||||
|
|
||||||
option(ENABLE_COMPILER_SUGGESTIONS "Enable -Wsuggest compiler warnings" OFF)
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# XXX: /W4 gives too many warnings. #3241
|
# XXX: /W4 gives too many warnings. #3241
|
||||||
add_compile_options(/W3)
|
add_compile_options(/W3)
|
||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
add_definitions(-DMSWIN)
|
add_definitions(-DWIN32)
|
||||||
else()
|
else()
|
||||||
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
|
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||||
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
|
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
|
||||||
@@ -288,7 +289,6 @@ else()
|
|||||||
add_compile_options(-Wimplicit-fallthrough)
|
add_compile_options(-Wimplicit-fallthrough)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_COMPILER_SUGGESTIONS)
|
|
||||||
# Clang doesn't have -Wsuggest-attribute so check for each one.
|
# Clang doesn't have -Wsuggest-attribute so check for each one.
|
||||||
check_c_compiler_flag(-Wsuggest-attribute=pure HAVE_WSUGGEST_ATTRIBUTE_PURE)
|
check_c_compiler_flag(-Wsuggest-attribute=pure HAVE_WSUGGEST_ATTRIBUTE_PURE)
|
||||||
if(HAVE_WSUGGEST_ATTRIBUTE_PURE)
|
if(HAVE_WSUGGEST_ATTRIBUTE_PURE)
|
||||||
@@ -309,7 +309,6 @@ else()
|
|||||||
if(HAVE_WSUGGEST_ATTRIBUTE_COLD)
|
if(HAVE_WSUGGEST_ATTRIBUTE_COLD)
|
||||||
add_compile_options(-Wsuggest-attribute=cold)
|
add_compile_options(-Wsuggest-attribute=cold)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
|
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
|
||||||
# 3.4.1 used there.
|
# 3.4.1 used there.
|
||||||
@@ -321,7 +320,6 @@ endif()
|
|||||||
if(MINGW)
|
if(MINGW)
|
||||||
# Use POSIX compatible stdio in Mingw
|
# Use POSIX compatible stdio in Mingw
|
||||||
add_definitions(-D__USE_MINGW_ANSI_STDIO)
|
add_definitions(-D__USE_MINGW_ANSI_STDIO)
|
||||||
add_definitions(-DMSWIN)
|
|
||||||
endif()
|
endif()
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# Windows Vista is the minimum supported version
|
# Windows Vista is the minimum supported version
|
||||||
@@ -367,7 +365,7 @@ option(CI_BUILD "CI, extra flags will be set" OFF)
|
|||||||
if(CI_BUILD)
|
if(CI_BUILD)
|
||||||
message(STATUS "CI build enabled")
|
message(STATUS "CI build enabled")
|
||||||
add_compile_options(-Werror)
|
add_compile_options(-Werror)
|
||||||
if(DEFINED ENV{BUILD_UCHAR})
|
if(DEFINED ENV{BUILD_32BIT})
|
||||||
# Get some test coverage for unsigned char
|
# Get some test coverage for unsigned char
|
||||||
add_compile_options(-funsigned-char)
|
add_compile_options(-funsigned-char)
|
||||||
endif()
|
endif()
|
||||||
@@ -402,7 +400,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT P
|
|||||||
"${CMAKE_MODULE_LINKER_FLAGS} -image_base 100000000")
|
"${CMAKE_MODULE_LINKER_FLAGS} -image_base 100000000")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories("${PROJECT_BINARY_DIR}/cmake.config")
|
include_directories("${PROJECT_BINARY_DIR}/config")
|
||||||
include_directories("${PROJECT_SOURCE_DIR}/src")
|
include_directories("${PROJECT_SOURCE_DIR}/src")
|
||||||
|
|
||||||
find_package(LibUV 1.28.0 REQUIRED)
|
find_package(LibUV 1.28.0 REQUIRED)
|
||||||
@@ -446,11 +444,11 @@ if(TS_HAS_SET_ALLOCATOR)
|
|||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_ALLOCATOR")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_ALLOCATOR")
|
||||||
endif()
|
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)
|
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
|
||||||
|
|
||||||
if(PREFER_LUA)
|
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_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
|
||||||
set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES})
|
set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES})
|
||||||
# Passive (not REQUIRED): if LUAJIT_FOUND is not set, nvim-test is skipped.
|
# Passive (not REQUIRED): if LUAJIT_FOUND is not set, nvim-test is skipped.
|
||||||
@@ -490,7 +488,6 @@ if(FEAT_TUI)
|
|||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
unibi_str_from_var(unibi_var_from_str(\"\"));
|
|
||||||
return unibi_num_from_var(unibi_var_from_num(0));
|
return unibi_num_from_var(unibi_var_from_num(0));
|
||||||
}
|
}
|
||||||
" UNIBI_HAS_VAR_FROM)
|
" UNIBI_HAS_VAR_FROM)
|
||||||
@@ -500,13 +497,18 @@ if(FEAT_TUI)
|
|||||||
add_definitions(-DNVIM_UNIBI_HAS_VAR_FROM)
|
add_definitions(-DNVIM_UNIBI_HAS_VAR_FROM)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(LibTermkey 0.22 REQUIRED)
|
find_package(LibTermkey 0.18 REQUIRED)
|
||||||
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
|
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(LIBVTERM 0.3 REQUIRED)
|
find_package(LIBVTERM 0.1 REQUIRED)
|
||||||
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
|
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_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_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
|
||||||
option(CLANG_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
|
option(CLANG_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
|
||||||
@@ -576,7 +578,11 @@ endif()
|
|||||||
|
|
||||||
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
|
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
|
||||||
|
|
||||||
|
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)
|
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(COMPILE_LUA AND NOT WIN32)
|
||||||
if(PREFER_LUA)
|
if(PREFER_LUA)
|
||||||
@@ -606,78 +612,17 @@ if(NOT BUSTED_OUTPUT_TYPE)
|
|||||||
set(BUSTED_OUTPUT_TYPE "nvim")
|
set(BUSTED_OUTPUT_TYPE "nvim")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#
|
|
||||||
# Lint
|
|
||||||
#
|
|
||||||
find_program(LUACHECK_PRG luacheck)
|
find_program(LUACHECK_PRG luacheck)
|
||||||
find_program(STYLUA_PRG stylua)
|
|
||||||
find_program(FLAKE8_PRG flake8)
|
find_program(FLAKE8_PRG flake8)
|
||||||
find_program(UNCRUSTIFY_PRG uncrustify)
|
find_program(GPERF_PRG gperf)
|
||||||
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)
|
|
||||||
|
|
||||||
include(InstallHelpers)
|
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(
|
install_helper(
|
||||||
FILES ${CMAKE_SOURCE_DIR}/src/man/nvim.1
|
FILES ${MANPAGES}
|
||||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -687,7 +632,7 @@ install_helper(
|
|||||||
add_subdirectory(src/nvim)
|
add_subdirectory(src/nvim)
|
||||||
get_directory_property(NVIM_VERSION_CFLAGS DIRECTORY src/nvim DEFINITION NVIM_VERSION_CFLAGS)
|
get_directory_property(NVIM_VERSION_CFLAGS DIRECTORY src/nvim DEFINITION NVIM_VERSION_CFLAGS)
|
||||||
add_subdirectory(test/includes)
|
add_subdirectory(test/includes)
|
||||||
add_subdirectory(cmake.config)
|
add_subdirectory(config)
|
||||||
add_subdirectory(test/functional/fixtures) # compile test programs
|
add_subdirectory(test/functional/fixtures) # compile test programs
|
||||||
add_subdirectory(runtime)
|
add_subdirectory(runtime)
|
||||||
get_directory_property(GENERATED_HELP_TAGS DIRECTORY runtime DEFINITION GENERATED_HELP_TAGS)
|
get_directory_property(GENERATED_HELP_TAGS DIRECTORY runtime DEFINITION GENERATED_HELP_TAGS)
|
||||||
@@ -713,6 +658,17 @@ if(BUSTED_PRG)
|
|||||||
set(FUNCTIONALTEST_PREREQS nvim printenv-test printargs-test shell-test pwsh-test streams-test tty-test ${GENERATED_HELP_TAGS})
|
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)
|
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)
|
check_lua_module(${LUA_PRG} "ffi" LUA_HAS_FFI)
|
||||||
if(LUA_HAS_FFI)
|
if(LUA_HAS_FFI)
|
||||||
add_custom_target(unittest
|
add_custom_target(unittest
|
||||||
@@ -738,11 +694,11 @@ if(BUSTED_PRG)
|
|||||||
set(TEST_LIBNVIM_PATH "")
|
set(TEST_LIBNVIM_PATH "")
|
||||||
endif()
|
endif()
|
||||||
configure_file(
|
configure_file(
|
||||||
${CMAKE_SOURCE_DIR}/test/cmakeconfig/paths.lua.in
|
${CMAKE_SOURCE_DIR}/test/config/paths.lua.in
|
||||||
${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua.gen)
|
${CMAKE_BINARY_DIR}/test/config/paths.lua.gen)
|
||||||
file(GENERATE
|
file(GENERATE
|
||||||
OUTPUT ${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua
|
OUTPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua
|
||||||
INPUT ${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua.gen)
|
INPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua.gen)
|
||||||
|
|
||||||
add_custom_target(functionaltest
|
add_custom_target(functionaltest
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
@@ -757,7 +713,8 @@ if(BUSTED_PRG)
|
|||||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||||
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
||||||
${TEST_TARGET_ARGS})
|
${TEST_TARGET_ARGS})
|
||||||
set_target_properties(functionaltest PROPERTIES FOLDER test)
|
set_target_properties(functionaltest functionaltest-prereqs
|
||||||
|
PROPERTIES FOLDER test)
|
||||||
|
|
||||||
add_custom_target(benchmark
|
add_custom_target(benchmark
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
@@ -772,7 +729,7 @@ if(BUSTED_PRG)
|
|||||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||||
DEPENDS ${BENCHMARK_PREREQS}
|
DEPENDS ${BENCHMARK_PREREQS}
|
||||||
${TEST_TARGET_ARGS})
|
${TEST_TARGET_ARGS})
|
||||||
set_target_properties(benchmark PROPERTIES FOLDER test)
|
set_target_properties(benchmark benchmark-prereqs PROPERTIES FOLDER test)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUSTED_LUA_PRG)
|
if(BUSTED_LUA_PRG)
|
||||||
@@ -792,9 +749,28 @@ if(BUSTED_LUA_PRG)
|
|||||||
set_target_properties(functionaltest-lua PROPERTIES FOLDER test)
|
set_target_properties(functionaltest-lua PROPERTIES FOLDER test)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
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
|
add_custom_target(uninstall
|
||||||
COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/UninstallHelper.cmake)
|
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
add_subdirectory(cmake.packaging)
|
add_subdirectory(packaging)
|
||||||
endif()
|
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.
|
- Try a [complexity:low] issue.
|
||||||
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
|
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
|
||||||
[Coverity](#coverity).
|
[Coverity](#coverity).
|
||||||
- [Improve documentation](#documenting)
|
- [Improve documentation][wiki-contribute-help]
|
||||||
- [Merge a Vim patch] (requires strong familiarity with Vim)
|
- [Merge a Vim patch] (familiarity with Vim is *strongly* recommended)
|
||||||
- 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.
|
|
||||||
|
|
||||||
Reporting problems
|
Reporting problems
|
||||||
------------------
|
------------------
|
||||||
@@ -33,9 +30,9 @@ Reporting problems
|
|||||||
Developer guidelines
|
Developer guidelines
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
- Read [:help dev](https://neovim.io/doc/user/develop.html#dev) if you are working on Nvim core.
|
- Read `:help 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-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-api-client` if you are developing an API client.
|
||||||
- Install `ninja` for faster builds of Nvim.
|
- Install `ninja` for faster builds of Nvim.
|
||||||
```
|
```
|
||||||
sudo apt-get install ninja-build
|
sudo apt-get install ninja-build
|
||||||
@@ -50,19 +47,21 @@ Pull requests (PRs)
|
|||||||
- Your PR must include [test coverage][run-tests].
|
- Your PR must include [test coverage][run-tests].
|
||||||
- Avoid cosmetic changes to unrelated files in the same commit.
|
- Avoid cosmetic changes to unrelated files in the same commit.
|
||||||
- Use a [feature branch][git-feature-branch] instead of the master branch.
|
- Use a [feature branch][git-feature-branch] instead of the master branch.
|
||||||
- Use a _rebase workflow_ for small PRs.
|
- Use a **rebase workflow** for small PRs.
|
||||||
- After addressing review comments, it's fine to force-push.
|
- After addressing review comments, it's fine to rebase and force-push.
|
||||||
- Use a _merge workflow_ (as opposed to "rebase") for big, high-risk PRs.
|
- Use a **merge workflow** for big, high-risk PRs.
|
||||||
- Merge `master` into your PR when there are conflicts or when master
|
- Merge `master` into your PR when there are conflicts or when master
|
||||||
introduces breaking changes.
|
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.
|
- Do not edit commits that come before the merge commit.
|
||||||
|
- During a squash/fixup, use `exec make -C build unittest` between each
|
||||||
### Merging to master
|
pick/edit/reword.
|
||||||
|
|
||||||
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).
|
|
||||||
|
|
||||||
### Stages: Draft and Ready for review
|
### 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):
|
- 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.
|
- 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)`, …
|
- Append optional scope to _type_ such as `(lsp)`, `(treesitter)`, `(float)`, …
|
||||||
- _Description_ shouldn't start with a capital letter or end in a period.
|
- _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)
|
### 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
|
- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
|
||||||
will fail the build.
|
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
|
- The [lint](#lint) build checks modified lines _and their immediate
|
||||||
neighbors_, to encourage incrementally updating the legacy style to meet our
|
neighbors_, to encourage incrementally updating the legacy style to meet our
|
||||||
[style](#style). (See [#3174][3174] for background.)
|
[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
|
### Clang scan-build
|
||||||
|
|
||||||
@@ -206,11 +218,6 @@ You can lint a single file (but this will _not_ exclude legacy errors):
|
|||||||
|
|
||||||
### Style
|
### 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
|
- Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match
|
||||||
the [style-guide]. To use the Nvim `gq` command with `uncrustify`:
|
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
|
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||||
```
|
```
|
||||||
|
- Use **[universal-ctags](https://github.com/universal-ctags/ctags).**
|
||||||
- Recommendation is to use **[clangd]**.
|
("Exuberant ctags", the typical `ctags` binary provided by your distro, is
|
||||||
Can use the maintained config in [nvim-lspconfig/clangd].
|
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).
|
- 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:
|
project root:
|
||||||
|
|
||||||
$ ln -s contrib/luarc.json .luarc.json
|
$ 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
|
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
|
shows each commit's diff. To show the whole surrounding function of a change
|
||||||
as context, use the `-W` argument as well.
|
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
|
[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-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-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-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-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
|
[git-rebasing]: http://git-scm.com/book/en/v2/Git-Branching-Rebasing
|
||||||
[github-issues]: https://github.com/neovim/neovim/issues
|
[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
|
[1820]: https://github.com/neovim/neovim/pull/1820
|
||||||
[include-what-you-use]: https://github.com/include-what-you-use/include-what-you-use#using-with-cmake
|
[gh]: https://cli.github.com/
|
||||||
[lua-language-server]: https://github.com/sumneko/lua-language-server/
|
[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
|
[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-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
|
[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/
|
[uncrustify]: http://uncrustify.sourceforge.net/
|
||||||
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
|
[lua-language-server]: https://github.com/sumneko/lua-language-server/
|
||||||
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
|
|
||||||
|
@@ -8,7 +8,7 @@ Neovim's license follows:
|
|||||||
====
|
====
|
||||||
Apache License
|
Apache License
|
||||||
Version 2.0, January 2004
|
Version 2.0, January 2004
|
||||||
https://www.apache.org/licenses/
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
@@ -196,11 +196,10 @@ The externally maintained libraries used by Neovim are:
|
|||||||
- libtermkey: MIT license
|
- libtermkey: MIT license
|
||||||
- libuv. Copyright Joyent, Inc. and other Node contributors. Node.js license.
|
- libuv. Copyright Joyent, Inc. and other Node contributors. Node.js license.
|
||||||
- libvterm: MIT license
|
- libvterm: MIT license
|
||||||
- lua-cjson: MIT license
|
|
||||||
- lua-compat: MIT license
|
- lua-compat: MIT license
|
||||||
- tree-sitter: MIT license
|
- tree-sitter: MIT license
|
||||||
- unibilium: LGPL v3
|
- xdiff: LGPL license
|
||||||
- xdiff: LGPL v2
|
- lua-cjson: MIT license
|
||||||
|
|
||||||
====
|
====
|
||||||
|
|
||||||
|
91
MAINTAIN.md
@@ -12,23 +12,23 @@ General guidelines
|
|||||||
* Use automation to solve problems
|
* Use automation to solve problems
|
||||||
* Never break the API... but sometimes break the UI
|
* 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
|
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:
|
"after next". So there are usually one or two (at most) planned milestones:
|
||||||
|
|
||||||
* Next bugfix-release (1.0.x)
|
- Next bugfix-release (1.0.x)
|
||||||
* Next feature-release (1.x.0)
|
- Next feature-release (1.x.0)
|
||||||
|
|
||||||
The forecasting problem might be solved with an explicit priority system (like
|
The forecasting problem might be solved with an explicit priority system (like
|
||||||
Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
|
Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
|
||||||
|
|
||||||
* PRs nearing completion.
|
- PRs nearing completion.
|
||||||
* Issue labels. E.g. the `+plan` label increases the ticket's priority merely
|
- 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
|
for having a plan written down: it is _closer to completion_ than tickets
|
||||||
without a plan.
|
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
|
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
|
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`.
|
1. Fix the bug on `master`.
|
||||||
2. Cherry-pick the fix to `release-x.y`.
|
2. Cherry-pick the fix to `release-x.y`.
|
||||||
3. Cut a release from `release-x.y`.
|
3. Cut a release from `release-x.y`.
|
||||||
* Run `./scripts/release.sh`
|
- Run `./scripts/release.sh`
|
||||||
* Update (force-push) the remote `stable` tag.
|
- Update (force-push) the remote `stable` tag.
|
||||||
* The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13)
|
- The [nightly job](https://github.com/neovim/neovim/blob/master/.github/workflows/release.yml#L4)
|
||||||
will update the release assets and force-push to the `stable` tag.
|
will update the release assets based on the `stable` tag.
|
||||||
|
|
||||||
### Release automation
|
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
|
||||||
Neovim automation includes a [backport bot](https://github.com/zeebe-io/backport-action).
|
form `backport release-0.X`. If the label is applied before the PR is merged,
|
||||||
Trigger the action by labeling a PR with `backport release-X.Y`. See `.github/workflows/backport.yml`.
|
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
|
Third-party dependencies
|
||||||
------------------------
|
--------------
|
||||||
|
|
||||||
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`.
|
These "bundled" dependencies can be updated by bumping their versions in `third-party/CMakeLists.txt`:
|
||||||
Some can be auto-bumped by `scripts/bump-deps.sh`.
|
- [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)
|
`scripts/bump-dep.sh` is a script that can automate this process for `LuaJIT`, `Luv`, `libuv` & `tree-sitter`. See usage guide:
|
||||||
* [Lua](https://www.lua.org/download.html)
|
- Run `./scripts/bump-deps.sh --dep Luv --version 1.43.0-0` to update a dependency.
|
||||||
* [Luv](https://github.com/luvit/luv)
|
See `./scripts/bump-deps.sh -h` for more detailed usage
|
||||||
* [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
|
- Run `./scripts/bump-deps.sh --pr` to create a pr
|
||||||
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
|
To generate the default PR title and body, the script uses the most recent commit (not in `master`) with prefix `build(deps): `
|
||||||
* [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)
|
|
||||||
|
|
||||||
### 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:
|
We also maintain some forks, particularly for Windows, if we are waiting on upstream changes:
|
||||||
|
https://github.com/neovim/neovim/wiki/Deps
|
||||||
* `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
|
|
||||||
|
|
||||||
See also
|
See also
|
||||||
--------
|
--------
|
||||||
|
|
||||||
* https://github.com/neovim/neovim/issues/862
|
- https://github.com/neovim/neovim/issues/862
|
||||||
* https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
|
- https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
|
||||||
|
77
Makefile
@@ -47,7 +47,13 @@ endif
|
|||||||
|
|
||||||
ifeq (,$(BUILD_TOOL))
|
ifeq (,$(BUILD_TOOL))
|
||||||
ifeq (Ninja,$(CMAKE_GENERATOR))
|
ifeq (Ninja,$(CMAKE_GENERATOR))
|
||||||
|
ifneq ($(shell $(CMAKE_PRG) --help 2>/dev/null | grep Ninja),)
|
||||||
BUILD_TOOL = ninja
|
BUILD_TOOL = ninja
|
||||||
|
else
|
||||||
|
# User's version of CMake doesn't support Ninja
|
||||||
|
BUILD_TOOL = $(MAKE)
|
||||||
|
CMAKE_GENERATOR := Unix Makefiles
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
BUILD_TOOL = $(MAKE)
|
BUILD_TOOL = $(MAKE)
|
||||||
endif
|
endif
|
||||||
@@ -96,7 +102,7 @@ build/.ran-cmake: | deps
|
|||||||
cd build && $(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
|
cd build && $(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
deps: | build/.ran-deps-cmake
|
deps: | build/.ran-third-party-cmake
|
||||||
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
||||||
+$(BUILD_TOOL) -C $(DEPS_BUILD_DIR)
|
+$(BUILD_TOOL) -C $(DEPS_BUILD_DIR)
|
||||||
endif
|
endif
|
||||||
@@ -104,12 +110,12 @@ endif
|
|||||||
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
||||||
$(DEPS_BUILD_DIR):
|
$(DEPS_BUILD_DIR):
|
||||||
mkdir -p "$@"
|
mkdir -p "$@"
|
||||||
build/.ran-deps-cmake:: $(DEPS_BUILD_DIR)
|
build/.ran-third-party-cmake:: $(DEPS_BUILD_DIR)
|
||||||
cd $(DEPS_BUILD_DIR) && \
|
cd $(DEPS_BUILD_DIR) && \
|
||||||
$(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
|
$(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
|
endif
|
||||||
build/.ran-deps-cmake::
|
build/.ran-third-party-cmake::
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
@@ -127,11 +133,50 @@ endif
|
|||||||
src/nvim/testdir/%.vim: phony_force
|
src/nvim/testdir/%.vim: phony_force
|
||||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
|
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
|
||||||
|
|
||||||
functionaltest functionaltest-lua unittest benchmark: | nvim
|
build/runtime/doc/tags helptags: | nvim
|
||||||
$(BUILD_TOOL) -C build $@
|
+$(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
|
# Builds help HTML _and_ checks for invalid help tags.
|
||||||
$(CMAKE_PRG) --build build --target $@
|
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
|
test: functionaltest unittest
|
||||||
|
|
||||||
@@ -148,6 +193,18 @@ distclean:
|
|||||||
install: checkprefix nvim
|
install: checkprefix nvim
|
||||||
+$(BUILD_TOOL) -C build install
|
+$(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:
|
appimage:
|
||||||
bash scripts/genappimage.sh
|
bash scripts/genappimage.sh
|
||||||
|
|
||||||
@@ -157,6 +214,8 @@ appimage:
|
|||||||
appimage-%:
|
appimage-%:
|
||||||
bash scripts/genappimage.sh $*
|
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.
|
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
|
||||||
# Does not work with "Unix Makefiles".
|
# Does not work with "Unix Makefiles".
|
||||||
ifeq ($(CMAKE_GENERATOR),Ninja)
|
ifeq ($(CMAKE_GENERATOR),Ninja)
|
||||||
@@ -167,4 +226,4 @@ $(DEPS_BUILD_DIR)/%: phony_force
|
|||||||
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
|
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
|
||||||
endif
|
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)
|
[Twitter](https://twitter.com/Neovim)
|
||||||
|
|
||||||
[](https://github.com/neovim/neovim/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush)
|
[](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://scan.coverity.com/projects/2227)
|
||||||
[](https://neovim.io/doc/reports/clang)
|
[](https://neovim.io/doc/reports/clang)
|
||||||
[](https://neovim.io/doc/reports/pvs/PVS-studio.html.d)
|
[](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:
|
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
|
make install
|
||||||
|
|
||||||
CMake hints for inspecting the build:
|
CMake hints for inspecting the build:
|
||||||
@@ -80,10 +81,8 @@ Project layout
|
|||||||
--------------
|
--------------
|
||||||
|
|
||||||
├─ ci/ build automation
|
├─ ci/ build automation
|
||||||
├─ cmake/ CMake utils
|
├─ cmake/ build scripts
|
||||||
├─ cmake.config/ CMake defines
|
├─ runtime/ user plugins/docs
|
||||||
├─ cmake.deps/ subproject to fetch and build dependencies (optional)
|
|
||||||
├─ runtime/ plugins and docs
|
|
||||||
├─ src/nvim/ application source code (see src/nvim/README.md)
|
├─ src/nvim/ application source code (see src/nvim/README.md)
|
||||||
│ ├─ api/ API subsystem
|
│ ├─ api/ API subsystem
|
||||||
│ ├─ eval/ VimL subsystem
|
│ ├─ eval/ VimL subsystem
|
||||||
@@ -94,6 +93,7 @@ Project layout
|
|||||||
│ ├─ msgpack_rpc/ RPC subsystem
|
│ ├─ msgpack_rpc/ RPC subsystem
|
||||||
│ ├─ os/ low-level platform code
|
│ ├─ os/ low-level platform code
|
||||||
│ └─ tui/ built-in UI
|
│ └─ tui/ built-in UI
|
||||||
|
├─ third-party/ CMake subproject to build dependencies
|
||||||
└─ test/ tests (see test/README.md)
|
└─ test/ tests (see test/README.md)
|
||||||
|
|
||||||
License
|
License
|
||||||
|
@@ -12,6 +12,11 @@ mkdir -p "${HOME}/.cache"
|
|||||||
echo "before_cache.sh: cache size"
|
echo "before_cache.sh: cache size"
|
||||||
du -chd 1 "${HOME}/.cache" | sort -rh | head -20
|
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.
|
# Update the third-party dependency cache only if the build was successful.
|
||||||
if ended_successfully && [ -d "${DEPS_BUILD_DIR}" ]; then
|
if ended_successfully && [ -d "${DEPS_BUILD_DIR}" ]; then
|
||||||
# Do not cache downloads. They should not be needed with up-to-date deps.
|
# 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
|
exit 1
|
||||||
fi
|
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.
|
# Compile dependencies.
|
||||||
build_deps
|
build_deps
|
||||||
|
|
||||||
|
202
ci/build.ps1
@@ -1,32 +1,24 @@
|
|||||||
[CmdletBinding(DefaultParameterSetName = "Build")]
|
param([switch]$NoTests)
|
||||||
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
|
|
||||||
)
|
|
||||||
|
|
||||||
Set-StrictMode -Version Latest
|
Set-StrictMode -Version Latest
|
||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
$ProgressPreference = 'SilentlyContinue'
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
|
|
||||||
$projectDir = [System.IO.Path]::GetFullPath("$(Get-Location)")
|
$env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$'
|
||||||
$buildDir = Join-Path -Path $projectDir -ChildPath "build"
|
$compiler = $Matches.compiler
|
||||||
|
$compileOption = if ($Matches -contains 'option') {$Matches.option} else {''}
|
||||||
# $env:CMAKE_BUILD_TYPE is ignored by cmake when not using ninja
|
$bits = $Matches.bits
|
||||||
$cmakeBuildType = $(if ($null -ne $env:CMAKE_BUILD_TYPE) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
|
$cmakeBuildType = $(if ($env:CMAKE_BUILD_TYPE -ne $null) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
|
||||||
|
$buildDir = [System.IO.Path]::GetFullPath("$(pwd)")
|
||||||
$depsCmakeVars = @{
|
$depsCmakeVars = @{
|
||||||
CMAKE_BUILD_TYPE = $cmakeBuildType;
|
CMAKE_BUILD_TYPE = $cmakeBuildType;
|
||||||
}
|
}
|
||||||
$nvimCmakeVars = @{
|
$nvimCmakeVars = @{
|
||||||
CMAKE_BUILD_TYPE = $cmakeBuildType;
|
CMAKE_BUILD_TYPE = $cmakeBuildType;
|
||||||
BUSTED_OUTPUT_TYPE = 'nvim';
|
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) {
|
if ($env:DEPS_BUILD_DIR -eq $null) {
|
||||||
$env:DEPS_BUILD_DIR = Join-Path -Path $projectDir -ChildPath ".deps"
|
$env:DEPS_BUILD_DIR = ".deps";
|
||||||
}
|
}
|
||||||
$uploadToCodeCov = $false
|
$uploadToCodeCov = $false
|
||||||
|
|
||||||
@@ -36,97 +28,150 @@ function exitIfFailed() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertToCmakeArgs($vars) {
|
if (-not $NoTests) {
|
||||||
return $vars.GetEnumerator() | ForEach-Object { "-D$($_.Key)=$($_.Value)" }
|
node --version
|
||||||
|
npm.cmd --version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 ($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
|
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
||||||
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
|
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 {
|
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x${bits} -no_logo && set" | foreach-object {
|
||||||
$name, $value = $_ -split '=', 2
|
$name, $value = $_ -split '=', 2
|
||||||
Set-Content env:\"$name" $value
|
set-content env:\"$name" $value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function BuildDeps {
|
if (-not $NoTests) {
|
||||||
|
python -m ensurepip
|
||||||
if (Test-Path -PathType container $env:DEPS_BUILD_DIR) {
|
python -m pip install pynvim ; exitIfFailed
|
||||||
$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
|
# Sanity check
|
||||||
python -c "import pynvim; print(str(pynvim))" ; exitIfFailed
|
python -c "import pynvim; print(str(pynvim))" ; exitIfFailed
|
||||||
|
|
||||||
gem.cmd install --pre neovim
|
gem.cmd install --pre neovim
|
||||||
Get-Command -CommandType Application neovim-ruby-host.bat; exitIfFailed
|
Get-Command -CommandType Application neovim-ruby-host.bat
|
||||||
|
|
||||||
node --version
|
npm.cmd install -g neovim
|
||||||
npm.cmd --version
|
Get-Command -CommandType Application neovim-node-host.cmd
|
||||||
|
|
||||||
npm.cmd install -g neovim; exitIfFailed
|
|
||||||
Get-Command -CommandType Application neovim-node-host.cmd; exitIfFailed
|
|
||||||
npm.cmd link neovim
|
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) {
|
if ($env:USE_LUACOV -eq 1) {
|
||||||
& $env:DEPS_PREFIX\luarocks\luarocks.bat install cluacov
|
& $env:DEPS_PREFIX\luarocks\luarocks.bat install cluacov
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function Test {
|
if (-not $NoTests) {
|
||||||
# Functional tests
|
# Functional tests
|
||||||
# The $LastExitCode from MSBuild can't be trusted
|
# The $LastExitCode from MSBuild can't be trusted
|
||||||
$failed = $false
|
$failed = $false
|
||||||
|
|
||||||
# Run only this test file:
|
# Run only this test file:
|
||||||
# $env:TEST_FILE = "test\functional\foo.lua"
|
# $env:TEST_FILE = "test\functional\foo.lua"
|
||||||
cmake --build $buildDir --target functionaltest 2>&1 |
|
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 |
|
||||||
ForEach-Object { $failed = $failed -or
|
foreach { $failed = $failed -or
|
||||||
$_ -match 'functional tests failed with error'; $_ }
|
$_ -match 'functional tests failed with error'; $_ }
|
||||||
|
|
||||||
if ($failed) {
|
if ($uploadToCodecov) {
|
||||||
exit $LastExitCode
|
|
||||||
}
|
|
||||||
|
|
||||||
if (-not $uploadToCodecov) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if ($env:USE_LUACOV -eq 1) {
|
if ($env:USE_LUACOV -eq 1) {
|
||||||
& $env:DEPS_PREFIX\bin\luacov.bat
|
& $env:DEPS_PREFIX\bin\luacov.bat
|
||||||
}
|
}
|
||||||
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
|
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
|
||||||
}
|
}
|
||||||
|
if ($failed) {
|
||||||
|
exit $LastExitCode
|
||||||
|
}
|
||||||
|
|
||||||
function TestOld {
|
|
||||||
# Old tests
|
# Old tests
|
||||||
# Add MSYS to path, required for e.g. `find` used in test scripts.
|
# Add MSYS to path, required for e.g. `find` used in test scripts.
|
||||||
# But would break functionaltests, where its `more` would be used then.
|
# But would break functionaltests, where its `more` would be used then.
|
||||||
$OldPath = $env:PATH
|
$OldPath = $env:PATH
|
||||||
$env:PATH = "C:\msys64\usr\bin;$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
|
$env:PATH = $OldPath
|
||||||
|
|
||||||
if ($uploadToCodecov) {
|
if ($uploadToCodecov) {
|
||||||
@@ -134,13 +179,10 @@ function TestOld {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Ensure choco's cpack is not in PATH otherwise, it conflicts with CMake's
|
||||||
function Package {
|
if (Test-Path -Path $env:ChocolateyInstall\bin\cpack.exe) {
|
||||||
cmake -S $projectDir -B $buildDir $(convertToCmakeArgs($nvimCmakeVars)) -G Ninja; exitIfFailed
|
Remove-Item -Path $env:ChocolateyInstall\bin\cpack.exe -Force
|
||||||
cmake --build $buildDir --target package; exitIfFailed
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSCmdlet.ParameterSetName) {
|
# Build artifacts
|
||||||
& (Get-ChildItem "Function:$($PSCmdlet.ParameterSetName)")
|
cpack -C $cmakeBuildType
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
@@ -24,7 +24,9 @@ build_deps() {
|
|||||||
mkdir -p "${DEPS_BUILD_DIR}"
|
mkdir -p "${DEPS_BUILD_DIR}"
|
||||||
|
|
||||||
# Use cached dependencies if $CACHE_MARKER exists.
|
# 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}"))."
|
echo "Using third-party dependencies from cache (last update: $(_stat "${CACHE_MARKER}"))."
|
||||||
cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_DIR}"
|
cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_DIR}"
|
||||||
fi
|
fi
|
||||||
@@ -33,7 +35,7 @@ build_deps() {
|
|||||||
# update CMake configuration and update to newer deps versions.
|
# update CMake configuration and update to newer deps versions.
|
||||||
cd "${DEPS_BUILD_DIR}"
|
cd "${DEPS_BUILD_DIR}"
|
||||||
echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
|
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
|
if ! top_make; then
|
||||||
exit 1
|
exit 1
|
||||||
|
@@ -5,7 +5,7 @@ set -o pipefail
|
|||||||
|
|
||||||
# Use default CC to avoid compilation problems when installing Python modules.
|
# Use default CC to avoid compilation problems when installing Python modules.
|
||||||
echo "Install neovim module for Python."
|
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."
|
echo "Install neovim RubyGem."
|
||||||
gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim
|
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
|
done
|
||||||
|
|
||||||
end_tests
|
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()
|
|
@@ -41,16 +41,6 @@ endif()
|
|||||||
if (MSVC)
|
if (MSVC)
|
||||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
|
list(APPEND CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# On macOS, if libintl is a static library then we also need
|
|
||||||
# to link libiconv and CoreFoundation.
|
|
||||||
get_filename_component(LibIntl_EXT "${LibIntl_LIBRARY}" EXT)
|
|
||||||
if (APPLE AND (LibIntl_EXT STREQUAL ".a"))
|
|
||||||
set(LibIntl_STATIC TRUE)
|
|
||||||
find_library(CoreFoundation_FRAMEWORK CoreFoundation)
|
|
||||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARY}" "${CoreFoundation_FRAMEWORK}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
|
|
||||||
@@ -64,9 +54,6 @@ int main(int argc, char** argv) {
|
|||||||
if (MSVC)
|
if (MSVC)
|
||||||
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
|
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
if (LibIntl_STATIC)
|
|
||||||
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARY}" "${CoreFoundation_FRAMEWORK}")
|
|
||||||
endif()
|
|
||||||
if (LibIntl_INCLUDE_DIR)
|
if (LibIntl_INCLUDE_DIR)
|
||||||
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}")
|
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
@@ -13,7 +13,7 @@ endif()
|
|||||||
find_path(LIBUV_INCLUDE_DIR uv.h
|
find_path(LIBUV_INCLUDE_DIR uv.h
|
||||||
HINTS ${PC_LIBUV_INCLUDEDIR} ${PC_LIBUV_INCLUDE_DIRS})
|
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}
|
find_library(LIBUV_LIBRARY NAMES ${LIBUV_NAMES}
|
||||||
HINTS ${PC_LIBUV_LIBDIR} ${PC_LIBUV_LIBRARY_DIRS})
|
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 --git-dir=${NVIM_SOURCE_DIR}/.git --work-tree=${NVIM_SOURCE_DIR} 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})
|
while(NOT EXISTS \$ENV{DESTDIR}\${_current_dir} AND NOT \${_prev_dir} STREQUAL \${_current_dir})
|
||||||
list(APPEND _parent_dirs \${_current_dir})
|
list(APPEND _parent_dirs \${_current_dir})
|
||||||
set(_prev_dir \${_current_dir})
|
set(_prev_dir \${_current_dir})
|
||||||
get_filename_component(_current_dir \${_current_dir} DIRECTORY)
|
get_filename_component(_current_dir \${_current_dir} PATH)
|
||||||
endwhile()
|
endwhile()
|
||||||
|
|
||||||
if(_parent_dirs)
|
if(_parent_dirs)
|
||||||
|
@@ -2,9 +2,7 @@
|
|||||||
set(ENV{LC_ALL} "en_US.UTF-8")
|
set(ENV{LC_ALL} "en_US.UTF-8")
|
||||||
|
|
||||||
if(POLICY CMP0012)
|
if(POLICY CMP0012)
|
||||||
# Avoid policy warning due to CI=true. This is needed even if the main
|
# Handle CI=true, without dev warnings.
|
||||||
# project has already set this policy as policy settings are reset when using
|
|
||||||
# the cmake script mode (-P).
|
|
||||||
cmake_policy(SET CMP0012 NEW)
|
cmake_policy(SET CMP0012 NEW)
|
||||||
endif()
|
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_CONFIG_HOME} ${BUILD_DIR}/Xtest_xdg/config)
|
||||||
set(ENV{XDG_DATA_HOME} ${BUILD_DIR}/Xtest_xdg/share)
|
set(ENV{XDG_DATA_HOME} ${BUILD_DIR}/Xtest_xdg/share)
|
||||||
unset(ENV{XDG_DATA_DIRS})
|
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})
|
if(NOT DEFINED ENV{NVIM_LOG_FILE})
|
||||||
set(ENV{NVIM_LOG_FILE} ${BUILD_DIR}/.nvimlog)
|
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})
|
list(APPEND BUSTED_ARGS --filter-out $ENV{TEST_FILTER_OUT})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# TMPDIR: for helpers.tmpname() and Nvim tempname().
|
# TMPDIR: use relative test path (for parallel test runs / isolation).
|
||||||
set(ENV{TMPDIR} "${BUILD_DIR}/Xtest_tmpdir")
|
set(ENV{TMPDIR} "${BUILD_DIR}/Xtest_tmpdir/${TEST_PATH}")
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory $ENV{TMPDIR})
|
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory $ENV{TMPDIR})
|
||||||
|
|
||||||
# HISTFILE: do not write into user's ~/.bash_history
|
# 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(CheckCSourceRuns)
|
||||||
include(CheckCSourceCompiles)
|
include(CheckCSourceCompiles)
|
||||||
|
|
||||||
check_type_size("int" SIZEOF_INT LANGUAGE C)
|
check_type_size("int" SIZEOF_INT)
|
||||||
check_type_size("long" SIZEOF_LONG LANGUAGE C)
|
check_type_size("long" SIZEOF_LONG)
|
||||||
check_type_size("intmax_t" SIZEOF_INTMAX_T LANGUAGE C)
|
check_type_size("intmax_t" SIZEOF_INTMAX_T)
|
||||||
check_type_size("int32_t" SIZEOF_INT32_T LANGUAGE C)
|
check_type_size("size_t" SIZEOF_SIZE_T)
|
||||||
check_type_size("size_t" SIZEOF_SIZE_T LANGUAGE C)
|
check_type_size("long long" SIZEOF_LONG_LONG)
|
||||||
check_type_size("long long" SIZEOF_LONG_LONG LANGUAGE C)
|
check_type_size("void *" SIZEOF_VOID_PTR)
|
||||||
check_type_size("void *" SIZEOF_VOID_PTR LANGUAGE C)
|
|
||||||
|
|
||||||
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
|
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
|
||||||
|
|
||||||
@@ -128,14 +127,14 @@ endif()
|
|||||||
|
|
||||||
# generate configuration header and update include directories
|
# generate configuration header and update include directories
|
||||||
configure_file (
|
configure_file (
|
||||||
"${PROJECT_SOURCE_DIR}/cmake.config/config.h.in"
|
"${PROJECT_SOURCE_DIR}/config/config.h.in"
|
||||||
"${PROJECT_BINARY_DIR}/cmake.config/auto/config.h"
|
"${PROJECT_BINARY_DIR}/config/auto/config.h"
|
||||||
)
|
)
|
||||||
|
|
||||||
# generate version definitions
|
# generate version definitions
|
||||||
configure_file (
|
configure_file (
|
||||||
"${PROJECT_SOURCE_DIR}/cmake.config/versiondef.h.in"
|
"${PROJECT_SOURCE_DIR}/config/versiondef.h.in"
|
||||||
"${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h"
|
"${PROJECT_BINARY_DIR}/config/auto/versiondef.h"
|
||||||
)
|
)
|
||||||
|
|
||||||
# generate pathdef.c
|
# generate pathdef.c
|
||||||
@@ -158,6 +157,6 @@ elseif (EXISTS ${HOSTNAME_PROG})
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
configure_file (
|
configure_file (
|
||||||
"${PROJECT_SOURCE_DIR}/cmake.config/pathdef.c.in"
|
"${PROJECT_SOURCE_DIR}/config/pathdef.c.in"
|
||||||
"${PROJECT_BINARY_DIR}/cmake.config/auto/pathdef.c"
|
"${PROJECT_BINARY_DIR}/config/auto/pathdef.c"
|
||||||
ESCAPE_QUOTES)
|
ESCAPE_QUOTES)
|
@@ -3,12 +3,8 @@
|
|||||||
|
|
||||||
#cmakedefine DEBUG
|
#cmakedefine DEBUG
|
||||||
|
|
||||||
#cmakedefine SIZEOF_INT @SIZEOF_INT@
|
#define SIZEOF_INT @SIZEOF_INT@
|
||||||
#cmakedefine SIZEOF_INTMAX_T @SIZEOF_INTMAX_T@
|
#define SIZEOF_LONG @SIZEOF_LONG@
|
||||||
#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@
|
|
||||||
|
|
||||||
#if @SIZEOF_VOID_PTR@ == 8
|
#if @SIZEOF_VOID_PTR@ == 8
|
||||||
#define ARCH_64
|
#define ARCH_64
|
||||||
@@ -16,7 +12,7 @@
|
|||||||
#define ARCH_32
|
#define ARCH_32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#cmakedefine PROJECT_NAME "@PROJECT_NAME@"
|
#define PROJECT_NAME "@PROJECT_NAME@"
|
||||||
|
|
||||||
#cmakedefine HAVE__NSGETENVIRON
|
#cmakedefine HAVE__NSGETENVIRON
|
||||||
#cmakedefine HAVE_FD_CLOEXEC
|
#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": {
|
"nodes": {
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1659877975,
|
"lastModified": 1644229661,
|
||||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -17,11 +17,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1662019588,
|
"lastModified": 1646254136,
|
||||||
"narHash": "sha256-oPEjHKGGVbBXqwwL+UjsveJzghWiWV0n9ogo1X6l4cw=",
|
"narHash": "sha256-8nQx02tTzgYO21BP/dy5BCRopE8OwE8Drsw98j+Qoaw=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "2da64a81275b68fdad38af669afeda43d401e94b",
|
"rev": "3e072546ea98db00c2364b81491b893673267827",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@@ -8,34 +8,22 @@
|
|||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils }:
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
{
|
{
|
||||||
overlay = final: prev: rec {
|
overlay = final: prev:
|
||||||
neovim-unwrapped = prev.neovim-unwrapped.override ({
|
let
|
||||||
libvterm-neovim = prev.libvterm-neovim.overrideAttrs (old: {
|
pkgs = nixpkgs.legacyPackages.${prev.system};
|
||||||
version = "0.3";
|
in
|
||||||
src = builtins.fetchTarball {
|
rec {
|
||||||
url = "https://www.leonerd.org.uk/code/libvterm/libvterm-0.3.tar.gz";
|
neovim = pkgs.neovim-unwrapped.overrideAttrs (oa: {
|
||||||
sha256 = "0zg6sn5brwrnqaab883pdj0l2swk5askbbwbdam0zq55ikbrzgar";
|
|
||||||
};
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
neovim = final.neovim-unwrapped.overrideAttrs (oa: {
|
|
||||||
version = "master";
|
version = "master";
|
||||||
src = ../.;
|
src = ../.;
|
||||||
|
|
||||||
buildInputs = oa.buildInputs
|
|
||||||
++ final.lib.optionals final.stdenv.isDarwin
|
|
||||||
(with final.darwin.apple_sdk.frameworks; [ CoreServices ]);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
# a development binary to help debug issues
|
# a development binary to help debug issues
|
||||||
neovim-debug = let
|
neovim-debug = let
|
||||||
stdenv = if final.stdenv.isLinux then
|
stdenv = if pkgs.stdenv.isLinux then pkgs.llvmPackages_latest.stdenv else pkgs.stdenv;
|
||||||
final.llvmPackages_latest.stdenv
|
in
|
||||||
else
|
((neovim.override {
|
||||||
final.stdenv;
|
lua = pkgs.luajit;
|
||||||
in ((neovim.override {
|
|
||||||
lua = final.luajit;
|
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
}).overrideAttrs (oa: {
|
}).overrideAttrs (oa: {
|
||||||
|
|
||||||
@@ -43,69 +31,77 @@
|
|||||||
NIX_CFLAGS_COMPILE = " -ggdb -Og";
|
NIX_CFLAGS_COMPILE = " -ggdb -Og";
|
||||||
|
|
||||||
cmakeBuildType = "Debug";
|
cmakeBuildType = "Debug";
|
||||||
cmakeFlags = oa.cmakeFlags ++ [ "-DMIN_LOG_LEVEL=0" ];
|
cmakeFlags = oa.cmakeFlags ++ [
|
||||||
|
"-DMIN_LOG_LEVEL=0"
|
||||||
|
];
|
||||||
|
|
||||||
disallowedReferences = [];
|
disallowedReferences = [];
|
||||||
}));
|
}));
|
||||||
|
|
||||||
# for neovim developers, beware of the slow binary
|
# for neovim developers, beware of the slow binary
|
||||||
neovim-developer = let luacheck = final.luaPackages.luacheck;
|
neovim-developer =
|
||||||
in (neovim-debug.override ({
|
let
|
||||||
doCheck = final.stdenv.isLinux;
|
lib = nixpkgs.lib;
|
||||||
})).overrideAttrs (oa: {
|
luacheck = pkgs.luaPackages.luacheck;
|
||||||
|
in
|
||||||
|
(neovim-debug.override ({ doCheck = pkgs.stdenv.isLinux; })).overrideAttrs (oa: {
|
||||||
cmakeFlags = oa.cmakeFlags ++ [
|
cmakeFlags = oa.cmakeFlags ++ [
|
||||||
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
|
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
|
||||||
"-DMIN_LOG_LEVEL=0"
|
"-DMIN_LOG_LEVEL=0"
|
||||||
"-DENABLE_LTO=OFF"
|
"-DENABLE_LTO=OFF"
|
||||||
] ++ final.lib.optionals final.stdenv.isLinux [
|
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
|
||||||
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
|
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
|
||||||
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
|
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
|
||||||
"-DCLANG_ASAN_UBSAN=ON"
|
"-DCLANG_ASAN_UBSAN=ON"
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
} // flake-utils.lib.eachDefaultSystem (system:
|
} //
|
||||||
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
overlays = [ self.overlay ];
|
overlays = [ self.overlay ];
|
||||||
inherit system;
|
inherit system;
|
||||||
};
|
};
|
||||||
|
|
||||||
lua = pkgs.lua5_1;
|
|
||||||
|
|
||||||
pythonEnv = pkgs.python3.withPackages(ps: [
|
pythonEnv = pkgs.python3.withPackages(ps: [
|
||||||
ps.msgpack
|
ps.msgpack
|
||||||
ps.flake8 # for 'make pylint'
|
ps.flake8 # for 'make pylint'
|
||||||
]);
|
]);
|
||||||
in {
|
in
|
||||||
|
rec {
|
||||||
|
|
||||||
packages = with pkgs; {
|
packages = with pkgs; {
|
||||||
default = neovim;
|
|
||||||
inherit neovim neovim-debug neovim-developer;
|
inherit neovim neovim-debug neovim-developer;
|
||||||
};
|
};
|
||||||
|
|
||||||
checks = {
|
checks = {
|
||||||
pylint = pkgs.runCommand "pylint" {
|
pylint = pkgs.runCommandNoCC "pylint" {
|
||||||
nativeBuildInputs = [ pythonEnv ];
|
nativeBuildInputs = [ pythonEnv ];
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
} "make -C ${./..} pylint > $out";
|
} "make -C ${./..} pylint > $out";
|
||||||
|
|
||||||
shlint = pkgs.runCommand "shlint" {
|
shlint = pkgs.runCommandNoCC "shlint" {
|
||||||
nativeBuildInputs = [ pkgs.shellcheck ];
|
nativeBuildInputs = [ pkgs.shellcheck ];
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
} "make -C ${./..} shlint > $out";
|
} "make -C ${./..} shlint > $out";
|
||||||
};
|
};
|
||||||
|
|
||||||
# kept for backwards-compatibility
|
|
||||||
defaultPackage = pkgs.neovim;
|
defaultPackage = pkgs.neovim;
|
||||||
|
|
||||||
devShells = {
|
apps = {
|
||||||
default = pkgs.neovim-developer.overrideAttrs (oa: {
|
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;
|
defaultApp = apps.nvim;
|
||||||
oa.buildInputs ++ [
|
|
||||||
|
devShell = let
|
||||||
|
in
|
||||||
|
pkgs.neovim-developer.overrideAttrs(oa: {
|
||||||
|
|
||||||
|
buildInputs = with pkgs; oa.buildInputs ++ [
|
||||||
cmake
|
cmake
|
||||||
lua.pkgs.luacheck
|
|
||||||
sumneko-lua-language-server
|
|
||||||
pythonEnv
|
pythonEnv
|
||||||
include-what-you-use # for scripts/check-includes.py
|
include-what-you-use # for scripts/check-includes.py
|
||||||
jq # jq for scripts/vim-patch.sh -r
|
jq # jq for scripts/vim-patch.sh -r
|
||||||
@@ -133,6 +129,5 @@
|
|||||||
cp -f ${pkgs.tree-sitter.builtGrammars.tree-sitter-c}/parser runtime/parser/c.so
|
cp -f ${pkgs.tree-sitter.builtGrammars.tree-sitter-c}/parser runtime/parser/c.so
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
};
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
"globals": [
|
"globals": [
|
||||||
"vim",
|
"vim",
|
||||||
"describe",
|
"describe",
|
||||||
"pending",
|
|
||||||
"it",
|
"it",
|
||||||
"before_each",
|
"before_each",
|
||||||
"after_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
|
Use
|
||||||
.Ar shada
|
.Ar shada
|
||||||
instead of the default
|
instead of the default
|
||||||
.Pa ~/.local/state/nvim/shada/main.shada .
|
.Pa ~/.local/share/nvim/shada/main.shada .
|
||||||
If
|
If
|
||||||
.Ar shada
|
.Ar shada
|
||||||
is
|
is
|
||||||
@@ -200,8 +200,7 @@ Skip loading plugins.
|
|||||||
Implied by
|
Implied by
|
||||||
.Cm -u NONE .
|
.Cm -u NONE .
|
||||||
.It Fl -clean
|
.It Fl -clean
|
||||||
Start Nvim with "factory defaults" (no user config and plugins, no shada).
|
Mimic a fresh install of Nvim. Skip loading non-builtin plugins and shada (viminfo) file.
|
||||||
.Ic ":help --clean"
|
|
||||||
.It Fl o Ns Op Ar N
|
.It Fl o Ns Op Ar N
|
||||||
Open
|
Open
|
||||||
.Ar N
|
.Ar N
|
||||||
@@ -327,7 +326,7 @@ Print version information and exit.
|
|||||||
.Sh ENVIRONMENT
|
.Sh ENVIRONMENT
|
||||||
.Bl -tag -width Fl
|
.Bl -tag -width Fl
|
||||||
.It Ev NVIM_LOG_FILE
|
.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
|
:help $NVIM_LOG_FILE
|
||||||
.It Ev VIM
|
.It Ev VIM
|
||||||
Used to locate user files, such as init.vim.
|
Used to locate user files, such as init.vim.
|
||||||
@@ -341,19 +340,11 @@ Path to the user-local configuration directory, see
|
|||||||
Defaults to
|
Defaults to
|
||||||
.Pa ~/.config .
|
.Pa ~/.config .
|
||||||
:help xdg
|
: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
|
.It Ev XDG_DATA_HOME
|
||||||
Like
|
Like
|
||||||
.Ev XDG_CONFIG_HOME ,
|
.Ev XDG_CONFIG_HOME ,
|
||||||
but used to store data not generally edited by the user,
|
but used to store data not generally edited by the user,
|
||||||
things like runtime files.
|
namely swap, backup, and ShaDa files.
|
||||||
Defaults to
|
Defaults to
|
||||||
.Pa ~/.local/share .
|
.Pa ~/.local/share .
|
||||||
:help xdg
|
:help xdg
|
@@ -1,6 +1,8 @@
|
|||||||
<CPackWiXPatch>
|
<CPackWiXPatch>
|
||||||
<!-- Fragment ID is from: <your build dir>/_CPack_Packages/win64/WIX/files.wxs -->
|
<!-- Fragment ID is from: <your build dir>/_CPack_Packages/win64/WIX/files.wxs -->
|
||||||
<CPackWiXFragment Id="CM_CP_bin.nvim.exe">
|
<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
|
<Environment
|
||||||
Id='UpdatePath'
|
Id='UpdatePath'
|
||||||
Name='PATH'
|
Name='PATH'
|
||||||
@@ -8,7 +10,7 @@
|
|||||||
Permanent='no'
|
Permanent='no'
|
||||||
System='yes'
|
System='yes'
|
||||||
Part='last'
|
Part='last'
|
||||||
Value='[INSTALL_ROOT]bin'
|
Value='[INSTALL_ROOT]/bin'
|
||||||
/>
|
/>
|
||||||
</CPackWiXFragment>
|
</CPackWiXFragment>
|
||||||
</CPackWiXPatch>
|
</CPackWiXPatch>
|
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
|
add_custom_target(doc_html
|
||||||
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
|
COMMAND make html
|
||||||
-V1 -es --clean -c "lua require('scripts.gen_help_html').gen('./build/runtime/doc', './build/doc_html', nil, 'todo_commit_id')" -c "0cq"
|
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${GENERATED_HELP_TAGS}
|
${GENERATED_HELP_TAGS}
|
||||||
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
|
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
|
||||||
@@ -119,16 +117,16 @@ endif()
|
|||||||
globrecurse_wrapper(RUNTIME_PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR} *.awk *.sh *.bat)
|
globrecurse_wrapper(RUNTIME_PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR} *.awk *.sh *.bat)
|
||||||
|
|
||||||
foreach(PROG ${RUNTIME_PROGRAMS})
|
foreach(PROG ${RUNTIME_PROGRAMS})
|
||||||
get_filename_component(BASEDIR ${PROG} DIRECTORY)
|
get_filename_component(BASEDIR ${PROG} PATH)
|
||||||
install_helper(PROGRAMS ${PROG}
|
install_helper(PROGRAMS ${PROG}
|
||||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/${BASEDIR})
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/${BASEDIR})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
globrecurse_wrapper(RUNTIME_FILES ${CMAKE_CURRENT_SOURCE_DIR}
|
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})
|
foreach(F ${RUNTIME_FILES})
|
||||||
get_filename_component(BASEDIR ${F} DIRECTORY)
|
get_filename_component(BASEDIR ${F} PATH)
|
||||||
install_helper(FILES ${F}
|
install_helper(FILES ${F}
|
||||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/${BASEDIR})
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/${BASEDIR})
|
||||||
endforeach()
|
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
|
|
105
runtime/autoload/dist/ft.vim
vendored
@@ -1,7 +1,7 @@
|
|||||||
" Vim functions for file type detection
|
" Vim functions for file type detection
|
||||||
"
|
"
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" 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
|
" These functions are moved here from runtime/filetype.vim to make startup
|
||||||
" faster.
|
" faster.
|
||||||
@@ -78,30 +78,22 @@ func dist#ft#FTbas()
|
|||||||
|
|
||||||
" most frequent FreeBASIC-specific keywords in distro files
|
" 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_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*\%(' ..
|
let fb_preproc = '\c^\s*\%(#\a\+\|option\s\+\%(byval\|dynamic\|escape\|\%(no\)\=gosub\|nokeyword\|private\|static\)\>\)'
|
||||||
\ '#\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_comment = "^\\s*/'"
|
let fb_comment = "^\\s*/'"
|
||||||
" OPTION EXPLICIT, without the leading underscore, is common to many dialects
|
" OPTION EXPLICIT, without the leading underscore, is common to many dialects
|
||||||
let qb64_preproc = '\c^\s*\%($\a\+\|option\s\+\%(_explicit\|_\=explicitarray\)\>\)'
|
let qb64_preproc = '\c^\s*\%($\a\+\|option\s\+\%(_explicit\|_\=explicitarray\)\>\)'
|
||||||
|
|
||||||
for lnum in range(1, min([line("$"), 100]))
|
let lines = getline(1, min([line("$"), 100]))
|
||||||
let line = getline(lnum)
|
|
||||||
if line =~ s:ft_visual_basic_content
|
if match(lines, fb_preproc) > -1 || match(lines, fb_comment) > -1 || match(lines, fb_keywords) > -1
|
||||||
setf vb
|
|
||||||
return
|
|
||||||
elseif line =~ fb_preproc || line =~ fb_comment || line =~ fb_keywords
|
|
||||||
setf freebasic
|
setf freebasic
|
||||||
return
|
elseif match(lines, qb64_preproc) > -1
|
||||||
elseif line =~ qb64_preproc
|
|
||||||
setf qb64
|
setf qb64
|
||||||
return
|
elseif match(lines, s:ft_visual_basic_content) > -1
|
||||||
endif
|
setf vb
|
||||||
endfor
|
else
|
||||||
setf basic
|
setf basic
|
||||||
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func dist#ft#FTbtm()
|
func dist#ft#FTbtm()
|
||||||
@@ -139,23 +131,6 @@ func dist#ft#FTcfg()
|
|||||||
endif
|
endif
|
||||||
endfunc
|
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()
|
func dist#ft#FTlpc()
|
||||||
if exists("g:lpc_syntax_for_c")
|
if exists("g:lpc_syntax_for_c")
|
||||||
let lnum = 1
|
let lnum = 1
|
||||||
@@ -348,7 +323,7 @@ func dist#ft#FTidl()
|
|||||||
setf idl
|
setf idl
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Distinguish between "default", Prolog and Cproto prototype file. */
|
" Distinguish between "default" and Cproto prototype file. */
|
||||||
func dist#ft#ProtoCheck(default)
|
func dist#ft#ProtoCheck(default)
|
||||||
" Cproto files have a comment in the first line and a function prototype in
|
" 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
|
" the second line, it always ends in ";". Indent files may also have
|
||||||
@@ -358,14 +333,7 @@ func dist#ft#ProtoCheck(default)
|
|||||||
if getline(2) =~ '.;$'
|
if getline(2) =~ '.;$'
|
||||||
setf cpp
|
setf cpp
|
||||||
else
|
else
|
||||||
" recognize Prolog by specific text in the first non-empty line
|
exe 'setf ' . a:default
|
||||||
" 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
|
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -466,7 +434,7 @@ func dist#ft#FTmm()
|
|||||||
setf nroff
|
setf nroff
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Returns true if file content looks like LambdaProlog module
|
" Returns true if file content looks like LambdaProlog
|
||||||
func IsLProlog()
|
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
|
" LambdaProlog comment may be RAPID header
|
||||||
@@ -526,8 +494,6 @@ func dist#ft#FTinc()
|
|||||||
" headers so assume POV-Ray
|
" headers so assume POV-Ray
|
||||||
elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? s:ft_pascal_keywords
|
elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? s:ft_pascal_keywords
|
||||||
setf pascal
|
setf pascal
|
||||||
elseif lines =~# '\<\%(require\|inherit\)\>' || lines =~# '[A-Z][A-Za-z0-9_:${}]*\s\+\%(??\|[?:+]\)\?= '
|
|
||||||
setf bitbake
|
|
||||||
else
|
else
|
||||||
call dist#ft#FTasmsyntax()
|
call dist#ft#FTasmsyntax()
|
||||||
if exists("b:asmsyntax")
|
if exists("b:asmsyntax")
|
||||||
@@ -856,44 +822,6 @@ func dist#ft#FTperl()
|
|||||||
return 0
|
return 0
|
||||||
endfunc
|
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()
|
func dist#ft#FTsys()
|
||||||
if exists("g:filetype_sys")
|
if exists("g:filetype_sys")
|
||||||
exe "setf " .. g:filetype_sys
|
exe "setf " .. g:filetype_sys
|
||||||
@@ -1064,23 +992,20 @@ func dist#ft#FTtf()
|
|||||||
setf tf
|
setf tf
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
let s:ft_krl_header = '\&\w+'
|
|
||||||
" Determine if a *.src file is Kuka Robot Language
|
" Determine if a *.src file is Kuka Robot Language
|
||||||
func dist#ft#FTsrc()
|
func dist#ft#FTsrc()
|
||||||
let ft_krl_def_or_deffct = '%(global\s+)?def%(fct)?>'
|
|
||||||
if exists("g:filetype_src")
|
if exists("g:filetype_src")
|
||||||
exe "setf " .. 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
|
setf krl
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Determine if a *.dat file is Kuka Robot Language
|
" Determine if a *.dat file is Kuka Robot Language
|
||||||
func dist#ft#FTdat()
|
func dist#ft#FTdat()
|
||||||
let ft_krl_defdat = 'defdat>'
|
|
||||||
if exists("g:filetype_dat")
|
if exists("g:filetype_dat")
|
||||||
exe "setf " .. 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
|
setf krl
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
" Vim filetype plugin file
|
" Vim filetype plugin file
|
||||||
" Language: FreeBASIC
|
" Language: FreeBASIC
|
||||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
" 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
|
" Dialects can be one of fb, qb, fblite, or deprecated
|
||||||
" Precedence is forcelang > #lang > lang
|
" Precedence is forcelang > #lang > lang
|
||||||
@@ -18,16 +18,17 @@ function! freebasic#GetDialect() abort
|
|||||||
|
|
||||||
" override with #lang directive or metacommand
|
" 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 pat = '\c^\s*\%(#\s*lang\s\+\|''\s*$lang\s*:\s*\)"\([^"]*\)"'
|
||||||
|
|
||||||
let save_cursor = getcurpos()
|
let save_cursor = getcurpos()
|
||||||
call cursor(1, 1)
|
call cursor(1, 1)
|
||||||
let lnum = search(pat, 'cn')
|
let lnum = search(pat, 'n', '', '', skip)
|
||||||
call setpos('.', save_cursor)
|
call setpos('.', save_cursor)
|
||||||
|
|
||||||
if lnum
|
if lnum
|
||||||
let word = matchlist(getline(lnum), pat)[1]
|
let word = matchlist(getline(lnum), pat)[1]
|
||||||
if word =~? '\<\%(fb\|deprecated\|fblite\|qb\)\>'
|
if word =~? '\%(fb\|deprecated\|fblite\|qb\)'
|
||||||
let dialect = word
|
let dialect = word
|
||||||
else
|
else
|
||||||
echomsg "freebasic#GetDialect: Invalid lang, found '" .. word .. "' at line " .. lnum .. " " .. getline(lnum)
|
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)
|
for v in values(healthchecks)
|
||||||
let output[v[0]] = v[1:]
|
let output[v[0]] = v[1:]
|
||||||
endfor
|
endfor
|
||||||
try
|
|
||||||
" vim.health is not a healthcheck, skip it
|
|
||||||
call remove(output, 'vim')
|
|
||||||
catch
|
|
||||||
endtry
|
|
||||||
return output
|
return output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@ function! s:check_config() abort
|
|||||||
let shadafile = empty(&shada) ? &shada : substitute(matchstr(
|
let shadafile = empty(&shada) ? &shada : substitute(matchstr(
|
||||||
\ split(&shada, ',')[-1], '^n.\+'), '^n', '', '')
|
\ split(&shada, ',')[-1], '^n.\+'), '^n', '', '')
|
||||||
let shadafile = empty(&shadafile) ? empty(shadafile) ?
|
let shadafile = empty(&shadafile) ? empty(shadafile) ?
|
||||||
\ stdpath('state').'/shada/main.shada' : expand(shadafile)
|
\ stdpath('data').'/shada/main.shada' : expand(shadafile)
|
||||||
\ : &shadafile ==# 'NONE' ? '' : &shadafile
|
\ : &shadafile ==# 'NONE' ? '' : &shadafile
|
||||||
if !empty(shadafile) && empty(glob(shadafile))
|
if !empty(shadafile) && empty(glob(shadafile))
|
||||||
" Since this may be the first time neovim has been run, we will try to
|
" 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`.',
|
\ ['Install a different Nvim package, or rebuild with `CMAKE_BUILD_TYPE=RelWithDebInfo`.',
|
||||||
\ s:suggest_faq])
|
\ s:suggest_faq])
|
||||||
endif
|
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
|
endfunction
|
||||||
|
|
||||||
function! s:get_tmux_option(option) abort
|
function! s:get_tmux_option(option) abort
|
||||||
@@ -235,7 +225,7 @@ function! s:check_tmux() abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" check for RGB capabilities
|
" 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_tc = stridx(info, " Tc: (flag) true") != -1
|
||||||
let has_rgb = stridx(info, " RGB: (flag) true") != -1
|
let has_rgb = stridx(info, " RGB: (flag) true") != -1
|
||||||
if !has_tc && !has_rgb
|
if !has_tc && !has_rgb
|
||||||
|
@@ -203,7 +203,7 @@ function! s:version_info(python) abort
|
|||||||
let nvim_path = s:trim(s:system([
|
let nvim_path = s:trim(s:system([
|
||||||
\ a:python, '-c',
|
\ a:python, '-c',
|
||||||
\ 'import sys; ' .
|
\ '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__)']))
|
\ 'import neovim; print(neovim.__file__)']))
|
||||||
if s:shell_error || empty(nvim_path)
|
if s:shell_error || empty(nvim_path)
|
||||||
return [python_version, 'unable to load neovim Python module', pypi_version,
|
return [python_version, 'unable to load neovim Python module', pypi_version,
|
||||||
@@ -615,10 +615,10 @@ function! s:check_node() abort
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !executable('node') || (!executable('npm') && !executable('yarn') && !executable('pnpm'))
|
if !executable('node') || (!executable('npm') && !executable('yarn'))
|
||||||
call health#report_warn(
|
call health#report_warn(
|
||||||
\ '`node` and `npm` (or `yarn`, `pnpm`) must be in $PATH.',
|
\ '`node` and `npm` (or `yarn`) must be in $PATH.',
|
||||||
\ ['Install Node.js and verify that `node` and `npm` (or `yarn`, `pnpm`) commands work.'])
|
\ ['Install Node.js and verify that `node` and `npm` (or `yarn`) commands work.'])
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let node_v = get(split(s:system(['node', '-v']), "\n"), 0, '')
|
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()
|
let [host, err] = provider#node#Detect()
|
||||||
if empty(host)
|
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: npm install -g neovim',
|
||||||
\ 'Run in shell (if you use yarn): yarn global add 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'])
|
\ 'You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim'])
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
call health#report_info('Nvim node.js host: '. host)
|
call health#report_info('Nvim node.js host: '. host)
|
||||||
|
|
||||||
let manager = 'npm'
|
let manager = executable('npm') ? 'npm' : 'yarn'
|
||||||
if executable('yarn')
|
|
||||||
let manager = 'yarn'
|
|
||||||
elseif executable('pnpm')
|
|
||||||
let manager = 'pnpm'
|
|
||||||
endif
|
|
||||||
|
|
||||||
let latest_npm_cmd = has('win32') ?
|
let latest_npm_cmd = has('win32') ?
|
||||||
\ 'cmd /c '. manager .' info neovim --json' :
|
\ 'cmd /c '. manager .' info neovim --json' :
|
||||||
\ 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',
|
\ printf('Package "neovim" is out-of-date. Installed: %s, latest: %s',
|
||||||
\ current_npm, latest_npm),
|
\ current_npm, latest_npm),
|
||||||
\ ['Run in shell: npm install -g neovim',
|
\ ['Run in shell: npm install -g neovim',
|
||||||
\ 'Run in shell (if you use yarn): yarn global add neovim',
|
\ 'Run in shell (if you use yarn): yarn global add neovim'])
|
||||||
\ 'Run in shell (if you use pnpm): pnpm install -g neovim'])
|
|
||||||
else
|
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
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|