Skip to content

Commit 59ae445

Browse files
committed
chore(stacks): add auto gen deps
1 parent 9052022 commit 59ae445

9 files changed

Lines changed: 38 additions & 34 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*/*.tar.gz
22
_dist
3+
.vscode

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function build {
2222
stack_version="${2:?stack_version is required}"
2323
docker run --rm \
2424
--privileged=true \
25+
--env STACK_DOWNLOAD_URL="${STACK_DOWNLOAD_URL:-}" \
2526
--env STACK_NAME="${STACK_NAME}" \
2627
--env STACK_VERSION="${stack_version}" \
2728
-v "${DIST_DIR}":"${DIST_DIR}" \

scripts/stack-utils

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ function generate-stack-template() {
2626
mkdir -p "${META_DIR}"
2727
mkdir -p "${DATA_DIR}"
2828
mkdir -p "${PROFILE_DIR}"
29-
touch /workspace/"${TARNAME}"/meta/dependencies
30-
touch /workspace/"${TARNAME}"/meta/preinstall
31-
touch /workspace/"${TARNAME}"/meta/postinstall
32-
chmod +x /workspace/"${TARNAME}"/meta/preinstall /workspace/"${TARNAME}"/meta/postinstall
29+
touch "${META_DIR}"/dependencies
30+
touch "${META_DIR}"/preinstall
31+
touch "${META_DIR}"/postinstall
32+
chmod +x "${META_DIR}"/preinstall "${META_DIR}"/postinstall
3333
}
3434

3535
function generate-stack-package() {
@@ -45,13 +45,19 @@ export PATH="/opt/drycc/${STACK_NAME}/bin:\$PATH"
4545
EOF
4646
}
4747

48+
function generate-stack-dependencies() {
49+
scanelp "${DATA_DIR}" | awk -F ":" '{print $1}' >> ${META_DIR}/dependencies
50+
cat ${META_DIR}/dependencies | awk '!x[$0]++' > ${META_DIR}/dependencies
51+
}
52+
4853
function source-stack-path() {
4954
. "${PROFILE_DIR}"/"${STACK_NAME}".sh
5055
}
5156

5257
function build-stack() {
5358
generate-stack-template
5459
build
60+
generate-stack-dependencies
5561
generate-stack-package "$1"
5662
}
5763

stacks/erlang/build.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
# Implement build function
77
function build() {
88
generate-stack-path
9-
cat << EOF > "${META_DIR}"/dependencies
10-
libssl1.1
11-
libodbc1
12-
libsctp1
13-
libwxgtk3.0
14-
EOF
159
source-stack-path
1610
./make.sh
1711
cp -rf /opt/drycc/erlang/* ${DATA_DIR}

stacks/mariadb/build.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55

66
# Implement build function
77
function build() {
8-
cat << EOF > /workspace/"${TARNAME}"/meta/dependencies
9-
libncurses6
10-
EOF
11-
128
install-packages \
139
cmake \
1410

stacks/php/build.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@
55

66
# Implement build function
77
function build() {
8-
cat << EOF > "${META_DIR}"/dependencies
9-
libreadline8
10-
libxml2
11-
libsqlite3-0
12-
libsqlite3
13-
libargon2-1
14-
libonig5
15-
EOF
16-
178
mkdir -p /opt/drycc/php/profile.d
189
cat << EOF > /opt/drycc/php/profile.d/php.sh
1910
export PATH=/opt/drycc/php/bin:/opt/drycc/php/sbin:$PATH

stacks/podman/build.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ function build() {
1010
fuse-overlayfs
1111
iptables
1212
conmon
13-
libgpgme11
14-
libdevmapper1.02.1
1513
EOF
1614

1715
install-packages \

stacks/postgresql/build.sh

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,32 @@ function build() {
1010
PG_MAJOR=$(echo "${STACK_VERSION}"|cut -d"." -f1)
1111

1212
cat << EOF > /workspace/"${TARNAME}"/meta/dependencies
13-
binutils \
14-
gdal-bin \
13+
binutils
14+
gdal-bin
1515
libproj-dev
16+
llvm-11-dev
17+
libllvm11
18+
libc6
19+
libc6-i386
20+
libssl1.1
21+
libgcc-s1
22+
lib32gcc-s1
23+
libgssapi-krb5-2
24+
libicu67
25+
libldap-2.4-2
26+
liblz4-1
27+
libpam0g
28+
libperl5.32
29+
libpq5
30+
libpython3.9
31+
libreadline8
32+
libstdc++6
33+
lib32stdc++6
34+
libtcl8.6
35+
libuuid1
36+
libxml2
37+
libxslt1.1
38+
zlib1g
1639
EOF
1740

1841
install-packages \
@@ -75,7 +98,7 @@ EOF
7598
cat << EOF > "${PROFILE_DIR}/${STACK_NAME}.sh"
7699
export PATH="/opt/drycc/postgresql/$PG_MAJOR/bin:\$PATH"
77100
EOF
78-
101+
rm postgresql-${STACK_VERSION}
79102
cp -rf /opt/drycc/postgresql/* "${DATA_DIR}"
80103
}
81104

stacks/python/build.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55

66
# Implement build function
77
function build() {
8-
cat << EOF > "${META_DIR}"/dependencies
9-
expat
10-
libffi-dev
11-
pkg-config
12-
libsqlite3-dev
13-
EOF
148
mkdir -p /opt/drycc/python/profile.d
159
cat << EOF > /opt/drycc/python/profile.d/python.sh
1610
export PATH="/opt/drycc/python/bin:\$PATH"

0 commit comments

Comments
 (0)