Skip to content

Commit 5044b34

Browse files
committed
Add support for running plugin build scripts with build.sh
1 parent c959bba commit 5044b34

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

build.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
set -eu -o pipefail
1414
export LC_ALL=C.UTF-8
15+
shopt -s nullglob
1516

1617
[ -v CI_TOOLS ] && [ "$CI_TOOLS" == "SGSGermany" ] \
1718
|| { echo "Invalid build environment: Environment variable 'CI_TOOLS' not set or invalid" >&2; exit 1; }
@@ -64,6 +65,13 @@ rm -f "$MOUNT/usr/bin/weechat" "$MOUNT/usr/bin/weechat-headless"
6465
echo + "rsync -v -rl --exclude .gitignore ./src/ …/" >&2
6566
rsync -v -rl --exclude '.gitignore' "$BUILD_DIR/src/" "$MOUNT/"
6667

68+
for PLUGIN in "$BUILD_DIR/plugins/"*"/src/"; do
69+
PLUGIN="$(sed -ne 's#^.*/\([^/]*\)/src/$#\1#p' <<< "$PLUGIN")"
70+
71+
echo + "rsync -v -rl --exclude .gitignore $(quote "./plugins/$PLUGIN/src/") …/" >&2
72+
rsync -v -rl --exclude '.gitignore' "$BUILD_DIR/plugins/$PLUGIN/src/" "$MOUNT/"
73+
done
74+
6775
echo + "ln -s /opt/weechat/include/weechat/ …/usr/include/weechat" >&2
6876
ln -s "/opt/weechat/include/weechat/" "$MOUNT/usr/include/weechat"
6977

@@ -101,6 +109,13 @@ VERSION="$(buildah run "$CONTAINER" -- weechat --version)"
101109
echo + "[[ ${VERSION@Q} == $VERSION_PATTERN ]]" >&2
102110
[[ "$VERSION" == $VERSION_PATTERN ]]
103111

112+
for PLUGIN in "$BUILD_DIR/plugins/"*"/build.sh.inc"; do
113+
PLUGIN="$(sed -ne 's#^.*/\([^/]*\)/build\.sh\.inc$#\1#p' <<< "$PLUGIN")"
114+
115+
echo + "source $(quote "./plugins/$PLUGIN/build.sh.inc")" >&2
116+
source "$BUILD_DIR/plugins/$PLUGIN/build.sh.inc"
117+
done
118+
104119
cleanup "$CONTAINER"
105120

106121
con_cleanup "$CONTAINER"

plugins/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This directory is empty by default

0 commit comments

Comments
 (0)