mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
Compare commits
15 Commits
release-0.
...
v0.3.6
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8a6bb66e80 | ||
![]() |
4553fc5e6c | ||
![]() |
877d539904 | ||
![]() |
60c3c92db1 | ||
![]() |
d7cf93ce34 | ||
![]() |
1060bfd033 | ||
![]() |
f891131c6b | ||
![]() |
9a5488c2a6 | ||
![]() |
1793ba8176 | ||
![]() |
947069ba14 | ||
![]() |
46c7e12f27 | ||
![]() |
b98be54148 | ||
![]() |
f1843c0035 | ||
![]() |
1204421888 | ||
![]() |
aaa8c3d711 |
29
.cirrus.yml
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
|
|
@@ -1,11 +1,11 @@
|
|||||||
BasedOnStyle: Google
|
BasedOnStyle: Google
|
||||||
Language: Cpp
|
Language: Cpp
|
||||||
ColumnLimit: 100
|
ColumnLimit: 80
|
||||||
IndentWidth: 2
|
IndentWidth: 2
|
||||||
TabWidth: 8
|
TabWidth: 2
|
||||||
UseTab: Never
|
UseTab: Never
|
||||||
IndentCaseLabels: false
|
IndentCaseLabels: true
|
||||||
BreakBeforeBraces: Custom
|
BreakBeforeBraces: Linux
|
||||||
AlignEscapedNewlinesLeft: false
|
AlignEscapedNewlinesLeft: false
|
||||||
AllowShortFunctionsOnASingleLine: false
|
AllowShortFunctionsOnASingleLine: false
|
||||||
AlignTrailingComments: true
|
AlignTrailingComments: true
|
||||||
@@ -17,51 +17,4 @@ AllowShortLoopsOnASingleLine: false
|
|||||||
BinPackParameters: false
|
BinPackParameters: false
|
||||||
BreakBeforeBinaryOperators: true
|
BreakBeforeBinaryOperators: true
|
||||||
BreakBeforeTernaryOperators: true
|
BreakBeforeTernaryOperators: true
|
||||||
ContinuationIndentWidth: 2
|
ContinuationIndentWidth: 4
|
||||||
AlwaysBreakAfterDefinitionReturnType: None
|
|
||||||
AlwaysBreakAfterReturnType: None
|
|
||||||
AlwaysBreakBeforeMultilineStrings: No
|
|
||||||
AlwaysBreakTemplateDeclarations: No
|
|
||||||
AlignEscapedNewlines: DontAlign
|
|
||||||
BinPackArguments: false
|
|
||||||
BraceWrapping:
|
|
||||||
AfterClass: false
|
|
||||||
AfterControlStatement: false
|
|
||||||
AfterEnum: false
|
|
||||||
AfterFunction: true
|
|
||||||
AfterObjCDeclaration: false
|
|
||||||
AfterStruct: false
|
|
||||||
AfterUnion: false
|
|
||||||
BeforeCatch: false
|
|
||||||
BeforeElse: false
|
|
||||||
IndentBraces: false
|
|
||||||
PointerAlignment: Right
|
|
||||||
SortIncludes: true
|
|
||||||
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
|
|
||||||
|
2
.clangd
2
.clangd
@@ -1,2 +0,0 @@
|
|||||||
CompileFlags:
|
|
||||||
CompilationDatabase: build/ # Search build/ directory for compile_commands.json
|
|
@@ -3,12 +3,9 @@ root = true
|
|||||||
[*]
|
[*]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
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}]
|
|
||||||
max_line_length = 100
|
|
||||||
|
|
||||||
[{Makefile,**/Makefile,runtime/doc/*.txt}]
|
[{Makefile,**/Makefile,runtime/doc/*.txt}]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
@@ -1,62 +0,0 @@
|
|||||||
# To use this file (requires git 2.23):
|
|
||||||
# git config blame.ignoreRevsFile .git-blame-ignore-revs
|
|
||||||
|
|
||||||
# eval.c: factor out eval/funcs.c #11828
|
|
||||||
# - This is a move/rename. git 2.33 doesn't know how to ignore it.
|
|
||||||
# It is here anyway, (1) in case git improves later, and (2) to
|
|
||||||
# save you the trouble of attempting this.
|
|
||||||
6c5bbf07d988ef55e5e8ba8d70b62c1f0885261b
|
|
||||||
|
|
||||||
# symbol renames
|
|
||||||
6186df3562e33e92f04ed8c850204ceabc4746e1
|
|
||||||
|
|
||||||
# style (uncrustify, etc.)
|
|
||||||
2d240024acbd68c2d3f82bc72cb12b1a4928c6bf
|
|
||||||
61178778230e609d68b271ffd53ffd993cd23c42
|
|
||||||
15af08ad176339d1f269ce264bb0efea283c9536
|
|
||||||
47f99d66440ae8be26b34531989ac61edc1ad9fe
|
|
||||||
1e49a1c888a3d9a581f4aa409a26ada3ac2417cb
|
|
||||||
3b3dbcf7b7ba5466e6ab643e256f2374b520a6b2
|
|
||||||
e8067d1490a31ff76143d576dc9948b4f09c6c55
|
|
||||||
d5b66e88601b4d2fde5d905f9d12847126ba4449
|
|
||||||
07715044887d82f74254e64c4c32fa49b0501bea
|
|
||||||
6ed43f8f1caad702f9590d174c5ec142f3d85b18
|
|
||||||
0a83017fe95df0290adb98ec6bf457b96a3fab17
|
|
||||||
867e8885991ae450019c18aa5e42546bd4b62c2c
|
|
||||||
1f49268c46fcbe65f7e2e2cb620e6f51c059cf9e
|
|
||||||
51a98aa0c2fe3231a0ffc8a78189bc6fafd6abf6
|
|
||||||
853346a94d6aa78c97314a3b217fb5a5408a47f1
|
|
||||||
30fefee684e641a0c6867446c6de30efa2f0a126
|
|
||||||
f4ca3a29ddcb0c98e8e09c45a6342af709f8cc45
|
|
||||||
48e67b229415b4e2b3315bd00b817e5f9ab970c8
|
|
||||||
7a26eb8a567cbc831d4f629f9eccb767a44436b8
|
|
||||||
2f9b9e61d7417183f2d9f36d804247c0926be9d4
|
|
||||||
c0767bd4f3ce7b34bb77da0657c49ba10ba1b32e
|
|
||||||
d90fb1c0bfc1e64c783c385a79e7de87013dadba
|
|
||||||
9c268263b1792d00b3ffdfd7495af2575862656e
|
|
||||||
8c74c895b300bcee5fa937a2329d1d4756567b42
|
|
||||||
40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf
|
|
||||||
4472c56d54f447040f6e8610b261b7efa0d04eb6
|
|
||||||
a68faed02dc8e37b8f10da14dc02e33e6ed93947
|
|
||||||
725cbe7d414f609e769081276f2a034e32a4337b
|
|
||||||
7e3bdc75e44b9139d8afaea4381b53ae78b15746
|
|
||||||
4ba12b3dda34472c193c9fa8ffd7d3bd5b6c04d6
|
|
||||||
849f104c2789c884428fd45501912c6591a78e12
|
|
||||||
38dd53c525054daf83dba27d7d46e90e8b41fa50
|
|
||||||
6059784770c4c88fb6fe528b9f7634192fa1164e
|
|
||||||
ee031eb5256bb83e0d6add2bae6fd943a4186ffe
|
|
||||||
69e11b58b4db0952f11a5ff85aa7150b5f5b8db8
|
|
||||||
271bb32855853b011fceaf0ad2f829bce66b2a19
|
|
||||||
aefdc6783cb77f09786542c90901a9e7120bea42
|
|
||||||
aa4f9c5341f5280f16cce0630ea54b84eef717b3
|
|
||||||
0adc66171a355a12494d87ebb767d509540c7ef9
|
|
||||||
93f24403f8cc760ff47979c596976b53a8b16358
|
|
||||||
1ffd527c837fb2465c9659273bbe5447a1352db2
|
|
||||||
2498e9feb025361576603a0101c86393d211e31e
|
|
||||||
|
|
||||||
# typos
|
|
||||||
d238b8f6003d34cae7f65ff7585b48a2cd9449fb
|
|
||||||
4547137aaff32b20172870a549d3a28a3c7adf1c
|
|
||||||
|
|
||||||
# generated docs
|
|
||||||
ea333badd24f691c753d8048f911d1db349bc2cd
|
|
16
.gitattributes
vendored
16
.gitattributes
vendored
@@ -1,16 +0,0 @@
|
|||||||
*.h.in linguist-language=C
|
|
||||||
*.c.in linguist-language=C
|
|
||||||
*CMakeLists.txt linguist-language=CMake
|
|
||||||
|
|
||||||
runtime/doc/* linguist-documentation
|
|
||||||
|
|
||||||
src/xdiff/** linguist-vendored
|
|
||||||
src/cjson/** linguist-vendored
|
|
||||||
src/unicode/** linguist-vendored
|
|
||||||
|
|
||||||
src/nvim/testdir/test42.in diff
|
|
||||||
|
|
||||||
.github/ export-ignore
|
|
||||||
.travis.yml export-ignore
|
|
||||||
codecov.yml export-ignore
|
|
||||||
.builds/ export-ignore
|
|
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,2 +0,0 @@
|
|||||||
github: neovim
|
|
||||||
open_collective: neovim
|
|
75
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
75
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -1,75 +0,0 @@
|
|||||||
name: Bug Report
|
|
||||||
description: Report a problem in Neovim
|
|
||||||
labels: [bug]
|
|
||||||
body:
|
|
||||||
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: "Neovim version (nvim -v)"
|
|
||||||
placeholder: "0.6.0 commit db1b0ee3b30f"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: "Vim (not Nvim) behaves the same?"
|
|
||||||
description: "Does `vim -u DEFAULTS` have the same issue? Note the exact Vim version (`8.x.yyyy`)."
|
|
||||||
placeholder: "no, vim 7.3.432"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: "Operating system/version"
|
|
||||||
placeholder: "macOS 11.5"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: "Terminal name/version"
|
|
||||||
placeholder: "xterm 3.1"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: "$TERM environment variable"
|
|
||||||
placeholder: "xterm-256color"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: "Installation"
|
|
||||||
description: "How did you install neovim: build from repo / system package manager / appimage / homebrew / snap / chocolatey / other (describe)?"
|
|
||||||
placeholder: "Arch User Repository (AUR)"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: "How to reproduce the issue"
|
|
||||||
description: |
|
|
||||||
- Steps to reproduce using `nvim --clean` ("factory defaults").
|
|
||||||
- For build failures: list the exact steps including CMake flags (if any).
|
|
||||||
- For shell-related problems: try `env -i TERM=ansi-256color "$(which nvim)"`.
|
|
||||||
placeholder: |
|
|
||||||
nvim --clean
|
|
||||||
:edit foo
|
|
||||||
yiwp
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: "Expected behavior"
|
|
||||||
description: "Describe the behavior you expect. May include logs, images, or videos."
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: "Actual behavior"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
5
.github/ISSUE_TEMPLATE/config.yml
vendored
5
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +0,0 @@
|
|||||||
blank_issues_enabled: false
|
|
||||||
contact_links:
|
|
||||||
- name: Question
|
|
||||||
url: https://neovim.discourse.group/
|
|
||||||
about: Ask questions about configuration and usage of Neovim
|
|
21
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
21
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -1,21 +0,0 @@
|
|||||||
name: Feature request
|
|
||||||
description: Request an enhancement for Neovim
|
|
||||||
labels: [enhancement]
|
|
||||||
body:
|
|
||||||
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Before requesting: search [existing issues](https://github.com/neovim/neovim/labels/enhancement) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ).
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: "Feature already in Vim?"
|
|
||||||
description: "Does the feature already exist in Vim? If possible, specify which version (or commit) that introduced it."
|
|
||||||
placeholder: "Yes, Vim 7.3.432"
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: "Feature description"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
54
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
54
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
@@ -1,54 +0,0 @@
|
|||||||
name: Language server (LSP) client bug
|
|
||||||
description: Report an issue with Neovim LSP
|
|
||||||
labels: [bug, lsp]
|
|
||||||
body:
|
|
||||||
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" or "Why isn't X language server/feature working?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: "Neovim version (nvim -v)"
|
|
||||||
placeholder: "0.6.0 commit db1b0ee3b30f"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: "Language server name/version"
|
|
||||||
placeholder: "rls 0.5.2"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: "Operating system/version"
|
|
||||||
placeholder: "emacs 23"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: 'Steps to reproduce using "nvim -u minimal_init.lua"'
|
|
||||||
description: |
|
|
||||||
- Download the minimal config with `curl -LO https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua` and modify it to include any specific commands or servers pertaining to your issues.
|
|
||||||
- _Note_: if the issue is with an autocompletion or other LSP plugin, report to that plugin's issue tracker.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: "Expected behavior"
|
|
||||||
description: "Describe the behavior you expect. May include logs, images, or videos."
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: "Actual behavior"
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: "Log file"
|
|
||||||
placeholder: "https://gist.github.com/prakhar1989/1b0a2c9849b2e1e912fb"
|
|
||||||
description: |
|
|
||||||
- Upload `lsp.log` before and after the problem in a [secret gist](https://gist.github.com/). Paste the URL to the gist.
|
|
||||||
- You can set the log level by adding `vim.lsp.set_log_level("debug")` after setting up LSP in your config.
|
|
||||||
- You can find the location of the log with `:lua print(vim.lsp.get_log_path())`
|
|
65
.github/labeler.yml
vendored
65
.github/labeler.yml
vendored
@@ -1,65 +0,0 @@
|
|||||||
"lsp":
|
|
||||||
- runtime/lua/vim/lsp.lua
|
|
||||||
- runtime/lua/vim/lsp/*
|
|
||||||
|
|
||||||
"lua":
|
|
||||||
- runtime/lua/**/*
|
|
||||||
- src/nvim/lua/*
|
|
||||||
|
|
||||||
"tui":
|
|
||||||
- src/nvim/tui/tui.*
|
|
||||||
|
|
||||||
"treesitter":
|
|
||||||
- src/nvim/lua/treesitter.*
|
|
||||||
- runtime/lua/vim/treesitter.lua
|
|
||||||
- runtime/lua/vim/treesitter/*
|
|
||||||
- runtime/queries/**/*
|
|
||||||
|
|
||||||
"diagnostic":
|
|
||||||
- runtime/lua/vim/diagnostic.lua
|
|
||||||
|
|
||||||
"dependencies":
|
|
||||||
- cmake.deps/**/*
|
|
||||||
|
|
||||||
"spell":
|
|
||||||
- src/nvim/spell*
|
|
||||||
|
|
||||||
"terminal":
|
|
||||||
- src/nvim/terminal.*
|
|
||||||
|
|
||||||
"column":
|
|
||||||
- src/nvim/sign*
|
|
||||||
|
|
||||||
"folds":
|
|
||||||
- src/nvim/fold*
|
|
||||||
|
|
||||||
"mouse":
|
|
||||||
- src/nvim/mouse*
|
|
||||||
|
|
||||||
"documentation":
|
|
||||||
- all: ["runtime/doc/*"]
|
|
||||||
- all: ["**/*.md"]
|
|
||||||
|
|
||||||
"clipboard":
|
|
||||||
- runtime/autoload/provider/clipboard.vim
|
|
||||||
|
|
||||||
"diff":
|
|
||||||
- src/nvim/diff.*
|
|
||||||
|
|
||||||
"build":
|
|
||||||
- CMakeLists.txt
|
|
||||||
- "**/CMakeLists.txt"
|
|
||||||
- "**/Makefile"
|
|
||||||
- "**/*.cmake"
|
|
||||||
|
|
||||||
"test":
|
|
||||||
- all: ["test/**/*"]
|
|
||||||
|
|
||||||
"ci":
|
|
||||||
- .github/labeler.yml
|
|
||||||
- .github/workflows/**/*
|
|
||||||
- .builds/*
|
|
||||||
- ci/**/*
|
|
||||||
|
|
||||||
"filetype":
|
|
||||||
- runtime/lua/vim/filetype.lua
|
|
16
.github/scripts/remove-reviewers.js
vendored
16
.github/scripts/remove-reviewers.js
vendored
@@ -1,16 +0,0 @@
|
|||||||
module.exports = async ({github, context}) => {
|
|
||||||
const requestedReviewers = await github.rest.pulls.listRequestedReviewers({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: context.issue.number
|
|
||||||
});
|
|
||||||
|
|
||||||
const reviewers = requestedReviewers.data.users.map(e => e.login)
|
|
||||||
|
|
||||||
github.rest.pulls.removeRequestedReviewers({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: context.issue.number,
|
|
||||||
reviewers: reviewers
|
|
||||||
});
|
|
||||||
}
|
|
92
.github/scripts/reviews.js
vendored
92
.github/scripts/reviews.js
vendored
@@ -1,92 +0,0 @@
|
|||||||
module.exports = async ({github, context}) => {
|
|
||||||
const pr_data = await github.rest.pulls.get({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: context.issue.number
|
|
||||||
})
|
|
||||||
const labels = pr_data.data.labels.map(e => e.name)
|
|
||||||
|
|
||||||
const reviewers = new Set()
|
|
||||||
if (labels.includes('api')) {
|
|
||||||
reviewers.add("bfredl")
|
|
||||||
reviewers.add("muniter")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('build')) {
|
|
||||||
reviewers.add("jamessan")
|
|
||||||
reviewers.add("justinmk")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('ci')) {
|
|
||||||
reviewers.add("dundargoc")
|
|
||||||
reviewers.add("jamessan")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('column')) {
|
|
||||||
reviewers.add("lewis6991")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('diagnostic')) {
|
|
||||||
reviewers.add("gpanders")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('diff')) {
|
|
||||||
reviewers.add("lewis6991")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('dependencies')) {
|
|
||||||
reviewers.add("jamessan")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('distribution')) {
|
|
||||||
reviewers.add("jamessan")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('documentation')) {
|
|
||||||
reviewers.add("clason")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('extmarks')) {
|
|
||||||
reviewers.add("bfredl")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('filetype')) {
|
|
||||||
reviewers.add("clason")
|
|
||||||
reviewers.add("gpanders")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('lsp')) {
|
|
||||||
reviewers.add("mfussenegger")
|
|
||||||
reviewers.add("glepnir")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('treesitter')) {
|
|
||||||
reviewers.add("bfredl")
|
|
||||||
reviewers.add("clason")
|
|
||||||
reviewers.add("vigoux")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('typo')) {
|
|
||||||
reviewers.add("dundargoc")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('ui')) {
|
|
||||||
reviewers.add("bfredl")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('vim-patch')) {
|
|
||||||
reviewers.add("seandewar")
|
|
||||||
reviewers.add("zeertzjq")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove person that opened the PR since they can't review themselves
|
|
||||||
const pr_opener = pr_data.data.user.login
|
|
||||||
reviewers.delete(pr_opener)
|
|
||||||
|
|
||||||
github.rest.pulls.requestReviewers({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: context.issue.number,
|
|
||||||
reviewers: Array.from(reviewers)
|
|
||||||
});
|
|
||||||
}
|
|
18
.github/workflows/api-docs-check.yml
vendored
18
.github/workflows/api-docs-check.yml
vendored
@@ -1,18 +0,0 @@
|
|||||||
name: Missing API docs
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches-ignore:
|
|
||||||
- 'marvim/api-doc-update**'
|
|
||||||
paths:
|
|
||||||
- 'src/nvim/api/*.[ch]'
|
|
||||||
- 'runtime/lua/**.lua'
|
|
||||||
- 'runtime/doc/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
call-regen-api-docs:
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
uses: ./.github/workflows/api-docs.yml
|
|
||||||
with:
|
|
||||||
check_only: true
|
|
70
.github/workflows/api-docs.yml
vendored
70
.github/workflows/api-docs.yml
vendored
@@ -1,70 +0,0 @@
|
|||||||
# Autogenerate the API docs on new commit to important branches
|
|
||||||
# Also work as a check for PR's to not forget committing their doc changes
|
|
||||||
# called from api-docs-check.yml
|
|
||||||
name: Autogenerate API docs
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'src/nvim/api/*.[ch]'
|
|
||||||
- 'runtime/lua/**.lua'
|
|
||||||
- 'runtime/doc/**'
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'release-[0-9]+.[0-9]+'
|
|
||||||
workflow_dispatch:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
check_only:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
regen-api-docs:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
# Fetch depth 0 is required if called through workflow_call. In order
|
|
||||||
# to create a PR we need to access other branches, which requires a
|
|
||||||
# full clone.
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen python3 python3-msgpack luajit
|
|
||||||
|
|
||||||
- name: Setup git config
|
|
||||||
run: |
|
|
||||||
git config --global user.name 'marvim'
|
|
||||||
git config --global user.email 'marvim@users.noreply.github.com'
|
|
||||||
|
|
||||||
- run: printf 'DOC_BRANCH=marvim/api-doc-update/%s\n' ${GITHUB_REF#refs/heads/} >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Generate docs
|
|
||||||
id: docs
|
|
||||||
run: |
|
|
||||||
git checkout -b ${DOC_BRANCH}
|
|
||||||
python3 scripts/gen_vimdoc.py
|
|
||||||
printf 'UPDATED_DOCS=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: FAIL, PR has not committed doc changes
|
|
||||||
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && inputs.check_only }}
|
|
||||||
run: |
|
|
||||||
echo "Job failed, run ./scripts/gen_vimdoc.py and commit your doc changes"
|
|
||||||
echo "The doc generation produces the following changes:"
|
|
||||||
git diff --color --exit-code
|
|
||||||
|
|
||||||
- name: Automatic PR
|
|
||||||
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && !inputs.check_only }}
|
|
||||||
run: |
|
|
||||||
git add -u
|
|
||||||
git commit -m 'docs: regenerate [skip ci]'
|
|
||||||
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${DOC_BRANCH}
|
|
||||||
gh pr create --draft --fill --base ${GITHUB_REF#refs/heads/} --head ${DOC_BRANCH} || true
|
|
27
.github/workflows/backport.yml
vendored
27
.github/workflows/backport.yml
vendored
@@ -1,27 +0,0 @@
|
|||||||
name: Backport
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types: [closed, labeled]
|
|
||||||
jobs:
|
|
||||||
backport:
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
name: Backport Pull Request
|
|
||||||
if: >
|
|
||||||
github.repository_owner == 'neovim' && (
|
|
||||||
github.event_name == 'pull_request_target' &&
|
|
||||||
github.event.pull_request.merged
|
|
||||||
)
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
# required to find all branches
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
- name: Create backport PRs
|
|
||||||
uses: zeebe-io/backport-action@v0.0.8
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
github_workspace: ${{ github.workspace }}
|
|
358
.github/workflows/ci.yml
vendored
358
.github/workflows/ci.yml
vendored
@@ -1,358 +0,0 @@
|
|||||||
name: CI
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'release-[0-9]+.[0-9]+'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'release-[0-9]+.[0-9]+'
|
|
||||||
paths-ignore:
|
|
||||||
- 'runtime/doc/*'
|
|
||||||
|
|
||||||
# Cancel any in-progress CI runs for a PR if it is updated
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
timeout-minutes: 10
|
|
||||||
env:
|
|
||||||
CC: gcc
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Setup common environment variables
|
|
||||||
run: ./.github/workflows/env.sh lint
|
|
||||||
|
|
||||||
- name: Install apt packages
|
|
||||||
run: |
|
|
||||||
sudo add-apt-repository ppa:neovim-ppa/stable
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y \
|
|
||||||
autoconf \
|
|
||||||
automake \
|
|
||||||
build-essential \
|
|
||||||
cmake \
|
|
||||||
flake8 \
|
|
||||||
gettext \
|
|
||||||
libluajit-5.1-dev \
|
|
||||||
libmsgpack-dev \
|
|
||||||
libtermkey-dev \
|
|
||||||
libtool-bin \
|
|
||||||
libtree-sitter-dev \
|
|
||||||
libunibilium-dev \
|
|
||||||
libuv1-dev \
|
|
||||||
libvterm-dev \
|
|
||||||
locales \
|
|
||||||
lua-busted \
|
|
||||||
lua-check \
|
|
||||||
lua-filesystem \
|
|
||||||
lua-inspect \
|
|
||||||
lua-lpeg \
|
|
||||||
lua-luv-dev \
|
|
||||||
lua-nvim \
|
|
||||||
luajit \
|
|
||||||
ninja-build \
|
|
||||||
pkg-config
|
|
||||||
|
|
||||||
- name: Cache uncrustify
|
|
||||||
id: cache-uncrustify
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ${{ env.CACHE_UNCRUSTIFY }}
|
|
||||||
key: ${{ env.UNCRUSTIFY_VERSION }}
|
|
||||||
|
|
||||||
- name: Clone uncrustify
|
|
||||||
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
repository: uncrustify/uncrustify
|
|
||||||
ref: ${{ env.UNCRUSTIFY_VERSION }}
|
|
||||||
path: uncrustify
|
|
||||||
|
|
||||||
- name: Install uncrustify
|
|
||||||
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
source_dir=uncrustify
|
|
||||||
build_dir=uncrustify/build
|
|
||||||
cmake -S $source_dir -B $build_dir -G Ninja -DCMAKE_BUILD_TYPE=Release
|
|
||||||
cmake --build $build_dir
|
|
||||||
mkdir -p $HOME/.cache
|
|
||||||
cp $build_dir/uncrustify ${{ env.CACHE_UNCRUSTIFY }}
|
|
||||||
|
|
||||||
- name: Cache artifacts
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ env.CACHE_NVIM_DEPS_DIR }}
|
|
||||||
key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!cmake.deps/**CMakeLists.txt') }}-${{ github.base_ref }}
|
|
||||||
|
|
||||||
- name: Build third-party deps
|
|
||||||
run: ./ci/before_script.sh
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: lintstylua
|
|
||||||
uses: JohnnyMorganz/stylua-action@v1
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
args: --check runtime/
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: lintlua
|
|
||||||
run: make lintlua
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: lintpy
|
|
||||||
run: make lintpy
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: lintsh
|
|
||||||
run: make lintsh
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: uncrustify
|
|
||||||
run: |
|
|
||||||
${{ env.CACHE_UNCRUSTIFY }} -c ./src/uncrustify.cfg -q --replace --no-backup $(find ./src/nvim -name "*.[ch]")
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: suggester / uncrustify
|
|
||||||
uses: reviewdog/action-suggester@v1
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
tool_name: uncrustify
|
|
||||||
cleanup: false
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: check uncrustify
|
|
||||||
run: |
|
|
||||||
git diff --color --exit-code
|
|
||||||
|
|
||||||
- name: Cache dependencies
|
|
||||||
run: ./ci/before_cache.sh
|
|
||||||
|
|
||||||
lintc:
|
|
||||||
# This job tests two things: it lints the code but also builds neovim using
|
|
||||||
# system dependencies instead of bundled dependencies. This is to make sure
|
|
||||||
# we are able to build neovim without pigeonholing ourselves into specifics
|
|
||||||
# of the bundled dependencies.
|
|
||||||
|
|
||||||
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
|
||||||
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 \
|
|
||||||
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 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
|
|
||||||
|
|
||||||
- name: Build nvim
|
|
||||||
run: ./ci/run_tests.sh build_nvim
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: lintc
|
|
||||||
run: make lintc
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: check-single-includes
|
|
||||||
run: make check-single-includes
|
|
||||||
|
|
||||||
- name: Cache dependencies
|
|
||||||
run: ./ci/before_cache.sh
|
|
||||||
|
|
||||||
posix:
|
|
||||||
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- flavor: asan
|
|
||||||
cc: clang-13
|
|
||||||
runner: ubuntu-20.04
|
|
||||||
os: linux
|
|
||||||
- flavor: tsan
|
|
||||||
cc: clang-13
|
|
||||||
runner: ubuntu-20.04
|
|
||||||
os: linux
|
|
||||||
- flavor: uchar
|
|
||||||
cc: gcc
|
|
||||||
runner: ubuntu-20.04
|
|
||||||
os: linux
|
|
||||||
- cc: clang
|
|
||||||
runner: macos-11
|
|
||||||
os: osx
|
|
||||||
|
|
||||||
# functionaltest-lua is our dumping ground for non-mainline configurations.
|
|
||||||
# 1. Check that the tests pass with PUC Lua instead of LuaJIT.
|
|
||||||
# 2. Use as oldest/minimum versions of dependencies/build tools we
|
|
||||||
# still explicitly support so we don't accidentally rely on
|
|
||||||
# features that is only available on later versions.
|
|
||||||
# 3. No treesitter parsers installed.
|
|
||||||
- flavor: functionaltest-lua
|
|
||||||
cc: gcc
|
|
||||||
runner: ubuntu-20.04
|
|
||||||
os: linux
|
|
||||||
cmake: minimum_required
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
timeout-minutes: 45
|
|
||||||
env:
|
|
||||||
CC: ${{ matrix.cc }}
|
|
||||||
CI_OS_NAME: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Setup common environment variables
|
|
||||||
run: ./.github/workflows/env.sh ${{ matrix.flavor }}
|
|
||||||
|
|
||||||
- name: Install apt packages
|
|
||||||
if: matrix.os == 'linux'
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y autoconf automake build-essential cmake cpanminus cscope gcc-multilib gdb gettext language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
|
|
||||||
|
|
||||||
- name: Install minimum required version of cmake
|
|
||||||
if: matrix.cmake == 'minimum_required'
|
|
||||||
env:
|
|
||||||
CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh'
|
|
||||||
CMAKE_VERSION: '3.10.0'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
|
|
||||||
mkdir -p "$HOME/.local/bin" /opt/cmake-custom
|
|
||||||
chmod a+x /tmp/cmake-installer.sh
|
|
||||||
/tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
|
|
||||||
ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake"
|
|
||||||
cmake_version="$(cmake --version | head -1)"
|
|
||||||
echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || {
|
|
||||||
echo "Unexpected CMake version: $cmake_version"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Install new clang
|
|
||||||
if: matrix.flavor == 'asan' || matrix.flavor == 'tsan'
|
|
||||||
run: |
|
|
||||||
wget https://apt.llvm.org/llvm.sh
|
|
||||||
chmod a+x llvm.sh
|
|
||||||
sudo ./llvm.sh 13
|
|
||||||
rm llvm.sh
|
|
||||||
|
|
||||||
- name: Install brew packages
|
|
||||||
if: matrix.os == 'osx'
|
|
||||||
run: |
|
|
||||||
brew update --quiet
|
|
||||||
brew install automake cpanminus ninja
|
|
||||||
|
|
||||||
- name: Setup interpreter packages
|
|
||||||
run: ./ci/install.sh
|
|
||||||
|
|
||||||
- name: Cache dependencies
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ env.CACHE_NVIM_DEPS_DIR }}
|
|
||||||
key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'cmake.deps/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
|
|
||||||
|
|
||||||
- name: Build third-party deps
|
|
||||||
run: ./ci/before_script.sh
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: ./ci/run_tests.sh build_nvim
|
|
||||||
|
|
||||||
- if: matrix.flavor != 'tsan' && matrix.flavor != 'functionaltest-lua' && !cancelled()
|
|
||||||
name: Unittests
|
|
||||||
run: ./ci/run_tests.sh unittests
|
|
||||||
|
|
||||||
- if: matrix.flavor != 'tsan' && !cancelled()
|
|
||||||
name: Functionaltests
|
|
||||||
run: ./ci/run_tests.sh functionaltests
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: Oldtests
|
|
||||||
run: ./ci/run_tests.sh oldtests
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: Install nvim
|
|
||||||
run: ./ci/run_tests.sh install_nvim
|
|
||||||
|
|
||||||
- name: Cache dependencies
|
|
||||||
run: ./ci/before_cache.sh
|
|
||||||
|
|
||||||
windows:
|
|
||||||
runs-on: windows-2019
|
|
||||||
timeout-minutes: 45
|
|
||||||
env:
|
|
||||||
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
|
||||||
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
|
||||||
CMAKE_BUILD_TYPE: "RelWithDebInfo"
|
|
||||||
name: windows (MSVC_64)
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ${{ env.DEPS_BUILD_DIR }}
|
|
||||||
key: ${{ hashFiles('cmake.deps\**') }}
|
|
||||||
|
|
||||||
- name: Build deps
|
|
||||||
run: .\ci\build.ps1 -BuildDeps
|
|
||||||
|
|
||||||
- name: Build nvim
|
|
||||||
run: .\ci\build.ps1 -Build
|
|
||||||
|
|
||||||
- name: Install test deps
|
|
||||||
continue-on-error: false
|
|
||||||
run: .\ci\build.ps1 -EnsureTestDeps
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: Run tests
|
|
||||||
run: .\ci\build.ps1 -Test
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: Run old tests
|
|
||||||
run: .\ci\build.ps1 -TestOld
|
|
42
.github/workflows/codeql-analysis.yml
vendored
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
|
|
23
.github/workflows/commitlint.yml
vendored
23
.github/workflows/commitlint.yml
vendored
@@ -1,23 +0,0 @@
|
|||||||
name: "Commit Linter"
|
|
||||||
on:
|
|
||||||
# Only pull_request and push honor [skip ci]. Since this workflow must pass
|
|
||||||
# to merge a PR, it can't be skipped, so use pull_request_target
|
|
||||||
pull_request_target:
|
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
jobs:
|
|
||||||
lint-commits:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event.pull_request.draft == false
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
path: pr_nvim
|
|
||||||
- uses: rhysd/action-setup-vim@v1
|
|
||||||
with:
|
|
||||||
neovim: true
|
|
||||||
- run: wget https://raw.githubusercontent.com/neovim/neovim/master/scripts/lintcommit.lua
|
|
||||||
- run: nvim --clean -es +"cd pr_nvim" +"lua dofile('../lintcommit.lua').main({trace=true})"
|
|
44
.github/workflows/coverity-scan.yml
vendored
44
.github/workflows/coverity-scan.yml
vendored
@@ -1,44 +0,0 @@
|
|||||||
name: Coverity
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '10 0 * * *' # Run every day at 00:10
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
scan:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
|
|
||||||
|
|
||||||
- name: Download Coverity
|
|
||||||
run: |
|
|
||||||
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=neovim%2Fneovim" -O coverity_tool.tgz
|
|
||||||
mkdir cov-scan
|
|
||||||
tar ax -f coverity_tool.tgz --strip-components=1 -C cov-scan
|
|
||||||
env:
|
|
||||||
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build dependencies
|
|
||||||
run: make deps
|
|
||||||
|
|
||||||
- name: Build/scan neovim
|
|
||||||
run: |
|
|
||||||
env PATH=$(pwd)/cov-scan/bin:$PATH cov-build --dir cov-int make
|
|
||||||
|
|
||||||
- name: Submit results
|
|
||||||
run: |
|
|
||||||
tar zcf cov-scan.tgz cov-int
|
|
||||||
curl --form token=$TOKEN \
|
|
||||||
--form email=$EMAIL \
|
|
||||||
--form file=@cov-scan.tgz \
|
|
||||||
--form version="$(git rev-parse HEAD)" \
|
|
||||||
--form description="Weekly GHA scan" \
|
|
||||||
'https://scan.coverity.com/builds?project=neovim%2Fneovim'
|
|
||||||
env:
|
|
||||||
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
|
||||||
EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
|
|
70
.github/workflows/env.sh
vendored
70
.github/workflows/env.sh
vendored
@@ -1,70 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e -u
|
|
||||||
|
|
||||||
FLAVOR=${1:-}
|
|
||||||
|
|
||||||
cat <<EOF >> "$GITHUB_PATH"
|
|
||||||
$HOME/.local/bin
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<EOF >> "$GITHUB_ENV"
|
|
||||||
CI_BUILD_DIR=$GITHUB_WORKSPACE
|
|
||||||
BUILD_DIR=$GITHUB_WORKSPACE/build
|
|
||||||
DEPS_BUILD_DIR=$HOME/nvim-deps
|
|
||||||
INSTALL_PREFIX=$HOME/nvim-install
|
|
||||||
LOG_DIR=$GITHUB_WORKSPACE/build/log
|
|
||||||
NVIM_LOG_FILE=$GITHUB_WORKSPACE/build/.nvimlog
|
|
||||||
VALGRIND_LOG=$GITHUB_WORKSPACE/build/log/valgrind-%p.log
|
|
||||||
CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps
|
|
||||||
CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker
|
|
||||||
CACHE_UNCRUSTIFY=$HOME/.cache/uncrustify
|
|
||||||
UNCRUSTIFY_VERSION=uncrustify-0.75.0
|
|
||||||
EOF
|
|
||||||
|
|
||||||
DEPS_CMAKE_FLAGS=
|
|
||||||
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"
|
|
||||||
|
|
||||||
case "$FLAVOR" in
|
|
||||||
asan)
|
|
||||||
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
|
|
||||||
cat <<EOF >> "$GITHUB_ENV"
|
|
||||||
CLANG_SANITIZER=ASAN_UBSAN
|
|
||||||
SYMBOLIZER=asan_symbolize-13
|
|
||||||
ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan:intercept_tls_get_addr=0
|
|
||||||
UBSAN_OPTIONS=print_stacktrace=1 log_path=$GITHUB_WORKSPACE/build/log/ubsan
|
|
||||||
EOF
|
|
||||||
;;
|
|
||||||
tsan)
|
|
||||||
cat <<EOF >> "$GITHUB_ENV"
|
|
||||||
TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
|
|
||||||
CLANG_SANITIZER=TSAN
|
|
||||||
EOF
|
|
||||||
;;
|
|
||||||
uchar)
|
|
||||||
cat <<EOF >> "$GITHUB_ENV"
|
|
||||||
BUILD_UCHAR=1
|
|
||||||
EOF
|
|
||||||
;;
|
|
||||||
lint)
|
|
||||||
# Re-enable once system deps are available
|
|
||||||
# BUILD_FLAGS="$BUILD_FLAGS -DLIBLUV_LIBRARY:FILEPATH=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/lua/5.1/luv.so -DLIBLUV_INCLUDE_DIR:PATH=/usr/include/lua5.1"
|
|
||||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUV=ON"
|
|
||||||
cat <<EOF >> "$GITHUB_ENV"
|
|
||||||
USE_BUNDLED=OFF
|
|
||||||
EOF
|
|
||||||
;;
|
|
||||||
functionaltest-lua)
|
|
||||||
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
|
|
||||||
FUNCTIONALTEST=functionaltest-lua
|
|
||||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
cat <<EOF >> "$GITHUB_ENV"
|
|
||||||
$BUILD_FLAGS
|
|
||||||
DEPS_CMAKE_FLAGS=$DEPS_CMAKE_FLAGS
|
|
||||||
FUNCTIONALTEST=$FUNCTIONALTEST
|
|
||||||
EOF
|
|
49
.github/workflows/labeler.yml
vendored
49
.github/workflows/labeler.yml
vendored
@@ -1,49 +0,0 @@
|
|||||||
name: "Pull Request Labeler"
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types: [opened]
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
triage:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/labeler@v4
|
|
||||||
with:
|
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
sync-labels: ""
|
|
||||||
|
|
||||||
type-scope:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GH_REPO: ${{ github.repository }}
|
|
||||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
||||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
||||||
steps:
|
|
||||||
- name: "Extract commit type and add as label"
|
|
||||||
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" || true
|
|
||||||
- name: "Extract commit scope and add as label"
|
|
||||||
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')" || true
|
|
||||||
- name: "Extract if the PR is a breaking change and add it as label"
|
|
||||||
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true
|
|
||||||
|
|
||||||
request-reviewer:
|
|
||||||
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: ["triage", "type-scope"]
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: 'Request reviewers'
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const script = require('./.github/scripts/reviews.js')
|
|
||||||
await script({github, context})
|
|
65
.github/workflows/notes.md
vendored
65
.github/workflows/notes.md
vendored
@@ -1,65 +0,0 @@
|
|||||||
```
|
|
||||||
${NVIM_VERSION}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
### Windows
|
|
||||||
|
|
||||||
#### Zip
|
|
||||||
|
|
||||||
1. Download **nvim-win64.zip**
|
|
||||||
2. Extract the zip.
|
|
||||||
3. Run `nvim-qt.exe`
|
|
||||||
|
|
||||||
#### MSI
|
|
||||||
|
|
||||||
1. Download **nvim-win64.msi**
|
|
||||||
2. Run the MSI
|
|
||||||
3. Search and run `nvim-qt.exe` or run `nvim.exe` on your CLI of choice.
|
|
||||||
|
|
||||||
### macOS
|
|
||||||
|
|
||||||
1. Download **nvim-macos.tar.gz**
|
|
||||||
2. Run `xattr -c ./nvim-macos.tar.gz` (to avoid "unknown developer" warning)
|
|
||||||
3. Extract: `tar xzvf nvim-macos.tar.gz`
|
|
||||||
4. Run `./nvim-macos/bin/nvim`
|
|
||||||
|
|
||||||
### Linux (x64)
|
|
||||||
|
|
||||||
#### Tarball
|
|
||||||
|
|
||||||
1. Download **nvim-linux64.tar.gz**
|
|
||||||
2. Extract: `tar xzvf nvim-linux64.tar.gz`
|
|
||||||
3. Run `./nvim-linux64/bin/nvim`
|
|
||||||
|
|
||||||
#### Debian Package
|
|
||||||
|
|
||||||
1. Download **nvim-linux64.deb**
|
|
||||||
2. Install the package using `sudo apt install ./nvim-linux64.deb`
|
|
||||||
3. Run `nvim`
|
|
||||||
|
|
||||||
#### AppImage
|
|
||||||
1. Download **nvim.appimage**
|
|
||||||
2. Run `chmod u+x nvim.appimage && ./nvim.appimage`
|
|
||||||
- If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
|
|
||||||
```
|
|
||||||
./nvim.appimage --appimage-extract
|
|
||||||
./squashfs-root/usr/bin/nvim
|
|
||||||
```
|
|
||||||
|
|
||||||
### Other
|
|
||||||
|
|
||||||
- Install by [package manager](https://github.com/neovim/neovim/wiki/Installing-Neovim)
|
|
||||||
|
|
||||||
## SHA256 Checksums
|
|
||||||
|
|
||||||
```
|
|
||||||
${SHA_LINUX_64_TAR}
|
|
||||||
${SHA_LINUX_64_DEB}
|
|
||||||
${SHA_APP_IMAGE}
|
|
||||||
${SHA_APP_IMAGE_ZSYNC}
|
|
||||||
${SHA_MACOS}
|
|
||||||
${SHA_WIN_64_ZIP}
|
|
||||||
${SHA_WIN_64_MSI}
|
|
||||||
```
|
|
278
.github/workflows/release.yml
vendored
278
.github/workflows/release.yml
vendored
@@ -1,278 +0,0 @@
|
|||||||
name: Release
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '5 5 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
tag_name:
|
|
||||||
description: 'Tag name for release'
|
|
||||||
required: false
|
|
||||||
default: nightly
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- v[0-9]+.[0-9]+.[0-9]+
|
|
||||||
|
|
||||||
# Build on the oldest supported images, so we have broader compatibility
|
|
||||||
# Build with gcc-10 to prevent triggering #14150 (default is still gcc-9 on 20.04)
|
|
||||||
jobs:
|
|
||||||
linux:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
outputs:
|
|
||||||
version: ${{ steps.build.outputs.version }}
|
|
||||||
release: ${{ steps.build.outputs.release }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
|
|
||||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
|
||||||
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
|
|
||||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
|
||||||
run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV
|
|
||||||
- name: Build release
|
|
||||||
id: build
|
|
||||||
run: |
|
|
||||||
CC=gcc-10 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH="
|
|
||||||
printf 'version<<END\n' >> $GITHUB_OUTPUT
|
|
||||||
./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT
|
|
||||||
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
|
|
||||||
cd "$GITHUB_WORKSPACE/build/"
|
|
||||||
cpack -C $NVIM_BUILD_TYPE
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: nvim-linux64
|
|
||||||
path: |
|
|
||||||
build/nvim-linux64.tar.gz
|
|
||||||
build/nvim-linux64.deb
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
appimage:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
container:
|
|
||||||
image: ubuntu:18.04
|
|
||||||
options: --privileged # Privileged mode is needed to load fuse module.
|
|
||||||
steps:
|
|
||||||
- name: Prepare container
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y software-properties-common
|
|
||||||
add-apt-repository -y ppa:ubuntu-toolchain-r/test # For gcc-10.
|
|
||||||
add-apt-repository -y ppa:git-core/ppa # For git>=2.18.
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y git gcc-10
|
|
||||||
apt-get install -y fuse libfuse2 # For linuxdeploy.
|
|
||||||
# Workaround for https://github.com/actions/checkout/issues/766.
|
|
||||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
|
|
||||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
|
||||||
run: CC=gcc-10 make appimage-latest
|
|
||||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
|
||||||
run: CC=gcc-10 make appimage-nightly
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: appimage
|
|
||||||
path: |
|
|
||||||
build/bin/nvim.appimage
|
|
||||||
build/bin/nvim.appimage.zsync
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
macOS:
|
|
||||||
runs-on: macos-11
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Install brew packages
|
|
||||||
run: |
|
|
||||||
brew update --quiet
|
|
||||||
brew install automake ninja
|
|
||||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
|
||||||
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
|
|
||||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
|
||||||
run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV
|
|
||||||
- name: Provision universal `libintl`
|
|
||||||
run: |
|
|
||||||
GETTEXT_PREFIX="$(brew --prefix gettext)"
|
|
||||||
printf 'GETTEXT_PREFIX=%s\n' "$GETTEXT_PREFIX" >> $GITHUB_ENV
|
|
||||||
bottle_tag="arm64_big_sur"
|
|
||||||
brew fetch --bottle-tag="$bottle_tag" gettext
|
|
||||||
cd "$(mktemp -d)"
|
|
||||||
tar xf "$(brew --cache)"/**/*gettext*${bottle_tag}*.tar.gz
|
|
||||||
lipo gettext/*/lib/libintl.a "${GETTEXT_PREFIX}/lib/libintl.a" -create -output libintl.a
|
|
||||||
mv -f libintl.a /usr/local/lib/
|
|
||||||
- name: Ensure static linkage to `libintl`
|
|
||||||
run: |
|
|
||||||
# We're about to mangle `gettext`, so let's remove any potentially broken
|
|
||||||
# installs (e.g. curl, git) as those could interfere with our build.
|
|
||||||
brew uninstall $(brew uses --installed --recursive gettext)
|
|
||||||
brew unlink gettext
|
|
||||||
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"
|
|
||||||
- name: Build release
|
|
||||||
run: |
|
|
||||||
export MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -f1 -d.)"
|
|
||||||
OSX_FLAGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_ARCHITECTURES=arm64\;x86_64"
|
|
||||||
make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \
|
|
||||||
CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH= $OSX_FLAGS" \
|
|
||||||
DEPS_CMAKE_FLAGS="$OSX_FLAGS"
|
|
||||||
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-macos" install
|
|
||||||
cd "$GITHUB_WORKSPACE/build/"
|
|
||||||
# Make sure we build everything for M1 as well
|
|
||||||
for macho in bin/* lib/nvim/parser/*.so
|
|
||||||
do
|
|
||||||
lipo -info "$macho" | grep -q arm64 || exit 1
|
|
||||||
done
|
|
||||||
cpack -C "$NVIM_BUILD_TYPE"
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: nvim-macos
|
|
||||||
path: build/nvim-macos.tar.gz
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
windows:
|
|
||||||
runs-on: windows-2019
|
|
||||||
env:
|
|
||||||
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
|
||||||
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
|
||||||
CMAKE_BUILD_TYPE: "RelWithDebInfo"
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- config: MSVC_64
|
|
||||||
archive: nvim-win64
|
|
||||||
name: windows (${{ matrix.config }})
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Build deps
|
|
||||||
run: .\ci\build.ps1 -BuildDeps
|
|
||||||
- name: build package
|
|
||||||
run: .\ci\build.ps1 -Package
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.archive }}
|
|
||||||
path: |
|
|
||||||
build/${{ matrix.archive }}.msi
|
|
||||||
build/${{ matrix.archive }}.zip
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
publish:
|
|
||||||
needs: [linux, appimage, macOS, windows]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
GH_REPO: ${{ github.repository }}
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
# Must perform checkout first, since it deletes the target directory
|
|
||||||
# before running, and would therefore delete the downloaded artifacts
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: sudo apt-get update && sudo apt-get install -y gettext-base
|
|
||||||
|
|
||||||
- if: github.event_name == 'workflow_dispatch'
|
|
||||||
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
|
||||||
- if: github.event_name == 'schedule'
|
|
||||||
run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV
|
|
||||||
- if: github.event_name == 'push'
|
|
||||||
run: |
|
|
||||||
TAG_NAME=${{ github.ref }}
|
|
||||||
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
|
|
||||||
- if: env.TAG_NAME == 'nightly'
|
|
||||||
run: |
|
|
||||||
(echo 'SUBJECT=Nvim development (prerelease) build';
|
|
||||||
echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV
|
|
||||||
gh release delete nightly --yes || true
|
|
||||||
git push origin :nightly || true
|
|
||||||
- if: env.TAG_NAME != 'nightly'
|
|
||||||
run: |
|
|
||||||
(echo 'SUBJECT=Nvim release build';
|
|
||||||
echo 'PRERELEASE=') >> $GITHUB_ENV
|
|
||||||
gh release delete stable --yes || true
|
|
||||||
git push origin :stable || true
|
|
||||||
# `sha256sum` outputs <sha> <path>, so we cd into each dir to drop the
|
|
||||||
# containing folder from the output.
|
|
||||||
- name: Generate Linux64 SHA256 checksums
|
|
||||||
run: |
|
|
||||||
cd ./nvim-linux64
|
|
||||||
sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum
|
|
||||||
echo "SHA_LINUX_64_TAR=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
|
||||||
sha256sum nvim-linux64.deb > nvim-linux64.deb.sha256sum
|
|
||||||
echo "SHA_LINUX_64_DEB=$(cat nvim-linux64.deb.sha256sum)" >> $GITHUB_ENV
|
|
||||||
- name: Generate App Image SHA256 checksums
|
|
||||||
run: |
|
|
||||||
cd ./appimage
|
|
||||||
sha256sum nvim.appimage > nvim.appimage.sha256sum
|
|
||||||
echo "SHA_APP_IMAGE=$(cat nvim.appimage.sha256sum)" >> $GITHUB_ENV
|
|
||||||
- name: Generate App Image Zsync SHA256 checksums
|
|
||||||
run: |
|
|
||||||
cd ./appimage
|
|
||||||
sha256sum nvim.appimage.zsync > nvim.appimage.zsync.sha256sum
|
|
||||||
echo "SHA_APP_IMAGE_ZSYNC=$(cat nvim.appimage.zsync.sha256sum)" >> $GITHUB_ENV
|
|
||||||
- name: Generate macOS SHA256 checksums
|
|
||||||
run: |
|
|
||||||
cd ./nvim-macos
|
|
||||||
sha256sum nvim-macos.tar.gz > nvim-macos.tar.gz.sha256sum
|
|
||||||
echo "SHA_MACOS=$(cat nvim-macos.tar.gz.sha256sum)" >> $GITHUB_ENV
|
|
||||||
- name: Generate Win64 SHA256 checksums
|
|
||||||
run: |
|
|
||||||
cd ./nvim-win64
|
|
||||||
sha256sum nvim-win64.zip > nvim-win64.zip.sha256sum
|
|
||||||
echo "SHA_WIN_64_ZIP=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV
|
|
||||||
sha256sum nvim-win64.msi > nvim-win64.msi.sha256sum
|
|
||||||
echo "SHA_WIN_64_MSI=$(cat nvim-win64.msi.sha256sum)" >> $GITHUB_ENV
|
|
||||||
- name: Publish release
|
|
||||||
env:
|
|
||||||
NVIM_VERSION: ${{ needs.linux.outputs.version }}
|
|
||||||
DEBUG: api
|
|
||||||
run: |
|
|
||||||
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
|
|
||||||
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
|
||||||
if [ "$TAG_NAME" != "nightly" ]; then
|
|
||||||
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
|
||||||
fi
|
|
||||||
|
|
||||||
publish-winget:
|
|
||||||
needs: publish
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
|
||||||
name: Publish stable
|
|
||||||
uses: vedantmgoyal2009/winget-releaser@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 }}
|
|
17
.github/workflows/remove-reviewers-on-draft.yml
vendored
17
.github/workflows/remove-reviewers-on-draft.yml
vendored
@@ -1,17 +0,0 @@
|
|||||||
name: "Remove reviewers"
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types: [converted_to_draft, closed]
|
|
||||||
jobs:
|
|
||||||
remove-reviewers:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: 'Remove reviewers'
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const script = require('./.github/scripts/remove-reviewers.js')
|
|
||||||
await script({github, context})
|
|
18
.github/workflows/reviews.yml
vendored
18
.github/workflows/reviews.yml
vendored
@@ -1,18 +0,0 @@
|
|||||||
name: "Request reviews"
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types: [labeled, ready_for_review]
|
|
||||||
jobs:
|
|
||||||
request-reviewer:
|
|
||||||
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: 'Request reviewers'
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const script = require('./.github/scripts/reviews.js')
|
|
||||||
await script({github, context})
|
|
52
.github/workflows/vim-patches.yml
vendored
52
.github/workflows/vim-patches.yml
vendored
@@ -1,52 +0,0 @@
|
|||||||
name: vim-patches
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '3 3 * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-vim-patches:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
env:
|
|
||||||
VIM_SOURCE_DIR: ${{ format('{0}/vim-src', github.workspace) }}
|
|
||||||
VERSION_BRANCH: marvim/ci-version-update
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
repository: vim/vim
|
|
||||||
path: ${{ env.VIM_SOURCE_DIR }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- run: |
|
|
||||||
gh release download -R neovim/neovim -p nvim.appimage
|
|
||||||
chmod a+x nvim.appimage
|
|
||||||
mkdir -p $HOME/.local/bin
|
|
||||||
mv nvim.appimage $HOME/.local/bin/nvim
|
|
||||||
printf '%s\n' "$HOME/.local/bin" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- name: Setup git config
|
|
||||||
run: |
|
|
||||||
git config --global user.name 'marvim'
|
|
||||||
git config --global user.email 'marvim@users.noreply.github.com'
|
|
||||||
|
|
||||||
- name: Update src/version.c
|
|
||||||
id: update-version
|
|
||||||
run: |
|
|
||||||
git checkout -b ${VERSION_BRANCH}
|
|
||||||
nvim -V1 -es -i NONE +'luafile scripts/vimpatch.lua' +q
|
|
||||||
printf 'NEW_PATCHES=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Automatic PR
|
|
||||||
if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }}
|
|
||||||
run: |
|
|
||||||
git add -u
|
|
||||||
git commit -m 'version.c: update [skip ci]'
|
|
||||||
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${VERSION_BRANCH}
|
|
||||||
gh pr create --draft --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true
|
|
43
.gitignore
vendored
43
.gitignore
vendored
@@ -1,23 +1,15 @@
|
|||||||
# Tools
|
# Tools
|
||||||
/venv/
|
.ropeproject/
|
||||||
compile_commands.json
|
# Visual Studio
|
||||||
/.luarc.json
|
|
||||||
|
|
||||||
# IDEs
|
|
||||||
/.vs/
|
/.vs/
|
||||||
/.vscode/
|
|
||||||
/.idea/
|
|
||||||
|
|
||||||
# Build/deps dir
|
# Build/deps dir
|
||||||
/build/
|
/build/
|
||||||
|
/cmake-build-debug/
|
||||||
|
/dist/
|
||||||
/.deps/
|
/.deps/
|
||||||
/tmp/
|
/tmp/
|
||||||
/.clangd/
|
|
||||||
/.cache/clangd/
|
|
||||||
/.ccls-cache/
|
|
||||||
/.clang-tidy
|
|
||||||
|
|
||||||
.DS_Store
|
|
||||||
*.mo
|
*.mo
|
||||||
.*.sw?
|
.*.sw?
|
||||||
*~
|
*~
|
||||||
@@ -25,6 +17,8 @@ compile_commands.json
|
|||||||
*.o
|
*.o
|
||||||
*.so
|
*.so
|
||||||
|
|
||||||
|
tags
|
||||||
|
|
||||||
/src/nvim/po/vim.pot
|
/src/nvim/po/vim.pot
|
||||||
/src/nvim/po/*.ck
|
/src/nvim/po/*.ck
|
||||||
|
|
||||||
@@ -32,14 +26,13 @@ compile_commands.json
|
|||||||
/.nvimlog
|
/.nvimlog
|
||||||
|
|
||||||
# Generated by scripts/vim-patch.sh
|
# Generated by scripts/vim-patch.sh
|
||||||
/.vim-src
|
/.vim-src/
|
||||||
*.rej
|
|
||||||
|
|
||||||
# Generated by old (Vim) tests.
|
# Generated by old (Vim) tests.
|
||||||
/src/nvim/testdir/del
|
/src/nvim/testdir/del
|
||||||
/src/nvim/testdir/test*.out
|
/src/nvim/testdir/test*.out
|
||||||
/src/nvim/testdir/test*.res
|
/src/nvim/testdir/test*.res
|
||||||
/src/nvim/testdir/test*.log
|
/src/nvim/testdir/test.log
|
||||||
/src/nvim/testdir/messages
|
/src/nvim/testdir/messages
|
||||||
/src/nvim/testdir/viminfo
|
/src/nvim/testdir/viminfo
|
||||||
/src/nvim/testdir/test.ok
|
/src/nvim/testdir/test.ok
|
||||||
@@ -47,31 +40,17 @@ compile_commands.json
|
|||||||
/src/nvim/testdir/X*
|
/src/nvim/testdir/X*
|
||||||
/src/nvim/testdir/valgrind.*
|
/src/nvim/testdir/valgrind.*
|
||||||
/src/nvim/testdir/.gdbinit
|
/src/nvim/testdir/.gdbinit
|
||||||
/runtime/indent/testdir/*.out
|
|
||||||
+runtime/indent/testdir/*.fail
|
|
||||||
# Generated by src/nvim/testdir/runnvim.sh.
|
|
||||||
/src/nvim/testdir/*.tlog
|
|
||||||
|
|
||||||
# Generated by unit tests.
|
# Generated by unit tests.
|
||||||
/test/includes/post/
|
/test/includes/post/
|
||||||
|
|
||||||
# Generated by luacheck during `make lualint'
|
# Generated by luacheck during `make testlint'
|
||||||
.luacheckcache
|
/test/.luacheckcache
|
||||||
|
|
||||||
# local make targets
|
# local make targets
|
||||||
local.mk
|
local.mk
|
||||||
|
|
||||||
# Generated from :help docs
|
# runtime/doc
|
||||||
tags
|
|
||||||
/runtime/doc/*.html
|
/runtime/doc/*.html
|
||||||
/runtime/doc/tags.ref
|
/runtime/doc/tags.ref
|
||||||
/runtime/doc/errors.log
|
/runtime/doc/errors.log
|
||||||
|
|
||||||
# Generated by gen_vimdoc.py:
|
|
||||||
/runtime/doc/*.mpack
|
|
||||||
/tmp-*-doc
|
|
||||||
|
|
||||||
# vim patches
|
|
||||||
/vim-*.patch
|
|
||||||
|
|
||||||
/CMakeUserPresets.json
|
|
||||||
|
42
.luacheckrc
42
.luacheckrc
@@ -1,42 +0,0 @@
|
|||||||
-- vim: ft=lua tw=80
|
|
||||||
|
|
||||||
stds.nvim = {
|
|
||||||
read_globals = { "jit" }
|
|
||||||
}
|
|
||||||
std = "lua51+nvim"
|
|
||||||
|
|
||||||
-- Ignore W211 (unused variable) with preload files.
|
|
||||||
files["**/preload.lua"] = {ignore = { "211" }}
|
|
||||||
-- Allow vim module to modify itself, but only here.
|
|
||||||
files["src/nvim/lua/vim.lua"] = {ignore = { "122/vim" }}
|
|
||||||
|
|
||||||
-- Don't report unused self arguments of methods.
|
|
||||||
self = false
|
|
||||||
|
|
||||||
-- Rerun tests only if their modification time changed.
|
|
||||||
cache = true
|
|
||||||
|
|
||||||
ignore = {
|
|
||||||
"631", -- max_line_length
|
|
||||||
"212/_.*", -- unused argument, for vars with "_" prefix
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Global objects defined by the C code
|
|
||||||
read_globals = {
|
|
||||||
"vim",
|
|
||||||
}
|
|
||||||
|
|
||||||
globals = {
|
|
||||||
"vim.g",
|
|
||||||
"vim.b",
|
|
||||||
"vim.w",
|
|
||||||
"vim.o",
|
|
||||||
"vim.bo",
|
|
||||||
"vim.wo",
|
|
||||||
"vim.go",
|
|
||||||
"vim.env"
|
|
||||||
}
|
|
||||||
|
|
||||||
exclude_files = {
|
|
||||||
'test/functional/fixtures/lua/syntax_error.lua',
|
|
||||||
}
|
|
22
.luacov
22
.luacov
@@ -1,22 +0,0 @@
|
|||||||
-- Configuration file for LuaCov
|
|
||||||
|
|
||||||
local source = require("lfs").currentdir()
|
|
||||||
|
|
||||||
local function pesc(s)
|
|
||||||
assert(type(s) == 'string', s)
|
|
||||||
return s:gsub('[%(%)%.%%%+%-%*%?%[%]%^%$]', '%%%1')
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
include = {
|
|
||||||
-- Absolute paths (starting with source dir, not hidden (i.e. .deps)).
|
|
||||||
pesc(source) .. "[/\\][^.].+",
|
|
||||||
-- Relative (non-hidden) paths.
|
|
||||||
'^[^/\\.]',
|
|
||||||
},
|
|
||||||
modules = {
|
|
||||||
['vim'] = 'runtime/lua/vim/shared.lua'
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- vim: ft=lua tw=80 sw=2 et
|
|
137
.mailmap
137
.mailmap
@@ -1,137 +0,0 @@
|
|||||||
Abdelhakeem <abdelhakeem.osama@hotmail.com> Abdelhakeem Osama
|
|
||||||
Alvaro Muñoz <alvaro@pwntester.com> Alvaro Muñoz
|
|
||||||
Andreas Johansson <andreas@ndrs.xyz> <ndreas@users.noreply.github.com>
|
|
||||||
Andrew Pyatkov <mrbiggfoot@gmail.com> <mrbiggfoot@users.noreply.github.com>
|
|
||||||
Anmol Sethi <hi@nhooyr.io> <anmol@aubble.com>
|
|
||||||
Anmol Sethi <hi@nhooyr.io> <me@anmol.io>
|
|
||||||
Anmol Sethi <hi@nhooyr.io> <nhooyr@users.noreply.github.com>
|
|
||||||
BK1603 <chouhan.shreyansh2702@gmail.com> Shreyansh Chouhan
|
|
||||||
Billy Su <g4691821@gmail.com> Billy SU
|
|
||||||
Billy Vong <billyvg@gmail.com> <billyvg@users.noreply.github.com>
|
|
||||||
bfredl <bjorn.linse@gmail.com>
|
|
||||||
Carlos Hernandez <carlos@techbyte.ca> <hurricanehrndz@users.noreply.github.com>
|
|
||||||
Chris Kipp <ckipp@pm.me> ckipp01
|
|
||||||
Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de>
|
|
||||||
Cédric Barreteau <> <cbarrete@users.noreply.github.com>
|
|
||||||
Dan Aloni <alonid@gmail.com> <dan@kernelim.com>
|
|
||||||
Daniel Hahler <git@thequod.de> <github@thequod.de>
|
|
||||||
dundargoc <gocdundar@gmail.com> <33953936+dundargoc@users.noreply.github.com>
|
|
||||||
dundargoc <gocdundar@gmail.com> Dundar Goc
|
|
||||||
Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima
|
|
||||||
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
|
|
||||||
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
|
|
||||||
Fabian Viöl <f.vioel@googlemail.com> Fabian
|
|
||||||
Florian Walch <florian@fwalch.com> <fwalch@users.noreply.github.com>
|
|
||||||
Gabriel Cruz <gabs.oficial98@gmail.com> <LTKills@users.noreply.github.com>
|
|
||||||
Gaelan Steele <gbs@canishe.com> Gaelan
|
|
||||||
Gavin D. Howard <gavin@schedmd.com> <yzena.tech@gmail.com>
|
|
||||||
George Zhao <zhaozg@gmail.com> <zhaozg@aliyun.com>
|
|
||||||
George Zhao <zhaozg@gmail.com> George Zhao
|
|
||||||
Gregory Anders <greg@gpanders.com> <8965202+gpanders@users.noreply.github.com>
|
|
||||||
Gregory Anders <greg@gpanders.com> Greg Anders
|
|
||||||
Grzegorz Milka <grzegorzmilka@gmail.com> Grzegorz
|
|
||||||
Harm te Hennepe <dhtehennepe@gmail.com> <d.h.tehennepe@student.utwente.nl>
|
|
||||||
Harm te Hennepe <dhtehennepe@gmail.com> <harm@tehennepe.org>
|
|
||||||
Hirokazu Hata <h.hata.ai.t@gmail.com> <h-michael@users.noreply.github.com>
|
|
||||||
Ihor Antonov <ngortheone@gmail.com> <ngortheone@users.noreply.github.com>
|
|
||||||
J Phani Mahesh <phanimahesh@gmail.com> <github@phanimahesh.me>
|
|
||||||
Jack Bracewell <FriedSock@users.noreply.github.com> <jack.bracewell@unboxedconsulting.com>
|
|
||||||
Jack Bracewell <FriedSock@users.noreply.github.com> <jbtwentythree@gmail.com>
|
|
||||||
Jacques Germishuys <jacquesg@striata.com> <jacquesg@users.noreply.github.com>
|
|
||||||
Jakub Łuczyński <doubleloop@o2.pl> <doubleloop@users.noreply.github.com>
|
|
||||||
James McCoy <jamessan@jamessan.com> <vega.james@gmail.com>
|
|
||||||
Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> <janedmundlazo@hotmail.com>
|
|
||||||
Jan Viljanen <jan.a.viljanen@gmail.com> <jan.viljanen@greenpeace.org>
|
|
||||||
Javier Lopez <graulopezjavier@gmail.com> Javier López
|
|
||||||
Jit Yao Yap <jityao@gmail.com> <jityao+github@gmail.com>
|
|
||||||
Jit Yao Yap <jityao@gmail.com> Jit
|
|
||||||
John Gehrig <jdg.gehrig@gmail.com> <jgehrig@users.noreply.github.com>
|
|
||||||
John Schmidt <john.schmidt.h@gmail.com> John
|
|
||||||
John Szakmeister <john@szakmeister.net> <jszakmeister@users.noreply.github.com>
|
|
||||||
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> <jdebp@users.noreply.github.com>
|
|
||||||
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> <postmaster@localhost>
|
|
||||||
Jurica Bradaric <jbradaric@gmail.com> <jbradaric@users.noreply.github.com>
|
|
||||||
Jurica Bradaric <jbradaric@gmail.com> <jurica.bradaric@avl.com>
|
|
||||||
KillTheMule <KillTheMule@users.noreply.github.com> <github@pipsfrank.de>
|
|
||||||
Kwon-Young Choi <kwon-young.choi@hotmail.fr> Kwon-Young
|
|
||||||
Lewis Russell <lewis6991@gmail.com> <me@lewisr.dev>
|
|
||||||
Lucas Hoffmann <l-m-h@web.de> <lucc@posteo.de>
|
|
||||||
Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com>
|
|
||||||
Marco Hinz <mh.codebro@gmail.com> <mh.codebro+github@gmail.com>
|
|
||||||
Marvim the Paranoid Android <marvim@users.noreply.github.com> marvim
|
|
||||||
Mateusz Czapliński <czapkofan@gmail.com> Mateusz Czaplinski
|
|
||||||
Mathias Fussenegger <f.mathias@zignar.net> <mfussenegger@users.noreply.github.com>
|
|
||||||
Mathias Fussenegger <f.mathias@zignar.net> Mathias Fußenegger
|
|
||||||
Matt Wozniski <godlygeek@gmail.com> <godlygeek+git@gmail.com>
|
|
||||||
Matthieu Coudron <mattator@gmail.com> <coudron@iij.ad.jp>
|
|
||||||
Matthieu Coudron <mattator@gmail.com> <matthieu.coudron@upmc.fr>
|
|
||||||
Matthieu Coudron <mattator@gmail.com> <mcoudron@hotmail.com>
|
|
||||||
Matthieu Coudron <mattator@gmail.com> <teto@users.noreply.github.com>
|
|
||||||
MichaHoffmann <michoffmann.potsdam@gmail.com> Michael Hoffmann
|
|
||||||
MichaHoffmann <michoffmann.potsdam@gmail.com> micha
|
|
||||||
Michael Ennen <mike.ennen@gmail.com> <brcolow@users.noreply.github.com>
|
|
||||||
Michael Ennen <mike.ennen@gmail.com> brcolow
|
|
||||||
Michael Reed <m.reed@mykolab.com> <Pyrohh@users.noreply.github.com>
|
|
||||||
Michael Schupikov <michael@schupikov.de> <DarkDeepBlue@users.noreply.github.com>
|
|
||||||
Nicolas Hillegeer <nicolas@hillegeer.com> <nicolashillegeer@gmail.com>
|
|
||||||
Panashe M. Fundira <fundirap@gmail.com> Panashe Fundira
|
|
||||||
Patrice Peterson <patrice.peterson@mailbox.org> runiq
|
|
||||||
Pavel Platto <hinidu@gmail.com> Hinidu
|
|
||||||
Petter Wahlman <petter@wahlman.no> <pwahlman@cisco.com>
|
|
||||||
Poh Zi How <poh.zihow@gmail.com> pohzipohzi
|
|
||||||
Rich Wareham <rjw57@cam.ac.uk> <rjw57@cantab.net>
|
|
||||||
Rui Abreu Ferreira <equalsraf@users.noreply.github.com> @equalsraf
|
|
||||||
Rui Abreu Ferreira <raf-ep@gmx.com> <equalsraf@users.noreply.github.com>
|
|
||||||
Rui Abreu Ferreira <raf-ep@gmx.com> <rap-ep@gmx.com>
|
|
||||||
Sam Wilson <tecywiz121@hotmail.com> <sawilson@akamai.com>
|
|
||||||
Sander Bosma <sanderbosma@gmail.com> sander2
|
|
||||||
Santos Gallegos <stsewd@protonmail.com> <santos_g@outlook.com>
|
|
||||||
Sebastian Parborg <darkdefende@gmail.com> DarkDefender
|
|
||||||
Shirasaka <tk.shirasaka@gmail.com> tk-shirasaka
|
|
||||||
Shota <shotat@users.noreply.github.com> shotat
|
|
||||||
Shougo Matsushita <Shougo.Matsu@gmail.com> Shougo
|
|
||||||
Stephan Seitz <stephan.seitz@fau.de> <stephan.lauf@yahoo.de>
|
|
||||||
Steven Sojka <Steven.Sojka@tdameritrade.com> <steelsojka@gmail.com>
|
|
||||||
Steven Sojka <steelsojka@gmail.com> <steelsojka@users.noreply.github.com>
|
|
||||||
TJ DeVries <devries.timothyj@gmail.com> <timothydvrs1234@gmail.com>
|
|
||||||
Thomas Fehér <thomas.feher@yahoo.de> <thomasfeher@web.de>
|
|
||||||
Thomas Vigouroux <thomas.vigouroux@protonmail.com> <tomvig38@gmail.com> <39092278+vigoux@users.noreply.github.com>
|
|
||||||
Utkarsh Maheshwari <UtkarshME96@gmail.com> UTkarsh Maheshwari
|
|
||||||
Utkarsh Maheshwari <utkarshme96@gmail.com> <UtkarshME96@gmail.com>
|
|
||||||
VVKot <volodymyr.kot.ua@gmail.com> Volodymyr Kot
|
|
||||||
Victor Adam <victor.adam@cofelyineo-gdfsuez.com> <Victor.Adam@derpymail.org>
|
|
||||||
Wang Shidong <wsdjeg@outlook.com> <wsdjeg@users.noreply.github.com>
|
|
||||||
Wei Huang <daviseago@gmail.com> davix
|
|
||||||
Xu Cheng <xucheng@me.com> <xu-cheng@users.noreply.github.com>
|
|
||||||
Yamakaky <yamakaky@gmail.com> <yamakaky@yamaworld.fr>
|
|
||||||
Yegappan Lakshmanan <yegappan@yahoo.com> <4298407+yegappan@users.noreply.github.com>
|
|
||||||
Yichao Zhou <broken.zhoug@gmail.com> Yichao Zhou <broken.zhou@gmail.com>
|
|
||||||
Yichao Zhou <broken.zhoug@gmail.com> zhou13 <broken.zhou@gmail.com>
|
|
||||||
Yorick Peterse <git@yorickpeterse.com> <yorick@yorickpeterse.com>
|
|
||||||
ZyX <kp-pav@yandex.ru> <kp-pav@ya.ru>
|
|
||||||
ZyX <kp-pav@yandex.ru> Nikolai Aleksandrovich Pavlov
|
|
||||||
aph <a.hewson@gmail.com> Ashley Hewson
|
|
||||||
butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com> We're Yet
|
|
||||||
chemzqm <chemzqm@gmail.com> Qiming zhao
|
|
||||||
chentau <tchen1998@gmail.com> Tony Chen
|
|
||||||
dedmass <carlo.abelli@gmail.com> Carlo Abelli
|
|
||||||
equal-l2 <eng.equall2@gmail.com> <equal-l2@users.noreply.github.com>
|
|
||||||
francisco souza <fsouza@users.noreply.github.com> <108725+fsouza@users.noreply.github.com>
|
|
||||||
glacambre <code@lacamb.re> <me@r4>
|
|
||||||
glacambre <code@lacamb.re> Ghjuvan Lacambre
|
|
||||||
ii14 <ii14@users.noreply.github.com> <59243201+ii14@users.noreply.github.com>
|
|
||||||
jdrouhard <john@jmdtech.org> <github@jmdtech.org>
|
|
||||||
kuuote <znmxodq1@gmail.com> <36663503+kuuote@users.noreply.github.com>
|
|
||||||
matveyt <matthewtarasov@gmail.com> <35012635+matveyt@users.noreply.github.com>
|
|
||||||
nate <nateozemon@gmail.com> nateozem
|
|
||||||
ray-x <rayx.cn@gmail.com> rayx
|
|
||||||
relnod <mail@paul-schiffers.de> <relnod@users.noreply.github.com>
|
|
||||||
rockerBOO <rockerboo@gmail.com> Dave Lage
|
|
||||||
rpigott <rpigott@berkeley.edu> Ronan Pigott
|
|
||||||
sach1t <sach0010t@gmail.com> <sach1t@users.noreply.github.com>
|
|
||||||
shade-of-noon <73705427+shade-of-noon@users.noreply.github.com> Edwin Pujols
|
|
||||||
shadmansaleh <shadmansaleh3@gmail.com> <13149513+shadmansaleh@users.noreply.github.com>
|
|
||||||
shadmansaleh <shadmansaleh3@gmail.com> Shadman
|
|
||||||
sohnryang <loop.infinitely@gmail.com> 손량
|
|
||||||
timeyyy <timeyyy_da_man@hotmail.com> Timothy C Eichler
|
|
||||||
timeyyy <timeyyy_da_man@hotmail.com> timothy eichler
|
|
@@ -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
|
|
143
.travis.yml
Normal file
143
.travis.yml
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
dist: xenial
|
||||||
|
|
||||||
|
language: c
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
# 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"
|
||||||
|
# Directory where third-party dependency sources are downloaded to.
|
||||||
|
- DEPS_DOWNLOAD_DIR="$TRAVIS_BUILD_DIR/deps-downloads"
|
||||||
|
# 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="-DTRAVIS_CI_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="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR -DUSE_BUNDLED_GPERF=OFF"
|
||||||
|
# Additional CMake flags for 32-bit builds.
|
||||||
|
- CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
|
||||||
|
-DCMAKE_IGNORE_PATH=/lib:/usr/lib:/usr/local/lib
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
|
||||||
|
# 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"
|
||||||
|
- ASAN_SYMBOLIZE=asan_symbolize
|
||||||
|
# Environment variables for Valgrind.
|
||||||
|
- VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
|
||||||
|
# If this file exists, the cache is valid (compile was successful).
|
||||||
|
- CACHE_MARKER="$HOME/.cache/nvim-deps/.travis_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"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
include:
|
||||||
|
- stage: normal builds
|
||||||
|
os: linux
|
||||||
|
compiler: clang-4.0
|
||||||
|
# Use Lua so that ASAN can test our embedded Lua support. 8fec4d53d0f6
|
||||||
|
env: >
|
||||||
|
CLANG_SANITIZER=ASAN_UBSAN
|
||||||
|
CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
|
||||||
|
ASAN_SYMBOLIZE=asan_symbolize-4.0
|
||||||
|
- 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"
|
||||||
|
- 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
|
||||||
|
- os: osx
|
||||||
|
compiler: clang
|
||||||
|
osx_image: xcode9.4 # macOS 10.13
|
||||||
|
- os: osx
|
||||||
|
compiler: gcc
|
||||||
|
osx_image: xcode9.4 # macOS 10.13
|
||||||
|
- if: branch = master
|
||||||
|
os: linux
|
||||||
|
env: CI_TARGET=lint
|
||||||
|
- stage: Flaky builds
|
||||||
|
os: linux
|
||||||
|
compiler: gcc
|
||||||
|
env: GCOV=gcov CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||||
|
- os: linux
|
||||||
|
compiler: clang
|
||||||
|
env: CLANG_SANITIZER=TSAN
|
||||||
|
allow_failures:
|
||||||
|
- env: GCOV=gcov CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||||
|
- env: CLANG_SANITIZER=TSAN
|
||||||
|
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
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- apport
|
||||||
|
- autoconf
|
||||||
|
- automake
|
||||||
|
- build-essential
|
||||||
|
- clang-4.0
|
||||||
|
- cmake
|
||||||
|
- cscope
|
||||||
|
- g++-multilib
|
||||||
|
- gcc-multilib
|
||||||
|
- gdb
|
||||||
|
- gperf
|
||||||
|
- language-pack-tr
|
||||||
|
- libc6-dev-i386
|
||||||
|
- libtool-bin
|
||||||
|
- locales
|
||||||
|
- ninja-build
|
||||||
|
- pkg-config
|
||||||
|
- unzip
|
||||||
|
- valgrind
|
||||||
|
- xclip
|
||||||
|
homebrew:
|
||||||
|
update: true
|
||||||
|
packages:
|
||||||
|
- ccache
|
||||||
|
- ninja
|
||||||
|
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
- /^release-\d+\.\d+$/
|
||||||
|
|
||||||
|
cache:
|
||||||
|
apt: true
|
||||||
|
ccache: true
|
||||||
|
directories:
|
||||||
|
- "$HOME/.cache/pip"
|
||||||
|
- "$HOME/.cache/nvim-deps"
|
||||||
|
- "$HOME/.cache/nvim-deps-downloads"
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
webhooks:
|
||||||
|
urls:
|
||||||
|
- https://webhooks.gitter.im/e/b5c38c99f9677aa3d031
|
@@ -1,4 +1,4 @@
|
|||||||
.DONE:
|
.DONE:
|
||||||
@echo "Use GNU Make (gmake) to build neovim"
|
@echo "Please use GNU Make (gmake) to build neovim"
|
||||||
.DEFAULT:
|
.DEFAULT:
|
||||||
@echo "Use GNU Make (gmake) to build neovim"
|
@echo "Please use GNU Make (gmake) to build neovim"
|
||||||
|
526
CMakeLists.txt
526
CMakeLists.txt
@@ -1,14 +1,15 @@
|
|||||||
# 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.
|
cmake_minimum_required(VERSION 2.8.12)
|
||||||
cmake_minimum_required(VERSION 3.10)
|
|
||||||
project(nvim C)
|
project(nvim C)
|
||||||
|
|
||||||
if(POLICY CMP0075)
|
if(POLICY CMP0059)
|
||||||
cmake_policy(SET CMP0075 NEW)
|
# Needed for use of DEFINITIONS variable, which is used to collect the
|
||||||
|
# compilation flags for reporting in "nvim --version"
|
||||||
|
# https://github.com/neovim/neovim/pull/8558#issuecomment-398033140
|
||||||
|
cmake_policy(SET CMP0059 OLD)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Point CMake at any custom modules we may ship
|
# Point CMake at any custom modules we may ship
|
||||||
@@ -16,31 +17,14 @@ 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)
|
||||||
|
|
||||||
# Prefer our bundled versions of dependencies.
|
# Prefer our bundled versions of dependencies.
|
||||||
if(DEFINED ENV{DEPS_BUILD_DIR})
|
if(DEFINED ENV{DEPS_BUILD_DIR})
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
|
||||||
# pkg-config 29.2 has a bug on OpenBSD which causes it to drop any paths that
|
|
||||||
# *contain* system include paths. To avoid this, we prefix what would be
|
|
||||||
# "/usr/include" as "/_usr/include".
|
|
||||||
# This check is also performed in the cmake.deps/CMakeLists.txt and in the
|
|
||||||
# else clause following here.
|
|
||||||
# https://github.com/neovim/neovim/pull/14745#issuecomment-860201794
|
|
||||||
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/_usr" CACHE PATH "Path prefix for finding dependencies")
|
|
||||||
else()
|
|
||||||
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")
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
|
||||||
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/_usr" CACHE PATH "Path prefix for finding dependencies")
|
|
||||||
else()
|
else()
|
||||||
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
|
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
|
||||||
endif()
|
|
||||||
# When running from within CLion or Visual Studio,
|
# When running from within CLion or Visual Studio,
|
||||||
# build bundled dependencies automatically.
|
# build bundled dependencies automatically.
|
||||||
if(NOT EXISTS ${DEPS_PREFIX}
|
if(NOT EXISTS ${DEPS_PREFIX}
|
||||||
@@ -60,7 +44,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}
|
||||||
@@ -69,8 +53,13 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_CROSSCOMPILING AND NOT UNIX)
|
||||||
|
list(INSERT CMAKE_FIND_ROOT_PATH 0 ${DEPS_PREFIX})
|
||||||
|
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX}/../host/bin)
|
||||||
|
else()
|
||||||
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
|
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
|
||||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
|
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
|
||||||
|
endif()
|
||||||
|
|
||||||
# used for check_c_compiler_flag
|
# used for check_c_compiler_flag
|
||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
@@ -84,27 +73,15 @@ 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()
|
||||||
|
|
||||||
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
# Ignore case when comparing filenames on Windows and Mac.
|
|
||||||
set(CASE_INSENSITIVE_FILENAME TRUE)
|
|
||||||
# Enable fixing case-insensitive filenames for Windows and Mac.
|
# Enable fixing case-insensitive filenames for Windows and Mac.
|
||||||
set(USE_FNAME_CASE TRUE)
|
set(USE_FNAME_CASE TRUE)
|
||||||
endif()
|
endif()
|
||||||
@@ -120,58 +97,65 @@ else()
|
|||||||
option(ENABLE_LTO "enable link time optimization" ON)
|
option(ENABLE_LTO "enable link time optimization" ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
|
# Set default build type.
|
||||||
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
set_default_buildtype()
|
message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Debug'")
|
||||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build" FORCE)
|
||||||
set(DEBUG 1)
|
|
||||||
else()
|
|
||||||
set(DEBUG 0)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Set available build types for CMake GUIs.
|
||||||
|
# A different build type 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 3)
|
||||||
set(NVIM_VERSION_PATCH 4)
|
set(NVIM_VERSION_PATCH 6)
|
||||||
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 5) # 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)
|
||||||
|
|
||||||
|
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
|
||||||
|
include(GetGitRevisionDescription)
|
||||||
|
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
|
||||||
|
if(NVIM_VERSION_COMMIT) # is a git repo
|
||||||
|
git_describe(NVIM_VERSION_MEDIUM)
|
||||||
|
# `git describe` annotates the most recent tagged release; for pre-release
|
||||||
|
# builds we must replace that with the unreleased version.
|
||||||
|
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+"
|
||||||
|
"v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}"
|
||||||
|
NVIM_VERSION_MEDIUM
|
||||||
|
${NVIM_VERSION_MEDIUM})
|
||||||
|
endif()
|
||||||
|
|
||||||
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
|
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
|
||||||
# NVIM_VERSION_CFLAGS set further below.
|
# NVIM_VERSION_CFLAGS set further below.
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
# Log level (MIN_LOG_LEVEL in log.h)
|
|
||||||
if("${MIN_LOG_LEVEL}" MATCHES "^$")
|
|
||||||
# Minimize logging for release-type builds.
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Release"
|
|
||||||
OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"
|
|
||||||
OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
|
|
||||||
message(STATUS "MIN_LOG_LEVEL not specified, default is 3 (ERROR) for release builds")
|
|
||||||
set(MIN_LOG_LEVEL 3)
|
|
||||||
else()
|
|
||||||
message(STATUS "MIN_LOG_LEVEL not specified, default is 1 (INFO)")
|
|
||||||
set(MIN_LOG_LEVEL 1)
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
|
|
||||||
message(FATAL_ERROR "invalid MIN_LOG_LEVEL: " ${MIN_LOG_LEVEL})
|
|
||||||
endif()
|
|
||||||
message(STATUS "MIN_LOG_LEVEL=${MIN_LOG_LEVEL}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Default to -O2 on release builds.
|
# Default to -O2 on release builds.
|
||||||
if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
|
if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
|
||||||
message(STATUS "Replacing -O3 in CMAKE_C_FLAGS_RELEASE with -O2")
|
message(STATUS "Replacing -O3 in CMAKE_C_FLAGS_RELEASE with -O2")
|
||||||
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")
|
# Minimize logging for release-type builds.
|
||||||
|
if(NOT CMAKE_C_FLAGS_RELEASE MATCHES DMIN_LOG_LEVEL)
|
||||||
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DMIN_LOG_LEVEL=3")
|
||||||
|
endif()
|
||||||
|
if(NOT CMAKE_C_FLAGS_MINSIZEREL MATCHES DMIN_LOG_LEVEL)
|
||||||
|
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DMIN_LOG_LEVEL=3")
|
||||||
|
endif()
|
||||||
|
if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DMIN_LOG_LEVEL)
|
||||||
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DMIN_LOG_LEVEL=3")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
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)
|
||||||
@@ -188,6 +172,11 @@ if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG)
|
|||||||
string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Enable -Wconversion.
|
||||||
|
if(NOT MSVC)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion")
|
||||||
|
endif()
|
||||||
|
|
||||||
# gcc 4.0+ sets _FORTIFY_SOURCE=2 automatically. This currently
|
# gcc 4.0+ sets _FORTIFY_SOURCE=2 automatically. This currently
|
||||||
# does not work with Neovim due to some uses of dynamically-sized structures.
|
# does not work with Neovim due to some uses of dynamically-sized structures.
|
||||||
# https://github.com/neovim/neovim/issues/223
|
# https://github.com/neovim/neovim/issues/223
|
||||||
@@ -254,74 +243,34 @@ check_c_source_compiles("
|
|||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
void *trace[1];
|
void *trace[1];
|
||||||
backtrace(trace, 1);
|
int trace_size = backtrace(trace, 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
" HAVE_EXECINFO_BACKTRACE)
|
" HAVE_EXECINFO_BACKTRACE)
|
||||||
|
|
||||||
check_c_source_compiles("
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
int a = 42;
|
|
||||||
__builtin_add_overflow(a, a, &a);
|
|
||||||
__builtin_sub_overflow(a, a, &a);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
" 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_definitions(/W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
add_definitions(-DWIN32)
|
||||||
add_definitions(-DMSWIN)
|
|
||||||
else()
|
else()
|
||||||
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
|
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||||
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
|
-Wstrict-prototypes -std=gnu99)
|
||||||
-Wdouble-promotion
|
|
||||||
-Wmissing-noreturn
|
|
||||||
-Wmissing-format-attribute
|
|
||||||
-Wmissing-prototypes)
|
|
||||||
|
|
||||||
check_c_compiler_flag(-Wimplicit-fallthrough HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
check_c_compiler_flag(-Wimplicit-fallthrough HAS_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||||
if(HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
if(HAS_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||||
add_compile_options(-Wimplicit-fallthrough)
|
add_definitions(-Wimplicit-fallthrough)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_COMPILER_SUGGESTIONS)
|
|
||||||
# Clang doesn't have -Wsuggest-attribute so check for each one.
|
|
||||||
check_c_compiler_flag(-Wsuggest-attribute=pure HAVE_WSUGGEST_ATTRIBUTE_PURE)
|
|
||||||
if(HAVE_WSUGGEST_ATTRIBUTE_PURE)
|
|
||||||
add_compile_options(-Wsuggest-attribute=pure)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
check_c_compiler_flag(-Wsuggest-attribute=const HAVE_WSUGGEST_ATTRIBUTE_CONST)
|
|
||||||
if(HAVE_WSUGGEST_ATTRIBUTE_CONST)
|
|
||||||
add_compile_options(-Wsuggest-attribute=const)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
check_c_compiler_flag(-Wsuggest-attribute=malloc HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
|
|
||||||
if(HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
|
|
||||||
add_compile_options(-Wsuggest-attribute=malloc)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
check_c_compiler_flag(-Wsuggest-attribute=cold HAVE_WSUGGEST_ATTRIBUTE_COLD)
|
|
||||||
if(HAVE_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.
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
add_compile_options(-Wno-c11-extensions)
|
add_definitions(-Wno-c11-extensions)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
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
|
||||||
@@ -331,7 +280,7 @@ endif()
|
|||||||
# OpenBSD's GCC (4.2.1) doesn't have -Wvla
|
# OpenBSD's GCC (4.2.1) doesn't have -Wvla
|
||||||
check_c_compiler_flag(-Wvla HAS_WVLA_FLAG)
|
check_c_compiler_flag(-Wvla HAS_WVLA_FLAG)
|
||||||
if(HAS_WVLA_FLAG)
|
if(HAS_WVLA_FLAG)
|
||||||
add_compile_options(-Wvla)
|
add_definitions(-Wvla)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
@@ -340,39 +289,46 @@ if(UNIX)
|
|||||||
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
|
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
|
||||||
|
|
||||||
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
||||||
add_compile_options(-fstack-protector-strong)
|
add_definitions(-fstack-protector-strong)
|
||||||
link_libraries(-fstack-protector-strong)
|
|
||||||
elseif(HAS_FSTACK_PROTECTOR_FLAG)
|
elseif(HAS_FSTACK_PROTECTOR_FLAG)
|
||||||
add_compile_options(-fstack-protector --param ssp-buffer-size=4)
|
add_definitions(-fstack-protector --param ssp-buffer-size=4)
|
||||||
link_libraries(-fstack-protector --param ssp-buffer-size=4)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
check_c_compiler_flag(-fno-common HAVE_FNO_COMMON)
|
|
||||||
if (HAVE_FNO_COMMON)
|
|
||||||
add_compile_options(-fno-common)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
|
check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
|
||||||
if(HAS_DIAG_COLOR_FLAG)
|
if(HAS_DIAG_COLOR_FLAG)
|
||||||
if(CMAKE_GENERATOR MATCHES "Ninja")
|
add_definitions(-fdiagnostics-color=auto)
|
||||||
add_compile_options(-fdiagnostics-color=always)
|
endif()
|
||||||
else()
|
|
||||||
add_compile_options(-fdiagnostics-color=auto)
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||||
|
# 1. Array-bounds testing is broken in some GCC versions before 4.8.5.
|
||||||
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
|
||||||
|
# 2. But _Pragma("...ignored") is broken (unresolved) in GCC 5+:
|
||||||
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66099
|
||||||
|
# So we must disable -Warray-bounds globally for GCC (for kbtree.h, #7083).
|
||||||
|
check_c_compiler_flag(-Wno-array-bounds HAS_NO_ARRAY_BOUNDS_FLAG)
|
||||||
|
if(HAS_NO_ARRAY_BOUNDS_FLAG)
|
||||||
|
add_definitions(-Wno-array-bounds)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(CI_BUILD "CI, extra flags will be set" OFF)
|
option(TRAVIS_CI_BUILD "Travis/QuickBuild CI, extra flags will be set" OFF)
|
||||||
|
|
||||||
if(CI_BUILD)
|
if(TRAVIS_CI_BUILD)
|
||||||
message(STATUS "CI build enabled")
|
message(STATUS "Travis/QuickBuild CI build enabled")
|
||||||
add_compile_options(-Werror)
|
add_definitions(-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_definitions(-funsigned-char)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
|
set(DEBUG 1)
|
||||||
|
else()
|
||||||
|
set(DEBUG 0)
|
||||||
|
endif()
|
||||||
|
|
||||||
option(LOG_LIST_ACTIONS "Add list actions logging" OFF)
|
option(LOG_LIST_ACTIONS "Add list actions logging" OFF)
|
||||||
|
|
||||||
add_definitions(-DINCLUDE_GENERATED_DECLARATIONS)
|
add_definitions(-DINCLUDE_GENERATED_DECLARATIONS)
|
||||||
@@ -392,8 +348,8 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
|||||||
add_definitions(-D_GNU_SOURCE)
|
add_definitions(-D_GNU_SOURCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT PREFER_LUA AND LUAJIT_VERSION LESS "2.1.0-beta3")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
# Required for luajit < 2.1.0-beta3.
|
# Required for luajit.
|
||||||
set(CMAKE_EXE_LINKER_FLAGS
|
set(CMAKE_EXE_LINKER_FLAGS
|
||||||
"${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000")
|
"${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS
|
set(CMAKE_SHARED_LINKER_FLAGS
|
||||||
@@ -402,55 +358,20 @@ 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 REQUIRED)
|
||||||
include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
|
include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
|
||||||
|
|
||||||
find_package(Msgpack 1.0.0 REQUIRED)
|
find_package(Msgpack 1.0.0 REQUIRED)
|
||||||
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
||||||
|
|
||||||
find_package(LibLUV 1.43.0 REQUIRED)
|
# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
|
||||||
include_directories(SYSTEM ${LIBLUV_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
find_package(TreeSitter REQUIRED)
|
|
||||||
include_directories(SYSTEM ${TreeSitter_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${TreeSitter_INCLUDE_DIRS}")
|
|
||||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${TreeSitter_LIBRARIES}")
|
|
||||||
check_c_source_compiles("
|
|
||||||
#include <tree_sitter/api.h>
|
|
||||||
int
|
|
||||||
main(void)
|
|
||||||
{
|
|
||||||
TSQueryCursor *cursor = ts_query_cursor_new();
|
|
||||||
ts_query_cursor_set_match_limit(cursor, 32);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
" TS_HAS_SET_MATCH_LIMIT)
|
|
||||||
if(TS_HAS_SET_MATCH_LIMIT)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_MATCH_LIMIT")
|
|
||||||
endif()
|
|
||||||
check_c_source_compiles("
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <tree_sitter/api.h>
|
|
||||||
int
|
|
||||||
main(void)
|
|
||||||
{
|
|
||||||
ts_set_allocator(malloc, calloc, realloc, free);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
" TS_HAS_SET_ALLOCATOR)
|
|
||||||
if(TS_HAS_SET_ALLOCATOR)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_ALLOCATOR")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# The unit test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
|
|
||||||
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.
|
||||||
@@ -471,7 +392,7 @@ main(void)
|
|||||||
return MSGPACK_OBJECT_FLOAT32;
|
return MSGPACK_OBJECT_FLOAT32;
|
||||||
}
|
}
|
||||||
" MSGPACK_HAS_FLOAT32)
|
" MSGPACK_HAS_FLOAT32)
|
||||||
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
|
unset(CMAKE_REQUIRED_LIBRARIES)
|
||||||
if(MSGPACK_HAS_FLOAT32)
|
if(MSGPACK_HAS_FLOAT32)
|
||||||
add_definitions(-DNVIM_MSGPACK_HAS_FLOAT32)
|
add_definitions(-DNVIM_MSGPACK_HAS_FLOAT32)
|
||||||
endif()
|
endif()
|
||||||
@@ -479,7 +400,7 @@ endif()
|
|||||||
option(FEAT_TUI "Enable the Terminal UI" ON)
|
option(FEAT_TUI "Enable the Terminal UI" ON)
|
||||||
|
|
||||||
if(FEAT_TUI)
|
if(FEAT_TUI)
|
||||||
find_package(UNIBILIUM 2.0 REQUIRED)
|
find_package(Unibilium REQUIRED)
|
||||||
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
|
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
|
||||||
|
|
||||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
|
||||||
@@ -490,23 +411,27 @@ 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)
|
||||||
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
|
unset(CMAKE_REQUIRED_INCLUDES)
|
||||||
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}")
|
unset(CMAKE_REQUIRED_LIBRARIES)
|
||||||
if(UNIBI_HAS_VAR_FROM)
|
if(UNIBI_HAS_VAR_FROM)
|
||||||
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 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)
|
||||||
@@ -521,9 +446,20 @@ if((CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) AND NOT CMAKE_C_COMPILER_ID MA
|
|||||||
message(FATAL_ERROR "Sanitizers are only supported for Clang")
|
message(FATAL_ERROR "Sanitizers are only supported for Clang")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_LIBICONV)
|
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD|FreeBSD|Windows") # see #5318
|
||||||
find_package(Iconv REQUIRED)
|
message(STATUS "skipping jemalloc on this system: ${CMAKE_SYSTEM_NAME}")
|
||||||
include_directories(SYSTEM ${Iconv_INCLUDE_DIRS})
|
option(ENABLE_JEMALLOC "enable jemalloc" OFF)
|
||||||
|
else()
|
||||||
|
option(ENABLE_JEMALLOC "enable jemalloc" ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_JEMALLOC)
|
||||||
|
if(CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN)
|
||||||
|
message(STATUS "Sanitizers enabled; disabling jemalloc")
|
||||||
|
else()
|
||||||
|
find_package(JeMalloc REQUIRED)
|
||||||
|
include_directories(SYSTEM ${JEMALLOC_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_LIBINTL)
|
if(ENABLE_LIBINTL)
|
||||||
@@ -532,6 +468,11 @@ if(ENABLE_LIBINTL)
|
|||||||
include_directories(SYSTEM ${LibIntl_INCLUDE_DIRS})
|
include_directories(SYSTEM ${LibIntl_INCLUDE_DIRS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_LIBICONV)
|
||||||
|
find_package(Iconv REQUIRED)
|
||||||
|
include_directories(SYSTEM ${Iconv_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
|
||||||
# Determine platform's threading library. Set CMAKE_THREAD_PREFER_PTHREAD
|
# Determine platform's threading library. Set CMAKE_THREAD_PREFER_PTHREAD
|
||||||
# explicitly to indicate a strong preference for pthread.
|
# explicitly to indicate a strong preference for pthread.
|
||||||
set(CMAKE_THREAD_PREFER_PTHREAD ON)
|
set(CMAKE_THREAD_PREFER_PTHREAD ON)
|
||||||
@@ -553,19 +494,18 @@ include(LuaHelpers)
|
|||||||
set(LUA_DEPENDENCIES lpeg mpack bit)
|
set(LUA_DEPENDENCIES lpeg mpack bit)
|
||||||
if(NOT LUA_PRG)
|
if(NOT LUA_PRG)
|
||||||
foreach(CURRENT_LUA_PRG luajit lua5.1 lua5.2 lua)
|
foreach(CURRENT_LUA_PRG luajit lua5.1 lua5.2 lua)
|
||||||
unset(_CHECK_LUA_PRG CACHE)
|
# If LUA_PRG is set find_program() will not search
|
||||||
|
unset(LUA_PRG CACHE)
|
||||||
unset(LUA_PRG_WORKS)
|
unset(LUA_PRG_WORKS)
|
||||||
find_program(_CHECK_LUA_PRG ${CURRENT_LUA_PRG})
|
find_program(LUA_PRG ${CURRENT_LUA_PRG})
|
||||||
|
|
||||||
if(_CHECK_LUA_PRG)
|
if(LUA_PRG)
|
||||||
check_lua_deps(${_CHECK_LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
|
check_lua_deps(${LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
|
||||||
if(LUA_PRG_WORKS)
|
if(LUA_PRG_WORKS)
|
||||||
set(LUA_PRG "${_CHECK_LUA_PRG}" CACHE FILEPATH "Path to a program.")
|
|
||||||
break()
|
break()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
unset(_CHECK_LUA_PRG CACHE)
|
|
||||||
else()
|
else()
|
||||||
check_lua_deps(${LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
|
check_lua_deps(${LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
|
||||||
endif()
|
endif()
|
||||||
@@ -576,29 +516,6 @@ endif()
|
|||||||
|
|
||||||
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
|
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
|
||||||
|
|
||||||
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
|
|
||||||
|
|
||||||
if(COMPILE_LUA AND NOT WIN32)
|
|
||||||
if(PREFER_LUA)
|
|
||||||
foreach(CURRENT_LUAC_PRG luac5.1 luac)
|
|
||||||
find_program(_CHECK_LUAC_PRG ${CURRENT_LUAC_PRG})
|
|
||||||
if(_CHECK_LUAC_PRG)
|
|
||||||
set(LUAC_PRG "${_CHECK_LUAC_PRG} -s -o - %s" CACHE STRING "Format for compiling to Lua bytecode")
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
elseif(LUA_PRG MATCHES "luajit")
|
|
||||||
check_lua_module(${LUA_PRG} "jit.bcsave" LUAJIT_HAS_JIT_BCSAVE)
|
|
||||||
if(LUAJIT_HAS_JIT_BCSAVE)
|
|
||||||
set(LUAC_PRG "${LUA_PRG} -b -s %s -" CACHE STRING "Format for compiling to Lua bytecode")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(LUAC_PRG)
|
|
||||||
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Setup busted.
|
# Setup busted.
|
||||||
find_program(BUSTED_PRG NAMES busted busted.bat)
|
find_program(BUSTED_PRG NAMES busted busted.bat)
|
||||||
find_program(BUSTED_LUA_PRG busted-lua)
|
find_program(BUSTED_LUA_PRG busted-lua)
|
||||||
@@ -606,91 +523,39 @@ 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(GPERF_PRG gperf)
|
||||||
find_program(FLAKE8_PRG flake8)
|
|
||||||
find_program(UNCRUSTIFY_PRG uncrustify)
|
|
||||||
find_program(SHELLCHECK_PRG shellcheck)
|
|
||||||
|
|
||||||
add_glob_targets(
|
|
||||||
REQUIRED
|
|
||||||
TARGET lintlua-luacheck
|
|
||||||
COMMAND ${LUACHECK_PRG}
|
|
||||||
FLAGS -q
|
|
||||||
GLOB_DIRS runtime/ scripts/ src/ test/
|
|
||||||
GLOB_PAT *.lua
|
|
||||||
TOUCH_STRATEGY SINGLE
|
|
||||||
)
|
|
||||||
|
|
||||||
add_glob_targets(
|
|
||||||
TARGET lintlua-stylua
|
|
||||||
COMMAND ${STYLUA_PRG}
|
|
||||||
FLAGS --color=always --check
|
|
||||||
GLOB_DIRS runtime/
|
|
||||||
GLOB_PAT *.lua
|
|
||||||
TOUCH_STRATEGY SINGLE
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_target(lintlua)
|
|
||||||
add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
|
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
#
|
# MIN_LOG_LEVEL for log.h
|
||||||
|
if("${MIN_LOG_LEVEL}" MATCHES "^$")
|
||||||
|
message(STATUS "MIN_LOG_LEVEL not specified")
|
||||||
|
else()
|
||||||
|
if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
|
||||||
|
message(FATAL_ERROR "invalid MIN_LOG_LEVEL: " ${MIN_LOG_LEVEL})
|
||||||
|
endif()
|
||||||
|
message(STATUS "MIN_LOG_LEVEL set to ${MIN_LOG_LEVEL}")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Go down the tree.
|
# Go down the tree.
|
||||||
#
|
|
||||||
|
|
||||||
add_subdirectory(src/nvim)
|
add_subdirectory(src/nvim)
|
||||||
get_directory_property(NVIM_VERSION_CFLAGS DIRECTORY src/nvim DEFINITION NVIM_VERSION_CFLAGS)
|
# Read compilation flags from src/nvim, used in config subdirectory below.
|
||||||
|
include(GetCompileFlags)
|
||||||
|
get_compile_flags(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)
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
install_helper(
|
install_helper(
|
||||||
FILES ${DEPS_PREFIX}/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim
|
FILES ${DEPS_PREFIX}/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim
|
||||||
@@ -707,12 +572,28 @@ if(BUSTED_PRG)
|
|||||||
# console pool: to do so we need to use the USES_TERMINAL
|
# console pool: to do so we need to use the USES_TERMINAL
|
||||||
# option, but this is only available in CMake 3.2
|
# option, but this is only available in CMake 3.2
|
||||||
set(TEST_TARGET_ARGS)
|
set(TEST_TARGET_ARGS)
|
||||||
|
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.2.0))
|
||||||
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
|
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(UNITTEST_PREREQS nvim-test unittest-headers)
|
set(UNITTEST_PREREQS nvim-test unittest-headers)
|
||||||
set(FUNCTIONALTEST_PREREQS nvim printenv-test printargs-test shell-test pwsh-test streams-test tty-test ${GENERATED_HELP_TAGS})
|
set(FUNCTIONALTEST_PREREQS nvim printargs-test shell-test)
|
||||||
|
if(NOT WIN32)
|
||||||
|
list(APPEND FUNCTIONALTEST_PREREQS tty-test)
|
||||||
|
endif()
|
||||||
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
|
||||||
@@ -724,6 +605,7 @@ if(BUSTED_PRG)
|
|||||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||||
-DTEST_TYPE=unit
|
-DTEST_TYPE=unit
|
||||||
|
-DSYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||||
DEPENDS ${UNITTEST_PREREQS}
|
DEPENDS ${UNITTEST_PREREQS}
|
||||||
${TEST_TARGET_ARGS})
|
${TEST_TARGET_ARGS})
|
||||||
@@ -738,11 +620,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}
|
||||||
@@ -754,10 +636,12 @@ if(BUSTED_PRG)
|
|||||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||||
-DTEST_TYPE=functional
|
-DTEST_TYPE=functional
|
||||||
|
-DSYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||||
-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}
|
||||||
@@ -769,10 +653,11 @@ if(BUSTED_PRG)
|
|||||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||||
-DTEST_TYPE=benchmark
|
-DTEST_TYPE=benchmark
|
||||||
|
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||||
-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)
|
||||||
@@ -786,15 +671,58 @@ if(BUSTED_LUA_PRG)
|
|||||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||||
-DTEST_TYPE=functional
|
-DTEST_TYPE=functional
|
||||||
|
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||||
-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-lua PROPERTIES FOLDER test)
|
set_target_properties(functionaltest-lua PROPERTIES FOLDER test)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_custom_target(uninstall
|
if(LUACHECK_PRG)
|
||||||
COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/UninstallHelper.cmake)
|
add_custom_target(testlint
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DLUACHECK_PRG=${LUACHECK_PRG}
|
||||||
|
-DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
|
-DIGNORE_PATTERN="*/preload.lua"
|
||||||
|
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||||
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake)
|
||||||
|
|
||||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
add_custom_target(
|
||||||
add_subdirectory(cmake.packaging)
|
lintbuiltinlua
|
||||||
|
COMMAND
|
||||||
|
${CMAKE_COMMAND}
|
||||||
|
-DLUACHECK_PRG=${LUACHECK_PRG}
|
||||||
|
-DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/src/nvim/lua
|
||||||
|
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||||
|
-DREAD_GLOBALS=vim
|
||||||
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake
|
||||||
|
)
|
||||||
|
add_custom_target(
|
||||||
|
lintruntimelua
|
||||||
|
COMMAND
|
||||||
|
${CMAKE_COMMAND}
|
||||||
|
-DLUACHECK_PRG=${LUACHECK_PRG}
|
||||||
|
-DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/runtime/lua
|
||||||
|
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||||
|
-DREAD_GLOBALS=vim
|
||||||
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake
|
||||||
|
)
|
||||||
|
# TODO(ZyX-I): Run linter for all lua code in src
|
||||||
|
add_custom_target(
|
||||||
|
lualint
|
||||||
|
DEPENDS lintruntimelua
|
||||||
|
DEPENDS lintbuiltinlua
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_NAME "Neovim")
|
||||||
|
set(CPACK_PACKAGE_VENDOR "neovim.io")
|
||||||
|
set(CPACK_PACKAGE_VERSION ${NVIM_VERSION_MEDIUM})
|
||||||
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Neovim")
|
||||||
|
# Set toplevel directory/installer name as Neovim
|
||||||
|
set(CPACK_PACKAGE_FILE_NAME "Neovim")
|
||||||
|
set(CPACK_TOPLEVEL_TAG "Neovim")
|
||||||
|
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||||
|
set(CPACK_NSIS_MODIFY_PATH ON)
|
||||||
|
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||||
|
include(CPack)
|
||||||
|
@@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
351
CONTRIBUTING.md
351
CONTRIBUTING.md
@@ -1,5 +1,4 @@
|
|||||||
Contributing to Neovim
|
# Contributing to Neovim
|
||||||
======================
|
|
||||||
|
|
||||||
Getting started
|
Getting started
|
||||||
---------------
|
---------------
|
||||||
@@ -7,112 +6,95 @@ Getting started
|
|||||||
If you want to help but don't know where to start, here are some
|
If you want to help but don't know where to start, here are some
|
||||||
low-risk/isolated tasks:
|
low-risk/isolated tasks:
|
||||||
|
|
||||||
|
- [Merge a Vim patch].
|
||||||
- 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 scan-build](#clang-scan-build),
|
||||||
[Coverity](#coverity).
|
[coverity](#coverity), and [PVS](#pvs-studio).
|
||||||
- [Improve documentation](#documenting)
|
|
||||||
- [Merge a Vim patch] (requires strong familiarity with Vim)
|
|
||||||
- NOTE: read the above link before sending improvements to "runtime files" (anything in `runtime/`).
|
|
||||||
- Vimscript and documentation files are (mostly) maintained by [Vim](https://github.com/vim/vim), not Nvim.
|
|
||||||
- Lua files are maintained by Nvim.
|
|
||||||
|
|
||||||
Reporting problems
|
|
||||||
------------------
|
|
||||||
|
|
||||||
- [Check the FAQ][wiki-faq].
|
|
||||||
- [Search existing issues][github-issues] (including closed!)
|
|
||||||
- Update Neovim to the latest version to see if your problem persists.
|
|
||||||
- Try to reproduce with `nvim --clean` ("factory defaults").
|
|
||||||
- [Bisect](https://neovim.io/doc/user/starting.html#bisect) your config: disable plugins incrementally, to narrow down the cause of the issue.
|
|
||||||
- [Bisect][git-bisect] Neovim's source code to find the cause of a regression, if you can. This is _extremely_ helpful.
|
|
||||||
- When reporting a crash, [include a stacktrace](https://github.com/neovim/neovim/wiki/FAQ#backtrace-linux).
|
|
||||||
- Use [ASAN/UBSAN](#clang-sanitizers-asan-and-ubsan) to get detailed errors for segfaults and undefined behavior.
|
|
||||||
- Check the logs. `:edit $NVIM_LOG_FILE`
|
|
||||||
- Include `cmake --system-information` for build-related issues.
|
|
||||||
|
|
||||||
Developer guidelines
|
Developer guidelines
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
- Read [:help dev](https://neovim.io/doc/user/develop.html#dev) if you are working on Nvim core.
|
- Nvim contributors should read `:help dev` (especially `:help dev-api`).
|
||||||
- Read [:help dev-ui](https://neovim.io/doc/user/develop.html#dev-ui) if you are developing a UI.
|
- External UI developers should read `:help dev-ui`.
|
||||||
- Read [:help dev-api-client](https://neovim.io/doc/user/develop.html#dev-api-client) if you are developing an API client.
|
- API client developers should read `:help dev-api-client`.
|
||||||
- Install `ninja` for faster builds of Nvim.
|
- Nvim developers are _strongly encouraged_ to install `ninja` for faster builds.
|
||||||
```
|
```
|
||||||
sudo apt-get install ninja-build
|
sudo apt-get install ninja-build
|
||||||
make distclean
|
make distclean
|
||||||
make # Nvim build system uses ninja automatically, if available.
|
make # Nvim build system uses ninja automatically, if available.
|
||||||
```
|
```
|
||||||
|
|
||||||
Pull requests (PRs)
|
Reporting problems
|
||||||
|
------------------
|
||||||
|
|
||||||
|
- Check the [**FAQ**][wiki-faq].
|
||||||
|
- Search [existing issues][github-issues] (including closed!)
|
||||||
|
- Update Neovim to the latest version to see if your problem persists.
|
||||||
|
- Disable plugins incrementally, to narrow down the cause of the issue.
|
||||||
|
- When reporting a crash, [include a stacktrace](https://github.com/neovim/neovim/wiki/Development-tips#backtrace-linux).
|
||||||
|
- [Bisect][git-bisect] to the cause of a regression, if you are able. This is _extremely_ helpful.
|
||||||
|
- Check `$NVIM_LOG_FILE`, if it exists.
|
||||||
|
- Include `cmake --system-information` for **build** issues.
|
||||||
|
|
||||||
|
Pull requests ("PRs")
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
- To avoid duplicate work, create a draft pull request.
|
- To avoid duplicate work, create a `[WIP]` pull request as soon as possible.
|
||||||
- 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
|
||||||
|
pick/edit/reword.
|
||||||
|
|
||||||
### Merging to master
|
### Stages: WIP, RFC, RDY
|
||||||
|
|
||||||
For maintainers: when a PR is ready to merge to master,
|
Pull requests have three stages: `[WIP]` (Work In Progress), `[RFC]` (Request
|
||||||
|
For Comment) and `[RDY]` (Ready).
|
||||||
|
|
||||||
- prefer _Squash Merge_ for "single-commit PRs" (when the PR has only one meaningful commit).
|
- Untagged PRs are assumed to be `[RFC]`, i.e. you are requesting a review.
|
||||||
- prefer _Merge_ for "multi-commit PRs" (when the PR has multiple meaningful commits).
|
- Prepend `[WIP]` to the PR title if you are _not_ requesting feedback and the
|
||||||
|
work is still in flux.
|
||||||
|
- Prepend `[RDY]` to the PR title if you are _done_ with the PR and are only
|
||||||
|
waiting on it to be merged.
|
||||||
|
|
||||||
### Stages: Draft and Ready for review
|
For example, a typical workflow is:
|
||||||
|
|
||||||
Pull requests have two stages: Draft and Ready for review.
|
1. You open a `[WIP]` PR where the work is _not_ ready for feedback, you just want to
|
||||||
|
let others know what you are doing.
|
||||||
1. [Create a Draft PR][pr-draft] while you are _not_ requesting feedback as
|
2. Once the PR is ready for review, you replace `[WIP]` in the title with `[RFC]`.
|
||||||
you are still working on the PR.
|
You may add fix up commits to address issues that come up during review.
|
||||||
- You can skip this if your PR is ready for review.
|
3. Once the PR is ready for merging, you rebase/squash your work appropriately and
|
||||||
2. [Change your PR to ready][pr-ready] when the PR is ready for review.
|
then replace `[RFC]` in the title with `[RDY]`.
|
||||||
- You can convert back to Draft at any time.
|
|
||||||
|
|
||||||
Do __not__ add labels like `[RFC]` or `[WIP]` in the title to indicate the
|
|
||||||
state of your PR: this just adds noise. Non-Draft PRs are assumed to be open
|
|
||||||
for comments; if you want feedback from specific people, `@`-mention them in
|
|
||||||
a comment.
|
|
||||||
|
|
||||||
### Commit messages
|
### Commit messages
|
||||||
|
|
||||||
Follow the [conventional commits guidelines][conventional_commits] to *make reviews easier* and to make
|
Follow [commit message hygiene][hygiene] to *make reviews easier* and to make
|
||||||
the VCS/git logs more valuable. The general structure of a commit message is:
|
the VCS/git logs more valuable.
|
||||||
|
|
||||||
```
|
|
||||||
<type>([optional scope]): <description>
|
|
||||||
|
|
||||||
[optional body]
|
|
||||||
|
|
||||||
[optional footer(s)]
|
|
||||||
```
|
|
||||||
|
|
||||||
- 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`
|
|
||||||
- You can **ignore this for "fixup" commits** or any commits you expect to be squashed.
|
|
||||||
- Append optional scope to _type_ such as `(lsp)`, `(treesitter)`, `(float)`, …
|
|
||||||
- _Description_ shouldn't start with a capital letter or end in a period.
|
|
||||||
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
|
|
||||||
- Try to keep the first line under 72 characters.
|
- Try to keep the first line under 72 characters.
|
||||||
- A blank line must follow the subject.
|
- **Prefix the commit subject with a _scope_:** `doc:`, `test:`, `foo.c:`,
|
||||||
- Breaking API changes must be indicated by
|
`runtime:`, ...
|
||||||
1. "!" after the type/scope, and
|
- For commits that contain only style/lint changes, a single-word subject
|
||||||
2. a "BREAKING CHANGE" footer describing the change.
|
line is preferred: `style` or `lint`.
|
||||||
Example:
|
- A blank line must separate the subject from the description.
|
||||||
```
|
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
|
||||||
refactor(provider)!: drop support for Python 2
|
|
||||||
|
|
||||||
BREAKING CHANGE: refactor to use Python 3 features since Python 2 is no longer supported.
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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 [travis CI], [quickbuild]
|
||||||
|
and [AppVeyor].
|
||||||
|
|
||||||
- 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.
|
||||||
@@ -123,171 +105,47 @@ Each pull request must pass the automated builds on [Cirrus CI] and [GitHub Acti
|
|||||||
- CI runs [ASan] and other analyzers.
|
- CI runs [ASan] and other analyzers.
|
||||||
- To run valgrind locally: `VALGRIND=1 make test`
|
- To run valgrind locally: `VALGRIND=1 make test`
|
||||||
- To run Clang ASan/UBSan locally: `CC=clang make CMAKE_FLAGS="-DCLANG_ASAN_UBSAN=ON"`
|
- To run Clang ASan/UBSan locally: `CC=clang make CMAKE_FLAGS="-DCLANG_ASAN_UBSAN=ON"`
|
||||||
- The [lint](#lint) build checks modified lines _and their immediate
|
- The `lint` build ([#3174][3174]) checks modified lines _and their immediate
|
||||||
neighbors_, to encourage incrementally updating the legacy style to meet our
|
neighbors_. This is to encourage incrementally updating the legacy style to
|
||||||
[style](#style). (See [#3174][3174] for background.)
|
meet our style guidelines.
|
||||||
- CI for FreeBSD runs on [Cirrus CI].
|
- A single word (`lint` or `style`) is sufficient as the subject line of
|
||||||
|
a commit that contains only style changes.
|
||||||
|
- [How to investigate QuickBuild failures](https://github.com/neovim/neovim/pull/4718#issuecomment-217631350)
|
||||||
|
|
||||||
|
QuickBuild uses this invocation:
|
||||||
|
|
||||||
|
mkdir -p build/${params.get("buildType")} \
|
||||||
|
&& cd build/${params.get("buildType")} \
|
||||||
|
&& cmake -G "Unix Makefiles" -DBUSTED_OUTPUT_TYPE=TAP -DCMAKE_BUILD_TYPE=${params.get("buildType")}
|
||||||
|
-DTRAVIS_CI_BUILD=ON ../.. && ${node.getAttribute("make", "make")}
|
||||||
|
VERBOSE=1 nvim unittest-prereqs functionaltest-prereqs
|
||||||
|
|
||||||
|
|
||||||
### Clang scan-build
|
### Clang scan-build
|
||||||
|
|
||||||
View the [Clang report] to see potential bugs found by the Clang
|
The auto-generated [clang-scan] report presents walk-throughs of bugs found by
|
||||||
[scan-build](https://clang-analyzer.llvm.org/scan-build.html) analyzer.
|
Clang's [scan-build](https://clang-analyzer.llvm.org/scan-build.html) static
|
||||||
|
analyzer. To verify a fix locally, run `scan-build` like this:
|
||||||
|
|
||||||
- Search the Neovim commit history to find examples:
|
|
||||||
```
|
|
||||||
git log --oneline --no-merges --grep clang
|
|
||||||
```
|
|
||||||
- To verify a fix locally, run `scan-build` like this:
|
|
||||||
```
|
|
||||||
rm -rf build/
|
rm -rf build/
|
||||||
scan-build --use-analyzer=/usr/bin/clang make
|
scan-build --use-analyzer=/usr/bin/clang make
|
||||||
```
|
|
||||||
|
|
||||||
### PVS-Studio
|
|
||||||
|
|
||||||
View the [PVS report](https://neovim.io/doc/reports/pvs/PVS-studio.html.d/) to
|
|
||||||
see potential bugs found by [PVS Studio](https://www.viva64.com/en/pvs-studio/).
|
|
||||||
|
|
||||||
- Use this format for commit messages (where `{id}` is the PVS warning-id)):
|
|
||||||
```
|
|
||||||
fix(PVS/V{id}): {description}
|
|
||||||
```
|
|
||||||
- Search the Neovim commit history to find examples:
|
|
||||||
```
|
|
||||||
git log --oneline --no-merges --grep PVS
|
|
||||||
```
|
|
||||||
- Try `./scripts/pvscheck.sh` to run PVS locally.
|
|
||||||
|
|
||||||
### Coverity
|
### Coverity
|
||||||
|
|
||||||
[Coverity](https://scan.coverity.com/projects/neovim-neovim) runs against the
|
[Coverity](https://scan.coverity.com/projects/neovim-neovim) runs against the
|
||||||
master build. To view the defects, just request access; you will be approved.
|
master build. To view the defects, just request access; you will be approved.
|
||||||
|
|
||||||
- Use this format for commit messages (where `{id}` is the CID (Coverity ID);
|
Use this commit-message format for coverity fixes:
|
||||||
([example](https://github.com/neovim/neovim/pull/804))):
|
|
||||||
```
|
|
||||||
fix(coverity/{id}): {description}
|
|
||||||
```
|
|
||||||
- Search the Neovim commit history to find examples:
|
|
||||||
```
|
|
||||||
git log --oneline --no-merges --grep coverity
|
|
||||||
```
|
|
||||||
|
|
||||||
### Clang sanitizers (ASAN and UBSAN)
|
coverity/<id>: <description of what fixed the defect>
|
||||||
|
|
||||||
ASAN/UBSAN can be used to detect memory errors and other common forms of undefined behavior at runtime in debug builds.
|
where `<id>` is the Coverity ID (CID). For example see [#804](https://github.com/neovim/neovim/pull/804).
|
||||||
|
|
||||||
- To build Neovim with sanitizers enabled, use
|
### PVS-Studio
|
||||||
```
|
|
||||||
rm -rf build && CMAKE_EXTRA_FLAGS="-DCMAKE_C_COMPILER=clang -DCLANG_ASAN_UBSAN=1" make
|
|
||||||
```
|
|
||||||
- When running Neovim, use
|
|
||||||
```
|
|
||||||
UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=log_path=/tmp/nvim_asan nvim args...
|
|
||||||
```
|
|
||||||
- If Neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages.
|
|
||||||
|
|
||||||
|
View the [PVS analysis report](https://neovim.io/doc/reports/pvs/) to see bugs
|
||||||
Coding
|
found by [PVS Studio](https://www.viva64.com/en/pvs-studio/).
|
||||||
------
|
You can run `scripts/pvscheck.sh` locally to run PVS on your machine.
|
||||||
|
|
||||||
### Lint
|
|
||||||
|
|
||||||
You can run the linter locally by:
|
|
||||||
|
|
||||||
make lint
|
|
||||||
|
|
||||||
The lint step downloads the [master error list] and excludes them, so only lint
|
|
||||||
errors related to the local changes are reported.
|
|
||||||
|
|
||||||
You can lint a single file (but this will _not_ exclude legacy errors):
|
|
||||||
|
|
||||||
./src/clint.py src/nvim/ops.c
|
|
||||||
|
|
||||||
### Style
|
|
||||||
|
|
||||||
- You can format files by using:
|
|
||||||
```
|
|
||||||
make format
|
|
||||||
```
|
|
||||||
This will format changed Lua and C files with all appropriate flags set.
|
|
||||||
- Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match
|
|
||||||
the [style-guide]. To use the Nvim `gq` command with `uncrustify`:
|
|
||||||
```
|
|
||||||
if !empty(findfile('src/uncrustify.cfg', ';'))
|
|
||||||
setlocal formatprg=uncrustify\ -q\ -l\ C\ -c\ src/uncrustify.cfg\ --no-backup
|
|
||||||
endif
|
|
||||||
```
|
|
||||||
The required version of `uncrustify` is specified in `uncrustify.cfg`.
|
|
||||||
- There is also `.clang-format` which has drifted from the [style-guide], but
|
|
||||||
is available for reference. To use the Nvim `gq` command with `clang-format`:
|
|
||||||
```
|
|
||||||
if !empty(findfile('.clang-format', ';'))
|
|
||||||
setlocal formatprg=clang-format\ -style=file
|
|
||||||
endif
|
|
||||||
```
|
|
||||||
|
|
||||||
### Navigate
|
|
||||||
|
|
||||||
- Set `blame.ignoreRevsFile` to ignore [noise commits](https://github.com/neovim/neovim/commit/2d240024acbd68c2d3f82bc72cb12b1a4928c6bf) in git blame:
|
|
||||||
```
|
|
||||||
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
|
||||||
```
|
|
||||||
|
|
||||||
- Recommendation is to use **[clangd]**.
|
|
||||||
Can use the maintained config in [nvim-lspconfig/clangd].
|
|
||||||
- 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
|
|
||||||
project root:
|
|
||||||
|
|
||||||
$ ln -s contrib/luarc.json .luarc.json
|
|
||||||
|
|
||||||
### Includes
|
|
||||||
|
|
||||||
For managing includes in C files, use [include-what-you-use].
|
|
||||||
|
|
||||||
- [Install include-what-you-use][include-what-you-use-install]
|
|
||||||
- Run with:
|
|
||||||
```
|
|
||||||
make CMAKE_EXTRA_FLAGS=-DCMAKE_C_INCLUDE_WHAT_YOU_USE=include-what-you-use | tee iwyu.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
See [#549][549] for more details.
|
|
||||||
|
|
||||||
Documenting
|
|
||||||
-----------
|
|
||||||
|
|
||||||
Many parts of the `:help` documentation are autogenerated from C or Lua docstrings using the `./scripts/gen_vimdoc.py` script.
|
|
||||||
You can filter the regeneration based on the target (api, lua, or lsp), or the file you changed, that need a doc refresh using `./scripts/gen_vimdoc.py -t <target>`.
|
|
||||||
|
|
||||||
## Lua docstrings
|
|
||||||
|
|
||||||
Lua documentation uses a subset of [EmmyLua] annotations. A rough outline of a function documentation is
|
|
||||||
|
|
||||||
```lua
|
|
||||||
--- {Brief}
|
|
||||||
---
|
|
||||||
--- {Long explanation}
|
|
||||||
---
|
|
||||||
---@param arg1 type {description}
|
|
||||||
---@param arg2 type {description}
|
|
||||||
{...}
|
|
||||||
---
|
|
||||||
---@return type {description}
|
|
||||||
```
|
|
||||||
|
|
||||||
If possible, always add type information (`table`, `string`, `number`, ...). Multiple valid types are separated by a bar (`string|table`). Indicate optional parameters via `type|nil`.
|
|
||||||
|
|
||||||
If a function in your Lua module should not be documented (e.g. internal function or local function), you should set the doc comment to:
|
|
||||||
|
|
||||||
```
|
|
||||||
---@private
|
|
||||||
```
|
|
||||||
|
|
||||||
Mark functions that are deprecated as
|
|
||||||
```
|
|
||||||
---@deprecated
|
|
||||||
```
|
|
||||||
|
|
||||||
Reviewing
|
Reviewing
|
||||||
---------
|
---------
|
||||||
@@ -295,46 +153,35 @@ Reviewing
|
|||||||
To help review pull requests, start with [this checklist][review-checklist].
|
To help review pull requests, start with [this checklist][review-checklist].
|
||||||
|
|
||||||
Reviewing can be done on GitHub, but you may find it easier to do locally.
|
Reviewing can be done on GitHub, but you may find it easier to do locally.
|
||||||
Using [GitHub CLI][gh], you can create a new branch with the contents of a pull
|
Using [`hub`][hub], you can create a new branch with the contents of a pull
|
||||||
request, e.g. [#1820][1820]:
|
request, e.g. [#1820][1820]:
|
||||||
|
|
||||||
gh pr checkout https://github.com/neovim/neovim/pull/1820
|
hub checkout https://github.com/neovim/neovim/pull/1820
|
||||||
|
|
||||||
Use [`git log -p master..FETCH_HEAD`][git-history-filtering] to list all
|
Use [`git log -p master..FETCH_HEAD`][git-history-filtering] to list all
|
||||||
commits in the feature branch which aren't in the `master` branch; `-p`
|
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
|
[hub]: https://hub.github.com/
|
||||||
[lua-language-server]: https://github.com/sumneko/lua-language-server/
|
[hygiene]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
||||||
[master error list]: https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json
|
[style-guide]: http://neovim.io/develop/style-guide.xml
|
||||||
[nvim-lspconfig/clangd]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#clangd
|
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
|
||||||
[pr-draft]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
|
|
||||||
[pr-ready]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
|
|
||||||
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
|
|
||||||
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
|
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
|
||||||
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
|
|
||||||
[uncrustify]: http://uncrustify.sourceforge.net/
|
|
||||||
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
|
|
||||||
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
|
[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
|
||||||
|
[travis CI]: https://travis-ci.org/neovim/neovim
|
||||||
|
[quickbuild]: http://neovim-qb.szakmeister.net/dashboard
|
||||||
|
[AppVeyor]: https://ci.appveyor.com/project/neovim/neovim
|
||||||
|
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
|
||||||
|
[clang-scan]: https://neovim.io/doc/reports/clang/
|
||||||
|
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
|
||||||
|
19
ISSUE_TEMPLATE.md
Normal file
19
ISSUE_TEMPLATE.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<!-- Before reporting: search existing issues and check the FAQ. -->
|
||||||
|
|
||||||
|
- `nvim --version`:
|
||||||
|
- Vim (version: ) behaves differently?
|
||||||
|
- Operating system/version:
|
||||||
|
- Terminal name/version:
|
||||||
|
- `$TERM`:
|
||||||
|
|
||||||
|
### Steps to reproduce using `nvim -u NORC`
|
||||||
|
|
||||||
|
```
|
||||||
|
nvim -u NORC
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Actual behaviour
|
||||||
|
|
||||||
|
### Expected behaviour
|
||||||
|
|
@@ -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
|
||||||
|
|
||||||
@@ -189,18 +189,8 @@ contributed under the Vim license and (2) externally maintained libraries.
|
|||||||
The externally maintained libraries used by Neovim are:
|
The externally maintained libraries used by Neovim are:
|
||||||
|
|
||||||
- Klib: a Generic Library in C. MIT/X11 license.
|
- Klib: a Generic Library in C. MIT/X11 license.
|
||||||
- Lua: MIT license
|
|
||||||
- LuaJIT: a Just-In-Time Compiler for Lua. Copyright Mike Pall. MIT license.
|
|
||||||
- Luv: Apache 2.0 license
|
|
||||||
- libmpack: 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
|
- LuaJIT: a Just-In-Time Compiler for Lua. Copyright Mike Pall. MIT license.
|
||||||
- lua-cjson: MIT license
|
|
||||||
- lua-compat: MIT license
|
|
||||||
- tree-sitter: MIT license
|
|
||||||
- unibilium: LGPL v3
|
|
||||||
- xdiff: LGPL v2
|
|
||||||
|
|
||||||
====
|
====
|
||||||
|
|
107
MAINTAIN.md
107
MAINTAIN.md
@@ -3,103 +3,46 @@ Maintaining the Neovim project
|
|||||||
|
|
||||||
Notes on maintaining the Neovim project.
|
Notes on maintaining the Neovim project.
|
||||||
|
|
||||||
General guidelines
|
See also: https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
|
||||||
------------------
|
|
||||||
|
|
||||||
* Decide by cost-benefit
|
Ticket Triage
|
||||||
* Write down what was decided
|
-------------
|
||||||
* Constraints are good
|
|
||||||
* Use automation to solve problems
|
|
||||||
* Never break the API... but sometimes break the UI
|
|
||||||
|
|
||||||
Issue triage
|
In practice we haven't found a meaningful way to forecast more precisely than
|
||||||
------------
|
"next" and "after next". That means there are usually one or two (at most)
|
||||||
|
planned milestones:
|
||||||
|
|
||||||
In practice we haven't found a way to forecast more precisely than "next" and
|
- Next bugfix-release (1.0.x)
|
||||||
"after next". So there are usually one or two (at most) planned milestones:
|
- Next feature-release (1.x.0)
|
||||||
|
|
||||||
* Next bugfix-release (1.0.x)
|
|
||||||
* Next feature-release (1.x.0)
|
|
||||||
|
|
||||||
The forecasting problem might be solved with an explicit priority system (like
|
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 (RDY).
|
||||||
* 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
|
||||||
for having a plan written down: it is _closer to completion_ than tickets
|
having a plan written down: it is _closer to completion_ than tickets without
|
||||||
without a plan.
|
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 RDY 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
|
||||||
can review open issues, but chances are your next milestone is already getting
|
can review open issues, but chances are your next milestone is already getting
|
||||||
full... :)
|
full :)
|
||||||
|
|
||||||
Release policy
|
Release Policy
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
Release "often", but not "early".
|
The goal is "early and often".
|
||||||
|
|
||||||
The (unreleased) `master` branch is the "early" channel; it should not be
|
Up to now we use only one branch, the `master` branch.
|
||||||
released if it's not stable. High-risk changes may be merged to `master` if
|
|
||||||
the next release is not imminent.
|
|
||||||
|
|
||||||
For maintenance releases, create a `release-x.y` branch. If the current release
|
|
||||||
has a major bug:
|
|
||||||
|
|
||||||
|
- If `master` is unstable we don't release.
|
||||||
|
- If the last release has a major bug, we:
|
||||||
1. Fix the bug on `master`.
|
1. Fix the bug on `master`.
|
||||||
2. Cherry-pick the fix to `release-x.y`.
|
2. Disable or remove any known risks present on `master`.
|
||||||
3. Cut a release from `release-x.y`.
|
3. Cut a release from `master`.
|
||||||
* Run `./scripts/release.sh`
|
|
||||||
* Update (force-push) the remote `stable` tag.
|
|
||||||
* The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13)
|
|
||||||
will update the release assets and force-push to the `stable` tag.
|
|
||||||
|
|
||||||
### Release automation
|
This is a bit silly, but it works ok. And it keeps `master` from biting off
|
||||||
|
more feature-creep than it can chew.
|
||||||
|
|
||||||
Neovim automation includes a [backport bot](https://github.com/zeebe-io/backport-action).
|
See also: https://github.com/neovim/neovim/issues/862
|
||||||
Trigger the action by labeling a PR with `backport release-X.Y`. See `.github/workflows/backport.yml`.
|
|
||||||
|
|
||||||
Third-party dependencies
|
|
||||||
------------------------
|
|
||||||
|
|
||||||
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`.
|
|
||||||
Some can be auto-bumped by `scripts/bump-deps.sh`.
|
|
||||||
|
|
||||||
* [LuaJIT](https://github.com/LuaJIT/LuaJIT)
|
|
||||||
* [Lua](https://www.lua.org/download.html)
|
|
||||||
* [Luv](https://github.com/luvit/luv)
|
|
||||||
* [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
|
|
||||||
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
|
|
||||||
* [libtermkey](https://github.com/neovim/libtermkey)
|
|
||||||
* [libuv](https://github.com/libuv/libuv)
|
|
||||||
* [libvterm](http://www.leonerd.org.uk/code/libvterm/)
|
|
||||||
* [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
|
||||||
* [msys2](https://github.com/msys2/MINGW-packages) (for mingw Windows build)
|
|
||||||
* Changes to mingw can [break our mingw build](https://github.com/msys2/MINGW-packages/issues/9946).
|
|
||||||
* [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
|
||||||
* [unibilium](https://github.com/neovim/unibilium)
|
|
||||||
|
|
||||||
### Vendored dependencies
|
|
||||||
|
|
||||||
These dependencies are "vendored" (inlined), we must update the sources manually:
|
|
||||||
|
|
||||||
* `src/mpack/`: [libmpack](https://github.com/libmpack/libmpack)
|
|
||||||
* send improvements upstream!
|
|
||||||
* `src/xdiff/`: [xdiff](https://github.com/git/git/tree/master/xdiff)
|
|
||||||
* `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson)
|
|
||||||
* `src/nvim/lib/`: [Klib](https://github.com/attractivechaos/klib)
|
|
||||||
* `runtime/lua/vim/inspect.lua`: [inspect.lua](https://github.com/kikito/inspect.lua)
|
|
||||||
* `src/nvim/tui/terminfo_defs.h`: terminfo definitions
|
|
||||||
* Run `scripts/update_terminfo.sh` to update these definitions.
|
|
||||||
* [treesitter parsers](https://github.com/neovim/neovim/blob/fcc24e43e0b5f9d801a01ff2b8f78ce8c16dd551/cmake.deps/CMakeLists.txt#L197-L210)
|
|
||||||
|
|
||||||
### Forks
|
|
||||||
|
|
||||||
We may maintain forks, if we are waiting on upstream changes: https://github.com/neovim/neovim/wiki/Deps
|
|
||||||
|
|
||||||
See also
|
|
||||||
--------
|
|
||||||
|
|
||||||
* https://github.com/neovim/neovim/issues/862
|
|
||||||
* https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
|
|
||||||
|
159
Makefile
159
Makefile
@@ -1,70 +1,48 @@
|
|||||||
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
|
THIS_DIR = $(shell pwd)
|
||||||
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
|
|
||||||
|
|
||||||
filter-false = $(strip $(filter-out 0 off OFF false FALSE,$1))
|
filter-false = $(strip $(filter-out 0 off OFF false FALSE,$1))
|
||||||
filter-true = $(strip $(filter-out 1 on ON true TRUE,$1))
|
filter-true = $(strip $(filter-out 1 on ON true TRUE,$1))
|
||||||
|
|
||||||
# See contrib/local.mk.example
|
# See contrib/local.mk.example
|
||||||
-include local.mk
|
-include local.mk
|
||||||
|
|
||||||
all: nvim
|
|
||||||
|
|
||||||
CMAKE_PRG ?= $(shell (command -v cmake3 || echo cmake))
|
CMAKE_PRG ?= $(shell (command -v cmake3 || echo cmake))
|
||||||
CMAKE_BUILD_TYPE ?= Debug
|
CMAKE_BUILD_TYPE ?= Debug
|
||||||
|
|
||||||
CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
|
CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
|
||||||
# Extra CMake flags which extend the default set
|
|
||||||
CMAKE_EXTRA_FLAGS ?=
|
|
||||||
NVIM_PRG := $(MAKEFILE_DIR)/build/bin/nvim
|
|
||||||
|
|
||||||
# CMAKE_INSTALL_PREFIX
|
BUILD_TYPE ?= $(shell (type ninja > /dev/null 2>&1 && echo "Ninja") || \
|
||||||
# - May be passed directly or as part of CMAKE_EXTRA_FLAGS.
|
|
||||||
# - `checkprefix` target checks that it matches the CMake-cached value. #9615
|
|
||||||
ifneq (,$(CMAKE_INSTALL_PREFIX)$(CMAKE_EXTRA_FLAGS))
|
|
||||||
CMAKE_INSTALL_PREFIX := $(shell echo $(CMAKE_EXTRA_FLAGS) | 2>/dev/null \
|
|
||||||
grep -o 'CMAKE_INSTALL_PREFIX=[^ ]\+' | cut -d '=' -f2)
|
|
||||||
endif
|
|
||||||
ifneq (,$(CMAKE_INSTALL_PREFIX))
|
|
||||||
override CMAKE_EXTRA_FLAGS += -DCMAKE_INSTALL_PREFIX=$(CMAKE_INSTALL_PREFIX)
|
|
||||||
|
|
||||||
checkprefix:
|
|
||||||
@if [ -f build/.ran-cmake ]; then \
|
|
||||||
cached_prefix=$(shell $(CMAKE_PRG) -L -N build | 2>/dev/null grep 'CMAKE_INSTALL_PREFIX' | cut -d '=' -f2); \
|
|
||||||
if ! [ "$(CMAKE_INSTALL_PREFIX)" = "$$cached_prefix" ]; then \
|
|
||||||
printf "Re-running CMake: CMAKE_INSTALL_PREFIX '$(CMAKE_INSTALL_PREFIX)' does not match cached value '%s'.\n" "$$cached_prefix"; \
|
|
||||||
$(RM) build/.ran-cmake; \
|
|
||||||
fi \
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
checkprefix: ;
|
|
||||||
endif
|
|
||||||
|
|
||||||
CMAKE_GENERATOR ?= $(shell (command -v ninja > /dev/null 2>&1 && echo "Ninja") || \
|
|
||||||
echo "Unix Makefiles")
|
echo "Unix Makefiles")
|
||||||
DEPS_BUILD_DIR ?= .deps
|
DEPS_BUILD_DIR ?= .deps
|
||||||
|
|
||||||
ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
|
ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
|
||||||
$(error DEPS_BUILD_DIR must not contain whitespace)
|
$(error DEPS_BUILD_DIR must not contain whitespace)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq (,$(BUILD_TOOL))
|
ifeq (,$(BUILD_TOOL))
|
||||||
ifeq (Ninja,$(CMAKE_GENERATOR))
|
ifeq (Ninja,$(BUILD_TYPE))
|
||||||
BUILD_TOOL = ninja
|
ifneq ($(shell $(CMAKE_PRG) --help 2>/dev/null | grep Ninja),)
|
||||||
|
BUILD_TOOL := ninja
|
||||||
|
else
|
||||||
|
# User's version of CMake doesn't support Ninja
|
||||||
|
BUILD_TOOL = $(MAKE)
|
||||||
|
BUILD_TYPE := Unix Makefiles
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
BUILD_TOOL = $(MAKE)
|
BUILD_TOOL = $(MAKE)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# Only need to handle Ninja here. Make will inherit the VERBOSE variable, and the -j, -l, and -n flags.
|
|
||||||
ifeq ($(CMAKE_GENERATOR),Ninja)
|
|
||||||
ifneq ($(VERBOSE),)
|
ifneq ($(VERBOSE),)
|
||||||
BUILD_TOOL += -v
|
# Only need to handle Ninja here. Make will inherit the VERBOSE variable.
|
||||||
endif
|
ifeq ($(BUILD_TYPE),Ninja)
|
||||||
BUILD_TOOL += $(shell printf '%s' '$(MAKEFLAGS)' | grep -o -- ' *-[jl][0-9]\+ *')
|
VERBOSE_FLAG := -v
|
||||||
ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))
|
|
||||||
BUILD_TOOL += -n
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
BUILD_CMD = $(BUILD_TOOL) $(VERBOSE_FLAG)
|
||||||
|
|
||||||
|
# Extra CMake flags which extend the default set
|
||||||
|
CMAKE_EXTRA_FLAGS ?=
|
||||||
DEPS_CMAKE_FLAGS ?=
|
DEPS_CMAKE_FLAGS ?=
|
||||||
# Back-compat: USE_BUNDLED_DEPS was the old name.
|
# Back-compat: USE_BUNDLED_DEPS was the old name.
|
||||||
USE_BUNDLED ?= $(USE_BUNDLED_DEPS)
|
USE_BUNDLED ?= $(USE_BUNDLED_DEPS)
|
||||||
@@ -82,89 +60,104 @@ endif
|
|||||||
# a warning, but we need to keep SCRIPTS argument.
|
# a warning, but we need to keep SCRIPTS argument.
|
||||||
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
|
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
|
||||||
|
|
||||||
|
all: nvim
|
||||||
|
|
||||||
nvim: build/.ran-cmake deps
|
nvim: build/.ran-cmake deps
|
||||||
+$(BUILD_TOOL) -C build
|
+$(BUILD_CMD) -C build
|
||||||
|
|
||||||
libnvim: build/.ran-cmake deps
|
libnvim: build/.ran-cmake deps
|
||||||
+$(BUILD_TOOL) -C build libnvim
|
+$(BUILD_CMD) -C build libnvim
|
||||||
|
|
||||||
cmake:
|
cmake:
|
||||||
touch CMakeLists.txt
|
touch CMakeLists.txt
|
||||||
$(MAKE) build/.ran-cmake
|
$(MAKE) build/.ran-cmake
|
||||||
|
|
||||||
build/.ran-cmake: | deps
|
build/.ran-cmake: | deps
|
||||||
cd build && $(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
|
cd build && $(CMAKE_PRG) -G '$(BUILD_TYPE)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(THIS_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_CMD) -C $(DEPS_BUILD_DIR)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
build/.ran-third-party-cmake:
|
||||||
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
||||||
$(DEPS_BUILD_DIR):
|
mkdir -p $(DEPS_BUILD_DIR)
|
||||||
mkdir -p "$@"
|
|
||||||
build/.ran-deps-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 '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
|
||||||
$(DEPS_CMAKE_FLAGS) $(MAKEFILE_DIR)/cmake.deps
|
$(DEPS_CMAKE_FLAGS) $(THIS_DIR)/third-party
|
||||||
endif
|
endif
|
||||||
build/.ran-deps-cmake::
|
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
# TODO: cmake 3.2+ add_custom_target() has a USES_TERMINAL flag.
|
# TODO: cmake 3.2+ add_custom_target() has a USES_TERMINAL flag.
|
||||||
oldtest: | nvim build/runtime/doc/tags
|
oldtest: | nvim helptags
|
||||||
+$(SINGLE_MAKE) -C src/nvim/testdir clean
|
+$(SINGLE_MAKE) -C src/nvim/testdir clean
|
||||||
ifeq ($(strip $(TEST_FILE)),)
|
ifeq ($(strip $(TEST_FILE)),)
|
||||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) $(MAKEOVERRIDES)
|
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" $(MAKEOVERRIDES)
|
||||||
else
|
else
|
||||||
@# Handle TEST_FILE=test_foo{,.res,.vim}.
|
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" NEW_TESTS=$(TEST_FILE) SCRIPTS= $(MAKEOVERRIDES)
|
||||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
|
|
||||||
endif
|
endif
|
||||||
# Build oldtest by specifying the relative .vim filename.
|
|
||||||
.PHONY: 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,%,$@)
|
|
||||||
|
|
||||||
functionaltest functionaltest-lua unittest benchmark: | nvim
|
helptags: | nvim
|
||||||
$(BUILD_TOOL) -C build $@
|
+$(BUILD_CMD) -C build helptags
|
||||||
|
|
||||||
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 helptags
|
||||||
|
+$(BUILD_CMD) -C build doc_html
|
||||||
|
|
||||||
|
functionaltest: | nvim
|
||||||
|
+$(BUILD_CMD) -C build functionaltest
|
||||||
|
|
||||||
|
functionaltest-lua: | nvim
|
||||||
|
+$(BUILD_CMD) -C build functionaltest-lua
|
||||||
|
|
||||||
|
testlint: | build/.ran-cmake deps
|
||||||
|
$(BUILD_CMD) -C build testlint
|
||||||
|
|
||||||
|
lualint: | build/.ran-cmake deps
|
||||||
|
$(BUILD_CMD) -C build lualint
|
||||||
|
|
||||||
|
unittest: | nvim
|
||||||
|
+$(BUILD_CMD) -C build unittest
|
||||||
|
|
||||||
|
benchmark: | nvim
|
||||||
|
+$(BUILD_CMD) -C build benchmark
|
||||||
|
|
||||||
test: functionaltest unittest
|
test: functionaltest unittest
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
+test -d build && $(BUILD_TOOL) -C build clean || true
|
+test -d build && $(BUILD_CMD) -C build clean || true
|
||||||
$(MAKE) -C src/nvim/testdir clean
|
$(MAKE) -C src/nvim/testdir clean
|
||||||
$(MAKE) -C runtime/doc clean
|
$(MAKE) -C runtime/doc clean
|
||||||
$(MAKE) -C runtime/indent clean
|
|
||||||
|
|
||||||
distclean:
|
distclean: clean
|
||||||
rm -rf $(DEPS_BUILD_DIR) build
|
rm -rf $(DEPS_BUILD_DIR) build
|
||||||
$(MAKE) clean
|
|
||||||
|
|
||||||
install: checkprefix nvim
|
install: | nvim
|
||||||
+$(BUILD_TOOL) -C build install
|
+$(BUILD_CMD) -C build install
|
||||||
|
|
||||||
|
clint: build/.ran-cmake
|
||||||
|
+$(BUILD_CMD) -C build clint
|
||||||
|
|
||||||
|
clint-full: build/.ran-cmake
|
||||||
|
+$(BUILD_CMD) -C build clint-full
|
||||||
|
|
||||||
|
check-single-includes: build/.ran-cmake
|
||||||
|
+$(BUILD_CMD) -C build check-single-includes
|
||||||
|
|
||||||
|
generated-sources: build/.ran-cmake
|
||||||
|
+$(BUILD_CMD) -C build generated-sources
|
||||||
|
|
||||||
appimage:
|
appimage:
|
||||||
bash scripts/genappimage.sh
|
bash scripts/genappimage.sh
|
||||||
|
|
||||||
# Build an appimage with embedded update information.
|
# Build an appimage with embedded update information appimage-nightly for
|
||||||
# appimage-nightly: for nightly builds
|
# nightly builds or appimage-latest for a release
|
||||||
# appimage-latest: for a release
|
|
||||||
appimage-%:
|
appimage-%:
|
||||||
bash scripts/genappimage.sh $*
|
bash scripts/genappimage.sh $*
|
||||||
|
|
||||||
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
|
lint: check-single-includes clint testlint lualint
|
||||||
# Does not work with "Unix Makefiles".
|
|
||||||
ifeq ($(CMAKE_GENERATOR),Ninja)
|
|
||||||
build/%: phony_force
|
|
||||||
$(BUILD_TOOL) -C build $(patsubst build/%,%,$@)
|
|
||||||
|
|
||||||
$(DEPS_BUILD_DIR)/%: phony_force
|
.PHONY: test testlint lualint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage
|
||||||
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY: test lintlua lintpy lintsh functionaltest unittest lint lintc clean distclean nvim libnvim cmake deps install appimage checkprefix lintcommit formatc formatlua format
|
|
||||||
|
94
README.md
94
README.md
@@ -1,12 +1,14 @@
|
|||||||
<h1 align="center">
|
[](https://neovim.io)
|
||||||
<img src="https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png" alt="Neovim">
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
[Documentation](https://neovim.io/doc/general/) |
|
[Wiki](https://github.com/neovim/neovim/wiki) |
|
||||||
[Chat](https://app.element.io/#/room/#neovim:matrix.org) |
|
[Documentation](https://neovim.io/doc) |
|
||||||
[Twitter](https://twitter.com/Neovim)
|
[Twitter](https://twitter.com/Neovim) |
|
||||||
|
[Community](https://neovim.io/community/) |
|
||||||
|
[Gitter **Chat**](https://gitter.im/neovim/neovim)
|
||||||
|
|
||||||
[](https://github.com/neovim/neovim/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush)
|
[](https://travis-ci.org/neovim/neovim)
|
||||||
|
[](https://ci.appveyor.com/project/neovim/neovim/branch/master)
|
||||||
|
[](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)
|
||||||
@@ -14,7 +16,6 @@
|
|||||||
[](https://repology.org/metapackage/neovim)
|
[](https://repology.org/metapackage/neovim)
|
||||||
[](https://buildd.debian.org/neovim)
|
[](https://buildd.debian.org/neovim)
|
||||||
[](https://github.com/neovim/neovim/releases/)
|
[](https://github.com/neovim/neovim/releases/)
|
||||||
[](https://snapcraft.io/nvim)
|
|
||||||
|
|
||||||
Neovim is a project that seeks to aggressively refactor Vim in order to:
|
Neovim is a project that seeks to aggressively refactor Vim in order to:
|
||||||
|
|
||||||
@@ -26,13 +27,15 @@ Neovim is a project that seeks to aggressively refactor Vim in order to:
|
|||||||
See the [Introduction](https://github.com/neovim/neovim/wiki/Introduction) wiki page and [Roadmap]
|
See the [Introduction](https://github.com/neovim/neovim/wiki/Introduction) wiki page and [Roadmap]
|
||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
|
[](https://waffle.io/neovim/neovim/metrics)
|
||||||
|
|
||||||
Features
|
Features
|
||||||
--------
|
--------
|
||||||
|
|
||||||
- Modern [GUIs](https://github.com/neovim/neovim/wiki/Related-projects#gui)
|
- Modern [GUIs](https://github.com/neovim/neovim/wiki/Related-projects#gui)
|
||||||
- [API access](https://github.com/neovim/neovim/wiki/Related-projects#api-clients)
|
- [API](https://github.com/neovim/neovim/wiki/Related-projects#api-clients)
|
||||||
from any language including C/C++, C#, Clojure, D, Elixir, Go, Haskell, Java,
|
access from any language including Clojure, Lisp, Go, Haskell, Lua,
|
||||||
JavaScript/Node.js, Julia, Lisp, Lua, Perl, Python, Racket, Ruby, Rust
|
JavaScript, Perl, Python, Ruby, and Rust
|
||||||
- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
|
- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
|
||||||
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
|
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
|
||||||
- [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances
|
- [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances
|
||||||
@@ -47,30 +50,50 @@ Install from package
|
|||||||
Pre-built packages for Windows, macOS, and Linux are found on the
|
Pre-built packages for Windows, macOS, and Linux are found on the
|
||||||
[Releases](https://github.com/neovim/neovim/releases/) page.
|
[Releases](https://github.com/neovim/neovim/releases/) page.
|
||||||
|
|
||||||
[Managed packages] are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], [Void Linux], [Gentoo], and more!
|
Managed packages are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], [Gentoo],
|
||||||
|
and [more](https://github.com/neovim/neovim/wiki/Installing-Neovim)!
|
||||||
|
|
||||||
Install from source
|
Install from source
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
See the [Building Neovim](https://github.com/neovim/neovim/wiki/Building-Neovim) wiki page for details.
|
|
||||||
|
|
||||||
The build is CMake-based, but a Makefile is provided as a convenience.
|
|
||||||
After installing the dependencies, run the following command.
|
|
||||||
|
|
||||||
make CMAKE_BUILD_TYPE=RelWithDebInfo
|
make CMAKE_BUILD_TYPE=RelWithDebInfo
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
To install to a non-default location:
|
To install to a non-default location, set `CMAKE_INSTALL_PREFIX`:
|
||||||
|
|
||||||
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_INSTALL_PREFIX=/full/path/
|
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=/full/path/"
|
||||||
make install
|
make install
|
||||||
|
|
||||||
CMake hints for inspecting the build:
|
To skip bundled (`third-party/*`) dependencies:
|
||||||
|
|
||||||
- `cmake --build build --target help` lists all build targets.
|
1. Install the dependencies using a package manager.
|
||||||
- `build/CMakeCache.txt` (or `cmake -LAH build/`) contains the resolved values of all CMake variables.
|
```
|
||||||
|
sudo apt install gperf luajit luarocks libuv1-dev libluajit-5.1-dev libunibilium-dev libmsgpack-dev libtermkey-dev libvterm-dev libjemalloc-dev
|
||||||
|
sudo luarocks build mpack
|
||||||
|
sudo luarocks build lpeg
|
||||||
|
sudo luarocks build inspect
|
||||||
|
```
|
||||||
|
2. Build with `USE_BUNDLED=OFF`:
|
||||||
|
```
|
||||||
|
make CMAKE_BUILD_TYPE=RelWithDebInfo USE_BUNDLED=OFF
|
||||||
|
sudo make install
|
||||||
|
```
|
||||||
|
|
||||||
|
CMake features:
|
||||||
|
|
||||||
|
- List all build targets:
|
||||||
|
```
|
||||||
|
cmake --build build --target help
|
||||||
|
```
|
||||||
|
- Print all variable definitions:
|
||||||
|
```
|
||||||
|
cmake -LAH
|
||||||
|
```
|
||||||
|
- `build/CMakeCache.txt` contains the resolved values of all CMake variables.
|
||||||
- `build/compile_commands.json` shows the full compiler invocations for each translation unit.
|
- `build/compile_commands.json` shows the full compiler invocations for each translation unit.
|
||||||
|
|
||||||
|
See the [Building Neovim](https://github.com/neovim/neovim/wiki/Building-Neovim) wiki page for details.
|
||||||
|
|
||||||
Transitioning from Vim
|
Transitioning from Vim
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
@@ -80,10 +103,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,14 +115,23 @@ 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
|
||||||
-------
|
-------
|
||||||
|
|
||||||
Neovim contributions since [b17d96][license-commit] are licensed under the
|
Neovim is licensed under the terms of the Apache 2.0 license, except for
|
||||||
Apache 2.0 license, except for contributions copied from Vim (identified by the
|
parts that were contributed under the Vim license.
|
||||||
`vim-patch` token). See LICENSE for details.
|
|
||||||
|
- Contributions committed before [b17d96][license-commit] remain under the Vim
|
||||||
|
license.
|
||||||
|
|
||||||
|
- Contributions committed after [b17d96][license-commit] are licensed under
|
||||||
|
Apache 2.0 unless those contributions were copied from Vim (identified in
|
||||||
|
the commit logs by the `vim-patch` token).
|
||||||
|
|
||||||
|
See `LICENSE` for details.
|
||||||
|
|
||||||
Vim is Charityware. You can use and copy it as much as you like, but you are
|
Vim is Charityware. You can use and copy it as much as you like, but you are
|
||||||
encouraged to make a donation for needy children in Uganda. Please see the
|
encouraged to make a donation for needy children in Uganda. Please see the
|
||||||
@@ -118,13 +148,11 @@ Apache 2.0 license, except for contributions copied from Vim (identified by the
|
|||||||
[nvim-features]: https://neovim.io/doc/user/vim_diff.html#nvim-features
|
[nvim-features]: https://neovim.io/doc/user/vim_diff.html#nvim-features
|
||||||
[Roadmap]: https://neovim.io/roadmap/
|
[Roadmap]: https://neovim.io/roadmap/
|
||||||
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui
|
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui
|
||||||
[Managed packages]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-package
|
[Homebrew]: https://github.com/neovim/homebrew-neovim#installation
|
||||||
[Debian]: https://packages.debian.org/testing/neovim
|
[Debian]: https://packages.debian.org/testing/neovim
|
||||||
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
|
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
|
||||||
[Fedora]: https://packages.fedoraproject.org/pkgs/neovim/neovim/
|
[Fedora]: https://apps.fedoraproject.org/packages/neovim
|
||||||
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
|
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
|
||||||
[Void Linux]: https://voidlinux.org/packages/?arch=x86_64&q=neovim
|
|
||||||
[Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim
|
[Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim
|
||||||
[Homebrew]: https://formulae.brew.sh/formula/neovim
|
|
||||||
|
|
||||||
<!-- vim: set tw=80: -->
|
<!-- vim: set tw=80: -->
|
||||||
|
25
appveyor.yml
Normal file
25
appveyor.yml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
version: '{build}'
|
||||||
|
environment:
|
||||||
|
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma -mx=9"
|
||||||
|
image: Visual Studio 2017
|
||||||
|
configuration:
|
||||||
|
- MSVC_64
|
||||||
|
- MSVC_32
|
||||||
|
- MINGW_64
|
||||||
|
- MINGW_32
|
||||||
|
- MINGW_64-gcov
|
||||||
|
matrix:
|
||||||
|
allow_failures:
|
||||||
|
- configuration: MINGW_64-gcov
|
||||||
|
install: []
|
||||||
|
before_build:
|
||||||
|
- ps: Install-Product node 8
|
||||||
|
build_script:
|
||||||
|
- powershell ci\build.ps1
|
||||||
|
cache:
|
||||||
|
- C:\msys64\var\cache\pacman\pkg -> ci\build.ps1
|
||||||
|
- .deps -> ci\build.ps1
|
||||||
|
- .deps -> third-party\**
|
||||||
|
artifacts:
|
||||||
|
- path: build/Neovim.zip
|
||||||
|
- path: build/bin/nvim.exe
|
94
busted/outputHandlers/TAP.lua
Normal file
94
busted/outputHandlers/TAP.lua
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
-- TODO(jkeyes): Use the upstream version when busted releases it. (But how to
|
||||||
|
-- inject our call to global_helpers.read_nvim_log() ?)
|
||||||
|
|
||||||
|
local pretty = require 'pl.pretty'
|
||||||
|
local global_helpers = require('test.helpers')
|
||||||
|
|
||||||
|
return function(options)
|
||||||
|
local busted = require 'busted'
|
||||||
|
local handler = require 'busted.outputHandlers.base'()
|
||||||
|
|
||||||
|
local success = 'ok %u - %s'
|
||||||
|
local failure = 'not ' .. success
|
||||||
|
local skip = 'ok %u - # SKIP %s'
|
||||||
|
local counter = 0
|
||||||
|
|
||||||
|
handler.suiteReset = function()
|
||||||
|
counter = 0
|
||||||
|
return nil, true
|
||||||
|
end
|
||||||
|
|
||||||
|
handler.suiteEnd = function()
|
||||||
|
io.write(global_helpers.read_nvim_log())
|
||||||
|
print('1..' .. counter)
|
||||||
|
io.flush()
|
||||||
|
return nil, true
|
||||||
|
end
|
||||||
|
|
||||||
|
local function showFailure(t)
|
||||||
|
local message = t.message
|
||||||
|
local trace = t.trace or {}
|
||||||
|
|
||||||
|
if message == nil then
|
||||||
|
message = 'Nil error'
|
||||||
|
elseif type(message) ~= 'string' then
|
||||||
|
message = pretty.write(message)
|
||||||
|
end
|
||||||
|
|
||||||
|
print(failure:format(counter, t.name))
|
||||||
|
print('# ' .. t.element.trace.short_src .. ' @ ' .. t.element.trace.currentline)
|
||||||
|
if t.randomseed then print('# Random seed: ' .. t.randomseed) end
|
||||||
|
print('# Failure message: ' .. message:gsub('\n', '\n# '))
|
||||||
|
if options.verbose and trace.traceback then
|
||||||
|
print('# ' .. trace.traceback:gsub('^\n', '', 1):gsub('\n', '\n# '))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
handler.testStart = function(element, parent)
|
||||||
|
local trace = element.trace
|
||||||
|
if options.verbose and trace and trace.short_src then
|
||||||
|
local fileline = trace.short_src .. ' @ ' .. trace.currentline .. ': '
|
||||||
|
local testName = fileline .. handler.getFullName(element)
|
||||||
|
print('# ' .. testName)
|
||||||
|
end
|
||||||
|
io.flush()
|
||||||
|
|
||||||
|
return nil, true
|
||||||
|
end
|
||||||
|
|
||||||
|
handler.testEnd = function(element, parent, status, trace)
|
||||||
|
counter = counter + 1
|
||||||
|
if status == 'success' then
|
||||||
|
local t = handler.successes[#handler.successes]
|
||||||
|
print(success:format(counter, t.name))
|
||||||
|
elseif status == 'pending' then
|
||||||
|
local t = handler.pendings[#handler.pendings]
|
||||||
|
print(skip:format(counter, (t.message or t.name)))
|
||||||
|
elseif status == 'failure' then
|
||||||
|
showFailure(handler.failures[#handler.failures])
|
||||||
|
elseif status == 'error' then
|
||||||
|
showFailure(handler.errors[#handler.errors])
|
||||||
|
end
|
||||||
|
io.flush()
|
||||||
|
|
||||||
|
return nil, true
|
||||||
|
end
|
||||||
|
|
||||||
|
handler.error = function(element, parent, message, debug)
|
||||||
|
if element.descriptor ~= 'it' then
|
||||||
|
counter = counter + 1
|
||||||
|
showFailure(handler.errors[#handler.errors])
|
||||||
|
end
|
||||||
|
io.flush()
|
||||||
|
|
||||||
|
return nil, true
|
||||||
|
end
|
||||||
|
|
||||||
|
busted.subscribe({ 'suite', 'reset' }, handler.suiteReset)
|
||||||
|
busted.subscribe({ 'suite', 'end' }, handler.suiteEnd)
|
||||||
|
busted.subscribe({ 'test', 'start' }, handler.testStart, { predicate = handler.cancelOnPending })
|
||||||
|
busted.subscribe({ 'test', 'end' }, handler.testEnd, { predicate = handler.cancelOnPending })
|
||||||
|
busted.subscribe({ 'error' }, handler.error)
|
||||||
|
|
||||||
|
return handler
|
||||||
|
end
|
@@ -1,9 +1,15 @@
|
|||||||
|
local s = require 'say'
|
||||||
local pretty = require 'pl.pretty'
|
local pretty = require 'pl.pretty'
|
||||||
|
local term = require 'term'
|
||||||
local global_helpers = require('test.helpers')
|
local global_helpers = require('test.helpers')
|
||||||
|
|
||||||
-- Colors are disabled by default. #15610
|
local colors
|
||||||
local colors = setmetatable({}, {__index = function() return function(s) return s == nil and '' or tostring(s) end end})
|
|
||||||
if os.getenv "TEST_COLORS" then
|
local isWindows = package.config:sub(1,1) == '\\'
|
||||||
|
|
||||||
|
if isWindows then
|
||||||
|
colors = setmetatable({}, {__index = function() return function(s) return s end end})
|
||||||
|
else
|
||||||
colors = require 'term.colors'
|
colors = require 'term.colors'
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -26,39 +32,41 @@ return function(options)
|
|||||||
|
|
||||||
local repeatSuiteString = '\nRepeating all tests (run %d of %d) . . .\n\n'
|
local repeatSuiteString = '\nRepeating all tests (run %d of %d) . . .\n\n'
|
||||||
local randomizeString = c.note('Note: Randomizing test order with a seed of %d.\n')
|
local randomizeString = c.note('Note: Randomizing test order with a seed of %d.\n')
|
||||||
local globalSetup = c.sect('--------') .. ' Global test environment setup.\n'
|
local globalSetup = c.sect('[----------]') .. ' Global test environment setup.\n'
|
||||||
local fileStartString = c.sect('--------') .. ' Running tests from ' .. c.file('%s') .. '\n'
|
local fileStartString = c.sect('[----------]') .. ' Running tests from ' .. c.file('%s') .. '\n'
|
||||||
local runString = c.sect('RUN ') .. ' ' .. c.test('%s') .. ': '
|
local runString = c.sect('[ RUN ]') .. ' ' .. c.test('%s') .. ': '
|
||||||
local successString = c.succ('OK') .. '\n'
|
local successString = c.succ('OK') .. '\n'
|
||||||
local skippedString = c.skip('SKIP') .. '\n'
|
local skippedString = c.skip('SKIP') .. '\n'
|
||||||
local failureString = c.fail('FAIL') .. '\n'
|
local failureString = c.fail('FAIL') .. '\n'
|
||||||
local errorString = c.errr('ERR') .. '\n'
|
local errorString = c.errr('ERR') .. '\n'
|
||||||
local fileEndString = c.sect('--------') .. ' '.. c.nmbr('%d') .. ' %s from ' .. c.file('%s') .. ' ' .. c.time('(%.2f ms total)') .. '\n\n'
|
local fileEndString = c.sect('[----------]') .. ' '.. c.nmbr('%d') .. ' %s from ' .. c.file('%s') .. ' ' .. c.time('(%.2f ms total)') .. '\n\n'
|
||||||
local globalTeardown = c.sect('--------') .. ' Global test environment teardown.\n'
|
local globalTeardown = c.sect('[----------]') .. ' Global test environment teardown.\n'
|
||||||
local suiteEndString = c.sect('========') .. ' ' .. c.nmbr('%d') .. ' %s from ' .. c.nmbr('%d') .. ' test %s ran. ' .. c.time('(%.2f ms total)') .. '\n'
|
local suiteEndString = c.sect('[==========]') .. ' ' .. c.nmbr('%d') .. ' %s from ' .. c.nmbr('%d') .. ' test %s ran. ' .. c.time('(%.2f ms total)') .. '\n'
|
||||||
local successStatus = c.succ('PASSED ') .. ' ' .. c.nmbr('%d') .. ' %s.\n'
|
local successStatus = c.succ('[ PASSED ]') .. ' ' .. c.nmbr('%d') .. ' %s.\n'
|
||||||
local timeString = c.time('%.2f ms')
|
local timeString = c.time('%.2f ms')
|
||||||
|
|
||||||
local summaryStrings = {
|
local summaryStrings = {
|
||||||
skipped = {
|
skipped = {
|
||||||
header = c.skip('SKIPPED ') .. ' ' .. c.nmbr('%d') .. ' %s, listed below:\n',
|
header = c.skip('[ SKIPPED ]') .. ' ' .. c.nmbr('%d') .. ' %s, listed below:\n',
|
||||||
test = c.skip('SKIPPED ') .. ' %s\n',
|
test = c.skip('[ SKIPPED ]') .. ' %s\n',
|
||||||
footer = ' ' .. c.nmbr('%d') .. ' SKIPPED %s\n',
|
footer = ' ' .. c.nmbr('%d') .. ' SKIPPED %s\n',
|
||||||
},
|
},
|
||||||
|
|
||||||
failure = {
|
failure = {
|
||||||
header = c.fail('FAILED ') .. ' ' .. c.nmbr('%d') .. ' %s, listed below:\n',
|
header = c.fail('[ FAILED ]') .. ' ' .. c.nmbr('%d') .. ' %s, listed below:\n',
|
||||||
test = c.fail('FAILED ') .. ' %s\n',
|
test = c.fail('[ FAILED ]') .. ' %s\n',
|
||||||
footer = ' ' .. c.nmbr('%d') .. ' FAILED %s\n',
|
footer = ' ' .. c.nmbr('%d') .. ' FAILED %s\n',
|
||||||
},
|
},
|
||||||
|
|
||||||
error = {
|
error = {
|
||||||
header = c.errr('ERROR ') .. ' ' .. c.nmbr('%d') .. ' %s, listed below:\n',
|
header = c.errr('[ ERROR ]') .. ' ' .. c.nmbr('%d') .. ' %s, listed below:\n',
|
||||||
test = c.errr('ERROR ') .. ' %s\n',
|
test = c.errr('[ ERROR ]') .. ' %s\n',
|
||||||
footer = ' ' .. c.nmbr('%d') .. ' %s\n',
|
footer = ' ' .. c.nmbr('%d') .. ' %s\n',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c = nil
|
||||||
|
|
||||||
local fileCount = 0
|
local fileCount = 0
|
||||||
local fileTestCount = 0
|
local fileTestCount = 0
|
||||||
local testCount = 0
|
local testCount = 0
|
||||||
@@ -68,6 +76,7 @@ return function(options)
|
|||||||
local errorCount = 0
|
local errorCount = 0
|
||||||
|
|
||||||
local pendingDescription = function(pending)
|
local pendingDescription = function(pending)
|
||||||
|
local name = pending.name
|
||||||
local string = ''
|
local string = ''
|
||||||
|
|
||||||
if type(pending.message) == 'string' then
|
if type(pending.message) == 'string' then
|
||||||
@@ -166,7 +175,7 @@ return function(options)
|
|||||||
return nil, true
|
return nil, true
|
||||||
end
|
end
|
||||||
|
|
||||||
handler.suiteStart = function(_suite, count, total, randomseed)
|
handler.suiteStart = function(suite, count, total, randomseed)
|
||||||
if total > 1 then
|
if total > 1 then
|
||||||
io.write(repeatSuiteString:format(count, total))
|
io.write(repeatSuiteString:format(count, total))
|
||||||
end
|
end
|
||||||
@@ -187,16 +196,14 @@ return function(options)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
handler.suiteEnd = function(suite, _count, _total)
|
handler.suiteEnd = function(suite, count, total)
|
||||||
local elapsedTime_ms = getElapsedTime(suite)
|
local elapsedTime_ms = getElapsedTime(suite)
|
||||||
local tests = (testCount == 1 and 'test' or 'tests')
|
local tests = (testCount == 1 and 'test' or 'tests')
|
||||||
local files = (fileCount == 1 and 'file' or 'files')
|
local files = (fileCount == 1 and 'file' or 'files')
|
||||||
io.write(globalTeardown)
|
io.write(globalTeardown)
|
||||||
|
io.write(global_helpers.read_nvim_log())
|
||||||
io.write(suiteEndString:format(testCount, tests, fileCount, files, elapsedTime_ms))
|
io.write(suiteEndString:format(testCount, tests, fileCount, files, elapsedTime_ms))
|
||||||
io.write(getSummaryString())
|
io.write(getSummaryString())
|
||||||
if failureCount > 0 or errorCount > 0 then
|
|
||||||
io.write(global_helpers.read_nvim_log(nil, true))
|
|
||||||
end
|
|
||||||
io.flush()
|
io.flush()
|
||||||
|
|
||||||
return nil, true
|
return nil, true
|
||||||
@@ -218,21 +225,15 @@ return function(options)
|
|||||||
return nil, true
|
return nil, true
|
||||||
end
|
end
|
||||||
|
|
||||||
handler.testStart = function(element, _parent)
|
handler.testStart = function(element, parent)
|
||||||
local testid = _G._nvim_test_id or ''
|
io.write(runString:format(handler.getFullName(element)))
|
||||||
local desc = ('%s %s'):format(testid, handler.getFullName(element))
|
|
||||||
io.write(runString:format(desc))
|
|
||||||
io.flush()
|
io.flush()
|
||||||
|
|
||||||
return nil, true
|
return nil, true
|
||||||
end
|
end
|
||||||
|
|
||||||
local function write_status(element, string)
|
handler.testEnd = function(element, parent, status, debug)
|
||||||
io.write(timeString:format(getElapsedTime(element)) .. ' ' .. string)
|
local elapsedTime_ms = getElapsedTime(element)
|
||||||
io.flush()
|
|
||||||
end
|
|
||||||
|
|
||||||
handler.testEnd = function(element, _parent, status, _debug)
|
|
||||||
local string
|
local string
|
||||||
|
|
||||||
fileTestCount = fileTestCount + 1
|
fileTestCount = fileTestCount + 1
|
||||||
@@ -245,21 +246,45 @@ return function(options)
|
|||||||
string = skippedString
|
string = skippedString
|
||||||
elseif status == 'failure' then
|
elseif status == 'failure' then
|
||||||
failureCount = failureCount + 1
|
failureCount = failureCount + 1
|
||||||
string = failureString .. failureDescription(handler.failures[#handler.failures])
|
string = nil
|
||||||
elseif status == 'error' then
|
elseif status == 'error' then
|
||||||
errorCount = errorCount + 1
|
errorCount = errorCount + 1
|
||||||
string = errorString .. failureDescription(handler.errors[#handler.errors])
|
string = nil
|
||||||
else
|
end
|
||||||
string = "unexpected test status! ("..status..")"
|
|
||||||
|
if string ~= nil then
|
||||||
|
if elapsedTime_ms == elapsedTime_ms then
|
||||||
|
string = timeString:format(elapsedTime_ms) .. ' ' .. string
|
||||||
|
end
|
||||||
|
io.write(string)
|
||||||
|
io.flush()
|
||||||
end
|
end
|
||||||
write_status(element, string)
|
|
||||||
|
|
||||||
return nil, true
|
return nil, true
|
||||||
end
|
end
|
||||||
|
|
||||||
handler.error = function(element, _parent, _message, _debug)
|
handler.testFailure = function(element, parent, message, debug)
|
||||||
|
io.write(failureString)
|
||||||
|
io.flush()
|
||||||
|
|
||||||
|
io.write(failureDescription(handler.failures[#handler.failures]))
|
||||||
|
io.flush()
|
||||||
|
return nil, true
|
||||||
|
end
|
||||||
|
|
||||||
|
handler.testError = function(element, parent, message, debug)
|
||||||
|
io.write(errorString)
|
||||||
|
io.flush()
|
||||||
|
|
||||||
|
io.write(failureDescription(handler.errors[#handler.errors]))
|
||||||
|
io.flush()
|
||||||
|
return nil, true
|
||||||
|
end
|
||||||
|
|
||||||
|
handler.error = function(element, parent, message, debug)
|
||||||
if element.descriptor ~= 'it' then
|
if element.descriptor ~= 'it' then
|
||||||
write_status(element, failureDescription(handler.errors[#handler.errors]))
|
io.write(failureDescription(handler.errors[#handler.errors]))
|
||||||
|
io.flush()
|
||||||
errorCount = errorCount + 1
|
errorCount = errorCount + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -273,6 +298,8 @@ return function(options)
|
|||||||
busted.subscribe({ 'file', 'end' }, handler.fileEnd)
|
busted.subscribe({ 'file', 'end' }, handler.fileEnd)
|
||||||
busted.subscribe({ 'test', 'start' }, handler.testStart, { predicate = handler.cancelOnPending })
|
busted.subscribe({ 'test', 'start' }, handler.testStart, { predicate = handler.cancelOnPending })
|
||||||
busted.subscribe({ 'test', 'end' }, handler.testEnd, { predicate = handler.cancelOnPending })
|
busted.subscribe({ 'test', 'end' }, handler.testEnd, { predicate = handler.cancelOnPending })
|
||||||
|
busted.subscribe({ 'failure', 'it' }, handler.testFailure)
|
||||||
|
busted.subscribe({ 'error', 'it' }, handler.testError)
|
||||||
busted.subscribe({ 'failure' }, handler.error)
|
busted.subscribe({ 'failure' }, handler.error)
|
||||||
busted.subscribe({ 'error' }, handler.error)
|
busted.subscribe({ 'error' }, handler.error)
|
||||||
|
|
@@ -7,17 +7,23 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
source "${CI_DIR}/common/build.sh"
|
source "${CI_DIR}/common/build.sh"
|
||||||
source "${CI_DIR}/common/suite.sh"
|
source "${CI_DIR}/common/suite.sh"
|
||||||
|
|
||||||
mkdir -p "${HOME}/.cache"
|
# Don't cache pip's log and selfcheck.
|
||||||
|
rm -rf "${HOME}/.cache/pip/log"
|
||||||
|
rm -f "${HOME}/.cache/pip/selfcheck.json"
|
||||||
|
|
||||||
echo "before_cache.sh: cache size"
|
echo "before_cache.sh: cache size"
|
||||||
du -chd 1 "${HOME}/.cache" | sort -rh | head -20
|
du -d 2 "${HOME}/.cache" | sort -n
|
||||||
|
|
||||||
|
echo "before_cache.sh: ccache stats"
|
||||||
|
ccache -s 2>/dev/null || true
|
||||||
|
|
||||||
# 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; then
|
||||||
# Do not cache downloads. They should not be needed with up-to-date deps.
|
rm -rf "${HOME}/.cache/nvim-deps"
|
||||||
rm -rf "${DEPS_BUILD_DIR}/build/downloads"
|
mv "${DEPS_BUILD_DIR}" "${HOME}/.cache/nvim-deps"
|
||||||
rm -rf "${CACHE_NVIM_DEPS_DIR}"
|
|
||||||
mv "${DEPS_BUILD_DIR}" "${CACHE_NVIM_DEPS_DIR}"
|
rm -rf "${HOME}/.cache/nvim-deps-downloads"
|
||||||
|
mv "${DEPS_DOWNLOAD_DIR}" "${HOME}/.cache/nvim-deps-downloads"
|
||||||
|
|
||||||
touch "${CACHE_MARKER}"
|
touch "${CACHE_MARKER}"
|
||||||
echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))."
|
echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))."
|
||||||
|
42
ci/before_install.sh
Executable file
42
ci/before_install.sh
Executable file
@@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
if [[ "${CI_TARGET}" == lint ]]; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 'python info:'
|
||||||
|
(
|
||||||
|
2>&1 python --version || true
|
||||||
|
2>&1 python2 --version || true
|
||||||
|
2>&1 python3 --version || true
|
||||||
|
2>&1 pip --version || true
|
||||||
|
2>&1 pip2 --version || true
|
||||||
|
2>&1 pip3 --version || true
|
||||||
|
echo 'pyenv versions:'
|
||||||
|
2>&1 pyenv versions || true
|
||||||
|
) | sed 's/^/ /'
|
||||||
|
|
||||||
|
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||||
|
echo "Upgrade Python 3 pip"
|
||||||
|
python3 -m pip -q install --user --upgrade pip
|
||||||
|
else
|
||||||
|
echo "Upgrade Python 2 pip"
|
||||||
|
python2.7 -m pip -q install --user --upgrade pip
|
||||||
|
echo "Upgrade Python 3 pip"
|
||||||
|
# Allow failure. pyenv pip3 on travis is broken:
|
||||||
|
# https://github.com/travis-ci/travis-ci/issues/8363
|
||||||
|
python3 -m pip -q install --user --upgrade pip || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Install node (LTS)"
|
||||||
|
|
||||||
|
if [[ "${TRAVIS_OS_NAME}" == osx ]] || [ ! -f ~/.nvm/nvm.sh ]; then
|
||||||
|
curl -o ~/.nvm/nvm.sh https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
source ~/.nvm/nvm.sh
|
||||||
|
nvm install --lts
|
||||||
|
nvm use --lts
|
@@ -3,6 +3,10 @@
|
|||||||
set -e
|
set -e
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
if [[ "${CI_TARGET}" == lint ]]; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
source "${CI_DIR}/common/build.sh"
|
source "${CI_DIR}/common/build.sh"
|
||||||
|
|
||||||
@@ -16,13 +20,18 @@ if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; the
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Show ccache stats so we can compare in before_cache
|
||||||
|
ccache -s 2>/dev/null || true
|
||||||
|
|
||||||
|
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||||
|
# Adds user to a dummy group.
|
||||||
|
# That allows to test changing the group of the file by `os_fchown`.
|
||||||
|
sudo dscl . -create /Groups/chown_test
|
||||||
|
sudo dscl . -append /Groups/chown_test GroupMembership "${USER}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Compile dependencies.
|
# Compile dependencies.
|
||||||
build_deps
|
build_deps
|
||||||
|
|
||||||
# Install cluacov for Lua coverage.
|
|
||||||
if [[ "$USE_LUACOV" == 1 ]]; then
|
|
||||||
"${DEPS_BUILD_DIR}/usr/bin/luarocks" install cluacov
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -rf "${LOG_DIR}"
|
rm -rf "${LOG_DIR}"
|
||||||
mkdir -p "${LOG_DIR}"
|
mkdir -p "${LOG_DIR}"
|
||||||
|
193
ci/build.ps1
193
ci/build.ps1
@@ -1,146 +1,137 @@
|
|||||||
[CmdletBinding(DefaultParameterSetName = "Build")]
|
$ErrorActionPreference = 'stop'
|
||||||
param(
|
Set-PSDebug -Strict -Trace 1
|
||||||
[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
|
$env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$'
|
||||||
$ErrorActionPreference = 'Stop'
|
$compiler = $Matches.compiler
|
||||||
$ProgressPreference = 'SilentlyContinue'
|
$compileOption = $Matches.option
|
||||||
|
$bits = $Matches.bits
|
||||||
$projectDir = [System.IO.Path]::GetFullPath("$(Get-Location)")
|
$cmakeBuildType = 'RelWithDebInfo'
|
||||||
$buildDir = Join-Path -Path $projectDir -ChildPath "build"
|
|
||||||
|
|
||||||
# $env:CMAKE_BUILD_TYPE is ignored by cmake when not using ninja
|
|
||||||
$cmakeBuildType = $(if ($null -ne $env:CMAKE_BUILD_TYPE) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
|
|
||||||
$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"});
|
|
||||||
}
|
|
||||||
if ($null -eq $env:DEPS_BUILD_DIR) {
|
|
||||||
$env:DEPS_BUILD_DIR = Join-Path -Path $projectDir -ChildPath ".deps"
|
|
||||||
}
|
}
|
||||||
$uploadToCodeCov = $false
|
$uploadToCodeCov = $false
|
||||||
|
|
||||||
|
# For pull requests, skip some build configurations to save time.
|
||||||
|
if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and $env:CONFIGURATION -match '^(MSVC_64|MINGW_32|MINGW_64-gcov)$') {
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
function exitIfFailed() {
|
function exitIfFailed() {
|
||||||
if ($LastExitCode -ne 0) {
|
if ($LastExitCode -ne 0) {
|
||||||
|
Set-PSDebug -Off
|
||||||
exit $LastExitCode
|
exit $LastExitCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertToCmakeArgs($vars) {
|
if ($compiler -eq 'MINGW') {
|
||||||
return $vars.GetEnumerator() | ForEach-Object { "-D$($_.Key)=$($_.Value)" }
|
if ($bits -eq 32) {
|
||||||
|
$arch = 'i686'
|
||||||
}
|
}
|
||||||
|
elseif ($bits -eq 64) {
|
||||||
|
$arch = 'x86_64'
|
||||||
|
}
|
||||||
|
if ($compileOption -eq 'gcov') {
|
||||||
|
$nvimCmakeVars['USE_GCOV'] = 'ON'
|
||||||
|
$uploadToCodecov = $true
|
||||||
|
}
|
||||||
|
# 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', 'perl', 'diffutils', 'unibilium').ForEach({
|
||||||
|
"mingw-w64-$arch-$_"
|
||||||
|
})
|
||||||
|
|
||||||
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
# Add MinGW to the PATH
|
||||||
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
|
$env:PATH = "C:\msys64\mingw$bits\bin;$env:PATH"
|
||||||
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | ForEach-Object {
|
|
||||||
$name, $value = $_ -split '=', 2
|
# Avoid pacman "warning" which causes non-zero return code. https://github.com/open62541/open62541/issues/2068
|
||||||
Set-Content env:\"$name" $value
|
& C:\msys64\usr\bin\mkdir -p /var/cache/pacman/pkg
|
||||||
|
|
||||||
|
# Build third-party dependencies
|
||||||
|
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" ; exitIfFailed
|
||||||
|
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S $mingwPackages" ; exitIfFailed
|
||||||
|
}
|
||||||
|
elseif ($compiler -eq 'MSVC') {
|
||||||
|
$cmakeGeneratorArgs = '/verbosity:normal'
|
||||||
|
if ($bits -eq 32) {
|
||||||
|
$cmakeGenerator = 'Visual Studio 15 2017'
|
||||||
|
}
|
||||||
|
elseif ($bits -eq 64) {
|
||||||
|
$cmakeGenerator = 'Visual Studio 15 2017 Win64'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function BuildDeps {
|
# Setup python (use AppVeyor system python)
|
||||||
|
C:\Python27\python.exe -m pip install pynvim ; exitIfFailed
|
||||||
if (Test-Path -PathType container $env:DEPS_BUILD_DIR) {
|
C:\Python35\python.exe -m pip install pynvim ; exitIfFailed
|
||||||
$cachedBuildTypeStr = $(Get-Content $env:DEPS_BUILD_DIR\CMakeCache.txt | Select-String -Pattern "CMAKE_BUILD_TYPE.*=($cmakeBuildType)")
|
# Disambiguate python3
|
||||||
if (-not $cachedBuildTypeStr) {
|
move c:\Python35\python.exe c:\Python35\python3.exe
|
||||||
Write-Warning " unable to validate build type from cache dir ${env:DEPS_BUILD_DIR}"
|
$env:PATH = "C:\Python35;C:\Python27;$env:PATH"
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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
|
||||||
|
python3 -c "import pynvim; print(str(pynvim))" ; exitIfFailed
|
||||||
|
|
||||||
gem.cmd install --pre neovim
|
$env:PATH = "C:\Ruby24\bin;$env:PATH"
|
||||||
Get-Command -CommandType Application neovim-ruby-host.bat; exitIfFailed
|
gem.cmd install neovim
|
||||||
|
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
|
||||||
|
|
||||||
if ($env:USE_LUACOV -eq 1) {
|
function convertToCmakeArgs($vars) {
|
||||||
& $env:DEPS_PREFIX\luarocks\luarocks.bat install cluacov
|
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Test {
|
if (-Not (Test-Path -PathType container .deps)) {
|
||||||
|
mkdir .deps
|
||||||
|
}
|
||||||
|
cd .deps
|
||||||
|
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) ..\third-party\ ; exitIfFailed
|
||||||
|
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Build Neovim
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -G $cmakeGenerator $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
|
||||||
|
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
|
||||||
|
bin\nvim --version ; exitIfFailed
|
||||||
|
|
||||||
# Functional tests
|
# Functional tests
|
||||||
# The $LastExitCode from MSBuild can't be trusted
|
# The $LastExitCode from MSBuild can't be trusted
|
||||||
$failed = $false
|
$failed = $false
|
||||||
|
# Temporarily turn off tracing to reduce log file output
|
||||||
# Run only this test file:
|
Set-PSDebug -Off
|
||||||
# $env:TEST_FILE = "test\functional\foo.lua"
|
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 |
|
||||||
cmake --build $buildDir --target functionaltest 2>&1 |
|
foreach { $failed = $failed -or
|
||||||
ForEach-Object { $failed = $failed -or
|
|
||||||
$_ -match 'functional tests failed with error'; $_ }
|
$_ -match 'functional tests failed with error'; $_ }
|
||||||
|
|
||||||
if ($failed) {
|
if ($failed) {
|
||||||
exit $LastExitCode
|
exit $LastExitCode
|
||||||
}
|
}
|
||||||
|
Set-PSDebug -Strict -Trace 1
|
||||||
|
|
||||||
if (-not $uploadToCodecov) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if ($env:USE_LUACOV -eq 1) {
|
|
||||||
& $env:DEPS_PREFIX\bin\luacov.bat
|
|
||||||
}
|
|
||||||
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
|
|
||||||
}
|
|
||||||
|
|
||||||
function TestOld {
|
|
||||||
# Old tests
|
|
||||||
# Add MSYS to path, required for e.g. `find` used in test scripts.
|
|
||||||
# But would break functionaltests, where its `more` would be used then.
|
|
||||||
$OldPath = $env:PATH
|
|
||||||
$env:PATH = "C:\msys64\usr\bin;$env:PATH"
|
|
||||||
& "C:\msys64\mingw64\bin\mingw32-make.exe" -C $(Convert-Path $projectDir\src\nvim\testdir) VERBOSE=1; exitIfFailed
|
|
||||||
$env:PATH = $OldPath
|
|
||||||
|
|
||||||
if ($uploadToCodecov) {
|
if ($uploadToCodecov) {
|
||||||
bash -l /c/projects/neovim/ci/common/submit_coverage.sh oldtest
|
C:\msys64\usr\bin\bash -lc "cd /c/projects/neovim; bash <(curl -s https://codecov.io/bash) -c -F functionaltest || echo 'codecov upload failed.'"
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Old tests
|
||||||
|
$env:PATH = "C:\msys64\usr\bin;$env:PATH"
|
||||||
|
& "C:\msys64\mingw$bits\bin\mingw32-make.exe" -C $(Convert-Path ..\src\nvim\testdir) VERBOSE=1
|
||||||
|
|
||||||
function Package {
|
if ($uploadToCodecov) {
|
||||||
cmake -S $projectDir -B $buildDir $(convertToCmakeArgs($nvimCmakeVars)) -G Ninja; exitIfFailed
|
C:\msys64\usr\bin\bash -lc "cd /c/projects/neovim; bash <(curl -s https://codecov.io/bash) -c -F oldtest || echo 'codecov upload failed.'"
|
||||||
cmake --build $buildDir --target package; exitIfFailed
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSCmdlet.ParameterSetName) {
|
# Build artifacts
|
||||||
& (Get-ChildItem "Function:$($PSCmdlet.ParameterSetName)")
|
cpack -G ZIP -C RelWithDebInfo
|
||||||
exit
|
if ($env:APPVEYOR_REPO_TAG_NAME -ne $null) {
|
||||||
|
cpack -G NSIS -C RelWithDebInfo
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
_stat() {
|
_stat() {
|
||||||
if test "${CI_OS_NAME}" = osx ; then
|
if test "${TRAVIS_OS_NAME}" = osx ; then
|
||||||
stat -f %Sm "${@}"
|
stat -f %Sm "${@}"
|
||||||
else
|
else
|
||||||
stat -c %y "${@}"
|
stat -c %y "${@}"
|
||||||
@@ -8,6 +8,8 @@ _stat() {
|
|||||||
|
|
||||||
top_make() {
|
top_make() {
|
||||||
printf '%78s\n' | tr ' ' '='
|
printf '%78s\n' | tr ' ' '='
|
||||||
|
# Travis has 1.5 virtual cores according to:
|
||||||
|
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
|
||||||
ninja "$@"
|
ninja "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,45 +18,54 @@ build_make() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build_deps() {
|
build_deps() {
|
||||||
|
if test "${BUILD_32BIT}" = ON ; then
|
||||||
|
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||||
|
fi
|
||||||
if test "${FUNCTIONALTEST}" = "functionaltest-lua" \
|
if test "${FUNCTIONALTEST}" = "functionaltest-lua" \
|
||||||
|| test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
|
|| test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
|
||||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
|
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "${DEPS_BUILD_DIR}"
|
mkdir -p "${DEPS_BUILD_DIR}"
|
||||||
|
mkdir -p "${DEPS_DOWNLOAD_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
|
||||||
echo "Using third-party dependencies from cache (last update: $(_stat "${CACHE_MARKER}"))."
|
export CCACHE_RECACHE=1
|
||||||
cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_DIR}"
|
elif test -f "${CACHE_MARKER}" ; then
|
||||||
|
echo "Using third-party dependencies from Travis cache (last update: $(_stat "${CACHE_MARKER}"))."
|
||||||
|
cp -r "${HOME}/.cache/nvim-deps"/. "${DEPS_BUILD_DIR}"
|
||||||
|
cp -r "${HOME}/.cache/nvim-deps-downloads"/. "${DEPS_DOWNLOAD_DIR}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Even if we're using cached dependencies, run CMake and make to
|
# Even if we're using cached dependencies, run CMake and make to
|
||||||
# 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} "${TRAVIS_BUILD_DIR}/third-party/"
|
||||||
|
|
||||||
if ! top_make; then
|
if ! top_make; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "${CI_BUILD_DIR}"
|
cd "${TRAVIS_BUILD_DIR}"
|
||||||
}
|
}
|
||||||
|
|
||||||
build_nvim() {
|
prepare_build() {
|
||||||
check_core_dumps --delete quiet
|
|
||||||
|
|
||||||
if test -n "${CLANG_SANITIZER}" ; then
|
if test -n "${CLANG_SANITIZER}" ; then
|
||||||
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
|
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
|
||||||
fi
|
fi
|
||||||
|
if test "${BUILD_32BIT}" = ON ; then
|
||||||
|
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "${BUILD_DIR}"
|
mkdir -p "${BUILD_DIR}"
|
||||||
cd "${BUILD_DIR}"
|
cd "${BUILD_DIR}"
|
||||||
echo "Configuring with '${CMAKE_FLAGS} $@'."
|
echo "Configuring with '${CMAKE_FLAGS} $@'."
|
||||||
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}"
|
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${TRAVIS_BUILD_DIR}"
|
||||||
|
}
|
||||||
|
|
||||||
|
build_nvim() {
|
||||||
echo "Building nvim."
|
echo "Building nvim."
|
||||||
if ! top_make nvim ; then
|
if ! top_make nvim ; then
|
||||||
exit 1
|
exit 1
|
||||||
@@ -75,11 +86,21 @@ build_nvim() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Invoke nvim to trigger *San early.
|
# Invoke nvim to trigger *San early.
|
||||||
if ! (bin/nvim --version && bin/nvim -u NONE -e -cq | cat -vet) ; then
|
if ! (bin/nvim --version && bin/nvim -u NONE -e -c ':qall') ; then
|
||||||
check_sanitizer "${LOG_DIR}"
|
asan_check "${LOG_DIR}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
check_sanitizer "${LOG_DIR}"
|
asan_check "${LOG_DIR}"
|
||||||
|
|
||||||
cd "${CI_BUILD_DIR}"
|
|
||||||
|
cd "${TRAVIS_BUILD_DIR}"
|
||||||
|
}
|
||||||
|
|
||||||
|
macos_rvm_dance() {
|
||||||
|
# neovim-ruby gem requires a ruby newer than the macOS default.
|
||||||
|
source ~/.rvm/scripts/rvm
|
||||||
|
rvm get stable --auto-dotfiles
|
||||||
|
rvm reload
|
||||||
|
rvm use 2.2.5
|
||||||
|
rvm use
|
||||||
}
|
}
|
||||||
|
@@ -1,56 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Collect and submit coverage reports.
|
|
||||||
#
|
|
||||||
# Args:
|
|
||||||
# $1: Flag(s) for codecov, separated by comma.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Change to grandparent dir (POSIXly).
|
|
||||||
CDPATH='' cd -P -- "$(dirname -- "$0")/../.." || exit
|
|
||||||
|
|
||||||
echo "=== running submit_coverage in $PWD: $* ==="
|
|
||||||
"$GCOV" --version
|
|
||||||
|
|
||||||
# Download/install codecov-bash and gcovr once.
|
|
||||||
codecov_sh="${TEMP:-/tmp}/codecov.bash"
|
|
||||||
if ! [ -f "$codecov_sh" ]; then
|
|
||||||
curl --retry 5 --silent --fail -o "$codecov_sh" https://codecov.io/bash
|
|
||||||
chmod +x "$codecov_sh"
|
|
||||||
|
|
||||||
python -m pip install --quiet --user gcovr
|
|
||||||
fi
|
|
||||||
|
|
||||||
(
|
|
||||||
cd build
|
|
||||||
python -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml
|
|
||||||
)
|
|
||||||
|
|
||||||
# Upload to codecov.
|
|
||||||
# -X gcov: disable gcov, done manually above.
|
|
||||||
# -X fix: disable fixing of reports (not necessary, rather slow)
|
|
||||||
# -Z: exit non-zero on failure
|
|
||||||
# -F: flag(s)
|
|
||||||
# NOTE: ignoring flags for now, since this causes timeouts on codecov.io then,
|
|
||||||
# which they know about for about a year already...
|
|
||||||
# Flags must match pattern ^[\w\,]+$ ("," as separator).
|
|
||||||
codecov_flags="$(uname -s),${1}"
|
|
||||||
codecov_flags=$(echo "$codecov_flags" | sed 's/[^,_a-zA-Z0-9]/_/g')
|
|
||||||
if ! "$codecov_sh" -f coverage.xml -X gcov -X fix -Z -F "${codecov_flags}"; then
|
|
||||||
echo "codecov upload failed."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Cleanup always, especially collected data.
|
|
||||||
find . \( -name '*.gcov' -o -name '*.gcda' \) -ls -delete | wc -l
|
|
||||||
rm -f coverage.xml
|
|
||||||
|
|
||||||
# Upload Lua coverage (generated manually on AppVeyor/Windows).
|
|
||||||
if [ "$USE_LUACOV" = 1 ] && [ "$1" != "oldtest" ]; then
|
|
||||||
if [ -x "${DEPS_BUILD_DIR}/usr/bin/luacov" ]; then
|
|
||||||
"${DEPS_BUILD_DIR}/usr/bin/luacov"
|
|
||||||
fi
|
|
||||||
if ! "$codecov_sh" -f luacov.report.out -X gcov -X fix -Z -F "lua,${codecov_flags}"; then
|
|
||||||
echo "codecov upload failed."
|
|
||||||
fi
|
|
||||||
rm luacov.stats.out
|
|
||||||
fi
|
|
@@ -1,3 +1,9 @@
|
|||||||
|
# HACK: get newline for use in strings given that "\n" and $'' do not work.
|
||||||
|
NL="$(printf '\nE')"
|
||||||
|
NL="${NL%E}"
|
||||||
|
|
||||||
|
FAIL_SUMMARY=""
|
||||||
|
|
||||||
# Test success marker. If END_MARKER file exists, we know that all tests
|
# Test success marker. If END_MARKER file exists, we know that all tests
|
||||||
# finished. If FAIL_SUMMARY_FILE exists we know that some tests failed, this
|
# finished. If FAIL_SUMMARY_FILE exists we know that some tests failed, this
|
||||||
# file will contain information about failed tests. Build is considered
|
# file will contain information about failed tests. Build is considered
|
||||||
@@ -5,27 +11,172 @@
|
|||||||
END_MARKER="$BUILD_DIR/.tests_finished"
|
END_MARKER="$BUILD_DIR/.tests_finished"
|
||||||
FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
|
FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
|
||||||
|
|
||||||
|
ANSI_CLEAR="\033[0K"
|
||||||
|
|
||||||
|
travis_fold() {
|
||||||
|
local action="$1"
|
||||||
|
local name="$2"
|
||||||
|
name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
|
||||||
|
name="$(echo -n "$name" | sed 's/-$//')"
|
||||||
|
echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
|
||||||
|
}
|
||||||
|
|
||||||
|
if test "$TRAVIS" != "true" ; then
|
||||||
|
travis_fold() {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
enter_suite() {
|
||||||
|
set +x
|
||||||
|
FAILED=0
|
||||||
|
rm -f "${END_MARKER}"
|
||||||
|
local suite_name="$1"
|
||||||
|
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE}/$suite_name"
|
||||||
|
travis_fold start "${NVIM_TEST_CURRENT_SUITE}"
|
||||||
|
set -x
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_suite() {
|
||||||
|
set +x
|
||||||
|
travis_fold end "${NVIM_TEST_CURRENT_SUITE}"
|
||||||
|
if test $FAILED -ne 0 ; then
|
||||||
|
echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:"
|
||||||
|
echo "${FAIL_SUMMARY}"
|
||||||
|
fi
|
||||||
|
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
|
||||||
|
if test "$1" != "--continue" ; then
|
||||||
|
exit $FAILED
|
||||||
|
else
|
||||||
|
local saved_failed=$FAILED
|
||||||
|
FAILED=0
|
||||||
|
return $saved_failed
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
fail() {
|
fail() {
|
||||||
local test_name="$1"
|
local test_name="$1"
|
||||||
local message="$2"
|
local fail_char="$2"
|
||||||
|
local message="$3"
|
||||||
|
|
||||||
|
: ${fail_char:=F}
|
||||||
: ${message:=Test $test_name failed}
|
: ${message:=Test $test_name failed}
|
||||||
|
|
||||||
local full_msg="$test_name :: $message"
|
local full_msg="$fail_char $NVIM_TEST_CURRENT_SUITE|$test_name :: $message"
|
||||||
|
FAIL_SUMMARY="${FAIL_SUMMARY}${NL}${full_msg}"
|
||||||
echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}"
|
echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}"
|
||||||
echo "Failed: $full_msg"
|
echo "Failed: $full_msg"
|
||||||
FAILED=1
|
FAILED=1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run_test() {
|
||||||
|
local cmd="$1"
|
||||||
|
test $# -gt 0 && shift
|
||||||
|
local test_name="$1"
|
||||||
|
: ${test_name:=$cmd}
|
||||||
|
test $# -gt 0 && shift
|
||||||
|
if ! eval "$cmd" ; then
|
||||||
|
fail "${test_name}" "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
run_test_wd() {
|
||||||
|
local hang_ok=
|
||||||
|
if test "$1" = "--allow-hang" ; then
|
||||||
|
hang_ok=1
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
local timeout="$1"
|
||||||
|
test $# -gt 0 && shift
|
||||||
|
|
||||||
|
local cmd="$1"
|
||||||
|
test $# -gt 0 && shift
|
||||||
|
|
||||||
|
local restart_cmd="$1"
|
||||||
|
: ${restart_cmd:=true}
|
||||||
|
test $# -gt 0 && shift
|
||||||
|
|
||||||
|
local test_name="$1"
|
||||||
|
: ${test_name:=$cmd}
|
||||||
|
test $# -gt 0 && shift
|
||||||
|
|
||||||
|
local output_file="$(mktemp)"
|
||||||
|
local status_file="$(mktemp)"
|
||||||
|
local sid_file="$(mktemp)"
|
||||||
|
|
||||||
|
local restarts=5
|
||||||
|
local prev_tmpsize=-1
|
||||||
|
while test $restarts -gt 0 ; do
|
||||||
|
: > "$status_file"
|
||||||
|
: > "$sid_file"
|
||||||
|
setsid \
|
||||||
|
env \
|
||||||
|
output_file="$output_file" \
|
||||||
|
status_file="$status_file" \
|
||||||
|
sid_file="$sid_file" \
|
||||||
|
cmd="$cmd" \
|
||||||
|
CI_DIR="$CI_DIR" \
|
||||||
|
sh -c '
|
||||||
|
. "${CI_DIR}/common/test.sh"
|
||||||
|
ps -o sid= > "$sid_file"
|
||||||
|
(
|
||||||
|
ret=0
|
||||||
|
if ! eval "$cmd" 2>&1 ; then
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
echo "$ret" > "$status_file"
|
||||||
|
) | tee -a "$output_file"
|
||||||
|
'
|
||||||
|
while test "$(stat -c "%s" "$status_file")" -eq 0 ; do
|
||||||
|
prev_tmpsize=$tmpsize
|
||||||
|
sleep $timeout
|
||||||
|
tmpsize="$(stat -c "%s" "$output_file")"
|
||||||
|
if test $tempsize -eq $prev_temsize ; then
|
||||||
|
# no output, assuming either hang or exit
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
restarts=$(( restarts - 1 ))
|
||||||
|
if test "$(stat -c "%s" "$status_file")" -eq 0 ; then
|
||||||
|
# Status file not updated, assuming hang
|
||||||
|
|
||||||
|
# SID not known, this should not ever happen
|
||||||
|
if test "$(stat -c "%s" "$sid_file")" -eq 0 ; then
|
||||||
|
fail "$test_name" E "Shell did not run"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Kill all processes which belong to one session: should get rid of test
|
||||||
|
# processes as well as sh itself.
|
||||||
|
pkill -KILL -s$(cat "$sid_file")
|
||||||
|
|
||||||
|
if test $restarts -eq 0 ; then
|
||||||
|
if test -z "$hang_ok" ; then
|
||||||
|
fail "$test_name" E "Test hang up"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Test ${test_name} hang up, restarting"
|
||||||
|
eval "$restart_cmd"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
local new_failed="$(cat "$status_file")"
|
||||||
|
if test "$new_failed" != "0" ; then
|
||||||
|
fail "$test_name" F "Test failed in run_test_wd"
|
||||||
|
fi
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -f "$output_file"
|
||||||
|
rm -f "$status_file"
|
||||||
|
rm -f "$sid_file"
|
||||||
|
}
|
||||||
|
|
||||||
ended_successfully() {
|
ended_successfully() {
|
||||||
if test -f "${FAIL_SUMMARY_FILE}" ; then
|
if test -f "${FAIL_SUMMARY_FILE}" ; then
|
||||||
echo 'Test failed, complete summary:'
|
echo 'Test failed, complete summary:'
|
||||||
cat "${FAIL_SUMMARY_FILE}"
|
cat "${FAIL_SUMMARY_FILE}"
|
||||||
|
|
||||||
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
|
|
||||||
rm -f "$FAIL_SUMMARY_FILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if ! test -f "${END_MARKER}" ; then
|
if ! test -f "${END_MARKER}" ; then
|
||||||
|
@@ -3,7 +3,10 @@
|
|||||||
|
|
||||||
submit_coverage() {
|
submit_coverage() {
|
||||||
if [ -n "${GCOV}" ]; then
|
if [ -n "${GCOV}" ]; then
|
||||||
"${CI_DIR}/common/submit_coverage.sh" "$@" || echo 'codecov upload failed.'
|
if curl --fail --output codecov.bash --silent https://codecov.io/bash; then
|
||||||
|
bash codecov.bash -c -F "$1" || echo "codecov upload failed."
|
||||||
|
rm -f codecov.bash
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,7 +18,7 @@ print_core() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
echo "======= Core file $core ======="
|
echo "======= Core file $core ======="
|
||||||
if test "${CI_OS_NAME}" = osx ; then
|
if test "${TRAVIS_OS_NAME}" = osx ; then
|
||||||
lldb -Q -o "bt all" -f "${app}" -c "${core}"
|
lldb -Q -o "bt all" -f "${app}" -c "${core}"
|
||||||
else
|
else
|
||||||
gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}"
|
gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}"
|
||||||
@@ -29,12 +32,11 @@ check_core_dumps() {
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
local app="${1:-${BUILD_DIR}/bin/nvim}"
|
local app="${1:-${BUILD_DIR}/bin/nvim}"
|
||||||
local cores
|
if test "${TRAVIS_OS_NAME}" = osx ; then
|
||||||
if test "${CI_OS_NAME}" = osx ; then
|
local cores="$(find /cores/ -type f -print)"
|
||||||
cores="$(find /cores/ -type f -print)"
|
|
||||||
local _sudo='sudo'
|
local _sudo='sudo'
|
||||||
else
|
else
|
||||||
cores="$(find ./ -type f \( -name 'core.*' -o -name core -o -name nvim.core \) -print)"
|
local cores="$(find ./ -type f -name 'core.*' -print)"
|
||||||
local _sudo=
|
local _sudo=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -51,7 +53,7 @@ check_core_dumps() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if test "$app" != quiet ; then
|
if test "$app" != quiet ; then
|
||||||
fail 'cores' 'Core dumps found'
|
fail 'cores' E 'Core dumps found'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,10 +71,9 @@ check_logs() {
|
|||||||
for log in $(find "${1}" -type f -name "${2}" -size +0); do
|
for log in $(find "${1}" -type f -name "${2}" -size +0); do
|
||||||
cat "${log}"
|
cat "${log}"
|
||||||
err=1
|
err=1
|
||||||
rm "${log}"
|
|
||||||
done
|
done
|
||||||
if test -n "${err}" ; then
|
if test -n "${err}" ; then
|
||||||
fail 'logs' 'Runtime errors detected.'
|
fail 'logs' E 'Runtime errors detected.'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,45 +81,52 @@ valgrind_check() {
|
|||||||
check_logs "${1}" "valgrind-*"
|
check_logs "${1}" "valgrind-*"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_sanitizer() {
|
asan_check() {
|
||||||
if test -n "${CLANG_SANITIZER}"; then
|
if test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
|
||||||
check_logs "${1}" "*san.*" | ${SYMBOLIZER:-cat}
|
check_logs "${1}" "*san.*" | $ASAN_SYMBOLIZE
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
unittests() {(
|
run_unittests() {(
|
||||||
|
enter_suite unittests
|
||||||
ulimit -c unlimited || true
|
ulimit -c unlimited || true
|
||||||
if ! build_make unittest ; then
|
if ! build_make unittest ; then
|
||||||
fail 'unittests' 'Unit tests failed'
|
fail 'unittests' F 'Unit tests failed'
|
||||||
fi
|
fi
|
||||||
submit_coverage unittest
|
submit_coverage unittest
|
||||||
check_core_dumps "$(command -v luajit)"
|
check_core_dumps "$(which luajit)"
|
||||||
|
exit_suite
|
||||||
)}
|
)}
|
||||||
|
|
||||||
functionaltests() {(
|
run_functionaltests() {(
|
||||||
|
enter_suite functionaltests
|
||||||
ulimit -c unlimited || true
|
ulimit -c unlimited || true
|
||||||
if ! build_make ${FUNCTIONALTEST}; then
|
if ! build_make ${FUNCTIONALTEST}; then
|
||||||
fail 'functionaltests' 'Functional tests failed'
|
fail 'functionaltests' F 'Functional tests failed'
|
||||||
fi
|
fi
|
||||||
submit_coverage functionaltest
|
submit_coverage functionaltest
|
||||||
check_sanitizer "${LOG_DIR}"
|
asan_check "${LOG_DIR}"
|
||||||
valgrind_check "${LOG_DIR}"
|
valgrind_check "${LOG_DIR}"
|
||||||
check_core_dumps
|
check_core_dumps
|
||||||
|
exit_suite
|
||||||
)}
|
)}
|
||||||
|
|
||||||
oldtests() {(
|
run_oldtests() {(
|
||||||
|
enter_suite oldtests
|
||||||
ulimit -c unlimited || true
|
ulimit -c unlimited || true
|
||||||
if ! make oldtest; then
|
if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then
|
||||||
reset
|
reset
|
||||||
fail 'oldtests' 'Legacy tests failed'
|
fail 'oldtests' F 'Legacy tests failed'
|
||||||
fi
|
fi
|
||||||
submit_coverage oldtest
|
submit_coverage oldtest
|
||||||
check_sanitizer "${LOG_DIR}"
|
asan_check "${LOG_DIR}"
|
||||||
valgrind_check "${LOG_DIR}"
|
valgrind_check "${LOG_DIR}"
|
||||||
check_core_dumps
|
check_core_dumps
|
||||||
|
exit_suite
|
||||||
)}
|
)}
|
||||||
|
|
||||||
check_runtime_files() {(
|
check_runtime_files() {(
|
||||||
|
set +x
|
||||||
local test_name="$1" ; shift
|
local test_name="$1" ; shift
|
||||||
local message="$1" ; shift
|
local message="$1" ; shift
|
||||||
local tst="$1" ; shift
|
local tst="$1" ; shift
|
||||||
@@ -129,25 +137,27 @@ check_runtime_files() {(
|
|||||||
# Prefer failing the build over using more robust construct because files
|
# Prefer failing the build over using more robust construct because files
|
||||||
# with IFS are not welcome.
|
# with IFS are not welcome.
|
||||||
if ! test -e "$file" ; then
|
if ! test -e "$file" ; then
|
||||||
fail "$test_name" "It appears that $file is only a part of the file name"
|
fail "$test_name" E \
|
||||||
|
"It appears that $file is only a part of the file name"
|
||||||
fi
|
fi
|
||||||
if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then
|
if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then
|
||||||
fail "$test_name" "$(printf "$message" "$file")"
|
fail "$test_name" F "$(printf "$message" "$file")"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
)}
|
)}
|
||||||
|
|
||||||
install_nvim() {(
|
install_nvim() {(
|
||||||
|
enter_suite 'install_nvim'
|
||||||
if ! build_make install ; then
|
if ! build_make install ; then
|
||||||
fail 'install' 'make install failed'
|
fail 'install' E 'make install failed'
|
||||||
exit 1
|
exit_suite
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"${INSTALL_PREFIX}/bin/nvim" --version
|
"${INSTALL_PREFIX}/bin/nvim" --version
|
||||||
if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then
|
if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then
|
||||||
echo "Running ':help' in the installed nvim failed."
|
echo "Running ':help' in the installed nvim failed."
|
||||||
echo "Maybe the helptags have not been generated properly."
|
echo "Maybe the helptags have not been generated properly."
|
||||||
fail 'help' 'Failed running :help'
|
fail 'help' F 'Failed running :help'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check that all runtime files were installed
|
# Check that all runtime files were installed
|
||||||
@@ -168,6 +178,13 @@ install_nvim() {(
|
|||||||
local genvimsynf=syntax/vim/generated.vim
|
local genvimsynf=syntax/vim/generated.vim
|
||||||
local gpat='syn keyword vimFuncName .*eval'
|
local gpat='syn keyword vimFuncName .*eval'
|
||||||
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then
|
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then
|
||||||
fail 'funcnames' "It appears that $genvimsynf does not contain $gpat."
|
fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
exit_suite
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
csi_clean() {
|
||||||
|
find "${BUILD_DIR}/bin" -name 'test-includes-*' -delete
|
||||||
|
find "${BUILD_DIR}" -name '*test-include*.o' -delete
|
||||||
|
}
|
||||||
|
@@ -3,18 +3,30 @@
|
|||||||
set -e
|
set -e
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
if [[ "${CI_TARGET}" == lint ]]; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||||
|
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Install neovim module for Python 3."
|
||||||
|
# Allow failure. pyenv pip3 on travis is broken:
|
||||||
|
# https://github.com/travis-ci/travis-ci/issues/8363
|
||||||
|
CC=cc python3 -m pip -q install --user --upgrade neovim || true
|
||||||
|
|
||||||
|
if ! [ "${TRAVIS_OS_NAME}" = osx ] ; then
|
||||||
|
# Update PATH for pip.
|
||||||
|
export PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$PATH"
|
||||||
# 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 2."
|
||||||
CC=cc python3 -m pip -q install --user --upgrade pynvim
|
CC=cc python2.7 -m pip -q install --user --upgrade neovim
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Install neovim RubyGem."
|
echo "Install neovim RubyGem."
|
||||||
gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim
|
gem install --no-document --version ">= 0.8.0" neovim
|
||||||
|
|
||||||
echo "Install neovim npm package"
|
echo "Install neovim npm package"
|
||||||
npm install -g neovim
|
npm install -g neovim
|
||||||
npm link neovim
|
npm link neovim
|
||||||
|
|
||||||
if [[ $CI_OS_NAME != osx ]]; then
|
|
||||||
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
|
|
||||||
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
|
|
||||||
fi
|
|
||||||
|
40
ci/run_lint.sh
Executable file
40
ci/run_lint.sh
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/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"
|
||||||
|
|
||||||
|
enter_suite 'clint'
|
||||||
|
|
||||||
|
run_test 'make clint-full' clint
|
||||||
|
|
||||||
|
exit_suite --continue
|
||||||
|
|
||||||
|
enter_suite 'testlint'
|
||||||
|
|
||||||
|
run_test 'make testlint' testlint
|
||||||
|
|
||||||
|
exit_suite --continue
|
||||||
|
|
||||||
|
enter_suite 'lualint'
|
||||||
|
|
||||||
|
run_test 'make lualint' lualint
|
||||||
|
|
||||||
|
exit_suite --continue
|
||||||
|
|
||||||
|
enter_suite single-includes
|
||||||
|
|
||||||
|
CLICOLOR_FORCE=1 run_test_wd \
|
||||||
|
--allow-hang \
|
||||||
|
10s \
|
||||||
|
'make check-single-includes' \
|
||||||
|
'csi_clean' \
|
||||||
|
single-includes
|
||||||
|
|
||||||
|
exit_suite --continue
|
||||||
|
|
||||||
|
end_tests
|
@@ -8,34 +8,29 @@ source "${CI_DIR}/common/build.sh"
|
|||||||
source "${CI_DIR}/common/test.sh"
|
source "${CI_DIR}/common/test.sh"
|
||||||
source "${CI_DIR}/common/suite.sh"
|
source "${CI_DIR}/common/suite.sh"
|
||||||
|
|
||||||
rm -f "$END_MARKER"
|
enter_suite build
|
||||||
|
|
||||||
# Run all tests (with some caveats) if no input argument is given
|
check_core_dumps --delete quiet
|
||||||
if (($# == 0)); then
|
|
||||||
tests=('build_nvim')
|
prepare_build
|
||||||
|
build_nvim
|
||||||
|
|
||||||
|
exit_suite --continue
|
||||||
|
|
||||||
|
enter_suite tests
|
||||||
|
|
||||||
if test "$CLANG_SANITIZER" != "TSAN" ; then
|
if test "$CLANG_SANITIZER" != "TSAN" ; then
|
||||||
# Additional threads are only created when the builtin UI starts, which
|
# Additional threads are only created when the builtin UI starts, which
|
||||||
# doesn't happen in the unit/functional tests
|
# doesn't happen in the unit/functional tests
|
||||||
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
|
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
|
||||||
tests+=('unittests')
|
run_test run_unittests
|
||||||
fi
|
fi
|
||||||
tests+=('functionaltests')
|
run_test run_functionaltests
|
||||||
fi
|
fi
|
||||||
|
run_test run_oldtests
|
||||||
|
|
||||||
tests+=('oldtests' 'install_nvim')
|
run_test install_nvim
|
||||||
else
|
|
||||||
tests=("$@")
|
|
||||||
fi
|
|
||||||
|
|
||||||
for i in "${tests[@]}"; do
|
exit_suite --continue
|
||||||
eval "$i" || fail "$i"
|
|
||||||
done
|
|
||||||
|
|
||||||
end_tests
|
end_tests
|
||||||
|
|
||||||
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
|
|
||||||
echo '=== Unexpected gcov errors: ==='
|
|
||||||
cat "${GCOV_ERROR_FILE}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
13
ci/script.sh
Executable file
13
ci/script.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
# This will pass the environment variables down to a bash process which runs
|
||||||
|
# as $USER, while retaining the environment variables defined and belonging
|
||||||
|
# to secondary groups given above in usermod.
|
||||||
|
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||||
|
sudo -E su "${USER}" -c "ci/run_${CI_TARGET}.sh"
|
||||||
|
else
|
||||||
|
ci/run_${CI_TARGET}.sh
|
||||||
|
fi
|
@@ -1,194 +0,0 @@
|
|||||||
{
|
|
||||||
"ref": "refs/heads/master",
|
|
||||||
"before": "66b136c43c12df3dcf8f19ff48f206ad2e4f43fc",
|
|
||||||
"after": "1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
|
||||||
"repository": {
|
|
||||||
"id": 292861950,
|
|
||||||
"node_id": "MDEwOlJlcG9zaXRvcnkyOTI4NjE5NTA=",
|
|
||||||
"name": "neovim-snap",
|
|
||||||
"full_name": "hurricanehrndz/neovim-snap",
|
|
||||||
"private": false,
|
|
||||||
"owner": {
|
|
||||||
"name": "hurricanehrndz",
|
|
||||||
"email": "hurricanehrndz@users.noreply.github.com",
|
|
||||||
"login": "hurricanehrndz",
|
|
||||||
"id": 5804237,
|
|
||||||
"node_id": "MDQ6VXNlcjU4MDQyMzc=",
|
|
||||||
"avatar_url": "https://avatars0.githubusercontent.com/u/5804237?v=4",
|
|
||||||
"gravatar_id": "",
|
|
||||||
"url": "https://api.github.com/users/hurricanehrndz",
|
|
||||||
"html_url": "https://github.com/hurricanehrndz",
|
|
||||||
"followers_url": "https://api.github.com/users/hurricanehrndz/followers",
|
|
||||||
"following_url": "https://api.github.com/users/hurricanehrndz/following{/other_user}",
|
|
||||||
"gists_url": "https://api.github.com/users/hurricanehrndz/gists{/gist_id}",
|
|
||||||
"starred_url": "https://api.github.com/users/hurricanehrndz/starred{/owner}{/repo}",
|
|
||||||
"subscriptions_url": "https://api.github.com/users/hurricanehrndz/subscriptions",
|
|
||||||
"organizations_url": "https://api.github.com/users/hurricanehrndz/orgs",
|
|
||||||
"repos_url": "https://api.github.com/users/hurricanehrndz/repos",
|
|
||||||
"events_url": "https://api.github.com/users/hurricanehrndz/events{/privacy}",
|
|
||||||
"received_events_url": "https://api.github.com/users/hurricanehrndz/received_events",
|
|
||||||
"type": "User",
|
|
||||||
"site_admin": false
|
|
||||||
},
|
|
||||||
"html_url": "https://github.com/hurricanehrndz/neovim-snap",
|
|
||||||
"description": "snap build for neovim",
|
|
||||||
"fork": false,
|
|
||||||
"url": "https://github.com/hurricanehrndz/neovim-snap",
|
|
||||||
"forks_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/forks",
|
|
||||||
"keys_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/keys{/key_id}",
|
|
||||||
"collaborators_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/collaborators{/collaborator}",
|
|
||||||
"teams_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/teams",
|
|
||||||
"hooks_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/hooks",
|
|
||||||
"issue_events_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/issues/events{/number}",
|
|
||||||
"events_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/events",
|
|
||||||
"assignees_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/assignees{/user}",
|
|
||||||
"branches_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/branches{/branch}",
|
|
||||||
"tags_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/tags",
|
|
||||||
"blobs_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/blobs{/sha}",
|
|
||||||
"git_tags_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/tags{/sha}",
|
|
||||||
"git_refs_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/refs{/sha}",
|
|
||||||
"trees_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/trees{/sha}",
|
|
||||||
"statuses_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/statuses/{sha}",
|
|
||||||
"languages_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/languages",
|
|
||||||
"stargazers_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/stargazers",
|
|
||||||
"contributors_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/contributors",
|
|
||||||
"subscribers_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/subscribers",
|
|
||||||
"subscription_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/subscription",
|
|
||||||
"commits_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/commits{/sha}",
|
|
||||||
"git_commits_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/commits{/sha}",
|
|
||||||
"comments_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/comments{/number}",
|
|
||||||
"issue_comment_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/issues/comments{/number}",
|
|
||||||
"contents_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/contents/{+path}",
|
|
||||||
"compare_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/compare/{base}...{head}",
|
|
||||||
"merges_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/merges",
|
|
||||||
"archive_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/{archive_format}{/ref}",
|
|
||||||
"downloads_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/downloads",
|
|
||||||
"issues_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/issues{/number}",
|
|
||||||
"pulls_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/pulls{/number}",
|
|
||||||
"milestones_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/milestones{/number}",
|
|
||||||
"notifications_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/notifications{?since,all,participating}",
|
|
||||||
"labels_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/labels{/name}",
|
|
||||||
"releases_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/releases{/id}",
|
|
||||||
"deployments_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/deployments",
|
|
||||||
"created_at": 1599227980,
|
|
||||||
"updated_at": "2020-09-04T14:02:38Z",
|
|
||||||
"pushed_at": 1599228352,
|
|
||||||
"git_url": "git://github.com/hurricanehrndz/neovim-snap.git",
|
|
||||||
"ssh_url": "git@github.com:hurricanehrndz/neovim-snap.git",
|
|
||||||
"clone_url": "https://github.com/hurricanehrndz/neovim-snap.git",
|
|
||||||
"svn_url": "https://github.com/hurricanehrndz/neovim-snap",
|
|
||||||
"homepage": null,
|
|
||||||
"size": 0,
|
|
||||||
"stargazers_count": 0,
|
|
||||||
"watchers_count": 0,
|
|
||||||
"language": null,
|
|
||||||
"has_issues": true,
|
|
||||||
"has_projects": true,
|
|
||||||
"has_downloads": true,
|
|
||||||
"has_wiki": true,
|
|
||||||
"has_pages": false,
|
|
||||||
"forks_count": 0,
|
|
||||||
"mirror_url": null,
|
|
||||||
"archived": false,
|
|
||||||
"disabled": false,
|
|
||||||
"open_issues_count": 0,
|
|
||||||
"license": {
|
|
||||||
"key": "mit",
|
|
||||||
"name": "MIT License",
|
|
||||||
"spdx_id": "MIT",
|
|
||||||
"url": "https://api.github.com/licenses/mit",
|
|
||||||
"node_id": "MDc6TGljZW5zZTEz"
|
|
||||||
},
|
|
||||||
"forks": 0,
|
|
||||||
"open_issues": 0,
|
|
||||||
"watchers": 0,
|
|
||||||
"default_branch": "master",
|
|
||||||
"stargazers": 0,
|
|
||||||
"master_branch": "master"
|
|
||||||
},
|
|
||||||
"pusher": {
|
|
||||||
"name": "hurricanehrndz",
|
|
||||||
"email": "hurricanehrndz@users.noreply.github.com"
|
|
||||||
},
|
|
||||||
"sender": {
|
|
||||||
"login": "hurricanehrndz",
|
|
||||||
"id": 5804237,
|
|
||||||
"node_id": "MDQ6VXNlcjU4MDQyMzc=",
|
|
||||||
"avatar_url": "https://avatars0.githubusercontent.com/u/5804237?v=4",
|
|
||||||
"gravatar_id": "",
|
|
||||||
"url": "https://api.github.com/users/hurricanehrndz",
|
|
||||||
"html_url": "https://github.com/hurricanehrndz",
|
|
||||||
"followers_url": "https://api.github.com/users/hurricanehrndz/followers",
|
|
||||||
"following_url": "https://api.github.com/users/hurricanehrndz/following{/other_user}",
|
|
||||||
"gists_url": "https://api.github.com/users/hurricanehrndz/gists{/gist_id}",
|
|
||||||
"starred_url": "https://api.github.com/users/hurricanehrndz/starred{/owner}{/repo}",
|
|
||||||
"subscriptions_url": "https://api.github.com/users/hurricanehrndz/subscriptions",
|
|
||||||
"organizations_url": "https://api.github.com/users/hurricanehrndz/orgs",
|
|
||||||
"repos_url": "https://api.github.com/users/hurricanehrndz/repos",
|
|
||||||
"events_url": "https://api.github.com/users/hurricanehrndz/events{/privacy}",
|
|
||||||
"received_events_url": "https://api.github.com/users/hurricanehrndz/received_events",
|
|
||||||
"type": "User",
|
|
||||||
"site_admin": false
|
|
||||||
},
|
|
||||||
"created": false,
|
|
||||||
"deleted": false,
|
|
||||||
"forced": false,
|
|
||||||
"base_ref": null,
|
|
||||||
"compare": "https://github.com/hurricanehrndz/neovim-snap/compare/66b136c43c12...1bf69c32217c",
|
|
||||||
"commits": [
|
|
||||||
{
|
|
||||||
"id": "1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
|
||||||
"tree_id": "62ea83a2349be8c930c45fdc199f71b08bf5927e",
|
|
||||||
"distinct": true,
|
|
||||||
"message": "Build of latest tag",
|
|
||||||
"timestamp": "2020-09-04T14:05:40Z",
|
|
||||||
"url": "https://github.com/hurricanehrndz/neovim-snap/commit/1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
|
||||||
"author": {
|
|
||||||
"name": "Carlos Hernandez",
|
|
||||||
"email": "carlos@techbyte.ca",
|
|
||||||
"username": "hurricanehrndz"
|
|
||||||
},
|
|
||||||
"committer": {
|
|
||||||
"name": "Carlos Hernandez",
|
|
||||||
"email": "carlos@techbyte.ca",
|
|
||||||
"username": "hurricanehrndz"
|
|
||||||
},
|
|
||||||
"added": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"removed": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"modified": [
|
|
||||||
"snap/snapcraft.yaml"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"head_commit": {
|
|
||||||
"id": "1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
|
||||||
"tree_id": "62ea83a2349be8c930c45fdc199f71b08bf5927e",
|
|
||||||
"distinct": true,
|
|
||||||
"message": "Build of latest tag",
|
|
||||||
"timestamp": "2020-09-04T14:05:40Z",
|
|
||||||
"url": "https://github.com/hurricanehrndz/neovim-snap/commit/1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
|
||||||
"author": {
|
|
||||||
"name": "Carlos Hernandez",
|
|
||||||
"email": "carlos@techbyte.ca",
|
|
||||||
"username": "hurricanehrndz"
|
|
||||||
},
|
|
||||||
"committer": {
|
|
||||||
"name": "Carlos Hernandez",
|
|
||||||
"email": "carlos@techbyte.ca",
|
|
||||||
"username": "hurricanehrndz"
|
|
||||||
},
|
|
||||||
"added": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"removed": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"modified": [
|
|
||||||
"snap/snapcraft.yaml"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
|
|
||||||
RESULT_SNAP=$(find ./ -name "*.snap")
|
|
||||||
|
|
||||||
sudo snap install "$RESULT_SNAP" --dangerous --classic
|
|
||||||
|
|
||||||
/snap/bin/nvim --version
|
|
||||||
|
|
||||||
SHA256=$(sha256sum "$RESULT_SNAP")
|
|
||||||
echo "SHA256: ${SHA256} ."
|
|
@@ -1,39 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
SNAP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
||||||
WEBHOOK_PAYLOAD="$(cat "${SNAP_DIR}/.snapcraft_payload")"
|
|
||||||
PAYLOAD_SIG="${SECRET_SNAP_SIG}"
|
|
||||||
|
|
||||||
|
|
||||||
snap_release_needed() {
|
|
||||||
last_committed_tag="$(git tag -l --sort=refname|head -1)"
|
|
||||||
last_snap_release="$(snap info nvim | awk '$1 == "latest/edge:" { print $2 }' | perl -lpe 's/v\d.\d.\d-//g')"
|
|
||||||
git fetch -f --tags
|
|
||||||
git checkout "${last_committed_tag}" 2> /dev/null
|
|
||||||
last_git_release="$(git describe --first-parent 2> /dev/null | perl -lpe 's/v\d.\d.\d-//g')"
|
|
||||||
|
|
||||||
if [[ -z "$(echo $last_snap_release | perl -ne "print if /${last_git_release}.*/")" ]]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
trigger_snapcraft_webhook() {
|
|
||||||
[[ -n "${PAYLOAD_SIG}" ]] || exit
|
|
||||||
echo "Triggering new snap release via webhook..."
|
|
||||||
curl -X POST \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-H "X-Hub-Signature: sha1=${PAYLOAD_SIG}" \
|
|
||||||
--data "${WEBHOOK_PAYLOAD}" \
|
|
||||||
https://snapcraft.io/nvim/webhook/notify
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if $(snap_release_needed); then
|
|
||||||
echo "New snap release required"
|
|
||||||
trigger_snapcraft_webhook
|
|
||||||
fi
|
|
@@ -1,11 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
sudo apt update
|
|
||||||
sudo usermod -aG lxd $USER
|
|
||||||
sudo /snap/bin/lxd.migrate -yes
|
|
||||||
sudo /snap/bin/lxd waitready
|
|
||||||
sudo /snap/bin/lxd init --auto
|
|
||||||
|
|
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
mkdir -p "$CI_BUILD_DIR/snaps-cache"
|
|
||||||
sg lxd -c snapcraft
|
|
||||||
|
|
Binary file not shown.
@@ -1,313 +0,0 @@
|
|||||||
# This is not meant to be included by the top-level.
|
|
||||||
cmake_minimum_required (VERSION 3.10)
|
|
||||||
project(NVIM_DEPS C)
|
|
||||||
|
|
||||||
# Point CMake at any custom modules we may ship
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/../cmake")
|
|
||||||
|
|
||||||
include(CheckCCompilerFlag)
|
|
||||||
include(Util)
|
|
||||||
|
|
||||||
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
|
||||||
if(NOT isMultiConfig)
|
|
||||||
set(BUILD_TYPE_STRING -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set_default_buildtype()
|
|
||||||
|
|
||||||
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-g)
|
|
||||||
|
|
||||||
check_c_compiler_flag(-Og HAS_OG_FLAG)
|
|
||||||
if(HAS_OG_FLAG)
|
|
||||||
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-Og ${DEFAULT_MAKE_CFLAGS})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
|
||||||
# pkg-config 29.2 has a bug on OpenBSD which causes it to drop any paths that
|
|
||||||
# *contain* system include paths. To avoid this, we prefix what would be
|
|
||||||
# "/usr/include" as "/_usr/include".
|
|
||||||
# This check is also performed in the root CMakeLists.txt
|
|
||||||
# https://github.com/neovim/neovim/pull/14745#issuecomment-860201794
|
|
||||||
set(DEPS_INSTALL_DIR "${CMAKE_BINARY_DIR}/_usr" CACHE PATH "Dependencies install directory.")
|
|
||||||
else()
|
|
||||||
set(DEPS_INSTALL_DIR "${CMAKE_BINARY_DIR}/usr" CACHE PATH "Dependencies install directory.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(DEPS_BIN_DIR "${DEPS_INSTALL_DIR}/bin" CACHE PATH "Dependencies binary install directory.")
|
|
||||||
set(DEPS_LIB_DIR "${DEPS_INSTALL_DIR}/lib" CACHE PATH "Dependencies library install directory.")
|
|
||||||
set(DEPS_BUILD_DIR "${CMAKE_BINARY_DIR}/build" CACHE PATH "Dependencies build directory.")
|
|
||||||
set(DEPS_DOWNLOAD_DIR "${DEPS_BUILD_DIR}/downloads" CACHE PATH "Dependencies download directory.")
|
|
||||||
|
|
||||||
option(USE_BUNDLED "Use bundled dependencies." ON)
|
|
||||||
|
|
||||||
option(USE_BUNDLED_UNIBILIUM "Use the bundled unibilium." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_LIBTERMKEY "Use the bundled libtermkey." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_LIBVTERM "Use the bundled libvterm." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_MSGPACK "Use the bundled msgpack." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_LUAJIT "Use the bundled version of luajit." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_LUAROCKS "Use the bundled version of luarocks." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_LUV "Use the bundled version of luv." ${USE_BUNDLED})
|
|
||||||
#XXX(tarruda): Lua is only used for debugging the functional test client, no
|
|
||||||
# build it unless explicitly requested
|
|
||||||
option(USE_BUNDLED_LUA "Use the bundled version of lua." OFF)
|
|
||||||
option(USE_BUNDLED_TS_PARSERS "Use the bundled treesitter parsers." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_TS "Use the bundled treesitter runtime." ${USE_BUNDLED})
|
|
||||||
|
|
||||||
if(USE_BUNDLED AND MSVC)
|
|
||||||
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." ON)
|
|
||||||
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." ON)
|
|
||||||
else()
|
|
||||||
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." OFF)
|
|
||||||
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source directory." OFF)
|
|
||||||
|
|
||||||
find_package(Git)
|
|
||||||
if(NOT Git_FOUND)
|
|
||||||
message(FATAL_ERROR "Git is required to apply patches.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(UNIX)
|
|
||||||
find_program(MAKE_PRG NAMES gmake make)
|
|
||||||
if(MAKE_PRG)
|
|
||||||
execute_process(
|
|
||||||
COMMAND "${MAKE_PRG}" --version
|
|
||||||
OUTPUT_VARIABLE MAKE_VERSION_INFO)
|
|
||||||
if(NOT "${OUTPUT_VARIABLE}" MATCHES ".*GNU.*")
|
|
||||||
unset(MAKE_PRG)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(NOT MAKE_PRG)
|
|
||||||
message(FATAL_ERROR "GNU Make is required to build the dependencies.")
|
|
||||||
else()
|
|
||||||
message(STATUS "Found GNU Make at ${MAKE_PRG}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# When using make, use the $(MAKE) variable to avoid warning about the job
|
|
||||||
# server.
|
|
||||||
if(CMAKE_GENERATOR MATCHES "Makefiles")
|
|
||||||
set(MAKE_PRG "$(MAKE)")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MINGW AND CMAKE_GENERATOR MATCHES "Ninja")
|
|
||||||
find_program(MAKE_PRG NAMES mingw32-make)
|
|
||||||
if(NOT MAKE_PRG)
|
|
||||||
message(FATAL_ERROR "GNU Make for mingw32 is required to build the dependencies.")
|
|
||||||
else()
|
|
||||||
message(STATUS "Found GNU Make for mingw32: ${MAKE_PRG}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ARG1)
|
|
||||||
set(DEPS_C_COMPILER "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}")
|
|
||||||
else()
|
|
||||||
set(DEPS_C_COMPILER "${CMAKE_C_COMPILER}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER)
|
|
||||||
set(DEPS_CXX_COMPILER "${CMAKE_CXX_COMPILER}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_OSX_SYSROOT)
|
|
||||||
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
|
|
||||||
if(DEPS_CXX_COMPILER)
|
|
||||||
set(DEPS_CXX_COMPILER "${DEPS_CXX_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_OSX_ARCHITECTURES)
|
|
||||||
string(REPLACE ";" "|" CMAKE_OSX_ARCHITECTURES_ALT_SEP "${CMAKE_OSX_ARCHITECTURES}")
|
|
||||||
# The LuaJIT build does not like being passed multiple `-arch` flags
|
|
||||||
# so we handle a universal build the old-fashioned way.
|
|
||||||
set(LUAJIT_C_COMPILER "${DEPS_C_COMPILER}")
|
|
||||||
foreach(ARCH IN LISTS CMAKE_OSX_ARCHITECTURES)
|
|
||||||
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -arch ${ARCH}")
|
|
||||||
if(DEPS_CXX_COMPILER)
|
|
||||||
set(DEPS_CXX_COMPILER "${DEPS_CXX_COMPILER} -arch ${ARCH}")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
|
|
||||||
# fall back to local system version. Needs to be done here and in top-level CMakeLists.txt.
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
||||||
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}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(HOSTDEPS_INSTALL_DIR "${DEPS_INSTALL_DIR}")
|
|
||||||
set(HOSTDEPS_BIN_DIR "${DEPS_BIN_DIR}")
|
|
||||||
set(HOSTDEPS_LIB_DIR "${DEPS_LIB_DIR}")
|
|
||||||
set(HOSTDEPS_C_COMPILER "${DEPS_C_COMPILER}")
|
|
||||||
set(HOSTDEPS_CXX_COMPILER "${DEPS_CXX_COMPILER}")
|
|
||||||
|
|
||||||
include(ExternalProject)
|
|
||||||
|
|
||||||
set(LIBUV_URL https://github.com/libuv/libuv/archive/v1.44.2.tar.gz)
|
|
||||||
set(LIBUV_SHA256 e6e2ba8b4c349a4182a33370bb9be5e23c51b32efb9b9e209d0e8556b73a48da)
|
|
||||||
|
|
||||||
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/releases/download/c-4.0.0/msgpack-c-4.0.0.tar.gz)
|
|
||||||
set(MSGPACK_SHA256 420fe35e7572f2a168d17e660ef981a589c9cbe77faa25eb34a520e1fcc032c8)
|
|
||||||
|
|
||||||
# https://github.com/LuaJIT/LuaJIT/tree/v2.1
|
|
||||||
set(LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/633f265f67f322cbe2c5fd11d3e46d968ac220f7.tar.gz)
|
|
||||||
set(LUAJIT_SHA256 2681f0a6f624a64a8dfb70a5a377d494daf38960442c547d9c468674c1afa3c2)
|
|
||||||
|
|
||||||
set(LUA_URL https://www.lua.org/ftp/lua-5.1.5.tar.gz)
|
|
||||||
set(LUA_SHA256 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333)
|
|
||||||
|
|
||||||
set(LUAROCKS_URL https://github.com/luarocks/luarocks/archive/v3.8.0.tar.gz)
|
|
||||||
set(LUAROCKS_SHA256 ab6612ca9ab87c6984871d2712d05525775e8b50172701a0a1cabddf76de2be7)
|
|
||||||
|
|
||||||
set(UNIBILIUM_URL https://github.com/neovim/unibilium/archive/92d929f.tar.gz)
|
|
||||||
set(UNIBILIUM_SHA256 29815283c654277ef77a3adcc8840db79ddbb20a0f0b0c8f648bd8cd49a02e4b)
|
|
||||||
|
|
||||||
set(LIBTERMKEY_URL https://www.leonerd.org.uk/code/libtermkey/libtermkey-0.22.tar.gz)
|
|
||||||
set(LIBTERMKEY_SHA256 6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600)
|
|
||||||
|
|
||||||
set(LIBVTERM_URL https://www.leonerd.org.uk/code/libvterm/libvterm-0.3.1.tar.gz)
|
|
||||||
set(LIBVTERM_SHA256 25a8ad9c15485368dfd0a8a9dca1aec8fea5c27da3fa74ec518d5d3787f0c397)
|
|
||||||
|
|
||||||
set(LUV_VERSION 1.44.2-1)
|
|
||||||
set(LUV_URL https://github.com/luvit/luv/archive/1.44.2-1.tar.gz)
|
|
||||||
set(LUV_SHA256 f8c69908e17ec8ab370253d1508e23deaecfc0c4752d2efb77e427e579501104)
|
|
||||||
|
|
||||||
set(LUA_COMPAT53_URL https://github.com/keplerproject/lua-compat-5.3/archive/v0.9.tar.gz)
|
|
||||||
set(LUA_COMPAT53_SHA256 ad05540d2d96a48725bb79a1def35cf6652a4e2ec26376e2617c8ce2baa6f416)
|
|
||||||
|
|
||||||
# cat.exe curl.exe curl-ca-bundle.crt diff.exe tee.exe xxd.exe
|
|
||||||
set(WINTOOLS_URL https://github.com/neovim/deps/raw/c1e7dd8de9e1b18d11dcfa0a192cd029262e5303/opt/win32tools.zip)
|
|
||||||
set(WINTOOLS_SHA256 3c4c490a3d392ceeb1347cb77cc821a31900b688a2189276d3a1131a3f21daf1)
|
|
||||||
|
|
||||||
set(WINGUI_URL https://github.com/equalsraf/neovim-qt/releases/download/v0.2.17/neovim-qt.zip)
|
|
||||||
set(WINGUI_SHA256 502e386eef677c2c2e0c11d8cbb27f3e12b4d96818369417e8da4129c4580c25)
|
|
||||||
|
|
||||||
set(WIN32YANK_X86_URL https://github.com/equalsraf/win32yank/releases/download/v0.0.4/win32yank-x86.zip)
|
|
||||||
set(WIN32YANK_X86_SHA256 62f34e5a46c5d4a7b3f3b512e1ff7b77fedd432f42581cbe825233a996eed62c)
|
|
||||||
set(WIN32YANK_X86_64_URL https://github.com/equalsraf/win32yank/releases/download/v0.0.4/win32yank-x64.zip)
|
|
||||||
set(WIN32YANK_X86_64_SHA256 33a747a92da60fb65e668edbf7661d3d902411a2d545fe9dc08623cecd142a20)
|
|
||||||
|
|
||||||
set(GETTEXT_URL https://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.1.tar.gz)
|
|
||||||
set(GETTEXT_SHA256 66415634c6e8c3fa8b71362879ec7575e27da43da562c798a8a2f223e6e47f5c)
|
|
||||||
|
|
||||||
set(LIBICONV_URL https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz)
|
|
||||||
set(LIBICONV_SHA256 ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178)
|
|
||||||
|
|
||||||
set(TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/v0.20.2.tar.gz)
|
|
||||||
set(TREESITTER_C_SHA256 af66fde03feb0df4faf03750102a0d265b007e5d957057b6b293c13116a70af2 )
|
|
||||||
|
|
||||||
set(TREESITTER_LUA_URL https://github.com/MunifTanjim/tree-sitter-lua/archive/v0.0.13.tar.gz)
|
|
||||||
set(TREESITTER_LUA_SHA256 564594fe0ffd2f2fb3578a15019b723e1bc94ac82cb6a0103a6b3b9ddcc6f315)
|
|
||||||
|
|
||||||
set(TREESITTER_VIM_URL https://github.com/vigoux/tree-sitter-viml/archive/v0.2.0.tar.gz)
|
|
||||||
set(TREESITTER_VIM_SHA256 608dcc31a7948cb66ae7f45494620e2e9face1af75598205541f80d782ec4501)
|
|
||||||
|
|
||||||
set(TREESITTER_HELP_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v1.3.0.tar.gz)
|
|
||||||
set(TREESITTER_HELP_SHA256 f33f6d49c7d71feb2fd68ef2b2684da150f9f8e486ad9726213631d673942331)
|
|
||||||
|
|
||||||
set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.20.7.tar.gz)
|
|
||||||
set(TREESITTER_SHA256 b355e968ec2d0241bbd96748e00a9038f83968f85d822ecb9940cbe4c42e182e)
|
|
||||||
|
|
||||||
if(USE_BUNDLED_UNIBILIUM)
|
|
||||||
include(BuildUnibilium)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_LIBTERMKEY)
|
|
||||||
include(BuildLibtermkey)
|
|
||||||
if(USE_BUNDLED_UNIBILIUM)
|
|
||||||
add_dependencies(libtermkey unibilium)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_LIBVTERM)
|
|
||||||
include(BuildLibvterm)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_LIBUV)
|
|
||||||
include(BuildLibuv)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_MSGPACK)
|
|
||||||
include(BuildMsgpack)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_LUAJIT)
|
|
||||||
include(BuildLuajit)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_LUA)
|
|
||||||
include(BuildLua)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_LUAROCKS)
|
|
||||||
include(BuildLuarocks)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_LUV)
|
|
||||||
include(BuildLuv)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_GETTEXT)
|
|
||||||
include(BuildGettext)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_LIBICONV)
|
|
||||||
include(BuildLibiconv)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_TS_PARSERS)
|
|
||||||
include(BuildTreesitterParsers)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_TS)
|
|
||||||
include(BuildTreesitter)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
include(GetBinaryDeps)
|
|
||||||
|
|
||||||
GetBinaryDep(TARGET wintools
|
|
||||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory . ${DEPS_INSTALL_DIR}/bin)
|
|
||||||
|
|
||||||
GetBinaryDep(TARGET wingui
|
|
||||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory bin ${DEPS_INSTALL_DIR}/bin
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory share ${DEPS_INSTALL_DIR}/share)
|
|
||||||
|
|
||||||
include(TargetArch)
|
|
||||||
GetBinaryDep(TARGET "win32yank_${TARGET_ARCH}"
|
|
||||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy win32yank.exe ${DEPS_INSTALL_DIR}/bin)
|
|
||||||
|
|
||||||
if("${TARGET_ARCH}" STREQUAL "X86_64")
|
|
||||||
set(TARGET_ARCH x64)
|
|
||||||
elseif(TARGET_ARCH STREQUAL "X86")
|
|
||||||
set(TARGET_ARCH ia32)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# clean-shared-libraries removes ${DEPS_INSTALL_DIR}/lib/nvim/parser/c.dll,
|
|
||||||
# resulting in MSVC build failure in CI.
|
|
||||||
if (MSVC)
|
|
||||||
set(ALL_DEPS ${THIRD_PARTY_DEPS})
|
|
||||||
else()
|
|
||||||
add_custom_target(clean-shared-libraries
|
|
||||||
COMMAND ${CMAKE_COMMAND}
|
|
||||||
-DREMOVE_FILE_GLOB=${DEPS_INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}*${CMAKE_SHARED_LIBRARY_SUFFIX}*
|
|
||||||
-P ${PROJECT_SOURCE_DIR}/cmake/RemoveFiles.cmake
|
|
||||||
DEPENDS ${THIRD_PARTY_DEPS}
|
|
||||||
)
|
|
||||||
set(ALL_DEPS clean-shared-libraries)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# TODO(justinmk): does anyone use this target?
|
|
||||||
add_custom_target(third-party ALL
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E touch .third-party
|
|
||||||
DEPENDS ${ALL_DEPS}
|
|
||||||
)
|
|
@@ -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,188 +0,0 @@
|
|||||||
# Luarocks recipe. Luarocks is only required when building Neovim, when
|
|
||||||
# cross compiling we still want to build for the HOST system, whenever
|
|
||||||
# writing a recipe that is meant for cross-compile, use the HOSTDEPS_* variables
|
|
||||||
# instead of DEPS_* - check the main CMakeLists.txt for a list.
|
|
||||||
#
|
|
||||||
# NOTE: LuaRocks rocks need to "DEPENDS" on the previous module, because
|
|
||||||
# running luarocks in parallel will break, e.g. when some rocks have
|
|
||||||
# the same dependency..
|
|
||||||
|
|
||||||
option(USE_BUNDLED_BUSTED "Use the bundled version of busted to run tests." ON)
|
|
||||||
|
|
||||||
# The luarocks binary location
|
|
||||||
set(LUAROCKS_BINARY ${HOSTDEPS_BIN_DIR}/luarocks)
|
|
||||||
|
|
||||||
# Arguments for calls to 'luarocks build'
|
|
||||||
if(NOT MSVC)
|
|
||||||
# In MSVC don't pass the compiler/linker to luarocks, the bundled
|
|
||||||
# version already knows, and passing them here breaks the build
|
|
||||||
set(LUAROCKS_BUILDARGS CC=${HOSTDEPS_C_COMPILER} LD=${HOSTDEPS_C_COMPILER})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Lua version, used with rocks directories.
|
|
||||||
# Defaults to 5.1 for bundled LuaJIT/Lua.
|
|
||||||
set(LUA_VERSION "5.1")
|
|
||||||
|
|
||||||
if(UNIX)
|
|
||||||
|
|
||||||
if(USE_BUNDLED_LUAJIT)
|
|
||||||
list(APPEND LUAROCKS_OPTS
|
|
||||||
--with-lua=${HOSTDEPS_INSTALL_DIR}
|
|
||||||
--with-lua-include=${HOSTDEPS_INSTALL_DIR}/include/luajit-2.1
|
|
||||||
--with-lua-interpreter=luajit)
|
|
||||||
elseif(USE_BUNDLED_LUA)
|
|
||||||
list(APPEND LUAROCKS_OPTS
|
|
||||||
--with-lua=${HOSTDEPS_INSTALL_DIR})
|
|
||||||
else()
|
|
||||||
find_package(LuaJit)
|
|
||||||
if(LUAJIT_FOUND)
|
|
||||||
list(APPEND LUAROCKS_OPTS
|
|
||||||
--with-lua-include=${LUAJIT_INCLUDE_DIRS}
|
|
||||||
--with-lua-interpreter=luajit)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Get LUA_VERSION used with rocks output.
|
|
||||||
if(LUAJIT_FOUND)
|
|
||||||
set(LUA_EXE "luajit")
|
|
||||||
else()
|
|
||||||
set(LUA_EXE "lua")
|
|
||||||
endif()
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${LUA_EXE} -e "print(string.sub(_VERSION, 5))"
|
|
||||||
OUTPUT_VARIABLE LUA_VERSION
|
|
||||||
ERROR_VARIABLE ERR
|
|
||||||
RESULT_VARIABLE RES)
|
|
||||||
if(NOT RES EQUAL 0)
|
|
||||||
message(FATAL_ERROR "Could not get LUA_VERSION with ${LUA_EXE}: ${ERR}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(LUAROCKS_CONFIGURE_COMMAND ${DEPS_BUILD_DIR}/src/luarocks/configure
|
|
||||||
--prefix=${HOSTDEPS_INSTALL_DIR} --force-config ${LUAROCKS_OPTS})
|
|
||||||
set(LUAROCKS_INSTALL_COMMAND ${MAKE_PRG} -j1 bootstrap)
|
|
||||||
elseif(MSVC OR MINGW)
|
|
||||||
|
|
||||||
if(MINGW)
|
|
||||||
set(COMPILER_FLAG /MW)
|
|
||||||
elseif(MSVC)
|
|
||||||
set(COMPILER_FLAG /MSVC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Ignore USE_BUNDLED_LUAJIT - always ON for native Win32
|
|
||||||
set(LUAROCKS_INSTALL_COMMAND install.bat /FORCECONFIG /NOREG /NOADMIN /Q /F
|
|
||||||
/LUA ${DEPS_INSTALL_DIR}
|
|
||||||
/LIB ${DEPS_LIB_DIR}
|
|
||||||
/BIN ${DEPS_BIN_DIR}
|
|
||||||
/INC ${DEPS_INSTALL_DIR}/include/luajit-2.1
|
|
||||||
/P ${DEPS_INSTALL_DIR}/luarocks /TREE ${DEPS_INSTALL_DIR}
|
|
||||||
/SCRIPTS ${DEPS_BIN_DIR}
|
|
||||||
/CMOD ${DEPS_BIN_DIR}
|
|
||||||
${COMPILER_FLAG}
|
|
||||||
/LUAMOD ${DEPS_BIN_DIR}/lua)
|
|
||||||
|
|
||||||
set(LUAROCKS_BINARY ${DEPS_INSTALL_DIR}/luarocks/luarocks.bat)
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "Trying to build luarocks in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
ExternalProject_Add(luarocks
|
|
||||||
PREFIX ${DEPS_BUILD_DIR}
|
|
||||||
URL ${LUAROCKS_URL}
|
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luarocks
|
|
||||||
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
|
||||||
-DPREFIX=${DEPS_BUILD_DIR}
|
|
||||||
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/luarocks
|
|
||||||
-DURL=${LUAROCKS_URL}
|
|
||||||
-DEXPECTED_SHA256=${LUAROCKS_SHA256}
|
|
||||||
-DTARGET=luarocks
|
|
||||||
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
|
||||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
|
||||||
BUILD_IN_SOURCE 1
|
|
||||||
CONFIGURE_COMMAND "${LUAROCKS_CONFIGURE_COMMAND}"
|
|
||||||
BUILD_COMMAND ""
|
|
||||||
INSTALL_COMMAND "${LUAROCKS_INSTALL_COMMAND}")
|
|
||||||
|
|
||||||
list(APPEND THIRD_PARTY_DEPS luarocks)
|
|
||||||
|
|
||||||
if(USE_BUNDLED_LUAJIT)
|
|
||||||
add_dependencies(luarocks luajit)
|
|
||||||
elseif(USE_BUNDLED_LUA)
|
|
||||||
add_dependencies(luarocks lua)
|
|
||||||
endif()
|
|
||||||
set(ROCKS_DIR ${HOSTDEPS_LIB_DIR}/luarocks/rocks-${LUA_VERSION})
|
|
||||||
|
|
||||||
# mpack
|
|
||||||
add_custom_command(OUTPUT ${ROCKS_DIR}/mpack
|
|
||||||
COMMAND ${LUAROCKS_BINARY} build mpack 1.0.8-0 ${LUAROCKS_BUILDARGS}
|
|
||||||
DEPENDS luarocks)
|
|
||||||
add_custom_target(mpack DEPENDS ${ROCKS_DIR}/mpack)
|
|
||||||
list(APPEND THIRD_PARTY_DEPS mpack)
|
|
||||||
|
|
||||||
# lpeg
|
|
||||||
add_custom_command(OUTPUT ${ROCKS_DIR}/lpeg
|
|
||||||
COMMAND ${LUAROCKS_BINARY} build lpeg 1.0.2-1 ${LUAROCKS_BUILDARGS}
|
|
||||||
DEPENDS mpack)
|
|
||||||
add_custom_target(lpeg DEPENDS ${ROCKS_DIR}/lpeg)
|
|
||||||
list(APPEND THIRD_PARTY_DEPS lpeg)
|
|
||||||
|
|
||||||
if((NOT USE_BUNDLED_LUAJIT) AND USE_BUNDLED_LUA)
|
|
||||||
# luabitop
|
|
||||||
add_custom_command(OUTPUT ${ROCKS_DIR}/luabitop
|
|
||||||
COMMAND ${LUAROCKS_BINARY} build luabitop 1.0.2-3 ${LUAROCKS_BUILDARGS}
|
|
||||||
DEPENDS lpeg)
|
|
||||||
add_custom_target(luabitop DEPENDS ${ROCKS_DIR}/luabitop)
|
|
||||||
list(APPEND THIRD_PARTY_DEPS luabitop)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_BUSTED)
|
|
||||||
if((NOT USE_BUNDLED_LUAJIT) AND USE_BUNDLED_LUA)
|
|
||||||
set(PENLIGHT_DEPENDS luabitop)
|
|
||||||
else()
|
|
||||||
set(PENLIGHT_DEPENDS lpeg)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# penlight
|
|
||||||
add_custom_command(OUTPUT ${ROCKS_DIR}/penlight
|
|
||||||
COMMAND ${LUAROCKS_BINARY} build penlight 1.5.4-1 ${LUAROCKS_BUILDARGS}
|
|
||||||
DEPENDS ${PENLIGHT_DEPENDS})
|
|
||||||
add_custom_target(penlight DEPENDS ${ROCKS_DIR}/penlight)
|
|
||||||
|
|
||||||
# busted
|
|
||||||
if(WIN32)
|
|
||||||
set(BUSTED_EXE "${HOSTDEPS_BIN_DIR}/busted.bat")
|
|
||||||
set(LUACHECK_EXE "${HOSTDEPS_BIN_DIR}/luacheck.bat")
|
|
||||||
else()
|
|
||||||
set(BUSTED_EXE "${HOSTDEPS_BIN_DIR}/busted")
|
|
||||||
set(LUACHECK_EXE "${HOSTDEPS_BIN_DIR}/luacheck")
|
|
||||||
endif()
|
|
||||||
add_custom_command(OUTPUT ${BUSTED_EXE}
|
|
||||||
COMMAND ${LUAROCKS_BINARY} build busted 2.0.0 ${LUAROCKS_BUILDARGS}
|
|
||||||
DEPENDS penlight)
|
|
||||||
add_custom_target(busted DEPENDS ${BUSTED_EXE})
|
|
||||||
|
|
||||||
# luacheck
|
|
||||||
add_custom_command(OUTPUT ${LUACHECK_EXE}
|
|
||||||
COMMAND ${LUAROCKS_BINARY} build luacheck 0.23.0-1 ${LUAROCKS_BUILDARGS}
|
|
||||||
DEPENDS busted)
|
|
||||||
add_custom_target(luacheck DEPENDS ${LUACHECK_EXE})
|
|
||||||
|
|
||||||
# luv
|
|
||||||
set(LUV_DEPS luacheck)
|
|
||||||
if(USE_BUNDLED_LUV)
|
|
||||||
set(NVIM_CLIENT_DEPS luacheck luv-static lua-compat-5.3)
|
|
||||||
else()
|
|
||||||
add_custom_command(OUTPUT ${ROCKS_DIR}/luv
|
|
||||||
COMMAND ${LUAROCKS_BINARY} build luv ${LUV_VERSION} ${LUAROCKS_BUILDARGS}
|
|
||||||
DEPENDS luacheck)
|
|
||||||
add_custom_target(luv DEPENDS ${ROCKS_DIR}/luv)
|
|
||||||
set(NVIM_CLIENT_DEPS luv)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# nvim-client: https://github.com/neovim/lua-client
|
|
||||||
add_custom_command(OUTPUT ${ROCKS_DIR}/nvim-client
|
|
||||||
COMMAND ${LUAROCKS_BINARY} build nvim-client 0.2.4-1 ${LUAROCKS_BUILDARGS}
|
|
||||||
DEPENDS ${NVIM_CLIENT_DEPS})
|
|
||||||
add_custom_target(nvim-client DEPENDS ${ROCKS_DIR}/nvim-client)
|
|
||||||
|
|
||||||
list(APPEND THIRD_PARTY_DEPS busted luacheck nvim-client)
|
|
||||||
endif()
|
|
@@ -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,329 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
|
||||||
project(gettext C)
|
|
||||||
|
|
||||||
# Adds PREFIX to each item in LIST
|
|
||||||
macro(PREFIX_LIST_ITEMS LIST PREFIX)
|
|
||||||
string(REPLACE ";" ";${PREFIX}" ${LIST} ";${${LIST}}")
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
file(READ gettext-runtime/config.h.in CONFIG_CONTENT)
|
|
||||||
string(REPLACE "#undef HAVE_GETCWD" "#define HAVE_GETCWD 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_LONG_LONG_INT" "#define HAVE_LONG_LONG_INT 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_ICONV_H" "#define HAVE_ICONV_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_ICONV" "#define HAVE_ICONV 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef ICONV_CONST" "#define ICONV_CONST const" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef uintmax_t" "
|
|
||||||
#if _WIN64
|
|
||||||
# define intmax_t long long
|
|
||||||
# define uintmax_t unsigned long long
|
|
||||||
#elif _WIN32
|
|
||||||
# define intmax_t long
|
|
||||||
# define uintmax_t unsigned long
|
|
||||||
#endif"
|
|
||||||
CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime/config.h ${CONFIG_CONTENT})
|
|
||||||
|
|
||||||
set(HAVE_NEWLOCALE 0)
|
|
||||||
set(HAVE_POSIX_PRINTF 0)
|
|
||||||
set(HAVE_SNPRINTF 0)
|
|
||||||
set(HAVE_ASPRINTF 0)
|
|
||||||
set(HAVE_WPRINTF 0)
|
|
||||||
set(HAVE_NAMELESS_LOCALES 0)
|
|
||||||
set(HAVE_LONG_LONG_INT 1)
|
|
||||||
configure_file(gettext-runtime/intl/libgnuintl.in.h
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime/intl/libgnuintl.h)
|
|
||||||
|
|
||||||
set(LOCALDIR "gettext")
|
|
||||||
set(LIBDIR "gettext")
|
|
||||||
set(PKGDATADIR "gettext")
|
|
||||||
set(PACKAGE_SUFFIX "gettext")
|
|
||||||
add_definitions(-DLOCALEDIR=\"${LOCALDIR}\"
|
|
||||||
-DLOCALE_ALIAS_PATH=\"${LOCALDIR}\"
|
|
||||||
-DLIBDIR=\"${LOCALDIR}\"
|
|
||||||
-DINSTALLDIR=\"${LOCALDIR}\"
|
|
||||||
-DEXEEXT=\".exe\"
|
|
||||||
-DLOCALEDIR=\"${LOCALDIR}\"
|
|
||||||
-DLIBDIR=\"${LIBDIR}\"
|
|
||||||
-DPACKAGE_SUFFIX=\"${PACKAGE_SUFFIX}\"
|
|
||||||
-DGETTEXTDATADIR=\"${PKGDATADIR}\"
|
|
||||||
-DBISON_LOCALEDIR=\"${LOCALDIR}\"
|
|
||||||
-DHAVE_CONFIG_H)
|
|
||||||
|
|
||||||
set(libintl_SOURCES
|
|
||||||
bindtextdom.c dcgettext.c dcigettext.c dcngettext.c dgettext.c dngettext.c
|
|
||||||
explodename.c finddomain.c gettext.c hash-string.c intl-compat.c l10nflist.c
|
|
||||||
langprefs.c loadmsgcat.c localcharset.c localealias.c localename-table.c
|
|
||||||
localename.c lock.c log.c ngettext.c osdep.c
|
|
||||||
plural-exp.c plural.c printf.c relocatable.c setlocale.c textdomain.c
|
|
||||||
threadlib.c version.c xsize.c)
|
|
||||||
|
|
||||||
PREFIX_LIST_ITEMS(libintl_SOURCES "gettext-runtime/intl/")
|
|
||||||
|
|
||||||
add_library(libintl ${libintl_SOURCES})
|
|
||||||
target_link_libraries(libintl ${LIBICONV_LIBRARIES})
|
|
||||||
set_property(TARGET libintl APPEND PROPERTY INCLUDE_DIRECTORIES
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime/intl
|
|
||||||
${LIBICONV_INCLUDE_DIRS})
|
|
||||||
set_property(TARGET libintl APPEND PROPERTY COMPILE_DEFINITIONS
|
|
||||||
BUILDING_LIBINTL
|
|
||||||
IN_LIBINTL
|
|
||||||
ENABLE_RELOCATABLE=1
|
|
||||||
IN_LIBRARY
|
|
||||||
NO_XMALLOC
|
|
||||||
set_relocation_prefix=libintl_set_relocation_prefix
|
|
||||||
relocate=libintl_relocate
|
|
||||||
HAVE_CONFIG_H
|
|
||||||
_CRT_SECURE_NO_WARNINGS)
|
|
||||||
|
|
||||||
|
|
||||||
file(READ gettext-tools/config.h.in CONFIG_CONTENT)
|
|
||||||
string(REPLACE "#undef FLEXIBLE_ARRAY_MEMBER" "#define FLEXIBLE_ARRAY_MEMBER 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "__declspec (dllimport)" "" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef ENDIANNESS" "#define ENDIANNESS 0" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef GNULIB_FWRITEERROR" "#define GNULIB_FWRITEERROR 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_DECL_STRERROR_R" "#define HAVE_DECL_STRERROR_R 0" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_DUP2" "#define HAVE_DUP2 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_ICONV_H" "#define HAVE_ICONV_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_ICONV" "#define HAVE_ICONV 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_LIBUNISTRING" "#define HAVE_LIBUNISTRING 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_STDINT_H_WITH_UINTMAX" "#define HAVE_STDINT_H_WITH_UINTMAX 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_STDINT_H" "#define HAVE_STDINT_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_LONG_LONG_INT" "#define HAVE_LONG_LONG_INT 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_STRING_H" "#define HAVE_STRING_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_SYS_TIMEB_H" "#define HAVE_SYS_TIMEB_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE__FTIME" "#define HAVE__FTIME 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_FLOAT_H" "#define HAVE_FLOAT_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef ICONV_CONST" "#define ICONV_CONST const" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef PACKAGE" "#define PACKAGE \"gettext\"\n#define gettext_VERSION" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef VERSION" "#define VERSION \"\"" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef mode_t" "#define mode_t int" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef pid_t" "#define pid_t int" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef restrict" "#define restrict __restrict" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef ssize_t" "#include <BaseTsd.h>\n#define ssize_t SSIZE_T" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef uid_t" "#define uid_t int" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
string(REPLACE "#undef HAVE_DECL___ARGV" "#define HAVE_DECL___ARGV 1" CONFIG_CONTENT ${CONFIG_CONTENT})
|
|
||||||
set(CONFIG_CONTENT "${CONFIG_CONTENT}\n#define isatty libtextstyle_isatty")
|
|
||||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gettext-tools/config.h ${CONFIG_CONTENT})
|
|
||||||
|
|
||||||
set(libgettextsrc_COMMON_SOURCE
|
|
||||||
message.c po-error.c po-xerror.c read-catalog-abstract.c po-lex.c
|
|
||||||
po-gram-gen.c po-charset.c read-po.c read-properties.c read-stringtable.c
|
|
||||||
open-catalog.c dir-list.c str-list.c)
|
|
||||||
|
|
||||||
set(libgettextsrc_FORMAT_SOURCE
|
|
||||||
format.c format-invalid.h format-c.c format-c-parse.h format-sh.c
|
|
||||||
format-python.c format-python-brace.c format-lisp.c format-elisp.c
|
|
||||||
format-librep.c format-scheme.c format-java.c format-csharp.c format-awk.c
|
|
||||||
format-pascal.c format-ycp.c format-tcl.c format-perl.c format-perl-brace.c
|
|
||||||
format-php.c format-gcc-internal.c format-gfc-internal.c format-qt.c
|
|
||||||
format-qt-plural.c format-kde.c format-kde-kuit.c format-boost.c format-lua.c
|
|
||||||
format-javascript.c)
|
|
||||||
|
|
||||||
set(libgettextsrc_SOURCES
|
|
||||||
${libgettextsrc_COMMON_SOURCE} read-catalog.c
|
|
||||||
write-catalog.c write-properties.c write-stringtable.c write-po.c
|
|
||||||
msgl-ascii.c msgl-iconv.c msgl-equal.c msgl-cat.c msgl-header.c msgl-english.c
|
|
||||||
msgl-check.c file-list.c msgl-charset.c po-time.c plural-exp.c plural-eval.c
|
|
||||||
plural-table.c quote.h sentence.h sentence.c
|
|
||||||
${libgettextsrc_FORMAT_SOURCE}
|
|
||||||
read-desktop.c locating-rule.c its.c search-path.c)
|
|
||||||
PREFIX_LIST_ITEMS(libgettextsrc_SOURCES "gettext-tools/src/")
|
|
||||||
|
|
||||||
set(GLIBC_SOURCE
|
|
||||||
uniname/uniname.c javaexec.c unsetenv.c classpath.c setenv.c xsetenv.c
|
|
||||||
sh-quote.c execute.c javaversion.c csharpcomp.c csharpexec.c javacomp.c
|
|
||||||
gettimeofday.c getdtablesize.c fcntl.c dup-safer-flag.c cloexec.c
|
|
||||||
fd-safer-flag.c fd-safer.c pipe2.c pipe2-safer.c spawn-pipe.c xmemdup0.c
|
|
||||||
secure_getenv.c tmpdir.c tempname.c mkdtemp.c fnmatch.c clean-temp.c
|
|
||||||
wait-process.c waitpid.c getdelim.c getline.c sigprocmask.c sigaction.c
|
|
||||||
addext.c argmatch.c backupfile.c basename.c c-strcasecmp.c c-strncasecmp.c
|
|
||||||
c-strstr.c closeout.c concat-filename.c error-progname.c error.c exitfail.c
|
|
||||||
fstrcmp.c full-write.c fwriteerror.c getopt.c getopt1.c hash.c libxml/buf.c
|
|
||||||
localcharset.c malloca.c mbchar.c mbslen.c mbsstr.c mbswidth.c obstack.c
|
|
||||||
progname.c printf-args.c printf-parse.c propername.c quotearg.c rawmemchr.c
|
|
||||||
safe-read.c safe-write.c stpcpy.c stpncpy.c strchrnul.c striconv.c
|
|
||||||
striconveh.c striconveha.c strnlen1.c trim.c gcd.c gl_linkedhash_list.c
|
|
||||||
uniconv/u8-conv-from-enc.c unictype/ctype_space.c unilbrk/lbrktables.c
|
|
||||||
unilbrk/u8-possible-linebreaks.c unilbrk/u8-width-linebreaks.c
|
|
||||||
unilbrk/ulc-common.c unilbrk/ulc-width-linebreaks.c unistr/u16-mbtouc-aux.c
|
|
||||||
unistr/u16-mbtouc.c unistr/u8-check.c unistr/u8-mblen.c
|
|
||||||
unistr/u8-mbtouc-aux.c unistr/u8-mbtouc-unsafe-aux.c
|
|
||||||
unistr/u8-mbtouc-unsafe.c unistr/u8-mbtouc.c unistr/u8-mbtoucr.c
|
|
||||||
unistr/u8-prev.c unistr/u8-uctomb-aux.c unistr/u8-uctomb.c uniwidth/width.c
|
|
||||||
vasnprintf.c vasprintf.c wcwidth.c xasprintf.c xconcat-filename.c xerror.c
|
|
||||||
xmalloc.c xstrdup.c xstriconv.c xstriconveh.c xvasprintf.c
|
|
||||||
libxml/DOCBparser.c libxml/HTMLparser.c libxml/HTMLtree.c libxml/SAX.c
|
|
||||||
libxml/SAX2.c libxml/c14n.c libxml/catalog.c libxml/chvalid.c
|
|
||||||
libxml/debugXML.c libxml/dict.c libxml/encoding.c libxml/entities.c
|
|
||||||
libxml/error.c libxml/globals.c libxml/hash.c libxml/legacy.c libxml/list.c
|
|
||||||
libxml/nanoftp.c libxml/nanohttp.c libxml/parser.c libxml/parserInternals.c
|
|
||||||
libxml/pattern.c libxml/relaxng.c libxml/schematron.c libxml/threads.c
|
|
||||||
libxml/tree.c libxml/trionan.c libxml/uri.c libxml/valid.c libxml/xinclude.c
|
|
||||||
libxml/xlink.c libxml/xmlIO.c libxml/xmlmemory.c libxml/xmlmodule.c
|
|
||||||
libxml/xmlreader.c libxml/xmlregexp.c libxml/xmlsave.c libxml/xmlschemas.c
|
|
||||||
libxml/xmlschemastypes.c libxml/xmlstring.c libxml/xmlunicode.c
|
|
||||||
libxml/xmlwriter.c libxml/xpath.c libxml/xpointer.c fatal-signal.c
|
|
||||||
copy-file.c read-file.c ftello.c utime.c gettime.c utimens.c)
|
|
||||||
PREFIX_LIST_ITEMS(GLIBC_SOURCE "gettext-tools/gnulib-lib/")
|
|
||||||
|
|
||||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gettext-tools/gnulib-lib/configmake.h "#define PKGDATADIR \"gettext\"")
|
|
||||||
|
|
||||||
set(LIBGLIB_SOURCES
|
|
||||||
ghash.c glist.c gmessages.c gprimes.c gstrfuncs.c gstring.c)
|
|
||||||
PREFIX_LIST_ITEMS(LIBGLIB_SOURCES "libtextstyle/lib/glib/")
|
|
||||||
|
|
||||||
set(LIBTEXTSTYLE_SOURCE
|
|
||||||
gl_array_list.h gl_array_list.c binary-io.h
|
|
||||||
binary-io.c c-ctype.h c-ctype.c c-strcase.h c-strcasecmp.c
|
|
||||||
c-strncasecmp.c concat-filename.c dirname-lgpl.c
|
|
||||||
basename-lgpl.c stripslash.c exitfail.c fatal-signal.h
|
|
||||||
fatal-signal.c fd-hook.c fd-ostream.c file-ostream.c
|
|
||||||
full-write.h full-write.c getprogname.h getprogname.c
|
|
||||||
gettext.h hash.h hash.c html-ostream.c html-styled-ostream.c
|
|
||||||
iconv-ostream.c gl_list.h gl_list.c math.c memory-ostream.c
|
|
||||||
minmax.h noop-styled-ostream.c ostream.c safe-read.c
|
|
||||||
safe-write.c sig-handler.c size_max.h styled-ostream.c
|
|
||||||
term-ostream.c term-style-control.c term-styled-ostream.c
|
|
||||||
unistd.c xalloc.h xmalloc.c xstrdup.c
|
|
||||||
xconcat-filename.c gl_xlist.h gl_xlist.c xsize.h xsize.c
|
|
||||||
xvasprintf.h xvasprintf.c xasprintf.c color.h color.c misc.h
|
|
||||||
misc.c version.c isatty.c fsync.c tparm.c tputs.c)
|
|
||||||
PREFIX_LIST_ITEMS(LIBTEXTSTYLE_SOURCE "libtextstyle/lib/")
|
|
||||||
|
|
||||||
configure_file(
|
|
||||||
libtextstyle/lib/stdbool.mini.h
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/libtextstyle/lib/textstyle/stdbool.h
|
|
||||||
COPYONLY)
|
|
||||||
|
|
||||||
set(LIBCROCO_SOURCES
|
|
||||||
cr-additional-sel.c cr-attr-sel.c cr-cascade.c cr-declaration.c
|
|
||||||
cr-doc-handler.c cr-enc-handler.c cr-fonts.c cr-input.c cr-num.c
|
|
||||||
cr-om-parser.c cr-parser.c cr-parsing-location.c cr-prop-list.c cr-pseudo.c
|
|
||||||
cr-rgb.c cr-sel-eng.c cr-selector.c cr-simple-sel.c cr-statement.c
|
|
||||||
cr-string.c cr-style.c cr-stylesheet.c cr-term.c cr-tknzr.c cr-token.c
|
|
||||||
cr-utils.c)
|
|
||||||
PREFIX_LIST_ITEMS(LIBCROCO_SOURCES "libtextstyle/lib/libcroco/")
|
|
||||||
|
|
||||||
set(libgettextsrc_SOURCES
|
|
||||||
${libgettextsrc_SOURCES} ${GLIBC_SOURCE} ${LIBGLIB_SOURCES}
|
|
||||||
${LIBTEXTSTYLE_SOURCE} ${LIBCROCO_SOURCES})
|
|
||||||
|
|
||||||
macro(CONFIGURE_HEADER_FILES HEADER_TEMPLATES_PATH)
|
|
||||||
set(HEADER_TEMPLATES_ABS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_TEMPLATES_PATH}")
|
|
||||||
file(GLOB_RECURSE HEADER_TEMPLATES "${HEADER_TEMPLATES_ABS_PATH}/*.in.h")
|
|
||||||
list(REMOVE_ITEM HEADER_TEMPLATES "${HEADER_TEMPLATES_ABS_PATH}/stdint.in.h")
|
|
||||||
list(REMOVE_ITEM HEADER_TEMPLATES "${HEADER_TEMPLATES_ABS_PATH}/wchar.in.h")
|
|
||||||
foreach(HEADER_TEMPLATE ${HEADER_TEMPLATES})
|
|
||||||
file(READ ${HEADER_TEMPLATE} HEADER_CONTENT)
|
|
||||||
string(REPLACE "/* The definition of _GL_ARG_NONNULL is copied here. */" "#include \"arg-nonnull.h\"" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "/* The definition of _GL_WARN_ON_USE is copied here. */" "#include \"warn-on-use.h\"" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */" "#include \"c++defs.h\"" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@GNULIB_LSTAT@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@GNULIB_MBSINIT@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@GNULIB_SIGACTION@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@GNULIB_SIGPROCMASK@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@GNULIB_STPCPY@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@GNULIB_STPNCPY@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@GNULIB_STRCHRNUL@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@HAVE_ISWCNTRL@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@HAVE_WCTYPE_T@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@HAVE_STRUCT_TIMEVAL@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@HAVE_WINSOCK2_H@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@DLL_VARIABLE@" "" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@HAVE_NEWLOCALE@" "0" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@PRAGMA_COLUMNS@" "" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "#if @GNULIB_UTIME@" "#if 1\n#define utime gl_utime" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@HAVE_UTIME@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
string(REPLACE "@HAVE_LONG_LONG_INT@" "1" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
|
|
||||||
string(REGEX REPLACE "^${HEADER_TEMPLATES_ABS_PATH}/" "" HEADER_PATH "${HEADER_TEMPLATE}")
|
|
||||||
string(REPLACE ".in" "" HEADER_PATH ${HEADER_PATH})
|
|
||||||
string(REPLACE "_" "/" HEADER_PATH ${HEADER_PATH})
|
|
||||||
# find_file will create a cache entry for the variable
|
|
||||||
# SYSTEM_HEADER, so reset it before each call
|
|
||||||
set(SYSTEM_HEADER "SYSTEM_HEADER-NOTFOUND")
|
|
||||||
find_file(SYSTEM_HEADER ${HEADER_PATH} PATHS "${LIBICONV_INCLUDE_DIRS}")
|
|
||||||
if(SYSTEM_HEADER)
|
|
||||||
# Gnulib uses #include_next to extend system header files,
|
|
||||||
# but MSVC doesn't support it, so a regular include directive
|
|
||||||
# with a relative path is used instead
|
|
||||||
string(REGEX REPLACE ".*/(.*/${HEADER_PATH})" "../\\1"
|
|
||||||
INCLUDE_PATH "${SYSTEM_HEADER}")
|
|
||||||
string(REGEX REPLACE "@INCLUDE_NEXT[^@]*@ @NEXT_[^@\n]+@"
|
|
||||||
"include <${INCLUDE_PATH}>" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Default any remaining template variables to 0
|
|
||||||
string(REGEX REPLACE "@[^@\n]+@" "0" HEADER_CONTENT "${HEADER_CONTENT}")
|
|
||||||
|
|
||||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${HEADER_TEMPLATES_PATH}/${HEADER_PATH}" "${HEADER_CONTENT}")
|
|
||||||
endforeach()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
CONFIGURE_HEADER_FILES("gettext-tools/gnulib-lib")
|
|
||||||
CONFIGURE_HEADER_FILES("libtextstyle/lib")
|
|
||||||
|
|
||||||
add_library(libgettextsrc ${libgettextsrc_SOURCES})
|
|
||||||
target_link_libraries(libgettextsrc ${LIBICONV_LIBRARIES})
|
|
||||||
set_property(TARGET libgettextsrc APPEND PROPERTY COMPILE_DEFINITIONS
|
|
||||||
LIBTEXTSTYLE_DLL_VARIABLE=)
|
|
||||||
|
|
||||||
set(msgmerge_SOURCES
|
|
||||||
msgmerge.c msgl-fsearch.c lang-table.c plural-count.c)
|
|
||||||
PREFIX_LIST_ITEMS(msgmerge_SOURCES "gettext-tools/src/")
|
|
||||||
|
|
||||||
add_executable(msgmerge ${msgmerge_SOURCES})
|
|
||||||
target_link_libraries(msgmerge libgettextsrc)
|
|
||||||
add_dependencies(msgmerge libgettextsrc libintl)
|
|
||||||
|
|
||||||
set(msgfmt_SOURCES
|
|
||||||
msgfmt.c write-mo.c write-java.c write-csharp.c write-resources.c write-tcl.c
|
|
||||||
write-qt.c write-desktop.c write-xml.c
|
|
||||||
../../gettext-runtime/intl/hash-string.c)
|
|
||||||
PREFIX_LIST_ITEMS(msgfmt_SOURCES "gettext-tools/src/")
|
|
||||||
|
|
||||||
add_executable(msgfmt ${msgfmt_SOURCES})
|
|
||||||
target_link_libraries(msgfmt libgettextsrc)
|
|
||||||
add_dependencies(msgfmt libgettextsrc libintl)
|
|
||||||
|
|
||||||
set(xgettext_SOURCES
|
|
||||||
xgettext.c xg-pos.c xg-encoding.c xg-mixed-string.c xg-arglist-context.c
|
|
||||||
xg-arglist-callshape.c xg-arglist-parser.c xg-message.c x-c.c x-po.c x-sh.c
|
|
||||||
x-python.c x-lisp.c x-elisp.c x-librep.c x-scheme.c x-smalltalk.c x-java.c
|
|
||||||
x-csharp.c x-awk.c x-ycp.c x-tcl.c x-perl.c x-php.c x-rst.c x-lua.c
|
|
||||||
x-javascript.c x-vala.c x-desktop.c)
|
|
||||||
PREFIX_LIST_ITEMS(xgettext_SOURCES "gettext-tools/src/")
|
|
||||||
|
|
||||||
add_executable(xgettext ${xgettext_SOURCES})
|
|
||||||
target_link_libraries(xgettext libgettextsrc)
|
|
||||||
add_dependencies(xgettext libgettextsrc libintl)
|
|
||||||
|
|
||||||
set_property(TARGET msgmerge msgfmt xgettext libgettextsrc APPEND PROPERTY
|
|
||||||
INCLUDE_DIRECTORIES
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/gettext-runtime/intl
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/gettext-tools/libgettextpo
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/gettext-tools/gnulib-lib
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/gettext-tools/gnulib-lib/libcroco
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/build-aux/snippet
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/libtextstyle/lib
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/libtextstyle/lib/libcroco
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime/intl
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/gettext-tools
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/gettext-tools/gnulib-lib
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/libtextstyle/lib
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/libtextstyle/lib/textstyle
|
|
||||||
${LIBICONV_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
|
||||||
|
|
||||||
install(FILES
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime/intl/libgnuintl.h
|
|
||||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
||||||
RENAME libintl.h)
|
|
||||||
|
|
||||||
install(TARGETS libintl msgmerge msgfmt xgettext
|
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
||||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
@@ -1,21 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
|
||||||
project(tree-sitter LANGUAGES C)
|
|
||||||
|
|
||||||
file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/lib/src/*.c)
|
|
||||||
foreach(sfile ${SRC_FILES})
|
|
||||||
get_filename_component(f ${sfile} NAME)
|
|
||||||
if(${f} MATCHES "lib.c$")
|
|
||||||
list(REMOVE_ITEM SRC_FILES ${sfile})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
include_directories(${PROJECT_SOURCE_DIR}/lib/include)
|
|
||||||
add_library(tree-sitter ${SRC_FILES})
|
|
||||||
|
|
||||||
install(FILES
|
|
||||||
lib/include/tree_sitter/api.h
|
|
||||||
lib/include/tree_sitter/parser.h
|
|
||||||
DESTINATION include/tree_sitter)
|
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
|
||||||
install(TARGETS tree-sitter
|
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
@@ -1,21 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
|
||||||
project(parser C)
|
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 99)
|
|
||||||
file(GLOB source_files src/*.c)
|
|
||||||
|
|
||||||
add_library(parser
|
|
||||||
MODULE
|
|
||||||
${source_files}
|
|
||||||
)
|
|
||||||
set_target_properties(
|
|
||||||
parser
|
|
||||||
PROPERTIES
|
|
||||||
POSITION_INDEPENDENT_CODE ON
|
|
||||||
OUTPUT_NAME ${PARSERLANG}
|
|
||||||
PREFIX ""
|
|
||||||
)
|
|
||||||
|
|
||||||
include_directories(src)
|
|
||||||
|
|
||||||
install(TARGETS parser LIBRARY DESTINATION lib/nvim/parser)
|
|
@@ -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,64 +0,0 @@
|
|||||||
set(CPACK_PACKAGE_NAME "Neovim")
|
|
||||||
set(CPACK_PACKAGE_VENDOR "neovim.io")
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME "nvim")
|
|
||||||
|
|
||||||
# From the GitHub About section
|
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Vim-fork focused on extensibility and usability.")
|
|
||||||
|
|
||||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
|
|
||||||
|
|
||||||
# Pull the versions defined with the top level CMakeLists.txt
|
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR ${NVIM_VERSION_MAJOR})
|
|
||||||
set(CPACK_PACKAGE_VERSION_MINOR ${NVIM_VERSION_MINOR})
|
|
||||||
set(CPACK_PACKAGE_VERSION_PATCH ${NVIM_VERSION_PATCH})
|
|
||||||
|
|
||||||
# CPACK_VERBATIM_VARIABLES ensures that the variables prefixed with *CPACK_*
|
|
||||||
# are correctly passed to the cpack program.
|
|
||||||
# This should always be set to true.
|
|
||||||
set(CPACK_VERBATIM_VARIABLES TRUE)
|
|
||||||
|
|
||||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
|
|
||||||
set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)
|
|
||||||
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME "nvim-win64")
|
|
||||||
set(CPACK_GENERATOR ZIP WIX)
|
|
||||||
|
|
||||||
# WIX
|
|
||||||
# CPACK_WIX_UPGRADE_GUID should be set, but should never change.
|
|
||||||
# CPACK_WIX_PRODUCT_GUID should not be set (leave as default to auto-generate).
|
|
||||||
|
|
||||||
# The following guid is just a randomly generated guid that's been pasted here.
|
|
||||||
# It has no special meaning other than to supply it to WIX.
|
|
||||||
set(CPACK_WIX_UPGRADE_GUID "207A1A70-7B0C-418A-A153-CA6883E38F4D")
|
|
||||||
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.ico)
|
|
||||||
|
|
||||||
# We use a wix patch to add further options to the installer. At present, it's just to add neovim to the path
|
|
||||||
# on installation, however, it can be extended.
|
|
||||||
# See: https://cmake.org/cmake/help/v3.7/module/CPackWIX.html#variable:CPACK_WIX_PATCH_FILE
|
|
||||||
list(APPEND CPACK_WIX_EXTENSIONS WixUtilExtension)
|
|
||||||
list(APPEND CPACK_WIX_PATCH_FILE ${CMAKE_CURRENT_LIST_DIR}/WixPatch.xml)
|
|
||||||
elseif(APPLE)
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME "nvim-macos")
|
|
||||||
set(CPACK_GENERATOR TGZ)
|
|
||||||
set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.icns)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME "nvim-linux64")
|
|
||||||
set(CPACK_GENERATOR TGZ DEB)
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_NAME "Neovim") # required
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Neovim.io") # required
|
|
||||||
|
|
||||||
# Automatically compute required shared lib dependencies.
|
|
||||||
# Unfortunately, you "just need to know" that this has a hidden
|
|
||||||
# dependency on dpkg-shlibdeps whilst using a debian based host.
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)
|
|
||||||
else()
|
|
||||||
set(CPACK_GENERATOR TGZ)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# CPack variables are loaded in on the call to include(CPack). If you set
|
|
||||||
# variables *after* the inclusion, they don't get updated within the CPack
|
|
||||||
# config. Note that some CPack commands should still be run after it, such
|
|
||||||
# as cpack_add_component().
|
|
||||||
include(CPack)
|
|
@@ -1,14 +0,0 @@
|
|||||||
<CPackWiXPatch>
|
|
||||||
<!-- Fragment ID is from: <your build dir>/_CPack_Packages/win64/WIX/files.wxs -->
|
|
||||||
<CPackWiXFragment Id="CM_CP_bin.nvim.exe">
|
|
||||||
<Environment
|
|
||||||
Id='UpdatePath'
|
|
||||||
Name='PATH'
|
|
||||||
Action='set'
|
|
||||||
Permanent='no'
|
|
||||||
System='yes'
|
|
||||||
Part='last'
|
|
||||||
Value='[INSTALL_ROOT]bin'
|
|
||||||
/>
|
|
||||||
</CPackWiXFragment>
|
|
||||||
</CPackWiXPatch>
|
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 120 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB |
@@ -1,147 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<svg
|
|
||||||
xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="256"
|
|
||||||
height="256"
|
|
||||||
viewBox="0 0 256 256"
|
|
||||||
version="1.1"
|
|
||||||
id="svg4612"
|
|
||||||
sodipodi:docname="neovim.svg"
|
|
||||||
inkscape:version="0.92.4 5da689c313, 2019-01-14">
|
|
||||||
<metadata
|
|
||||||
id="metadata4616">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title>neovim-mark@2x</dc:title>
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<sodipodi:namedview
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1"
|
|
||||||
objecttolerance="10"
|
|
||||||
gridtolerance="10"
|
|
||||||
guidetolerance="10"
|
|
||||||
inkscape:pageopacity="0"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:window-width="2560"
|
|
||||||
inkscape:window-height="1333"
|
|
||||||
id="namedview4614"
|
|
||||||
showgrid="false"
|
|
||||||
inkscape:zoom="2.1945358"
|
|
||||||
inkscape:cx="132.84232"
|
|
||||||
inkscape:cy="196.34741"
|
|
||||||
inkscape:window-x="0"
|
|
||||||
inkscape:window-y="34"
|
|
||||||
inkscape:window-maximized="1"
|
|
||||||
inkscape:current-layer="svg4612" />
|
|
||||||
<title
|
|
||||||
id="title4587">neovim-mark@2x</title>
|
|
||||||
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
|
|
||||||
<defs
|
|
||||||
id="defs4604">
|
|
||||||
<linearGradient
|
|
||||||
x1="167.95833"
|
|
||||||
y1="-0.46142399"
|
|
||||||
x2="167.95833"
|
|
||||||
y2="335.45523"
|
|
||||||
id="linearGradient-1"
|
|
||||||
gradientTransform="scale(0.46142398,2.1672042)"
|
|
||||||
gradientUnits="userSpaceOnUse">
|
|
||||||
<stop
|
|
||||||
stop-color="#16B0ED"
|
|
||||||
stop-opacity="0.800235524"
|
|
||||||
offset="0%"
|
|
||||||
id="stop4589" />
|
|
||||||
<stop
|
|
||||||
stop-color="#0F59B2"
|
|
||||||
stop-opacity="0.83700023"
|
|
||||||
offset="100%"
|
|
||||||
id="stop4591" />
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient
|
|
||||||
x1="1118.3427"
|
|
||||||
y1="-0.46586797"
|
|
||||||
x2="1118.3427"
|
|
||||||
y2="338.68604"
|
|
||||||
id="linearGradient-2"
|
|
||||||
gradientTransform="scale(0.46586797,2.1465309)"
|
|
||||||
gradientUnits="userSpaceOnUse">
|
|
||||||
<stop
|
|
||||||
stop-color="#7DB643"
|
|
||||||
offset="0%"
|
|
||||||
id="stop4594" />
|
|
||||||
<stop
|
|
||||||
stop-color="#367533"
|
|
||||||
offset="100%"
|
|
||||||
id="stop4596" />
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient
|
|
||||||
x1="356.33795"
|
|
||||||
y1="0"
|
|
||||||
x2="356.33795"
|
|
||||||
y2="612.90131"
|
|
||||||
id="linearGradient-3"
|
|
||||||
gradientTransform="scale(0.84189739,1.1877932)"
|
|
||||||
gradientUnits="userSpaceOnUse">
|
|
||||||
<stop
|
|
||||||
stop-color="#88C649"
|
|
||||||
stop-opacity="0.8"
|
|
||||||
offset="0%"
|
|
||||||
id="stop4599" />
|
|
||||||
<stop
|
|
||||||
stop-color="#439240"
|
|
||||||
stop-opacity="0.84"
|
|
||||||
offset="100%"
|
|
||||||
id="stop4601" />
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
<g
|
|
||||||
id="Page-1"
|
|
||||||
sketch:type="MSPage"
|
|
||||||
style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1"
|
|
||||||
transform="matrix(0.34367476,0,0,0.34367476,25.312651,1.7737533)">
|
|
||||||
<g
|
|
||||||
id="mark-copy"
|
|
||||||
sketch:type="MSLayerGroup"
|
|
||||||
transform="translate(2,3)">
|
|
||||||
<path
|
|
||||||
d="M 0,155.5704 155,-1 V 727 L 0,572.23792 Z"
|
|
||||||
id="Left---green"
|
|
||||||
sketch:type="MSShapeGroup"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
style="fill:url(#linearGradient-1)" />
|
|
||||||
<path
|
|
||||||
d="M 443.0604,156.9824 600,-1 596.81879,727 442,572.21994 Z"
|
|
||||||
id="Right---blue"
|
|
||||||
sketch:type="MSShapeGroup"
|
|
||||||
transform="matrix(-1,0,0,1,1042,0)"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
style="fill:url(#linearGradient-2)" />
|
|
||||||
<path
|
|
||||||
d="M 154.98629,0 558,615.1897 445.2246,728 42,114.17202 Z"
|
|
||||||
id="Cross---blue"
|
|
||||||
sketch:type="MSShapeGroup"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
style="fill:url(#linearGradient-3)" />
|
|
||||||
<path
|
|
||||||
d="M 155,283.83232 154.78675,308 31,124.71061 42.461949,113 Z"
|
|
||||||
id="Shadow"
|
|
||||||
sketch:type="MSShapeGroup"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
style="fill:#000000;fill-opacity:0.12999998" />
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 4.3 KiB |
@@ -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()
|
|
50
cmake/FindJeMalloc.cmake
Normal file
50
cmake/FindJeMalloc.cmake
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# - Try to find jemalloc
|
||||||
|
# Once done this will define
|
||||||
|
# JEMALLOC_FOUND - System has jemalloc
|
||||||
|
# JEMALLOC_INCLUDE_DIRS - The jemalloc include directories
|
||||||
|
# JEMALLOC_LIBRARIES - The libraries needed to use jemalloc
|
||||||
|
|
||||||
|
if(NOT USE_BUNDLED_JEMALLOC)
|
||||||
|
find_package(PkgConfig)
|
||||||
|
if (PKG_CONFIG_FOUND)
|
||||||
|
pkg_check_modules(PC_JEMALLOC QUIET jemalloc)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(PC_JEMALLOC_INCLUDEDIR)
|
||||||
|
set(PC_JEMALLOC_INCLUDE_DIRS)
|
||||||
|
set(PC_JEMALLOC_LIBDIR)
|
||||||
|
set(PC_JEMALLOC_LIBRARY_DIRS)
|
||||||
|
set(LIMIT_SEARCH NO_DEFAULT_PATH)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(JEMALLOC_DEFINITIONS ${PC_JEMALLOC_CFLAGS_OTHER})
|
||||||
|
|
||||||
|
find_path(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h
|
||||||
|
PATHS ${PC_JEMALLOC_INCLUDEDIR} ${PC_JEMALLOC_INCLUDE_DIRS}
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
|
# If we're asked to use static linkage, add libjemalloc.a as a preferred library name.
|
||||||
|
if(JEMALLOC_USE_STATIC)
|
||||||
|
list(APPEND JEMALLOC_NAMES
|
||||||
|
"${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
|
list(INSERT JEMALLOC_NAMES 0
|
||||||
|
"${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND JEMALLOC_NAMES jemalloc)
|
||||||
|
|
||||||
|
find_library(JEMALLOC_LIBRARY NAMES ${JEMALLOC_NAMES}
|
||||||
|
HINTS ${PC_JEMALLOC_LIBDIR} ${PC_JEMALLOC_LIBRARY_DIRS}
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
|
set(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY})
|
||||||
|
set(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR})
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE
|
||||||
|
# if all listed variables are TRUE
|
||||||
|
find_package_handle_standard_args(JeMalloc DEFAULT_MSG
|
||||||
|
JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)
|
||||||
|
|
||||||
|
mark_as_advanced(JEMALLOC_INCLUDE_DIR JEMALLOC_LIBRARY)
|
@@ -1,10 +0,0 @@
|
|||||||
# - Try to find libvterm
|
|
||||||
# Once done this will define
|
|
||||||
# LIBVTERM_FOUND - System has libvterm
|
|
||||||
# LIBVTERM_INCLUDE_DIRS - The libvterm include directories
|
|
||||||
# LIBVTERM_LIBRARIES - The libraries needed to use libvterm
|
|
||||||
|
|
||||||
include(LibFindMacros)
|
|
||||||
|
|
||||||
libfind_pkg_detect(LIBVTERM vterm FIND_PATH vterm.h FIND_LIBRARY vterm)
|
|
||||||
libfind_process(LIBVTERM REQUIRED)
|
|
@@ -31,24 +31,13 @@ find_library(LibIntl_LIBRARY
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (LibIntl_INCLUDE_DIR)
|
if (LibIntl_INCLUDE_DIR)
|
||||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}")
|
set(CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# On some systems (linux+glibc) libintl is passively available.
|
# On some systems (linux+glibc) libintl is passively available.
|
||||||
# So only specify the library if one was found.
|
# So only specify the library if one was found.
|
||||||
if (LibIntl_LIBRARY)
|
if (LibIntl_LIBRARY)
|
||||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${LibIntl_LIBRARY}")
|
set(CMAKE_REQUIRED_LIBRARIES "${LibIntl_LIBRARY}")
|
||||||
endif()
|
|
||||||
if (MSVC)
|
|
||||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
|
|
||||||
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()
|
endif()
|
||||||
|
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
@@ -61,18 +50,6 @@ int main(int argc, char** argv) {
|
|||||||
bind_textdomain_codeset(\"foo\", \"bar\");
|
bind_textdomain_codeset(\"foo\", \"bar\");
|
||||||
textdomain(\"foo\");
|
textdomain(\"foo\");
|
||||||
}" HAVE_WORKING_LIBINTL)
|
}" HAVE_WORKING_LIBINTL)
|
||||||
if (MSVC)
|
|
||||||
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
|
|
||||||
endif()
|
|
||||||
if (LibIntl_STATIC)
|
|
||||||
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARY}" "${CoreFoundation_FRAMEWORK}")
|
|
||||||
endif()
|
|
||||||
if (LibIntl_INCLUDE_DIR)
|
|
||||||
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}")
|
|
||||||
endif()
|
|
||||||
if (LibIntl_LIBRARY)
|
|
||||||
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${LibIntl_LIBRARY}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (HAVE_WORKING_LIBINTL)
|
if (HAVE_WORKING_LIBINTL)
|
||||||
# On some systems (linux+glibc) libintl is passively available.
|
# On some systems (linux+glibc) libintl is passively available.
|
||||||
@@ -81,7 +58,6 @@ if (HAVE_WORKING_LIBINTL)
|
|||||||
if(LibIntl_FIND_REQUIRED)
|
if(LibIntl_FIND_REQUIRED)
|
||||||
unset(LibIntl_FIND_REQUIRED)
|
unset(LibIntl_FIND_REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
set(LibIntl_FIND_QUIETLY ON)
|
|
||||||
|
|
||||||
check_variable_exists(_nl_msg_cat_cntr HAVE_NL_MSG_CAT_CNTR)
|
check_variable_exists(_nl_msg_cat_cntr HAVE_NL_MSG_CAT_CNTR)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -1,32 +0,0 @@
|
|||||||
# - Try to find luv
|
|
||||||
# Once done this will define
|
|
||||||
# LIBLUV_FOUND - System has libluv
|
|
||||||
# LIBLUV_INCLUDE_DIRS - The libluv include directories
|
|
||||||
# LIBLUV_LIBRARIES - The libraries needed to use libluv
|
|
||||||
|
|
||||||
find_package(PkgConfig)
|
|
||||||
if (PKG_CONFIG_FOUND)
|
|
||||||
pkg_check_modules(PC_LIBLUV QUIET luv)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(LIBLUV_DEFINITIONS ${PC_LIBLUV_CFLAGS_OTHER})
|
|
||||||
|
|
||||||
find_path(LIBLUV_INCLUDE_DIR luv/luv.h
|
|
||||||
PATHS ${PC_LIBLUV_INCLUDEDIR} ${PC_LIBLUV_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
# Explicitly look for luv.so. #10407
|
|
||||||
list(APPEND LIBLUV_NAMES luv_a luv libluv_a luv${CMAKE_SHARED_LIBRARY_SUFFIX})
|
|
||||||
|
|
||||||
find_library(LIBLUV_LIBRARY NAMES ${LIBLUV_NAMES}
|
|
||||||
HINTS ${PC_LIBLUV_LIBDIR} ${PC_LIBLUV_LIBRARY_DIRS})
|
|
||||||
|
|
||||||
set(LIBLUV_LIBRARIES ${LIBLUV_LIBRARY})
|
|
||||||
set(LIBLUV_INCLUDE_DIRS ${LIBLUV_INCLUDE_DIR})
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set LIBLUV_FOUND to TRUE
|
|
||||||
# if all listed variables are TRUE
|
|
||||||
find_package_handle_standard_args(LibLUV DEFAULT_MSG
|
|
||||||
LIBLUV_LIBRARY LIBLUV_INCLUDE_DIR)
|
|
||||||
|
|
||||||
mark_as_advanced(LIBLUV_INCLUDE_DIR LIBLUV_LIBRARY)
|
|
@@ -4,20 +4,36 @@
|
|||||||
# LIBTERMKEY_INCLUDE_DIRS - The libtermkey include directories
|
# LIBTERMKEY_INCLUDE_DIRS - The libtermkey include directories
|
||||||
# LIBTERMKEY_LIBRARIES - The libraries needed to use libtermkey
|
# LIBTERMKEY_LIBRARIES - The libraries needed to use libtermkey
|
||||||
|
|
||||||
|
if(NOT USE_BUNDLED_LIBTERMKEY)
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
if (PKG_CONFIG_FOUND)
|
if (PKG_CONFIG_FOUND)
|
||||||
pkg_check_modules(PC_LIBTERMKEY QUIET termkey)
|
pkg_check_modules(PC_LIBTERMKEY QUIET termkey)
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
set(PC_LIBTERMKEY_INCLUDEDIR)
|
||||||
|
set(PC_LIBTERMKEY_INCLUDE_DIRS)
|
||||||
|
set(PC_LIBTERMKEY_LIBDIR)
|
||||||
|
set(PC_LIBTERMKEY_LIBRARY_DIRS)
|
||||||
|
set(LIMIT_SEARCH NO_DEFAULT_PATH)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(LIBTERMKEY_DEFINITIONS ${PC_LIBTERMKEY_CFLAGS_OTHER})
|
set(LIBTERMKEY_DEFINITIONS ${PC_LIBTERMKEY_CFLAGS_OTHER})
|
||||||
|
|
||||||
find_path(LIBTERMKEY_INCLUDE_DIR termkey.h
|
find_path(LIBTERMKEY_INCLUDE_DIR termkey.h
|
||||||
PATHS ${PC_LIBTERMKEY_INCLUDEDIR} ${PC_LIBTERMKEY_INCLUDE_DIRS})
|
PATHS ${PC_LIBTERMKEY_INCLUDEDIR} ${PC_LIBTERMKEY_INCLUDE_DIRS}
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
|
# If we're asked to use static linkage, add libuv.a as a preferred library name.
|
||||||
|
if(LIBTERMKEY_USE_STATIC)
|
||||||
|
list(APPEND LIBTERMKEY_NAMES
|
||||||
|
"${CMAKE_STATIC_LIBRARY_PREFIX}termkey${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
|
endif()
|
||||||
|
|
||||||
list(APPEND LIBTERMKEY_NAMES termkey)
|
list(APPEND LIBTERMKEY_NAMES termkey)
|
||||||
|
|
||||||
find_library(LIBTERMKEY_LIBRARY NAMES ${LIBTERMKEY_NAMES}
|
find_library(LIBTERMKEY_LIBRARY NAMES ${LIBTERMKEY_NAMES}
|
||||||
HINTS ${PC_LIBTERMKEY_LIBDIR} ${PC_LIBTERMKEY_LIBRARY_DIRS})
|
HINTS ${PC_LIBTERMKEY_LIBDIR} ${PC_LIBTERMKEY_LIBRARY_DIRS}
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
set(LIBTERMKEY_LIBRARIES ${LIBTERMKEY_LIBRARY})
|
set(LIBTERMKEY_LIBRARIES ${LIBTERMKEY_LIBRARY})
|
||||||
set(LIBTERMKEY_INCLUDE_DIRS ${LIBTERMKEY_INCLUDE_DIR})
|
set(LIBTERMKEY_INCLUDE_DIRS ${LIBTERMKEY_INCLUDE_DIR})
|
||||||
|
@@ -4,19 +4,38 @@
|
|||||||
# LIBUV_FOUND - system has libuv
|
# LIBUV_FOUND - system has libuv
|
||||||
# LIBUV_INCLUDE_DIRS - the libuv include directories
|
# LIBUV_INCLUDE_DIRS - the libuv include directories
|
||||||
# LIBUV_LIBRARIES - link these to use libuv
|
# LIBUV_LIBRARIES - link these to use libuv
|
||||||
|
#
|
||||||
|
# Set the LIBUV_USE_STATIC variable to specify if static libraries should
|
||||||
|
# be preferred to shared ones.
|
||||||
|
|
||||||
|
if(NOT USE_BUNDLED_LIBUV)
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
if (PKG_CONFIG_FOUND)
|
if (PKG_CONFIG_FOUND)
|
||||||
pkg_check_modules(PC_LIBUV QUIET libuv)
|
pkg_check_modules(PC_LIBUV QUIET libuv)
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
set(PC_LIBUV_INCLUDEDIR)
|
||||||
|
set(PC_LIBUV_INCLUDE_DIRS)
|
||||||
|
set(PC_LIBUV_LIBDIR)
|
||||||
|
set(PC_LIBUV_LIBRARY_DIRS)
|
||||||
|
set(LIMIT_SEARCH NO_DEFAULT_PATH)
|
||||||
|
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}
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
list(APPEND LIBUV_NAMES uv_a uv)
|
# If we're asked to use static linkage, add libuv.a as a preferred library name.
|
||||||
|
if(LIBUV_USE_STATIC)
|
||||||
|
list(APPEND LIBUV_NAMES
|
||||||
|
"${CMAKE_STATIC_LIBRARY_PREFIX}uv${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
|
endif(LIBUV_USE_STATIC)
|
||||||
|
|
||||||
|
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}
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARY)
|
mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARY)
|
||||||
|
|
||||||
@@ -75,14 +94,6 @@ if(WIN32)
|
|||||||
list(APPEND LIBUV_LIBRARIES ws2_32)
|
list(APPEND LIBUV_LIBRARIES ws2_32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Threads)
|
|
||||||
if(Threads_FOUND)
|
|
||||||
# TODO: Fix the cmake file to properly handle static deps for bundled builds.
|
|
||||||
# Meanwhile just include the threads library if CMake tells us there's one to
|
|
||||||
# use.
|
|
||||||
list(APPEND LIBUV_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set LIBUV_FOUND to TRUE
|
# handle the QUIETLY and REQUIRED arguments and set LIBUV_FOUND to TRUE
|
||||||
|
47
cmake/FindLibVterm.cmake
Normal file
47
cmake/FindLibVterm.cmake
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
# - Try to find libvterm
|
||||||
|
# Once done this will define
|
||||||
|
# LIBVTERM_FOUND - System has libvterm
|
||||||
|
# LIBVTERM_INCLUDE_DIRS - The libvterm include directories
|
||||||
|
# LIBVTERM_LIBRARIES - The libraries needed to use libvterm
|
||||||
|
|
||||||
|
if(NOT USE_BUNDLED_LIBVTERM)
|
||||||
|
find_package(PkgConfig)
|
||||||
|
if (PKG_CONFIG_FOUND)
|
||||||
|
pkg_check_modules(PC_LIBVTERM QUIET vterm)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(PC_LIBVTERM_INCLUDEDIR)
|
||||||
|
set(PC_LIBVTERM_INCLUDE_DIRS)
|
||||||
|
set(PC_LIBVTERM_LIBDIR)
|
||||||
|
set(PC_LIBVTERM_LIBRARY_DIRS)
|
||||||
|
set(LIMIT_SEARCH NO_DEFAULT_PATH)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(LIBVTERM_DEFINITIONS ${PC_LIBVTERM_CFLAGS_OTHER})
|
||||||
|
|
||||||
|
find_path(LIBVTERM_INCLUDE_DIR vterm.h
|
||||||
|
PATHS ${PC_LIBVTERM_INCLUDEDIR} ${PC_LIBVTERM_INCLUDE_DIRS}
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
|
# If we're asked to use static linkage, add libuv.a as a preferred library name.
|
||||||
|
if(LIBVTERM_USE_STATIC)
|
||||||
|
list(APPEND LIBVTERM_NAMES
|
||||||
|
"${CMAKE_STATIC_LIBRARY_PREFIX}vterm${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND LIBVTERM_NAMES vterm)
|
||||||
|
|
||||||
|
find_library(LIBVTERM_LIBRARY NAMES ${LIBVTERM_NAMES}
|
||||||
|
HINTS ${PC_LIBVTERM_LIBDIR} ${PC_LIBVTERM_LIBRARY_DIRS}
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
|
set(LIBVTERM_LIBRARIES ${LIBVTERM_LIBRARY})
|
||||||
|
set(LIBVTERM_INCLUDE_DIRS ${LIBVTERM_INCLUDE_DIR})
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set LIBVTERM_FOUND to TRUE
|
||||||
|
# if all listed variables are TRUE
|
||||||
|
find_package_handle_standard_args(LibVterm DEFAULT_MSG
|
||||||
|
LIBVTERM_LIBRARY LIBVTERM_INCLUDE_DIR)
|
||||||
|
|
||||||
|
mark_as_advanced(LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY)
|
197
cmake/FindLua.cmake
Normal file
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.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)
|
@@ -4,16 +4,32 @@
|
|||||||
# LUAJIT_INCLUDE_DIRS - The luajit include directories
|
# LUAJIT_INCLUDE_DIRS - The luajit include directories
|
||||||
# LUAJIT_LIBRARIES - The libraries needed to use luajit
|
# LUAJIT_LIBRARIES - The libraries needed to use luajit
|
||||||
|
|
||||||
|
if(NOT USE_BUNDLED_LUAJIT)
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
if (PKG_CONFIG_FOUND)
|
if (PKG_CONFIG_FOUND)
|
||||||
pkg_check_modules(PC_LUAJIT QUIET luajit)
|
pkg_check_modules(PC_LUAJIT QUIET luajit)
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
set(PC_LUAJIT_INCLUDEDIR)
|
||||||
|
set(PC_LUAJIT_INCLUDE_DIRS)
|
||||||
|
set(PC_LUAJIT_LIBDIR)
|
||||||
|
set(PC_LUAJIT_LIBRARY_DIRS)
|
||||||
|
set(LIMIT_SEARCH NO_DEFAULT_PATH)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(LUAJIT_DEFINITIONS ${PC_LUAJIT_CFLAGS_OTHER})
|
set(LUAJIT_DEFINITIONS ${PC_LUAJIT_CFLAGS_OTHER})
|
||||||
|
|
||||||
find_path(LUAJIT_INCLUDE_DIR luajit.h
|
find_path(LUAJIT_INCLUDE_DIR luajit.h
|
||||||
PATHS ${PC_LUAJIT_INCLUDEDIR} ${PC_LUAJIT_INCLUDE_DIRS}
|
PATHS ${PC_LUAJIT_INCLUDEDIR} ${PC_LUAJIT_INCLUDE_DIRS}
|
||||||
PATH_SUFFIXES luajit-2.0 luajit-2.1)
|
PATH_SUFFIXES luajit-2.0
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
|
# If we're asked to use static linkage, add libluajit-5.1.a as a preferred
|
||||||
|
# library name.
|
||||||
|
if(LUAJIT_USE_STATIC)
|
||||||
|
list(APPEND LUAJIT_NAMES
|
||||||
|
"${CMAKE_STATIC_LIBRARY_PREFIX}luajit-5.1${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
list(APPEND LUAJIT_NAMES lua51)
|
list(APPEND LUAJIT_NAMES lua51)
|
||||||
@@ -24,7 +40,8 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_library(LUAJIT_LIBRARY NAMES ${LUAJIT_NAMES}
|
find_library(LUAJIT_LIBRARY NAMES ${LUAJIT_NAMES}
|
||||||
PATHS ${PC_LUAJIT_LIBDIR} ${PC_LUAJIT_LIBRARY_DIRS})
|
PATHS ${PC_LUAJIT_LIBDIR} ${PC_LUAJIT_LIBRARY_DIRS}
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
set(LUAJIT_LIBRARIES ${LUAJIT_LIBRARY})
|
set(LUAJIT_LIBRARIES ${LUAJIT_LIBRARY})
|
||||||
set(LUAJIT_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIR})
|
set(LUAJIT_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIR})
|
||||||
|
@@ -4,17 +4,26 @@
|
|||||||
# MSGPACK_INCLUDE_DIRS - The msgpack include directories
|
# MSGPACK_INCLUDE_DIRS - The msgpack include directories
|
||||||
# MSGPACK_LIBRARIES - The libraries needed to use msgpack
|
# MSGPACK_LIBRARIES - The libraries needed to use msgpack
|
||||||
|
|
||||||
|
if(NOT USE_BUNDLED_MSGPACK)
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
if (PKG_CONFIG_FOUND)
|
if (PKG_CONFIG_FOUND)
|
||||||
pkg_search_module(PC_MSGPACK QUIET
|
pkg_search_module(PC_MSGPACK QUIET
|
||||||
msgpackc>=${Msgpack_FIND_VERSION}
|
msgpackc>=${Msgpack_FIND_VERSION}
|
||||||
msgpack>=${Msgpack_FIND_VERSION})
|
msgpack>=${Msgpack_FIND_VERSION})
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
set(PC_MSGPACK_INCLUDEDIR)
|
||||||
|
set(PC_MSGPACK_INCLUDE_DIRS)
|
||||||
|
set(PC_MSGPACK_LIBDIR)
|
||||||
|
set(PC_MSGPACK_LIBRARY_DIRS)
|
||||||
|
set(LIMIT_SEARCH NO_DEFAULT_PATH)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(MSGPACK_DEFINITIONS ${PC_MSGPACK_CFLAGS_OTHER})
|
set(MSGPACK_DEFINITIONS ${PC_MSGPACK_CFLAGS_OTHER})
|
||||||
|
|
||||||
find_path(MSGPACK_INCLUDE_DIR msgpack/version_master.h
|
find_path(MSGPACK_INCLUDE_DIR msgpack/version_master.h
|
||||||
HINTS ${PC_MSGPACK_INCLUDEDIR} ${PC_MSGPACK_INCLUDE_DIRS})
|
HINTS ${PC_MSGPACK_INCLUDEDIR} ${PC_MSGPACK_INCLUDE_DIRS}
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
if(MSGPACK_INCLUDE_DIR)
|
if(MSGPACK_INCLUDE_DIR)
|
||||||
file(READ ${MSGPACK_INCLUDE_DIR}/msgpack/version_master.h msgpack_version_h)
|
file(READ ${MSGPACK_INCLUDE_DIR}/msgpack/version_master.h msgpack_version_h)
|
||||||
@@ -26,6 +35,13 @@ else()
|
|||||||
set(MSGPACK_VERSION_STRING)
|
set(MSGPACK_VERSION_STRING)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# If we're asked to use static linkage, add libmsgpack{,c}.a as a preferred library name.
|
||||||
|
if(MSGPACK_USE_STATIC)
|
||||||
|
list(APPEND MSGPACK_NAMES
|
||||||
|
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpackc${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||||
|
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpack${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# The import library for the msgpack DLL has a different name
|
# The import library for the msgpack DLL has a different name
|
||||||
list(APPEND MSGPACK_NAMES msgpackc_import)
|
list(APPEND MSGPACK_NAMES msgpackc_import)
|
||||||
@@ -37,7 +53,8 @@ find_library(MSGPACK_LIBRARY NAMES ${MSGPACK_NAMES}
|
|||||||
# Check each directory for all names to avoid using headers/libraries from
|
# Check each directory for all names to avoid using headers/libraries from
|
||||||
# different places.
|
# different places.
|
||||||
NAMES_PER_DIR
|
NAMES_PER_DIR
|
||||||
HINTS ${PC_MSGPACK_LIBDIR} ${PC_MSGPACK_LIBRARY_DIRS})
|
HINTS ${PC_MSGPACK_LIBDIR} ${PC_MSGPACK_LIBRARY_DIRS}
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
mark_as_advanced(MSGPACK_INCLUDE_DIR MSGPACK_LIBRARY)
|
mark_as_advanced(MSGPACK_INCLUDE_DIR MSGPACK_LIBRARY)
|
||||||
|
|
||||||
|
@@ -1,11 +0,0 @@
|
|||||||
# - Try to find tree-sitter
|
|
||||||
# Once done, this will define
|
|
||||||
#
|
|
||||||
# TreeSitter_FOUND - system has tree-sitter
|
|
||||||
# TreeSitter_INCLUDE_DIRS - the tree-sitter include directories
|
|
||||||
# TreeSitter_LIBRARIES - link these to use tree-sitter
|
|
||||||
|
|
||||||
include(LibFindMacros)
|
|
||||||
|
|
||||||
libfind_pkg_detect(TreeSitter tree-sitter FIND_PATH tree_sitter/api.h FIND_LIBRARY tree-sitter)
|
|
||||||
libfind_process(TreeSitter)
|
|
@@ -1,12 +0,0 @@
|
|||||||
# - Try to find unibilium
|
|
||||||
# Once done this will define
|
|
||||||
# UNIBILIUM_FOUND - System has unibilium
|
|
||||||
# UNIBILIUM_INCLUDE_DIRS - The unibilium include directories
|
|
||||||
# UNIBILIUM_LIBRARIES - The libraries needed to use unibilium
|
|
||||||
|
|
||||||
include(LibFindMacros)
|
|
||||||
|
|
||||||
libfind_pkg_detect(UNIBILIUM unibilium
|
|
||||||
FIND_PATH unibilium.h
|
|
||||||
FIND_LIBRARY unibilium)
|
|
||||||
libfind_process(UNIBILIUM)
|
|
47
cmake/FindUnibilium.cmake
Normal file
47
cmake/FindUnibilium.cmake
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
# - Try to find unibilium
|
||||||
|
# Once done this will define
|
||||||
|
# UNIBILIUM_FOUND - System has unibilium
|
||||||
|
# UNIBILIUM_INCLUDE_DIRS - The unibilium include directories
|
||||||
|
# UNIBILIUM_LIBRARIES - The libraries needed to use unibilium
|
||||||
|
|
||||||
|
if(NOT USE_BUNDLED_UNIBILIUM)
|
||||||
|
find_package(PkgConfig)
|
||||||
|
if (PKG_CONFIG_FOUND)
|
||||||
|
pkg_check_modules(PC_UNIBILIUM QUIET unibilium)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(PC_UNIBILIUM_INCLUDEDIR)
|
||||||
|
set(PC_UNIBILIUM_INCLUDE_DIRS)
|
||||||
|
set(PC_UNIBILIUM_LIBDIR)
|
||||||
|
set(PC_UNIBILIUM_LIBRARY_DIRS)
|
||||||
|
set(LIMIT_SEARCH NO_DEFAULT_PATH)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(UNIBILIUM_DEFINITIONS ${PC_UNIBILIUM_CFLAGS_OTHER})
|
||||||
|
|
||||||
|
find_path(UNIBILIUM_INCLUDE_DIR unibilium.h
|
||||||
|
PATHS ${PC_UNIBILIUM_INCLUDEDIR} ${PC_UNIBILIUM_INCLUDE_DIRS}
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
|
# If we're asked to use static linkage, add libunibilium.a as a preferred library name.
|
||||||
|
if(UNIBILIUM_USE_STATIC)
|
||||||
|
list(APPEND UNIBILIUM_NAMES
|
||||||
|
"${CMAKE_STATIC_LIBRARY_PREFIX}unibilium${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND UNIBILIUM_NAMES unibilium)
|
||||||
|
|
||||||
|
find_library(UNIBILIUM_LIBRARY NAMES ${UNIBILIUM_NAMES}
|
||||||
|
HINTS ${PC_UNIBILIUM_LIBDIR} ${PC_UNIBILIUM_LIBRARY_DIRS}
|
||||||
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
|
set(UNIBILIUM_LIBRARIES ${UNIBILIUM_LIBRARY})
|
||||||
|
set(UNIBILIUM_INCLUDE_DIRS ${UNIBILIUM_INCLUDE_DIR})
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set UNIBILIUM_FOUND to TRUE
|
||||||
|
# if all listed variables are TRUE
|
||||||
|
find_package_handle_standard_args(unibilium DEFAULT_MSG
|
||||||
|
UNIBILIUM_LIBRARY UNIBILIUM_INCLUDE_DIR)
|
||||||
|
|
||||||
|
mark_as_advanced(UNIBILIUM_INCLUDE_DIR UNIBILIUM_LIBRARY)
|
10
cmake/FindWinpty.cmake
Normal file
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)
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user