-
Notifications
You must be signed in to change notification settings - Fork 10
/
build-jq.sh
executable file
·30 lines (25 loc) · 1.2 KB
/
build-jq.sh
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
#!/bin/bash
mkdir -p build
cd build
ONIGURUMA_VERSION=5.9.6
JQ_VERSION=1.6
PLATFORM=$(printf "$(uname)-$(uname -m)" | tr "[A-Z]" "[a-z]")
wget https://github.com/kkos/oniguruma/releases/download/v${ONIGURUMA_VERSION}/onig-${ONIGURUMA_VERSION}.tar.gz && \
tar xvf onig-${ONIGURUMA_VERSION}.tar.gz && \
rm onig-${ONIGURUMA_VERSION}.tar.gz && \
cd onig-${ONIGURUMA_VERSION} && \
./configure --prefix $(cd .. && pwd -P) && \
make && \
make install && \
cd ..
wget https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-${JQ_VERSION}.tar.gz && \
tar xvf jq-${JQ_VERSION}.tar.gz && \
rm jq-${JQ_VERSION}.tar.gz && \
cd jq-${JQ_VERSION} && \
./configure --disable-maintainer-mode --prefix $(cd .. && pwd -P) --with-oniguruma=$(cd .. && pwd -P) --disable-docs && \
sed -i.bak 's/LIBS = -lonig/LIBS = /' Makefile && \
sed -i.bak "s/libjq_la_LIBADD = -lm/libjq_la_LIBADD = -lm $(find ../onig-${ONIGURUMA_VERSION} -name '*.lo' | xargs echo | sed 's/\//\\\//g')/" Makefile && \
sed -i.bak "s/jq_LDADD = libjq.la -lm/jq_LDADD = libjq.la -lm $(find ../onig-${ONIGURUMA_VERSION} -name '*.lo' | xargs echo | sed 's/\//\\\//g')/" Makefile && \
make && \
make install && \
cd ..