Skip to content

Commit 7d4df6f

Browse files
committed
feat(stacks): add jq and yj
1 parent 440a71d commit 7d4df6f

2 files changed

Lines changed: 59 additions & 0 deletions

File tree

stacks/jq/build.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
function install-deps() {
7+
install-packages build-essential \
8+
autoconf \
9+
libtool \
10+
git \
11+
ruby \
12+
bison \
13+
flex \
14+
python3 \
15+
python3-pip \
16+
wget && \
17+
pip3 install pipenv
18+
}
19+
20+
# Implement build function
21+
function build() {
22+
generate-stack-path
23+
install-deps
24+
rm -rf jq
25+
git clone --dept 1 -b jq-${STACK_VERSION} https://github.com/stedolan/jq
26+
cd jq
27+
git submodule update --init
28+
autoreconf -fi
29+
./configure --with-oniguruma=builtin --enable-all-static --prefix=/opt/drycc/jq
30+
make LDFLAGS=-all-static
31+
make install
32+
cp -rf /opt/drycc/jq/* ${DATA_DIR}
33+
cd - && rm -rf jq
34+
}
35+
36+
# call build stack
37+
build-stack "${1}"

stacks/yj/build.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
# Implement build function
7+
function build() {
8+
generate-stack-path
9+
BIN_DIR="${DATA_DIR}"/bin
10+
mkdir -p "${BIN_DIR}"
11+
architecture=$(dpkg --print-architecture); \
12+
case "$architecture" in \
13+
amd64) yj_name=yj-linux ;; \
14+
*) yj_name=yj-linux=$architecture ;; \
15+
esac ; \
16+
curl -o "${BIN_DIR}"/yj \
17+
-L "https://github.com/sclevine/yj/releases/download/v${STACK_VERSION}/$yj_name"; \
18+
chmod +x "${BIN_DIR}"/yj
19+
}
20+
21+
# call build stack
22+
build-stack "${1}"

0 commit comments

Comments
 (0)