forked from such-gitea/wownero
Update .gitea/workflows/build.yaml
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Build Wownero Core (Final & Verified)
|
||||
name: Build Wownero Core (Final Fix)
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
@@ -52,16 +52,16 @@ jobs:
|
||||
tar -xf cmake.tar.gz
|
||||
echo "$(pwd)/cmake-3.28.1-linux-x86_64/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Sanitize Makefiles (CMake Zlib Fix)
|
||||
- name: Sanitize Makefiles (CMake Zlib + Order)
|
||||
run: |
|
||||
# 1. RESTORE UPSTREAM FILES
|
||||
curl -L -o contrib/depends/funcs.mk https://codeberg.org/wownero/wownero/raw/branch/master/contrib/depends/funcs.mk
|
||||
curl -L -o contrib/depends/packages/packages.mk https://codeberg.org/wownero/wownero/raw/branch/master/contrib/depends/packages/packages.mk
|
||||
|
||||
# 2. INJECT ZLIB/ZSTD (Safe Append)
|
||||
sed -i 's/^packages :=.*/packages := boost openssl expat libusb hidapi protobuf libiconv sodium zeromq unbound zlib zstd/' contrib/depends/packages/packages.mk
|
||||
# 2. OVERWRITE PACKAGE LIST (Force Zlib/Zstd FIRST)
|
||||
echo "packages := zlib zstd libiconv boost openssl expat libusb hidapi protobuf sodium zeromq unbound" > contrib/depends/packages/packages.mk
|
||||
|
||||
# 3. GENERATE ZLIB.MK (CMake Method - PROVEN TO WORK in v0.11.4.2)
|
||||
# 3. GENERATE ZLIB.MK (CMake Method - PROVEN WORKING)
|
||||
cat <<'EOF' > contrib/depends/packages/zlib.mk
|
||||
package=zlib
|
||||
$(package)_version=1.3.1
|
||||
@@ -149,42 +149,44 @@ jobs:
|
||||
make HOST=${{ matrix.target }} -j$(nproc)
|
||||
|
||||
# -----------------------------------------------------
|
||||
# NUCLEAR OPTION: Build Static Deps Manually if Depends Failed
|
||||
# HARVEST: Ensure libs exist even if not in final prefix
|
||||
# -----------------------------------------------------
|
||||
- name: Verify and Fix Missing Static Libs
|
||||
- name: Harvest Missing Libraries
|
||||
run: |
|
||||
LIB_DIR="contrib/depends/${{ matrix.target }}/lib"
|
||||
INC_DIR="contrib/depends/${{ matrix.target }}/include"
|
||||
WORK_DIR="contrib/depends/work/build/${{ matrix.target }}"
|
||||
|
||||
# Fix ZSTD if missing from depends output
|
||||
if [ -z "$(find $LIB_DIR -name '*zstd*.a')" ]; then
|
||||
echo "::warning::Static Zstd missing! Building locally..."
|
||||
curl -L -o zstd.tar.gz https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz
|
||||
tar -xf zstd.tar.gz && cd zstd-1.5.5
|
||||
|
||||
# Simple static build
|
||||
if [[ "${{ matrix.target }}" == *"mingw"* ]]; then
|
||||
CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar make lib-release
|
||||
echo "Checking $LIB_DIR..."
|
||||
|
||||
# 1. Harvest ZSTD if missing
|
||||
if [ -z "$(find $LIB_DIR -name 'libzstd*.a')" ]; then
|
||||
echo "::warning::Static Zstd missing in prefix. Searching build dir..."
|
||||
# Find any static libzstd in the work directory
|
||||
FOUND=$(find $WORK_DIR -name "libzstd.a" -o -name "libzstd_static.a" | head -n 1)
|
||||
if [ -n "$FOUND" ]; then
|
||||
echo "Found at $FOUND. Copying..."
|
||||
cp -v "$FOUND" $LIB_DIR/libzstd.a
|
||||
# Also copy headers if possible
|
||||
find $WORK_DIR -name "zstd.h" -exec cp {} $INC_DIR/ \;
|
||||
else
|
||||
# We can use the host compiler if it's linux-linux, but for cross we need CC set
|
||||
# This simple fallback is mostly for Linux Native where it might fail
|
||||
make lib-release
|
||||
echo "::error::Zstd build failed completely."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp lib/libzstd.a $LIB_DIR/
|
||||
cp lib/zstd.h $INC_DIR/
|
||||
cd ..
|
||||
fi
|
||||
|
||||
# Fix ZLIB if missing
|
||||
if [ -z "$(find $LIB_DIR -name '*libz*.a')" ]; then
|
||||
echo "::warning::Static Zlib missing! Building locally..."
|
||||
curl -L -o zlib.tar.gz https://zlib.net/zlib-1.3.1.tar.gz
|
||||
tar -xf zlib.tar.gz && cd zlib-1.3.1
|
||||
./configure --static
|
||||
make
|
||||
cp libz.a $LIB_DIR/
|
||||
cd ..
|
||||
# 2. Harvest ZLIB if missing
|
||||
if [ -z "$(find $LIB_DIR -name 'libz*.a')" ]; then
|
||||
echo "::warning::Static Zlib missing in prefix. Searching build dir..."
|
||||
FOUND=$(find $WORK_DIR -name "libz.a" -o -name "libz_static.a" | head -n 1)
|
||||
if [ -n "$FOUND" ]; then
|
||||
echo "Found at $FOUND. Copying..."
|
||||
cp -v "$FOUND" $LIB_DIR/libz.a
|
||||
find $WORK_DIR -name "zlib.h" -exec cp {} $INC_DIR/ \;
|
||||
else
|
||||
echo "::error::Zlib build failed completely."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Build Wownero Core
|
||||
@@ -220,8 +222,8 @@ jobs:
|
||||
cp -v $LIB_DIR/*.a output/lib/ || true
|
||||
|
||||
# Ensure correct names for LWS
|
||||
find $LIB_DIR -name "*zstd*.a" -exec cp -v {} output/lib/libzstd.a \;
|
||||
find $LIB_DIR -name "*libz*.a" ! -name "*zmq*" -exec cp -v {} output/lib/libz.a \;
|
||||
find $LIB_DIR -name "*zstd*.a" -exec cp -v {} output/lib/libzstd.a \; || true
|
||||
find $LIB_DIR -name "*libz*.a" ! -name "*zmq*" -exec cp -v {} output/lib/libz.a \; || true
|
||||
|
||||
echo "=== ARTIFACT CONTENTS ==="
|
||||
ls -l output/lib/
|
||||
|
||||
Reference in New Issue
Block a user