Skip to content

Commit d1e5b99

Browse files
committed
chore: fix
1 parent 615b876 commit d1e5b99

File tree

3 files changed

+40
-29
lines changed

3 files changed

+40
-29
lines changed

.github/workflows/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
# Operating Systems to test
6262
# Comment out any OS you want to skip during development
6363
OS_MATRIX='[
64-
"macos-latest"
64+
"macos-latest", "ubuntu-latest"
6565
]'
6666
# To add more OS: "macos-latest", "windows-latest"
6767

.github/workflows/_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
uses: actions/cache@v4
6161
with:
6262
path: vendor
63-
key: vendor-${{ runner.os }}-${{ hashFiles('scripts/setup_vendors.sh') }}-v3
63+
key: vendor-${{ runner.os }}-${{ hashFiles('scripts/setup_vendors.sh') }}-v4
6464
restore-keys: |
6565
vendor-${{ runner.os }}-
6666

scripts/setup_vendors.sh

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -122,40 +122,47 @@ fi
122122
echo ""
123123
echo "==> Setting up nghttp2..."
124124

125-
if [ ! -d "nghttp2" ]; then
126-
echo "Downloading nghttp2..."
125+
# On macOS, use Homebrew's nghttp2 if available
126+
if [ "$OS" = "Darwin" ] && command -v brew &> /dev/null && brew list libnghttp2 &> /dev/null; then
127+
echo "✓ Using Homebrew's libnghttp2"
128+
echo " Location: $(brew --prefix libnghttp2)"
129+
else
130+
# Build from source on Linux or if Homebrew version not available
131+
if [ ! -d "nghttp2" ]; then
132+
echo "Downloading nghttp2..."
127133

128-
NGHTTP2_VERSION="1.59.0"
129-
curl -L "https://github.com/nghttp2/nghttp2/releases/download/v${NGHTTP2_VERSION}/nghttp2-${NGHTTP2_VERSION}.tar.gz" \
130-
-o nghttp2.tar.gz
134+
NGHTTP2_VERSION="1.59.0"
135+
curl -L "https://github.com/nghttp2/nghttp2/releases/download/v${NGHTTP2_VERSION}/nghttp2-${NGHTTP2_VERSION}.tar.gz" \
136+
-o nghttp2.tar.gz
131137

132-
tar xzf nghttp2.tar.gz
133-
mv "nghttp2-${NGHTTP2_VERSION}" nghttp2
134-
rm nghttp2.tar.gz
135-
fi
138+
tar xzf nghttp2.tar.gz
139+
mv "nghttp2-${NGHTTP2_VERSION}" nghttp2
140+
rm nghttp2.tar.gz
141+
fi
136142

137-
cd nghttp2
143+
cd nghttp2
138144

139-
if [ ! -f "lib/.libs/libnghttp2.a" ]; then
140-
echo "Building nghttp2..."
145+
if [ ! -f "lib/.libs/libnghttp2.a" ]; then
146+
echo "Building nghttp2..."
141147

142-
# Build with -fPIC for use in shared libraries
143-
CFLAGS="-fPIC" ./configure --prefix="$VENDOR_DIR/nghttp2/install" \
144-
--enable-lib-only \
145-
--enable-static \
146-
--disable-shared \
147-
--disable-examples \
148-
--disable-python-bindings
148+
# Build with -fPIC for use in shared libraries
149+
CFLAGS="-fPIC" ./configure --prefix="$VENDOR_DIR/nghttp2/install" \
150+
--enable-lib-only \
151+
--enable-static \
152+
--disable-shared \
153+
--disable-examples \
154+
--disable-python-bindings
149155

150-
make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
151-
make install
156+
make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
157+
make install
152158

153-
echo "✓ nghttp2 built successfully"
154-
else
155-
echo "✓ nghttp2 already built"
156-
fi
159+
echo "✓ nghttp2 built successfully"
160+
else
161+
echo "✓ nghttp2 already built"
162+
fi
157163

158-
cd "$VENDOR_DIR"
164+
cd "$VENDOR_DIR"
165+
fi
159166

160167
#
161168
# Summary
@@ -170,7 +177,11 @@ echo " ✓ BoringSSL: $VENDOR_DIR/boringssl/build"
170177
if [ "$OS" = "Linux" ]; then
171178
echo " ✓ liburing: $VENDOR_DIR/liburing/install"
172179
fi
173-
echo " ✓ nghttp2: $VENDOR_DIR/nghttp2/install"
180+
if [ "$OS" = "Darwin" ] && command -v brew &> /dev/null && brew list libnghttp2 &> /dev/null; then
181+
echo " ✓ nghttp2: $(brew --prefix libnghttp2) (Homebrew)"
182+
else
183+
echo " ✓ nghttp2: $VENDOR_DIR/nghttp2/install"
184+
fi
174185
echo ""
175186
echo "You can now run: make build"
176187
echo ""

0 commit comments

Comments
 (0)