forked from sourcegraph/zoekt
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstall-ctags-alpine.sh
More file actions
executable file
·50 lines (40 loc) · 1.11 KB
/
install-ctags-alpine.sh
File metadata and controls
executable file
·50 lines (40 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# This script installs universal-ctags within an alpine container.
# Commit hash of github.com/universal-ctags/ctags.
# Last bumped 2024-09-02.
CTAGS_VERSION=v6.1.0
CTAGS_ARCHIVE_TOP_LEVEL_DIR=ctags-6.1.0
# When using commits you can rely on
# CTAGS_ARCHIVE_TOP_LEVEL_DIR=ctags-$CTAGS_VERSION
CTAGS_TMPDIR=
cleanup() {
apk --no-cache --purge del ctags-build-deps || true
cd /
if [ -n "$CTAGS_TMPDIR" ]; then
rm -rf "$CTAGS_TMPDIR"
fi
}
trap cleanup EXIT
set -eux
apk --no-cache add \
--virtual ctags-build-deps \
autoconf \
automake \
binutils \
curl \
g++ \
gcc \
jansson-dev \
make \
pkgconfig
# ctags is dynamically linked against jansson
apk --no-cache add jansson
NUMCPUS=$(grep -c '^processor' /proc/cpuinfo)
CTAGS_TMPDIR=$(mktemp -d /tmp/ctags.XXXXXX)
# Installation
curl --retry 5 "https://codeload.github.com/universal-ctags/ctags/tar.gz/$CTAGS_VERSION" | tar xz -C "$CTAGS_TMPDIR"
cd "$CTAGS_TMPDIR/$CTAGS_ARCHIVE_TOP_LEVEL_DIR"
./autogen.sh
./configure --program-prefix=universal- --enable-json --disable-readcmd
make -j"$NUMCPUS" --load-average="$NUMCPUS"
make install