-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
some symlinks to make transitioning easier
- Loading branch information
Showing
9 changed files
with
239 additions
and
134 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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pkg-build |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
arg="$1" | ||
shift | ||
|
||
if test "$arg" = "-L"; then | ||
|
||
if test -z "$TEA_PREFIX"; then | ||
echo "tea.xyz/brewkit: error: TEA_PREFIX unset" >&2 | ||
exit 1 | ||
fi | ||
|
||
if test -z "$GITHUB_TOKEN"; then | ||
GITHUB_TOKEN=$(tea gh auth token) | ||
fi | ||
|
||
if test -n "$SRCROOT"; then | ||
docker run \ | ||
--name tea \ | ||
--rm \ | ||
--volume "$SRCROOT/tea.linux/home":/root \ | ||
--volume "$SRCROOT/tea.linux":/root/.tea \ | ||
--volume "$TEA_PREFIX/tea.xyz/var/www":/root/.tea/tea.xyz/var/www \ | ||
--volume /root/.tea/tea.xyz/var/pantry \ | ||
--volume /root/.tea/tea.xyz/var/pantries \ | ||
--volume "$SRCROOT"/projects:/pantry/projects \ | ||
--env GITHUB_TOKEN=$GITHUB_TOKEN \ | ||
--env TEA_PANTRY_PATH=/pantry \ | ||
ghcr.io/teaxyz/infuser \ | ||
tea +tea.xyz/brewkit "$@" | ||
else | ||
docker run \ | ||
--name tea \ | ||
--rm \ | ||
--volume "$TEA_PREFIX/tea.xyz/brewkit/mnt":/root \ | ||
--volume "$TEA_PREFIX/tea.xyz/var/www":/root/.tea/tea.xyz/var/www \ | ||
--volume /root/.tea/tea.xyz/var/pantries \ | ||
--volume /root/.tea/tea.xyz/var/pantry \ | ||
--env GITHUB_TOKEN=$GITHUB_TOKEN \ | ||
ghcr.io/teaxyz/infuser \ | ||
tea +tea.xyz/brewkit "$@" | ||
fi | ||
elif test -n "$arg"; then | ||
d="$(cd "$(dirname "$0")" && pwd)" | ||
export PATH="$d:$PATH" | ||
exec pkg-"$arg" "$@" | ||
else | ||
echo "tea.xyz/brewkit: error: invalid usage" >&2 | ||
exit 1 | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if test -n "$RUNNER_DEBUG" -a -n "$GITHUB_ACTIONS" -o -n "$VERBOSE"; then | ||
set -x | ||
fi | ||
|
||
d="$(cd $(dirname $0)/.. && pwd)" | ||
PATH="$d/libexec:$PATH" | ||
|
||
if test -z "$1"; then | ||
if test -z "$TEA_PANTRY_PATH"; then | ||
echo "error: TEA_PANTRY_PATH is not set" >&2 | ||
exit 1 | ||
fi | ||
for x in $(echo "$TEA_PANTRY_PATH" | tr ':' '\n'); do | ||
if test -d "$x"/.git; then | ||
PKGS="$(GIT_DIR="$x"/.git peek.sh) $PKGS" | ||
fi | ||
done | ||
else | ||
PKGS="$@" | ||
fi | ||
|
||
if test -z "$GITHUB_TOKEN"; then | ||
export GITHUB_TOKEN=$(tea gh auth token) | ||
fi | ||
|
||
# should one of these depend on the other: | ||
# ensure they are build in the correct order | ||
PKGS="$(sort.ts $PKGS --delimiter ' ')" | ||
|
||
for PKG in $PKGS; do | ||
PKG="$(resolve.ts $PKG)" | ||
ZIP="$(query.ts $PKG --src)" | ||
PREFIX="$(query.ts $PKG --prefix)" | ||
SRCDIR="$(query.ts $PKG --srcdir)" | ||
|
||
if test -n "$ZIP"; then | ||
fetch.ts $PKG -o "$ZIP" | ||
fi | ||
|
||
if test -f "$ZIP"; then | ||
extract.ts "$ZIP" --pkg $PKG --output-dir "$SRCDIR" | ||
else | ||
mkdir -p "$SRCDIR" | ||
fi | ||
|
||
DEPS=$(deps.ts $PKG --build) # eg. nodejs.org^4 | ||
DEPS=$(install.ts $DEPS) # eg. ~/.tea/nodejs.org/v4.3.2 | ||
|
||
mkdir -p "$SRCDIR" | ||
BUILD_SCRIPT="$(stage.ts $PKG --srcdir "$SRCDIR" --prefix "$PREFIX" --deps "$DEPS")" | ||
|
||
if command -v bash 2>/dev/null; then | ||
BASH=bash | ||
else | ||
BASH="tea bash" | ||
fi | ||
|
||
$BASH -e "$BUILD_SCRIPT" | ||
|
||
PATH="$d/share/brewkit:$PATH" fixup.ts "$PREFIX" --deps "$DEPS" | ||
|
||
find "$PREFIX" -type f -name \*.la -delete | ||
|
||
link.ts "$PREFIX" $PKG | ||
|
||
if test -n "$GITHUB_ACTIONS"; then | ||
GH_PKGS="$PKG $GH_PKGS" | ||
GH_RELATIVE_PATHS="$GH_RELATIVE_PATHS ${PREFIX#$TEA_PREFIX/}" | ||
|
||
if test -f "$ZIP"; then | ||
GH_SRCS="$GH_SRCS ${ZIP#$TEA_PREFIX/}" | ||
GH_SRCS_RELATIVE_PATHS="$GH_SRCS_RELATIVE_PATHS ${ZIP#$TEA_PREFIX/}" | ||
else | ||
GH_SRCS="$GH_SRCS ~" | ||
fi | ||
fi | ||
done | ||
|
||
if test -n "$GITHUB_ACTIONS"; then | ||
echo "pkgs=$GH_PKGS" >> $GITHUB_OUTPUT | ||
echo "relative-paths=$GH_RELATIVE_PATHS" >> $GITHUB_OUTPUT | ||
echo "srcs=$GH_SRCS" >> $GITHUB_OUTPUT | ||
echo "srcs-relative-paths=$GH_SRCS_RELATIVE_PATHS" >> $GITHUB_OUTPUT | ||
fi |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
d="$(cd $(dirname $0)/.. && pwd)" | ||
PATH="$d/libexec:$PATH" | ||
|
||
if test -z "$1"; then | ||
if test -z "$TEA_PANTRY_PATH"; then | ||
echo "error: TEA_PANTRY_PATH is not set" >&2 | ||
exit 1 | ||
fi | ||
for x in $(echo "$TEA_PANTRY_PATH" | tr ':' '\n'); do | ||
if test -d "$x"/.git; then | ||
PKGS="$(GIT_DIR="$x"/.git peek.sh) $PKGS" | ||
fi | ||
done | ||
else | ||
PKGS="$1" | ||
fi | ||
|
||
for PKG in $PKGS; do | ||
PKG="$(resolve.ts $PKG --cellar)" | ||
DEPS="$(deps.ts $PKG --test)" | ||
DEPS="$(install.ts $DEPS)" | ||
DSTDIR="$(query.ts $PKG --testdir)" | ||
|
||
mkdir -p "$DSTDIR" | ||
|
||
stage-test.ts $PKG --deps "$DEPS" --dstdir "$DSTDIR" | ||
|
||
if command -v bash 2>/dev/null; then | ||
BASH=bash | ||
else | ||
BASH="tea bash" | ||
fi | ||
|
||
$BASH -e "$DSTDIR"/xyz.tea.test.sh | ||
done |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pkg-build |