1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-03 13:19:00 +03:00

Merge branch 'stock-nvim' of github.com:qvacua/vimr into stock-nvim

# Conflicts:
#	bin/build_vimr.sh
This commit is contained in:
George Harker 2023-11-08 09:42:05 -08:00
commit e51e2ed665
13 changed files with 77 additions and 202 deletions

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "Neovim"]
path = Neovim
url = git@github.com:georgeharker/vimr-neovim.git
url = git@github.com:qvacua/neovim.git

2
Neovim

@ -1 +1 @@
Subproject commit 3dcf6880ad65d15495dce18211e72a41e46f502c
Subproject commit 56a55ada8b25db5b010ee8f732baae95cca4f01d

View File

@ -1,5 +1,5 @@
{
"deploymentTarget": "10.15",
"deploymentTarget": "13",
"gettext": {
"arm64BottleTag": "arm64_ventura",
"x86_64BottleTag": "ventura"

View File

@ -1,56 +0,0 @@
#!/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="" \
CMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
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

View File

@ -0,0 +1,53 @@
#!/bin/bash
set -Eeuo pipefail
readonly clean=${clean:?"true or false"}
readonly NVIM_BUILD_TYPE=${NVIM_BUILD_TYPE:-"Release"}
build_neovim() {
# slightly modified version of /Neovim/.github/scripts/build_universal_macos.sh
local -r MACOSX_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}"
export MACOSX_DEPLOYMENT_TARGET
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
cmake -S cmake.deps -B .deps -G Ninja \
-D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \
-D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \
-D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64 \
-D CMAKE_FIND_FRAMEWORK=NEVER
cmake --build .deps
cmake -B build -G Ninja \
-D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \
-D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \
-D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64 \
-D CMAKE_FIND_FRAMEWORK=NEVER
cmake --build build
cpack --config build/CPackConfig.cmake
}
main() {
# This script is located in /NvimServer/bin and we have to go to /
pushd "$(dirname "${BASH_SOURCE[0]}")/../../" >/dev/null
./NvimServer/bin/prepare_libintl.sh
local deployment_target
deployment_target=$(jq -r .deploymentTarget ./NvimServer/Resources/buildInfo.json)
readonly deployment_target
pushd ../Neovim >/dev/null
echo "### Building neovim binary"
if [[ "${clean}" == true ]]; then
make distclean
fi
build_neovim "${deployment_target}"
popd >/dev/null
popd >/dev/null
}
main

View File

@ -1,27 +0,0 @@
#!/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

View File

@ -1,42 +0,0 @@
#!/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

View File

@ -14,5 +14,6 @@ pushd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null
if [[ "${clean_deps}" == true ]]; then
rm -rf ./NvimServer/build
rm -rf ./NvimServer/third-party
fi
popd >/dev/null

View File

@ -20,15 +20,10 @@ main() {
pushd ./NvimServer/third-party >/dev/null
brew fetch --bottle-tag="${arm64_bottle}" gettext
brew fetch --bottle-tag="${x86_64_bottle}" gettext
brew fetch --bottle-tag="${arm64_bottle}" lua
brew fetch --bottle-tag="${x86_64_bottle}" lua
local version; version=$(brew info gettext --json | jq -r ".[0].versions.stable"); readonly version
echo "### gettext version ${version}"
local lua_version; lua_version=$(brew info lua --json | jq -r ".[0].versions.stable"); readonly version
echo "### gettext lua_version ${lua_version}"
local temp_dir; temp_dir="$(mktemp -d)"; readonly temp_dir
echo "${temp_dir}"
@ -36,28 +31,20 @@ main() {
mkdir "${arm64_bottle}"
pushd "${arm64_bottle}" >/dev/null
tar xf "$(brew --cache)"/**/*--gettext--+([0-9.])${arm64_bottle}*.tar.gz
tar xf "$(brew --cache)"/**/*--lua--+([0-9.])${arm64_bottle}*.tar.gz
popd >/dev/null
mkdir "${x86_64_bottle}"
pushd "${x86_64_bottle}" >/dev/null
tar xf "$(brew --cache)"/**/*--gettext--+([0-9.])${x86_64_bottle}*.tar.gz
tar xf "$(brew --cache)"/**/*--lua--+([0-9.])${x86_64_bottle}*.tar.gz
popd >/dev/null
mkdir universal
cp -r "${arm64_bottle}/gettext/${version}/include" ./universal/
mkdir universal/lib
lipo "${arm64_bottle}/gettext/${version}/lib/libintl.a" "${x86_64_bottle}/gettext/${version}/lib/libintl.a" -create -output ./universal/lib/libintl.a
mkdir universal_lua
cp -r "${arm64_bottle}/lua/${lua_version}/include" ./universal_lua/
mkdir universal_lua/lib
lipo "${arm64_bottle}/lua/${lua_version}/lib/liblua.a" "${x86_64_bottle}/lua/${lua_version}/lib/liblua.a" -create -output ./universal_lua/lib/liblua.a
popd >/dev/null
mv "${temp_dir}/universal" gettext
mv "${temp_dir}/universal_lua" lua
rm -rf "${temp_dir}"
popd >/dev/null

View File

@ -9,50 +9,5 @@ let package = Package(
.library(name: "NvimServerTypes", targets: ["NvimServerTypes"]),
],
dependencies: [],
targets: [
.target(name: "NvimServerTypes", dependencies: [], path: "NvimServerTypes"),
.executableTarget(
name: "NvimServer",
dependencies: [],
path: "NvimServer/Sources",
cSettings: [
// Otherwise we get typedef redefinition error due to double definition of Boolean
.unsafeFlags(["-fno-modules"]),
.define("INCLUDE_GENERATED_DECLARATIONS", to: "1"),
// The target folder is the working directory.
.headerSearchPath("../../NvimServer/neovim/src"),
.headerSearchPath("../../NvimServer/neovim/build/include"),
.headerSearchPath("../../NvimServer/neovim/.deps/usr/include"),
.headerSearchPath("../../NvimServer/neovim/build/cmake.config"),
.headerSearchPath("../../NvimServer/neovim/build/src/nvim/auto/"),
.headerSearchPath("../../NvimServer/third-party/gettext/include"),
.headerSearchPath("../../NvimServer/third-party/lua/include/lua"),
],
linkerSettings: [
.linkedFramework("CoreServices"),
.linkedFramework("CoreFoundation"),
.linkedLibrary("util"),
.linkedLibrary("m"),
.linkedLibrary("dl"),
.linkedLibrary("pthread"),
.linkedLibrary("iconv"),
.unsafeFlags([
// These paths seem to depend on where swift build is executed. Xcode does it in the
// folder where Package.swift is located.
"../neovim/build/lib/libnvim.a",
"../neovim/.deps/usr/lib/libmsgpack-c.a",
"../neovim/.deps/usr/lib/libluv.a",
"../neovim/.deps/usr/lib/liblpeg.a",
"../neovim/.deps/usr/lib/libtermkey.a",
"../neovim/.deps/usr/lib/libuv.a",
"../neovim/.deps/usr/lib/libunibilium.a",
"../neovim/.deps/usr/lib/libvterm.a",
"../neovim/.deps/usr/lib/libluajit-5.1.a",
"../neovim/.deps/usr/lib/libtree-sitter.a",
"NvimServer/third-party/gettext/lib/libintl.a",
]),
]
),
],
cLanguageStandard: .gnu99
targets: [.target(name: "NvimServerTypes", dependencies: [], path: "NvimServerTypes")]
)

View File

@ -2,18 +2,21 @@
set -Eeuo pipefail
declare -r -x clean=${clean:-false}
declare -r -x build_libnvim=${build_libnvim:-true}
declare -r -x build_dir=${build_dir:-"./.build"}
main() {
pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null
pushd "./NvimServer"
./NvimServer/bin/build_nvimserver.sh
cp ./.build/apple/Products/Release/NvimServer ../NvimView/Sources/NvimView/Resources
cp -r ./runtime ../NvimView/Sources/NvimView/Resources
cp ../NvimView/Sources/NvimView/Resources/com.qvacua.NvimView.vim ../NvimView/Sources/NvimView/Resources/runtime/plugin
popd >/dev/null
pushd "./NvimServer"
./NvimServer/bin/build_neovim.sh
popd
pushd ./Neovim/build
tar -xf nvim-macos.tar.gz
cp ./nvim-macos/bin/nvim ../../NvimView/Sources/NvimView/Resources/NvimServer
cp -r ./nvim-macos/share/nvim/runtime ../../NvimView/Sources/NvimView/Resources
popd
cp ./NvimView/Sources/NvimView/Resources/com.qvacua.NvimView.vim ./NvimView/Sources/NvimView/Resources/runtime/plugin
popd >/dev/null
}

View File

@ -12,14 +12,15 @@ prepare_nvimserver() {
rm -rf "${resources_folder}/runtime"
# Build NvimServer and copy
build_libnvim=true ./NvimServer/NvimServer/bin/build_nvimserver.sh
cp ./NvimServer/.build/apple/Products/Release/NvimServer "${resources_folder}"
./NvimServer/NvimServer/bin/build_neovim.sh
pushd ./Neovim/build >/dev/null
tar -xf nvim-macos.tar.gz
popd >/dev/null
cp ./Neovim/build/nvim-macos/bin/nvim "${resources_folder}/NvimServer"
# Create and copy runtime folder
install_path="$(/usr/bin/mktemp -d -t 'nvim-runtime')"
nvim_install_path="${install_path}" ./NvimServer/NvimServer/bin/build_runtime.sh
cp -r "${install_path}/share/nvim/runtime" "${resources_folder}"
rm -rf "${install_path}"
cp -r ./Neovim/build/nvim-macos/share/nvim/runtime "${resources_folder}"
# Copy VimR specific vim file to runtime/plugin folder
cp "${resources_folder}/com.qvacua.NvimView.vim" "${resources_folder}/runtime/plugin"

View File

@ -2,7 +2,7 @@
set -Eeuo pipefail
readonly vimr_app_path=${vimr_app_path:?"Path to VimR.app"}
readonly identity="Developer ID Application: George Harker (B8V3694RNX)"
readonly identity="Developer ID Application: Tae Won Ha (H96Q2NKTQH)"
remove_sparkle_xpc () {
# VimR is not sandboxed, so, remove the XPCs