Skip to content

Commit aee3fa2

Browse files
committed
Add vimr-deps download script
1 parent 71eab5e commit aee3fa2

File tree

7 files changed

+61
-8
lines changed

7 files changed

+61
-8
lines changed

Diff for: .github/workflows/vimr-deps-release-on-tag.yml

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
fetch-depth: 0
1414
- name: Install brew packages
1515
run: |
16+
brew update >/dev/null
17+
brew upgrade
1618
brew install automake coreutils pyenv pyenv-virtualenv
1719
- name: Set up Python env
1820
run: |

Diff for: VimR/VimR.xcodeproj/project.pbxproj

+8-8
Original file line numberDiff line numberDiff line change
@@ -1245,17 +1245,17 @@
12451245
COMBINE_HIDPI_IMAGES = YES;
12461246
CURRENT_PROJECT_VERSION = 20211201.192602;
12471247
DEFINES_MODULE = YES;
1248-
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../third-party/vimr-deps/include";
1248+
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/.deps/include";
12491249
IBC_MODULE = VimR;
12501250
INFOPLIST_FILE = VimR/Info.plist;
12511251
LD_RUNPATH_SEARCH_PATHS = (
12521252
"$(inherited)",
12531253
"@executable_path/../Frameworks",
12541254
);
12551255
OTHER_LDFLAGS = (
1256-
"$(PROJECT_DIR)/../third-party/vimr-deps/lib/liblzma.a",
1257-
"$(PROJECT_DIR)/../third-party/vimr-deps/lib/libpcre.a",
1258-
"$(PROJECT_DIR)/../third-party/vimr-deps/lib/libag.a",
1256+
"$(PROJECT_DIR)/.deps/lib/liblzma.a",
1257+
"$(PROJECT_DIR)/.deps/lib/libpcre.a",
1258+
"$(PROJECT_DIR)/.deps/lib/libag.a",
12591259
"-pthread",
12601260
);
12611261
PRODUCT_BUNDLE_IDENTIFIER = "$(VIMR_BUNDLE_IDENTIFIER)";
@@ -1273,17 +1273,17 @@
12731273
COMBINE_HIDPI_IMAGES = YES;
12741274
CURRENT_PROJECT_VERSION = 20211201.192602;
12751275
DEFINES_MODULE = YES;
1276-
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../third-party/vimr-deps/include";
1276+
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/.deps/include";
12771277
IBC_MODULE = VimR;
12781278
INFOPLIST_FILE = VimR/Info.plist;
12791279
LD_RUNPATH_SEARCH_PATHS = (
12801280
"$(inherited)",
12811281
"@executable_path/../Frameworks",
12821282
);
12831283
OTHER_LDFLAGS = (
1284-
"$(PROJECT_DIR)/../third-party/vimr-deps/lib/liblzma.a",
1285-
"$(PROJECT_DIR)/../third-party/vimr-deps/lib/libpcre.a",
1286-
"$(PROJECT_DIR)/../third-party/vimr-deps/lib/libag.a",
1284+
"$(PROJECT_DIR)/.deps/lib/liblzma.a",
1285+
"$(PROJECT_DIR)/.deps/lib/libpcre.a",
1286+
"$(PROJECT_DIR)/.deps/lib/libag.a",
12871287
"-pthread",
12881288
);
12891289
PRODUCT_BUNDLE_IDENTIFIER = "$(VIMR_BUNDLE_IDENTIFIER)";

Diff for: bin/build_vimr.sh

+6
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@ set -Eeuo pipefail
33

44
readonly code_sign=${code_sign:?"true or false"}
55
readonly use_carthage_cache=${use_carthage_cache:?"true or false"}
6+
readonly download_deps=${download_deps:?"true or false: when true, vimr-deps is downloaded"}
67

78
main () {
89
pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null
910
echo "### Building VimR target"
1011

12+
if [[ "${download_deps}" == true ]]; then
13+
rm -rf ./VimR/.deps
14+
./bin/download_vimr_deps.sh
15+
fi
16+
1117
local -r build_path="./build"
1218

1319
# Carthage often crashes => do it at the beginning.

Diff for: bin/build_vimr_dev.sh

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -Eeuo pipefail
33

44
readonly clean=${clean:?"true or false: when true, xcodebuild clean will be performed"}
5+
readonly download_deps=${download_deps:-false}
56

67
main() {
78
if [[ "${clean}" == true ]]; then
@@ -11,6 +12,11 @@ main() {
1112
fi
1213

1314
pushd "$(dirname "${BASH_SOURCE[0]}")/.." > /dev/null
15+
if [[ "${download_deps}" == true ]]; then
16+
rm -rf ./VimR/.deps
17+
./bin/download_vimr_deps.sh
18+
fi
19+
1420
xcodebuild \
1521
-workspace VimR.xcworkspace \
1622
-derivedDataPath ./build \

Diff for: bin/download_vimr_deps.sh

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
set -Eeuo pipefail
3+
4+
readonly target_dir_path="VimR/.deps"
5+
readonly file_name="vimr-deps"
6+
readonly compressed_file_name="${file_name}.tar.bz2"
7+
8+
download_vimr_deps() {
9+
echo "### Downloading ${file_name}"
10+
local version
11+
version=$(cat ./resources/vimr-deps_version.txt)
12+
readonly version
13+
14+
echo "#### Downloading ${version}"
15+
16+
rm -rf "${target_dir_path}"
17+
18+
mkdir -p ${target_dir_path}
19+
curl -o "${target_dir_path}/vimr-deps.tar.bz2" -L "https://github.com/qvacua/vimr/releases/download/${version}/${compressed_file_name}"
20+
21+
pushd ${target_dir_path} >/dev/null
22+
tar xf "${compressed_file_name}"
23+
rm ${compressed_file_name}
24+
mv "${file_name}"/* .
25+
rm -r "${file_name}"
26+
popd >/dev/null
27+
28+
echo "### Downloaded ${file_name}"
29+
}
30+
31+
main() {
32+
pushd "$(dirname "${BASH_SOURCE[0]}")/.." > /dev/null
33+
download_vimr_deps
34+
popd >/dev/null
35+
}
36+
37+
main

Diff for: bin/resources

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../resources

Diff for: resources/vimr-deps_version.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vimr-deps-2021-12-12

0 commit comments

Comments
 (0)