-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the dependency on the sourcegraph monorepo
- Loading branch information
1 parent
b4193c2
commit 801a704
Showing
1 changed file
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,45 @@ | ||
#!/bin/sh | ||
|
||
# This script installs universal-ctags within an alpine container. | ||
|
||
# Commit hash of github.com/universal-ctags/ctags. | ||
# Last bumped 2023-10-24. | ||
CTAGS_VERSION=v6.0.0 | ||
CTAGS_ARCHIVE_TOP_LEVEL_DIR=ctags-6.0.0 | ||
# When using commits you can rely on | ||
# CTAGS_ARCHIVE_TOP_LEVEL_DIR=ctags-$CTAGS_VERSION | ||
|
||
cleanup() { | ||
apk --no-cache --purge del ctags-build-deps || true | ||
cd / | ||
rm -rf /tmp/ctags-$CTAGS_VERSION | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
set -eux | ||
# shellcheck disable=SC3040 | ||
set -o pipefail || true | ||
# Commit from 2023-10-24. Please always pick a commit from the main branch. | ||
export SOURCEGRAPH_COMMIT=45a6748bb491513b9e1162d888711ca9b3bb4303 | ||
wget -O - https://raw.githubusercontent.com/sourcegraph/sourcegraph/$SOURCEGRAPH_COMMIT/cmd/symbols/ctags-install-alpine.sh | sh | ||
|
||
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) | ||
|
||
# Installation | ||
curl --retry 5 "https://codeload.github.com/universal-ctags/ctags/tar.gz/$CTAGS_VERSION" | tar xz -C /tmp | ||
cd /tmp/$CTAGS_ARCHIVE_TOP_LEVEL_DIR | ||
./autogen.sh | ||
./configure --program-prefix=universal- --enable-json | ||
make -j"$NUMCPUS" --load-average="$NUMCPUS" | ||
make install |