164164echo " "
165165echo " ==> Setting up nghttp2..."
166166
167- # On Windows with vcpkg, use vcpkg's nghttp2
168- if [ " $OS " = " Windows" ] && [ -n " $VCPKG_ROOT " ] && [ -d " $VCPKG_ROOT /installed/x64-windows" ]; then
169- echo " ✓ Using vcpkg's nghttp2"
170- echo " Location: $VCPKG_ROOT /installed/x64-windows"
171- # On Windows with MSYS2, use the MSYS2 package
172- elif [ " $OS " = " Windows" ] && [ -d " /mingw64/include/nghttp2" ]; then
173- echo " ✓ Using MSYS2's nghttp2"
174- echo " Location: /mingw64"
175- # On Windows without vcpkg or MSYS2, skip
176- elif [ " $OS " = " Windows" ]; then
177- echo " ⊘ nghttp2 on Windows requires vcpkg or MSYS2"
178- echo " vcpkg: vcpkg install nghttp2:x64-windows"
179- echo " MSYS2: pacman -S mingw-w64-x86_64-nghttp2"
167+ if [ " $OS " = " Windows" ]; then
168+ # Always build nghttp2 from source on Windows for compatibility
169+ if [ ! -d " nghttp2" ]; then
170+ echo " Downloading nghttp2..."
171+
172+ NGHTTP2_VERSION=" 1.59.0"
173+ curl -L " https://github.com/nghttp2/nghttp2/releases/download/v${NGHTTP2_VERSION} /nghttp2-${NGHTTP2_VERSION} .tar.gz" \
174+ -o nghttp2.tar.gz
175+
176+ tar xzf nghttp2.tar.gz
177+ mv " nghttp2-${NGHTTP2_VERSION} " nghttp2
178+ rm nghttp2.tar.gz
179+ fi
180+
181+ cd nghttp2
182+
183+ # Check if already built (Windows uses .lib files)
184+ if [ ! -f " build/lib/Release/nghttp2.lib" ]; then
185+ echo " Building nghttp2 with CMake for Windows..."
186+
187+ mkdir -p build
188+ cd build
189+
190+ # Use CMake for Windows build
191+ cmake .. \
192+ -DCMAKE_BUILD_TYPE=Release \
193+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
194+ -DBUILD_SHARED_LIBS=OFF \
195+ -DENABLE_LIB_ONLY=ON \
196+ -DENABLE_STATIC_LIB=ON
197+
198+ cmake --build . --config Release
199+
200+ echo " ✓ nghttp2 built successfully"
201+ else
202+ echo " ✓ nghttp2 already built"
203+ fi
204+
205+ cd " $VENDOR_DIR "
180206else
181207 # Build from source on Linux or if Homebrew version not available
182208 if [ ! -d " nghttp2" ]; then
@@ -221,6 +247,48 @@ else
221247 cd " $VENDOR_DIR "
222248fi
223249
250+ #
251+ # 4. zlib (Windows only - Linux/macOS have system zlib)
252+ #
253+ if [ " $OS " = " Windows" ]; then
254+ echo " "
255+ echo " ==> Setting up zlib..."
256+
257+ if [ ! -d " zlib" ]; then
258+ echo " Downloading zlib..."
259+ ZLIB_VERSION=" 1.3.1"
260+ curl -L " https://github.com/madler/zlib/archive/refs/tags/v${ZLIB_VERSION} .tar.gz" \
261+ -o zlib.tar.gz
262+
263+ tar xzf zlib.tar.gz
264+ mv " zlib-${ZLIB_VERSION} " zlib
265+ rm zlib.tar.gz
266+ fi
267+
268+ cd zlib
269+
270+ # Check if already built
271+ if [ ! -f " build/Release/zlibstatic.lib" ]; then
272+ echo " Building zlib with CMake for Windows..."
273+
274+ mkdir -p build
275+ cd build
276+
277+ # Use CMake for Windows build
278+ cmake .. \
279+ -DCMAKE_BUILD_TYPE=Release \
280+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON
281+
282+ cmake --build . --config Release
283+
284+ echo " ✓ zlib built successfully"
285+ else
286+ echo " ✓ zlib already built"
287+ fi
288+
289+ cd " $VENDOR_DIR "
290+ fi
291+
224292# Clean up downloaded archives to save cache space
225293echo " "
226294echo " ==> Cleaning up downloaded archives..."
@@ -241,12 +309,9 @@ echo " ✓ BoringSSL: $VENDOR_DIR/boringssl/build"
241309if [ " $OS " = " Linux" ]; then
242310 echo " ✓ liburing: $VENDOR_DIR /liburing/install"
243311fi
244- if [ " $OS " = " Windows" ] && [ -n " $VCPKG_ROOT " ] && [ -d " $VCPKG_ROOT /installed/x64-windows" ]; then
245- echo " ✓ nghttp2: $VCPKG_ROOT /installed/x64-windows (vcpkg)"
246- elif [ " $OS " = " Windows" ] && [ -d " /mingw64/include/nghttp2" ]; then
247- echo " ✓ nghttp2: /mingw64 (MSYS2)"
248- elif [ " $OS " = " Windows" ]; then
249- echo " ⊘ nghttp2: Install via vcpkg or MSYS2"
312+ if [ " $OS " = " Windows" ]; then
313+ echo " ✓ nghttp2: $VENDOR_DIR /nghttp2/build"
314+ echo " ✓ zlib: $VENDOR_DIR /zlib/build"
250315else
251316 echo " ✓ nghttp2: $VENDOR_DIR /nghttp2/install"
252317fi
0 commit comments