forked from such-gitea/wownero
Update .gitea/workflows/build.yaml
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Build Wownero Core (God Mode)
|
||||
name: Build Wownero Core (Corrected Dependencies)
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
tar -xf cmake.tar.gz
|
||||
echo "$(pwd)/cmake-3.28.1-linux-x86_64/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Sanitize Makefiles (Add Zlib/Zstd/Boost 1.90)
|
||||
- name: Sanitize Makefiles (Strict Static)
|
||||
run: |
|
||||
# 1. RESTORE UPSTREAM FILES
|
||||
curl -L -o contrib/depends/funcs.mk https://codeberg.org/wownero/wownero/raw/branch/master/contrib/depends/funcs.mk
|
||||
@@ -61,7 +61,8 @@ jobs:
|
||||
# 2. INJECT ZLIB/ZSTD
|
||||
sed -i 's/^packages :=.*/packages := boost openssl expat libusb hidapi protobuf libiconv sodium zeromq unbound zlib zstd/' contrib/depends/packages/packages.mk
|
||||
|
||||
# 3. GENERATE ZLIB.MK
|
||||
# 3. GENERATE ZLIB.MK (With CMake for better cross-compile support)
|
||||
# We switch to CMake for Zlib to ensure it handles Windows/Cross properly
|
||||
cat <<'EOF' > contrib/depends/packages/zlib.mk
|
||||
package=zlib
|
||||
$(package)_version=1.3.1
|
||||
@@ -69,13 +70,13 @@ jobs:
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--static
|
||||
$(package)_config_opts=-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=OFF
|
||||
endef
|
||||
define $(package)_config_cmds
|
||||
CHOST=${host} ./configure $($(package)_config_opts) --prefix=$($(package)_staging_prefix_dir)
|
||||
$($(package)_cmake)
|
||||
endef
|
||||
define $(package)_build_cmds
|
||||
$(MAKE) libz.a
|
||||
$(MAKE)
|
||||
endef
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) install
|
||||
@@ -113,7 +114,6 @@ jobs:
|
||||
$(package)_config_opts_debug=variant=debug
|
||||
$(package)_config_opts+=--layout=system --user-config=user-config.jam
|
||||
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
|
||||
|
||||
$(package)_config_opts_linux=threadapi=pthread runtime-link=static
|
||||
$(package)_config_opts_darwin=target-os=darwin runtime-link=shared
|
||||
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
|
||||
@@ -122,12 +122,10 @@ jobs:
|
||||
$(package)_config_opts_i686_linux=address-model=32 architecture=x86
|
||||
$(package)_config_opts_x86_64_darwin=address-model=64
|
||||
$(package)_config_opts_aarch64_darwin=address-model=64 architecture=arm binary-format=mach-o abi=aapcs
|
||||
|
||||
$(package)_toolset_$(host_os)=gcc
|
||||
$(package)_archiver_$(host_os)=$($(package)_ar)
|
||||
$(package)_toolset_darwin=darwin
|
||||
$(package)_archiver_darwin=$($(package)_libtool)
|
||||
|
||||
$(package)_config_libraries=atomic,chrono,date_time,filesystem,program_options,regex,serialization,system,thread,locale,context,coroutine
|
||||
$(package)_cxxflags=-std=c++17 -fPIC
|
||||
endef
|
||||
@@ -151,6 +149,22 @@ jobs:
|
||||
cd contrib/depends
|
||||
make HOST=${{ matrix.target }} -j$(nproc)
|
||||
|
||||
- name: Verify Dependencies (Critical)
|
||||
run: |
|
||||
LIB_DIR="contrib/depends/${{ matrix.target }}/lib"
|
||||
echo "Checking $LIB_DIR for critical libraries..."
|
||||
ls -la $LIB_DIR
|
||||
|
||||
# Use find to locate specific files, failing if not found
|
||||
if [ -z "$(find $LIB_DIR -name 'libz*.a')" ]; then
|
||||
echo "::error::Static Zlib missing!"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$(find $LIB_DIR -name 'libzstd*.a')" ]; then
|
||||
echo "::error::Static Zstd missing!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Build Wownero Core
|
||||
run: |
|
||||
PREFIX=$(pwd)/contrib/depends/${{ matrix.target }}
|
||||
@@ -174,44 +188,29 @@ jobs:
|
||||
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Package Artifacts (The Fix)
|
||||
- name: Package Artifacts (With Hunt & Copy)
|
||||
run: |
|
||||
LIB_DIR="contrib/depends/${{ matrix.target }}/lib"
|
||||
INC_DIR="contrib/depends/${{ matrix.target }}/include"
|
||||
|
||||
mkdir -p output/lib output/include output/bin
|
||||
|
||||
# Copy Binaries
|
||||
find build/bin -type f -exec cp -v {} output/bin/ \;
|
||||
find build/bin -type f -exec cp {} output/bin/ \;
|
||||
|
||||
# NUCLEAR LIBRARY FIX:
|
||||
# 1. Copy everything ending in .a
|
||||
# NUCLEAR LIBRARY COPY
|
||||
# Copy EVERYTHING in the lib folder
|
||||
cp -v $LIB_DIR/*.a output/lib/ || true
|
||||
|
||||
# 2. HUNT DOWN ZLIB/ZSTD if they are named weirdly or missing
|
||||
# ZSTD often ends up as libzstd.a OR libzstd_static.a depending on version.
|
||||
# We force them to standard names in the output folder.
|
||||
# Explicitly find and rename ZSTD/ZLIB if they have weird names
|
||||
# This ensures 'libzstd.a' and 'libz.a' exist in the output for LWS to find
|
||||
find $LIB_DIR -name "libzstd*.a" -exec cp -v {} output/lib/libzstd.a \;
|
||||
find $LIB_DIR -name "libz*.a" ! -name "*zmq*" -exec cp -v {} output/lib/libz.a \;
|
||||
|
||||
# Fix ZSTD
|
||||
if [ ! -f output/lib/libzstd.a ]; then
|
||||
echo "Standard libzstd.a missing. Hunting..."
|
||||
find $LIB_DIR -name "*zstd*.a" -exec cp -v {} output/lib/libzstd.a \;
|
||||
fi
|
||||
|
||||
# Fix ZLIB
|
||||
if [ ! -f output/lib/libz.a ]; then
|
||||
echo "Standard libz.a missing. Hunting..."
|
||||
find $LIB_DIR -name "*libz*.a" ! -name "*zmq*" ! -name "*zstd*" -exec cp -v {} output/lib/libz.a \;
|
||||
fi
|
||||
|
||||
# Debug output to PROVE they are there
|
||||
echo "=== ARTIFACT CONTENTS ==="
|
||||
# Verify final payload
|
||||
echo "=== FINAL PAYLOAD ==="
|
||||
ls -l output/lib/
|
||||
|
||||
# Copy headers
|
||||
cp -r src output/include/wownero-src
|
||||
cp -r $INC_DIR/* output/include/
|
||||
|
||||
tar -czf wownero-core-${{ matrix.target }}.tar.gz -C output .
|
||||
|
||||
- name: Upload Artifact
|
||||
|
||||
Reference in New Issue
Block a user