-
Notifications
You must be signed in to change notification settings - Fork 448
add ./install_dependencies.sh script, update build commands #1603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
eba88a8
maybe instead of #1565?
henderkes 2032952
linter, documentation
henderkes cd5e04b
run ./install_dependencies.sh in documentation
henderkes 583d034
AI translations
henderkes 8a2b119
linter
henderkes d3a659c
linter 2
henderkes 16bc71b
quote $(nproc)
henderkes 37c4ce1
Merge remote-tracking branch 'dunglas/main' into install_dependencies.sh
henderkes 6c93bad
linter
henderkes c96bba9
suggestions
henderkes ccee477
make file executable
henderkes 1800cc8
add "frankenphp extensions" back in
henderkes fe2b7ef
Merge remote-tracking branch 'dunglas/main' into install_dependencies.sh
henderkes c606249
remove trailing space to make the linter happy
henderkes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,78 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| # Set paths | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| DIST_DIR="${SCRIPT_DIR}/dist/dependencies" | ||
| BUILDROOT_LIB="$DIST_DIR/lib" | ||
| BUILDROOT_INCLUDE="$DIST_DIR/include" | ||
|
|
||
| # Ensure folders exist | ||
| mkdir -p "$BUILDROOT_LIB" "$BUILDROOT_INCLUDE" | ||
|
|
||
| # Check for libwatcher-c.a and header | ||
| if [ ! -f "$BUILDROOT_LIB/libwatcher-c.a" ] || [ ! -f "$BUILDROOT_INCLUDE/wtr/watcher-c.h" ]; then | ||
| echo "Building libwatcher-c..." | ||
| mkdir -p watcher | ||
| cd watcher | ||
| curl -sL https://api.github.com/repos/e-dant/watcher/releases/latest | | ||
| grep tarball_url | | ||
| awk -F '"' '{print $4}' | | ||
| xargs curl -sL | tar xz --strip-components=1 | ||
| cd watcher-c | ||
| ${CC:-cc} -c -o libwatcher-c.o ./src/watcher-c.cpp -I ./include -I ../include -std=c++17 -Wall -Wextra -fPIC | ||
| ar rcs libwatcher-c.a libwatcher-c.o | ||
| cp libwatcher-c.a "$BUILDROOT_LIB/" | ||
| mkdir -p "$BUILDROOT_INCLUDE/wtr" | ||
| cp -R include/wtr/watcher-c.h "$BUILDROOT_INCLUDE/wtr/" | ||
| cd ../../ | ||
| rm -rf watcher | ||
| fi | ||
|
|
||
| # Check for Brotli static libs and headers | ||
| if [ ! -f "$BUILDROOT_LIB/libbrotlienc.a" ] || | ||
| [ ! -f "$BUILDROOT_LIB/libbrotlidec.a" ] || | ||
| [ ! -f "$BUILDROOT_LIB/libbrotlicommon.a" ] || | ||
| [ ! -d "$BUILDROOT_INCLUDE/brotli" ]; then | ||
| echo "Building Brotli..." | ||
| if ! command -v cmake &>/dev/null; then | ||
| echo "cmake is not installed. Please install cmake to build Brotli." | ||
| exit 1 | ||
| fi | ||
| git clone --depth 1 https://github.com/google/brotli.git brotli-source | ||
| cd brotli-source | ||
| mkdir out && cd out | ||
| cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=OFF .. | ||
| make -j"$(nproc)" | ||
| cp libbrotlienc.a libbrotlidec.a libbrotlicommon.a "$BUILDROOT_LIB/" | ||
| cp -R ../c/include/brotli "$BUILDROOT_INCLUDE/" | ||
| cd ../../ | ||
| rm -rf brotli-source | ||
| fi | ||
|
|
||
| if ! command -v xcaddy &>/dev/null; then | ||
| echo "Installing xcaddy..." | ||
|
|
||
| go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest | ||
|
|
||
| # Determine install path | ||
| if [ -n "${GOBIN:-}" ] && [ -x "$GOBIN/xcaddy" ]; then | ||
| XCADDY="$GOBIN/xcaddy" | ||
| elif [ -n "${GOPATH:-}" ] && [ -x "$GOPATH/bin/xcaddy" ]; then | ||
| XCADDY="$GOPATH/bin/xcaddy" | ||
| elif [ -x "$HOME/go/bin/xcaddy" ]; then | ||
| XCADDY="$HOME/go/bin/xcaddy" | ||
| else | ||
| echo "Error: xcaddy installed but not found in expected paths." >&2 | ||
| echo "Ensure \$GOBIN, \$GOPATH/bin, or \$HOME/go/bin exists and contains xcaddy." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "xcaddy installed at: $XCADDY" | ||
| EXPORT_CMD="export PATH=\"$(dirname "$XCADDY"):\$PATH\"" | ||
|
|
||
| echo "To make xcaddy available, run the following:" | ||
| echo " echo '$EXPORT_CMD' >> ~/.bashrc && source ~/.bashrc" | ||
| else | ||
| XCADDY="$(command -v xcaddy)" | ||
| fi |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.