Skip to content

Commit

Permalink
Move neovim build scripts to /bin
Browse files Browse the repository at this point in the history
  • Loading branch information
qvacua committed Nov 24, 2023
1 parent 969b9b6 commit c5f41a7
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 174 deletions.
3 changes: 0 additions & 3 deletions NvimServer/NvimServer/.gitignore

This file was deleted.

86 changes: 0 additions & 86 deletions NvimServer/NvimServer/bin/README.md

This file was deleted.

19 changes: 0 additions & 19 deletions NvimServer/NvimServer/bin/clean_all.sh

This file was deleted.

1 change: 0 additions & 1 deletion NvimServer/NvimServer/neovim

This file was deleted.

2 changes: 0 additions & 2 deletions bin/.gitignore

This file was deleted.

30 changes: 30 additions & 0 deletions bin/build_nvimserver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
set -Eeuo pipefail

declare -r -x clean=${clean:-false}

main() {
pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null

resources_folder="./NvimView/Sources/NvimView/Resources"
rm -rf "${resources_folder}/NvimServer"
rm -rf "${resources_folder}/runtime"

# Build NvimServer and copy
./bin/neovim/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
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"

popd >/dev/null
}

main
24 changes: 0 additions & 24 deletions bin/build_nvimserver_for_local_dev.sh

This file was deleted.

22 changes: 1 addition & 21 deletions bin/build_vimr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,6 @@ readonly strip_symbols=${strip_symbols:-true}
readonly notarize=${notarize:?"true or false"}
readonly clean=${clean:?"true or false"}

prepare_nvimserver() {
resources_folder="./NvimView/Sources/NvimView/Resources"
rm -rf "${resources_folder}/NvimServer"
rm -rf "${resources_folder}/runtime"

# Build NvimServer and copy
./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
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"
}

build_vimr() {
local -r build_path=$1

Expand All @@ -47,7 +27,7 @@ main () {
pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null
echo "### Building VimR"

prepare_nvimserver
./bin/build_nvimserver.sh

local -r build_path="./build"
build_vimr "${build_path}"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ build_neovim() {
-D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \
-D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64 \
-D CMAKE_FIND_FRAMEWORK=NEVER \
-D LIBINTL_INCLUDE_DIR=../NvimServer/NvimServer/third-party/gettext/include \
-D LIBINTL_LIBRARY=../NvimServer/NvimServer/third-party/gettext/lib/libintl.a
-D LIBINTL_INCLUDE_DIR=../bin/neovim/third-party/gettext/include \
-D LIBINTL_LIBRARY=../bin/neovim/third-party/gettext/lib/libintl.a
cmake --build build

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
# This script is located in /bin/neovim/bin and we have to go to /
pushd "$(dirname "${BASH_SOURCE[0]}")/../../../" >/dev/null

./NvimServer/bin/prepare_libintl.sh
./bin/neovim/bin/prepare_libintl.sh

local deployment_target
deployment_target=$(jq -r .deploymentTarget ./NvimServer/Resources/buildInfo.json)
deployment_target=$(jq -r .deploymentTarget ./bin/neovim/resources/buildInfo.json)
readonly deployment_target

pushd ../Neovim >/dev/null
pushd ./Neovim >/dev/null
echo "### Building neovim binary"
if [[ "${clean}" == true ]]; then
make distclean
Expand Down
13 changes: 13 additions & 0 deletions bin/neovim/bin/clean_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -Eeuo pipefail

pushd "$(dirname "${BASH_SOURCE[0]}")/../../.." >/dev/null
pushd ./Neovim

rm -rf ./build
rm -rf ./.deps
make distclean

popd

popd >/dev/null
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ set -Eeuo pipefail
shopt -s extglob

main() {
# This script is located in /NvimServer/bin and we have to go to /
pushd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null
# This script is located in /bin/neovim/bin and we have to go to /
pushd "$(dirname "${BASH_SOURCE[0]}")/../../.." >/dev/null

rm -rf ./NvimServer/third-party
mkdir -p NvimServer/third-party
pushd ./bin/neovim >/dev/null
rm -rf ./third-party
mkdir -p third-party

local arm64_bottle
arm64_bottle=$(jq -r .gettext.arm64BottleTag ./NvimServer/Resources/buildInfo.json)
readonly arm64_bottle
local arm64_bottle
arm64_bottle=$(jq -r .gettext.arm64BottleTag ./resources/buildInfo.json)
readonly arm64_bottle

local x86_64_bottle
x86_64_bottle=$(jq -r .gettext.x86_64BottleTag ./NvimServer/Resources/buildInfo.json)
readonly x86_64_bottle
local x86_64_bottle
x86_64_bottle=$(jq -r .gettext.x86_64BottleTag ./resources/buildInfo.json)
readonly x86_64_bottle
popd >/dev/null

pushd ./NvimServer/third-party >/dev/null
pushd ./bin/neovim/third-party >/dev/null
brew fetch --bottle-tag="${arm64_bottle}" gettext
brew fetch --bottle-tag="${x86_64_bottle}" gettext

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions bin/neovim/third-party/gettext/bin
1 change: 1 addition & 0 deletions bin/neovim/third-party/gettext/include
3 changes: 3 additions & 0 deletions bin/neovim/third-party/gettext/lib/libintl.a
Git LFS file not shown
1 change: 1 addition & 0 deletions bin/neovim/third-party/gettext/share

0 comments on commit c5f41a7

Please sign in to comment.