forked from such-gitea/wownero
Build: Add static libevent as well for all platforms
All checks were successful
Build Wownero Core (Libevent FailSafe) / build-all (aarch64-apple-darwin11) (push) Successful in 18m20s
Build Wownero Core (Libevent FailSafe) / build-all (aarch64-linux-gnu) (push) Successful in 9m22s
Build Wownero Core (Libevent FailSafe) / build-all (riscv64-linux-gnu) (push) Successful in 12m1s
Build Wownero Core (Libevent FailSafe) / build-all (x86_64-apple-darwin11) (push) Successful in 12m45s
Build Wownero Core (Libevent FailSafe) / build-all (x86_64-linux-gnu) (push) Successful in 9m14s
Build Wownero Core (Libevent FailSafe) / build-all (x86_64-w64-mingw32) (push) Successful in 10m31s
Build Wownero Core (Libevent FailSafe) / release (push) Successful in 27s
All checks were successful
Build Wownero Core (Libevent FailSafe) / build-all (aarch64-apple-darwin11) (push) Successful in 18m20s
Build Wownero Core (Libevent FailSafe) / build-all (aarch64-linux-gnu) (push) Successful in 9m22s
Build Wownero Core (Libevent FailSafe) / build-all (riscv64-linux-gnu) (push) Successful in 12m1s
Build Wownero Core (Libevent FailSafe) / build-all (x86_64-apple-darwin11) (push) Successful in 12m45s
Build Wownero Core (Libevent FailSafe) / build-all (x86_64-linux-gnu) (push) Successful in 9m14s
Build Wownero Core (Libevent FailSafe) / build-all (x86_64-w64-mingw32) (push) Successful in 10m31s
Build Wownero Core (Libevent FailSafe) / release (push) Successful in 27s
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Build Wownero Core (Windows Filename Fix)
|
name: Build Wownero Core (Libevent FailSafe)
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master, main ]
|
branches: [ master, main ]
|
||||||
@@ -63,7 +63,30 @@ jobs:
|
|||||||
curl -L -o contrib/depends/funcs.mk https://codeberg.org/wownero/wownero/raw/branch/master/contrib/depends/funcs.mk
|
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
|
curl -L -o contrib/depends/packages/packages.mk https://codeberg.org/wownero/wownero/raw/branch/master/contrib/depends/packages/packages.mk
|
||||||
|
|
||||||
sed -i 's/^packages :=.*/packages := boost openssl expat libusb hidapi protobuf libiconv sodium zeromq unbound zlib zstd/' contrib/depends/packages/packages.mk
|
# Inject packages: libevent added before unbound
|
||||||
|
sed -i 's/^packages :=.*/packages := boost openssl expat libusb hidapi protobuf libiconv sodium zeromq libevent unbound zlib zstd/' contrib/depends/packages/packages.mk
|
||||||
|
|
||||||
|
# GENERATE LIBEVENT.MK (Attempt 1: Makefiles)
|
||||||
|
cat <<'EOF' > contrib/depends/packages/libevent.mk
|
||||||
|
package=libevent
|
||||||
|
$(package)_version=2.1.12-stable
|
||||||
|
$(package)_download_path=https://github.com/libevent/libevent/releases/download/release-$($(package)_version)/
|
||||||
|
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||||
|
$(package)_sha256_hash=92e6de1be9ec176428fd2367677e61ecedc2fc1cb11bc61069461ea910c1d4d7
|
||||||
|
define $(package)_set_vars
|
||||||
|
$(package)_config_opts=--disable-shared --disable-openssl --disable-libenc --disable-samples --disable-debug-mode --prefix=$($(package)_staging_prefix_dir)
|
||||||
|
endef
|
||||||
|
define $(package)_config_cmds
|
||||||
|
./configure $($(package)_config_opts) --host=${host}
|
||||||
|
endef
|
||||||
|
define $(package)_build_cmds
|
||||||
|
$(MAKE)
|
||||||
|
endef
|
||||||
|
define $(package)_stage_cmds
|
||||||
|
$(MAKE) install
|
||||||
|
endef
|
||||||
|
EOF
|
||||||
|
sed -i 's/^ /\t/' contrib/depends/packages/libevent.mk
|
||||||
|
|
||||||
# GENERATE ZLIB.MK
|
# GENERATE ZLIB.MK
|
||||||
cat <<'EOF' > contrib/depends/packages/zlib.mk
|
cat <<'EOF' > contrib/depends/packages/zlib.mk
|
||||||
@@ -180,20 +203,18 @@ jobs:
|
|||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
# 2. FAIL-SAFE (Mkdir Fixed + Windows Name Fix)
|
# 2. FAIL-SAFE (Now includes Libevent)
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
- name: Ensure Static Libs Exist
|
- name: Ensure Static Libs Exist
|
||||||
run: |
|
run: |
|
||||||
# ABSOLUTE PATHS to prevent cp errors
|
|
||||||
LIB_DIR="$(pwd)/contrib/depends/${{ matrix.target }}/lib"
|
LIB_DIR="$(pwd)/contrib/depends/${{ matrix.target }}/lib"
|
||||||
INC_DIR="$(pwd)/contrib/depends/${{ matrix.target }}/include"
|
INC_DIR="$(pwd)/contrib/depends/${{ matrix.target }}/include"
|
||||||
TOOLCHAIN="$(pwd)/contrib/depends/${{ matrix.target }}/share/toolchain.cmake"
|
TOOLCHAIN="$(pwd)/contrib/depends/${{ matrix.target }}/share/toolchain.cmake"
|
||||||
|
|
||||||
# Create dirs
|
|
||||||
mkdir -p "$LIB_DIR"
|
mkdir -p "$LIB_DIR"
|
||||||
mkdir -p "$INC_DIR"
|
mkdir -p "$INC_DIR"
|
||||||
|
|
||||||
# 1. CHECK ZSTD
|
# --- FAIL-SAFE 1: ZSTD ---
|
||||||
if [ ! -f "$LIB_DIR/libzstd.a" ]; then
|
if [ ! -f "$LIB_DIR/libzstd.a" ]; then
|
||||||
echo "Zstd missing! Activating Fail-Safe Build..."
|
echo "Zstd missing! Activating Fail-Safe Build..."
|
||||||
mkdir -p temp_zstd && cd temp_zstd
|
mkdir -p temp_zstd && cd temp_zstd
|
||||||
@@ -207,18 +228,13 @@ jobs:
|
|||||||
-DZSTD_BUILD_PROGRAMS=OFF -DZSTD_BUILD_TESTS=OFF
|
-DZSTD_BUILD_PROGRAMS=OFF -DZSTD_BUILD_TESTS=OFF
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
|
|
||||||
# Zstd naming is usually consistent, but let's be safe
|
if [ -f lib/libzstd.a ]; then cp lib/libzstd.a "$LIB_DIR/"; fi
|
||||||
if [ -f lib/libzstd.a ]; then
|
if [ -f lib/libzstdstatic.a ]; then cp lib/libzstdstatic.a "$LIB_DIR/libzstd.a"; fi
|
||||||
cp lib/libzstd.a "$LIB_DIR/"
|
|
||||||
elif [ -f lib/libzstdstatic.a ]; then
|
|
||||||
cp lib/libzstdstatic.a "$LIB_DIR/libzstd.a"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp ../../lib/zstd.h "$INC_DIR/"
|
cp ../../lib/zstd.h "$INC_DIR/"
|
||||||
cd ../../..
|
cd ../../..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 2. CHECK ZLIB
|
# --- FAIL-SAFE 2: ZLIB ---
|
||||||
if [ ! -f "$LIB_DIR/libz.a" ]; then
|
if [ ! -f "$LIB_DIR/libz.a" ]; then
|
||||||
echo "Zlib missing! Activating Fail-Safe Build..."
|
echo "Zlib missing! Activating Fail-Safe Build..."
|
||||||
mkdir -p temp_zlib && cd temp_zlib
|
mkdir -p temp_zlib && cd temp_zlib
|
||||||
@@ -231,19 +247,41 @@ jobs:
|
|||||||
-DBUILD_SHARED_LIBS=OFF
|
-DBUILD_SHARED_LIBS=OFF
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
|
|
||||||
# WINDOWS FIX: Check for libzlibstatic.a
|
if [ -f libz.a ]; then cp libz.a "$LIB_DIR/"; fi
|
||||||
if [ -f libz.a ]; then
|
if [ -f libzlibstatic.a ]; then cp libzlibstatic.a "$LIB_DIR/libz.a"; fi
|
||||||
cp libz.a "$LIB_DIR/"
|
|
||||||
elif [ -f libzlibstatic.a ]; then
|
|
||||||
echo "Detected Windows naming (libzlibstatic.a). Renaming to libz.a..."
|
|
||||||
cp libzlibstatic.a "$LIB_DIR/libz.a"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp zlib.h "$INC_DIR/"
|
cp zlib.h "$INC_DIR/"
|
||||||
cp zconf.h "$INC_DIR/"
|
cp zconf.h "$INC_DIR/"
|
||||||
cd ../..
|
cd ../..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# --- FAIL-SAFE 3: LIBEVENT (The Fix) ---
|
||||||
|
if [ ! -f "$LIB_DIR/libevent.a" ]; then
|
||||||
|
echo "Libevent missing! Activating Fail-Safe Build..."
|
||||||
|
mkdir -p temp_event && cd temp_event
|
||||||
|
curl -L -o libevent.tar.gz https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
|
||||||
|
tar -xf libevent.tar.gz && cd libevent-2.1.12-stable
|
||||||
|
|
||||||
|
cmake . -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN" \
|
||||||
|
-DCMAKE_INSTALL_PREFIX="$(pwd)/inst" \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DEVENT__DISABLE_OPENSSL=ON \
|
||||||
|
-DEVENT__DISABLE_MBEDTLS=ON \
|
||||||
|
-DEVENT__DISABLE_TESTS=ON \
|
||||||
|
-DEVENT__DISABLE_SAMPLES=ON \
|
||||||
|
-DEVENT__LIBRARY_TYPE=STATIC
|
||||||
|
make -j$(nproc)
|
||||||
|
|
||||||
|
# Locate and copy the static lib (name might vary, grab any .a)
|
||||||
|
find . -name "libevent.a" -exec cp {} "$LIB_DIR/" \;
|
||||||
|
find . -name "libevent_core.a" -exec cp {} "$LIB_DIR/" \;
|
||||||
|
find . -name "libevent_extra.a" -exec cp {} "$LIB_DIR/" \;
|
||||||
|
|
||||||
|
# Also copy headers
|
||||||
|
mkdir -p "$INC_DIR/event2"
|
||||||
|
cp -r include/event2/* "$INC_DIR/event2/"
|
||||||
|
cd ../..
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Package Artifacts
|
- name: Package Artifacts
|
||||||
run: |
|
run: |
|
||||||
LIB_DIR="contrib/depends/${{ matrix.target }}/lib"
|
LIB_DIR="contrib/depends/${{ matrix.target }}/lib"
|
||||||
@@ -253,11 +291,17 @@ jobs:
|
|||||||
find build/bin -type f -exec cp -v {} output/bin/ \;
|
find build/bin -type f -exec cp -v {} output/bin/ \;
|
||||||
cp -v $LIB_DIR/*.a output/lib/
|
cp -v $LIB_DIR/*.a output/lib/
|
||||||
|
|
||||||
# Final Verification
|
# Final Verification (The "Stop if Fucked" check)
|
||||||
ls -l output/lib/libz*.a
|
ls -l output/lib/libz*.a
|
||||||
if [ ! -f output/lib/libzstd.a ]; then echo "FATAL: libzstd.a missing"; exit 1; fi
|
if [ ! -f output/lib/libzstd.a ]; then echo "FATAL: libzstd.a missing"; exit 1; fi
|
||||||
if [ ! -f output/lib/libz.a ]; then echo "FATAL: libz.a missing"; exit 1; fi
|
if [ ! -f output/lib/libz.a ]; then echo "FATAL: libz.a missing"; exit 1; fi
|
||||||
|
|
||||||
|
# Check for ANY libevent static lib (it might be libevent_core.a etc)
|
||||||
|
if [ -z "$(find output/lib -name 'libevent*.a')" ]; then
|
||||||
|
echo "FATAL: libevent.a missing (checked libevent*.a)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
cp -r src output/include/wownero-src
|
cp -r src output/include/wownero-src
|
||||||
cp -r $INC_DIR/* output/include/
|
cp -r $INC_DIR/* output/include/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user