-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove uibridge, allow basically unmodified nvim binary #1015
Changes from 34 commits
16c27a9
d7411b7
3306da6
68c29ca
615d327
774f531
80d61a8
dff45d9
5c1f97e
013110e
ae221d3
ba32d88
acc9328
2d7e364
7e7ad34
690c5d1
ff35970
6fb2e5c
faa60d9
c82ea28
80062c8
6ff21ed
67012a4
56d1e67
736bbde
151d66b
b5adab0
62817d6
3bd7394
d5b5b65
c1a7d38
63e1c40
3e6de12
dff22ec
f93ef45
39ca0b3
e103f67
63aafa0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,3 +179,7 @@ Temporary Items | |
|
||
.deps | ||
tags.* | ||
/RxPack/.build | ||
/Workspace/.swiftpm | ||
.swiftpm | ||
/NvimServer/.build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "NvimServer"] | ||
path = NvimServer | ||
url = git@github.com:qvacua/neovim.git | ||
[submodule "Neovim"] | ||
path = Neovim | ||
url = git@github.com:georgeharker/vimr-neovim.git |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.deps | ||
third-party | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.security.cs.allow-jit</key> | ||
<true/> | ||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key> | ||
<true/> | ||
<key>com.apple.security.cs.disable-executable-page-protection</key> | ||
<true/> | ||
<key>com.apple.security.cs.disable-library-validation</key> | ||
<true/> | ||
</dict> | ||
</plist> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"deploymentTarget": "10.15", | ||
"gettext": { | ||
"arm64BottleTag": "arm64_ventura", | ||
"x86_64BottleTag": "ventura" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../NvimServerTypes/Sources/include/NvimServerTypes.h |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../Neovim/src/nvim/main.c |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
## How to develop | ||
|
||
First, clean everything | ||
|
||
``` | ||
$ ./bin/clean_all.sh | ||
``` | ||
|
||
Then, build `libnvim` once with dependencies | ||
|
||
``` | ||
$ target=x86_64 build_deps=true ./bin/build_libnvim.sh | ||
``` | ||
|
||
After editing the code of neovim or NvimServer, you build NvimServer in Xcode or by executing | ||
the following: | ||
|
||
``` | ||
$ target="${ARCH}" build_deps=false build_dir="${PROJECT_ROOT}/NvimServer/build" \ | ||
./bin/build_nvimserver.sh | ||
``` | ||
|
||
where `${ARCH}` is either `arm64` or `x86_64`. | ||
We use `${PROJECT_ROOT}/NvimServer/build` as the NvimServer target assumes that location. | ||
|
||
## How to release | ||
|
||
``` | ||
$ ./bin/build_release.sh | ||
``` | ||
|
||
The resulting package will be in `${PROJECT_ROOT}/NvimServer/build/NvimServer.tar.bz2`. | ||
|
||
## Individual steps | ||
|
||
In the following the `target` variable can be either `x86_64` or `arm64`. | ||
|
||
### How to build `libintl` | ||
|
||
``` | ||
$ ./bin/build_deps.sh | ||
``` | ||
|
||
which will result in | ||
|
||
``` | ||
${PROJECT_ROOT} | ||
NvimServer | ||
third-party | ||
lib | ||
liba | ||
libb | ||
... | ||
include | ||
a.h | ||
b.h | ||
... | ||
x86_64 | ||
lib | ||
liba | ||
libb | ||
include | ||
a.h | ||
b.h | ||
``` | ||
|
||
Files, e.g. `lib` and `include`, in `${PROJECT_ROOT}/NvimServer/third-party` are used to build | ||
`libnvim` and NvimServer. | ||
|
||
### How to build `libnvim` | ||
|
||
``` | ||
$ build_deps=true ./bin/build_libnvim.sh | ||
``` | ||
|
||
When `build_deps` is `true`, then the `build_deps.sh` is executed. The resuling library will be | ||
located in `/build/lib/libnvim.a`. | ||
|
||
### how to build NvimServer | ||
|
||
``` | ||
$ build_dir="${some_dir}" build_libnvim=true build_deps=true ./bin/build_nvimserver.sh | ||
``` | ||
|
||
The `build_libnvim.sh` script is executed automatically with the given parameters. The resulting | ||
binary will be located in `${some_dir}`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
set -Eeuo pipefail | ||
|
||
readonly clean=${clean:?"true or false"} | ||
|
||
build_libnvim() { | ||
local -r deployment_target=$1 | ||
|
||
# Brew's gettext does not get sym-linked to PATH | ||
export PATH="/opt/homebrew/opt/gettext/bin:/usr/local/opt/gettext/bin:${PATH}" | ||
|
||
#macos_flags="-DCMAKE_OSX_DEPLOYMENT_TARGET=${deployment_target} -DCMAKE_OSX_ARCHITECTURES=arm64\;x86_64" | ||
macos_flags="-DCMAKE_OSX_DEPLOYMENT_TARGET=${deployment_target} -DCMAKE_OSX_ARCHITECTURES=arm64" | ||
|
||
pushd ../Neovim | ||
|
||
# W/o setting MACOSX_DEPLOYMENT_TARGET, the dependencies have min. macOS set to the macOS you're on. | ||
make \ | ||
CMAKE_BUILD_TYPE=Release \ | ||
SDKROOT="$(xcrun --show-sdk-path)" \ | ||
MACOSX_DEPLOYMENT_TARGET="${deployment_target}" \ | ||
CMAKE_EXTRA_FLAGS="" \ | ||
DEPS_CMAKE_FLAGS="${macos_flags}" \ | ||
libnvim nvim | ||
|
||
popd | ||
} | ||
|
||
main() { | ||
# This script is located in /NvimServer/bin and we have to go to / | ||
echo "$(dirname "${BASH_SOURCE[0]}")/../../" | ||
pushd "$(dirname "${BASH_SOURCE[0]}")/../../" >/dev/null | ||
|
||
echo "### Building libnvim" | ||
local deployment_target | ||
deployment_target=$(jq -r .deploymentTarget ./NvimServer/Resources/buildInfo.json) | ||
readonly deployment_target | ||
|
||
if [[ "${clean}" == true ]]; then | ||
pushd ../Neovim | ||
make distclean | ||
popd | ||
|
||
./NvimServer/bin/prepare_libintl.sh | ||
|
||
fi | ||
|
||
build_libnvim "${deployment_target}" | ||
|
||
popd >/dev/null | ||
echo "### Built libnvim" | ||
} | ||
|
||
main | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
set -Eeuo pipefail | ||
|
||
declare -r -x clean=${clean:?"if true, will clean libnvim and nvimserver"} | ||
readonly build_libnvim=${build_libnvim:?"true or false"} | ||
readonly build_dir=${build_dir:-"./.build"} | ||
|
||
main() { | ||
echo "### Building NvimServer" | ||
# This script is located in /NvimServer/bin and we have to go to / | ||
pushd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null | ||
if [[ "${clean}" == true ]]; then | ||
rm -rf "${build_dir}" | ||
fi | ||
|
||
if [[ "${build_libnvim}" == true ]]; then | ||
./NvimServer/bin/build_libnvim.sh | ||
fi | ||
|
||
#swift build --arch arm64 --arch x86_64 -c release --product NvimServer | ||
swift build --arch arm64 -c release --product NvimServer | ||
|
||
popd >/dev/null | ||
echo "### Built NvimServer" | ||
} | ||
|
||
main |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
set -Eeuo pipefail | ||
|
||
readonly nvim_install_path=${nvim_install_path:?"where to install temp nvim"} | ||
|
||
build_runtime() { | ||
pushd ../Neovim | ||
|
||
local -r deployment_target=$1 | ||
|
||
echo "#### runtime in ${nvim_install_path}" | ||
|
||
echo "### Building nvim to get the complete runtime" | ||
make \ | ||
SDKROOT="$(xcrun --show-sdk-path)" \ | ||
MACOSX_DEPLOYMENT_TARGET="${deployment_target}" \ | ||
CMAKE_EXTRA_FLAGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${deployment_target} -DCUSTOM_UI=0 -DCMAKE_INSTALL_PREFIX=${nvim_install_path}" \ | ||
DEPS_CMAKE_FLAGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${deployment_target}" \ | ||
CMAKE_BUILD_TYPE="Release" \ | ||
install | ||
|
||
echo "#### runtime is installed at ${nvim_install_path}/share/nvim/runtime" | ||
|
||
popd | ||
} | ||
|
||
main() { | ||
# This script is located in /NvimServer/bin and we have to go to / | ||
pushd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null | ||
|
||
echo "### Building runtime" | ||
local deployment_target | ||
deployment_target=$(jq -r .deploymentTarget ./NvimServer/Resources/buildInfo.json) | ||
readonly deployment_target | ||
|
||
build_runtime "${deployment_target}" | ||
|
||
popd >/dev/null | ||
echo "### Built runtime" | ||
} | ||
|
||
main |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
set -Eeuo pipefail | ||
|
||
readonly clean_deps=${clean_deps:-true} | ||
|
||
pushd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null | ||
pushd ../Neovim | ||
|
||
rm -rf ./build | ||
rm -rf ./.deps | ||
make distclean | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm getting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May have forgotten to update the clean_all script. Or possibly stock vim only has make clean. I’ll look into that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wookayin: Yes, Neovim has the |
||
|
||
popd | ||
|
||
if [[ "${clean_deps}" == true ]]; then | ||
rm -rf ./NvimServer/build | ||
fi | ||
popd >/dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the MacOS version bump? I'm still on Big Sur 😭