aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/download-unicode-files.sh4
-rwxr-xr-xscripts/genappimage.sh11
-rwxr-xr-xscripts/pvscheck.sh60
-rwxr-xr-xscripts/vim-patch.sh2
4 files changed, 46 insertions, 31 deletions
diff --git a/scripts/download-unicode-files.sh b/scripts/download-unicode-files.sh
index 54fc32550c..5f38d0589a 100755
--- a/scripts/download-unicode-files.sh
+++ b/scripts/download-unicode-files.sh
@@ -22,7 +22,7 @@ UNIDIR=${1:-$UNIDIR_DEFAULT}
DOWNLOAD_URL_BASE=${2:-$DOWNLOAD_URL_BASE_DEFAULT}
for filename in $data_files ; do
- curl -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/UNIDATA/$filename"
+ curl -L -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/UNIDATA/$filename"
(
cd "$UNIDIR"
git add $filename
@@ -30,7 +30,7 @@ for filename in $data_files ; do
done
for filename in $emoji_files ; do
- curl -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/emoji/3.0/$filename"
+ curl -L -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/emoji/latest/$filename"
(
cd "$UNIDIR"
git add $filename
diff --git a/scripts/genappimage.sh b/scripts/genappimage.sh
index fd7247b947..a73ccd86c7 100755
--- a/scripts/genappimage.sh
+++ b/scripts/genappimage.sh
@@ -18,23 +18,22 @@ ROOT_DIR="$(git rev-parse --show-toplevel)"
APP_BUILD_DIR="$ROOT_DIR/build"
APP_DIR="$APP.AppDir"
-# App version, used by generate_appimage.
-VERSION=$("$ROOT_DIR"/build/bin/nvim --version | head -n 1 | grep -o 'v.*')
-
########################################################################
# Compile nvim and install it into AppDir
########################################################################
# Build and install nvim into the AppImage
-make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=${APP_DIR}/usr"
+make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=${APP_DIR}/usr -DCMAKE_INSTALL_MANDIR=man"
make install
########################################################################
# Get helper functions and move to AppDir
########################################################################
+# App version, used by generate_appimage.
+VERSION=$("$ROOT_DIR"/build/bin/nvim --version | head -n 1 | grep -o 'v.*')
+
cd "$APP_BUILD_DIR"
-mkdir "$APP_DIR"
curl -Lo "$APP_BUILD_DIR"/appimage_functions.sh https://github.com/probonopd/AppImages/raw/master/functions.sh
. ./appimage_functions.sh
@@ -80,3 +79,5 @@ generate_appimage
mv "$ROOT_DIR"/out/*.AppImage "$ROOT_DIR"/build/bin
# Remove the (now empty) folder the AppImage was built in
rmdir "$ROOT_DIR"/out
+
+echo 'genappimage.sh: finished'
diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh
index ca85b6be7f..e4536b3dce 100755
--- a/scripts/pvscheck.sh
+++ b/scripts/pvscheck.sh
@@ -1,27 +1,36 @@
#!/bin/sh
+
+# Assume that "local" is available.
+# shellcheck disable=SC2039
+
set -e
# Note: -u causes problems with posh, it barks at “undefined” $@ when no
# arguments provided.
test -z "$POSH_VERSION" && set -u
get_jobs_num() {
- local num="$(cat /proc/cpuinfo | grep -c "^processor")"
- num="$(echo $(( num + 1 )))"
- num="${num:-1}"
- echo $num
+ if [ -n "${TRAVIS:-}" ] ; then
+ # HACK: /proc/cpuinfo on Travis CI is misleading, so hardcode 1.
+ echo 1
+ else
+ echo $(( $(grep -c "^processor" /proc/cpuinfo) + 1 ))
+ fi
}
help() {
echo 'Usage:'
- echo ' pvscheck.sh [--pvs URL] [--deps] [target-directory [branch]]'
- echo ' pvscheck.sh [--pvs URL] [--recheck|--only-analyse] [target-directory]'
+ echo ' pvscheck.sh [--pvs URL] [--deps] [--environment-cc]'
+ echo ' [target-directory [branch]]'
+ echo ' pvscheck.sh [--pvs URL] [--recheck] [--environment-cc]'
+ echo ' [target-directory]'
+ echo ' pvscheck.sh [--pvs URL] --only-analyse [target-directory]'
echo ' pvscheck.sh [--pvs URL] --pvs-install {target-directory}'
echo ' pvscheck.sh --patch [--only-build]'
echo
echo ' --pvs: Use the specified URL as a path to pvs-studio archive.'
echo ' By default latest tested version is used.'
echo
- echo ' May use `--pvs detect` to try detecting latest version.'
+ echo ' May use "--pvs detect" to try detecting latest version.'
echo ' That assumes certain viva64.com site properties and'
echo ' may be broken by the site update.'
echo
@@ -29,6 +38,9 @@ help() {
echo ' Without this it assumes all dependencies are already'
echo ' installed.'
echo
+ echo ' --environment-cc: (for regular run and --recheck) Do not export'
+ echo ' CC=clang. Build is still run with CFLAGS=-O0.'
+ echo
echo ' --only-build: (for --patch) Only patch files in ./build directory.'
echo
echo ' --pvs-install: Only install PVS-studio to the specified location.'
@@ -261,20 +273,14 @@ install_pvs() {(
rmdir "$pvsdir"
)}
-adjust_path() {
- if test -d "$tgt/pvs-studio" ; then
- local saved_pwd="$PWD"
- cd "$tgt/pvs-studio"
- export PATH="$PWD/bin${PATH+:}${PATH}"
- cd "$saved_pwd"
- fi
-}
-
create_compile_commands() {(
local tgt="$1" ; shift
local deps="$1" ; shift
+ local environment_cc="$1" ; shift
- export CC=clang
+ if test -z "$environment_cc" ; then
+ export CC=clang
+ fi
export CFLAGS=' -O0 '
if test -z "$deps" ; then
@@ -359,19 +365,21 @@ do_check() {
local branch="$1" ; shift
local pvs_url="$1" ; shift
local deps="$1" ; shift
+ local environment_cc="$1" ; shift
git clone --branch="$branch" . "$tgt"
install_pvs "$tgt" "$pvs_url"
- do_recheck "$tgt" "$deps"
+ do_recheck "$tgt" "$deps" "$environment_cc"
}
do_recheck() {
local tgt="$1" ; shift
- local deps="$2" ; shift
+ local deps="$1" ; shift
+ local environment_cc="$1" ; shift
- create_compile_commands "$tgt" "$deps"
+ create_compile_commands "$tgt" "$deps" "$environment_cc"
do_analysis "$tgt"
}
@@ -379,7 +387,12 @@ do_recheck() {
do_analysis() {
local tgt="$1" ; shift
- adjust_path "$tgt"
+ if test -d "$tgt/pvs-studio" ; then
+ local saved_pwd="$PWD"
+ cd "$tgt/pvs-studio"
+ export PATH="$PWD/bin${PATH+:}${PATH}"
+ cd "$saved_pwd"
+ fi
run_analysis "$tgt"
}
@@ -406,6 +419,7 @@ main() {
only-analyse store_const \
pvs-install store_const \
deps store_const \
+ environment-cc store_const \
-- \
'modify realdir tgt "$PWD/../neovim-pvs"' \
'store branch master' \
@@ -424,11 +438,11 @@ main() {
elif test -n "$pvs_install" ; then
install_pvs "$tgt" "$pvs_url"
elif test -n "$recheck" ; then
- do_recheck "$tgt" "$deps"
+ do_recheck "$tgt" "$deps" "$environment_cc"
elif test -n "$only_analyse" ; then
do_analysis "$tgt"
else
- do_check "$tgt" "$branch" "$pvs_url" "$deps"
+ do_check "$tgt" "$branch" "$pvs_url" "$deps" "$environment_cc"
fi
}
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index 3b083e7b83..63665b9253 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -280,7 +280,7 @@ submit_pr() {
echo "Pushing to 'origin/${checked_out_branch}'."
output="$(git push origin "${checked_out_branch}" 2>&1)" &&
echo "✔ ${output}" ||
- (echo "✘ ${output}"; git reset --soft HEAD^1; false)
+ (echo "✘ ${output}"; false)
echo
fi