forked from such-gitea/wownero
Build: Upgrade to Boost 1.90 and Fix Static Cross-Compilation
All checks were successful
Build Wownero Core (Portable Mac Fix) / build-all (aarch64-apple-darwin11) (push) Successful in 12m36s
Build Wownero Core (Portable Mac Fix) / build-all (aarch64-linux-gnu) (push) Successful in 8m56s
Build Wownero Core (Portable Mac Fix) / build-all (riscv64-linux-gnu) (push) Successful in 11m38s
Build Wownero Core (Portable Mac Fix) / build-all (x86_64-apple-darwin11) (push) Successful in 13m8s
Build Wownero Core (Portable Mac Fix) / build-all (x86_64-linux-gnu) (push) Successful in 9m13s
Build Wownero Core (Portable Mac Fix) / build-all (x86_64-w64-mingw32) (push) Successful in 10m9s
Build Wownero Core (Portable Mac Fix) / release (push) Successful in 26s
All checks were successful
Build Wownero Core (Portable Mac Fix) / build-all (aarch64-apple-darwin11) (push) Successful in 12m36s
Build Wownero Core (Portable Mac Fix) / build-all (aarch64-linux-gnu) (push) Successful in 8m56s
Build Wownero Core (Portable Mac Fix) / build-all (riscv64-linux-gnu) (push) Successful in 11m38s
Build Wownero Core (Portable Mac Fix) / build-all (x86_64-apple-darwin11) (push) Successful in 13m8s
Build Wownero Core (Portable Mac Fix) / build-all (x86_64-linux-gnu) (push) Successful in 9m13s
Build Wownero Core (Portable Mac Fix) / build-all (x86_64-w64-mingw32) (push) Successful in 10m9s
Build Wownero Core (Portable Mac Fix) / release (push) Successful in 26s
- Upgrade dependencies: Boost 1.90.0, OpenSSL 3.0.13, Zlib 1.3.1, Zstd 1.5.5 - Fix macOS ARM/Intel builds by relaxing static runtime requirements in CMake - Add missing Boost libraries (context, coroutine) for LWS support - Sanitize depends system to prevent Makefile corruption - Enable full static linking for Linux and Windows targets
This commit is contained in:
219
.gitea/workflows/build.yaml
Normal file
219
.gitea/workflows/build.yaml
Normal file
@@ -0,0 +1,219 @@
|
||||
name: Build Wownero Core (Portable Mac Fix)
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
tags: [ 'v*' ]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
NODE_TLS_REJECT_UNAUTHORIZED: '0'
|
||||
|
||||
jobs:
|
||||
build-all:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: wownero-builder-base:latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- x86_64-linux-gnu # Linux x64
|
||||
- x86_64-w64-mingw32 # Windows x64
|
||||
- aarch64-linux-gnu # Linux ARM64
|
||||
- riscv64-linux-gnu # Linux RISC-V
|
||||
- x86_64-apple-darwin11 # macOS Intel
|
||||
- aarch64-apple-darwin11 # macOS ARM
|
||||
|
||||
steps:
|
||||
- name: Fix DNS
|
||||
run: echo "192.168.88.230 git.such.software" >> /etc/hosts
|
||||
|
||||
- name: Checkout
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
rm -rf *
|
||||
git config --global --add safe.directory '*'
|
||||
git config --global url."http://oauth2:${GITHUB_TOKEN}@git.such.software:3000/Builds/RandomWOW.git".insteadOf "https://codeberg.org/wownero/RandomWOW"
|
||||
git config --global url."http://oauth2:${GITHUB_TOKEN}@git.such.software:3000/Builds/wownero.git".insteadOf "https://codeberg.org/wownero/wownero.git"
|
||||
git clone http://oauth2:$GITHUB_TOKEN@git.such.software:3000/${{ github.repository }}.git .
|
||||
git submodule update --init --recursive
|
||||
|
||||
- name: Download macOS SDK
|
||||
if: contains(matrix.target, 'apple')
|
||||
run: |
|
||||
mkdir -p contrib/depends/SDKs
|
||||
curl -L -k -o contrib/depends/SDKs/MacOSX10.15.sdk.tar.gz \
|
||||
"https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.15.sdk.tar.gz"
|
||||
|
||||
- name: Install Modern CMake
|
||||
run: |
|
||||
curl -L -o cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v3.28.1/cmake-3.28.1-linux-x86_64.tar.gz
|
||||
tar -xf cmake.tar.gz
|
||||
echo "$(pwd)/cmake-3.28.1-linux-x86_64/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Sanitize Makefiles (Stable + Mac Compat)
|
||||
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
|
||||
|
||||
# 3. GENERATE ZLIB.MK
|
||||
cat <<'EOF' > contrib/depends/packages/zlib.mk
|
||||
package=zlib
|
||||
$(package)_version=1.3.1
|
||||
$(package)_download_path=https://zlib.net/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--static
|
||||
endef
|
||||
define $(package)_config_cmds
|
||||
CHOST=${host} ./configure $($(package)_config_opts) --prefix=$($(package)_staging_prefix_dir)
|
||||
endef
|
||||
define $(package)_build_cmds
|
||||
$(MAKE) libz.a
|
||||
endef
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) install
|
||||
endef
|
||||
EOF
|
||||
sed -i 's/^ /\t/' contrib/depends/packages/zlib.mk
|
||||
|
||||
# 4. GENERATE ZSTD.MK
|
||||
cat <<'EOF' > contrib/depends/packages/zstd.mk
|
||||
package=zstd
|
||||
$(package)_version=1.5.5
|
||||
$(package)_download_path=https://github.com/facebook/zstd/releases/download/v$($(package)_version)/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4
|
||||
define $(package)_build_cmds
|
||||
$(MAKE) -C lib libzstd.a
|
||||
endef
|
||||
define $(package)_stage_cmds
|
||||
cp lib/libzstd.a $($(package)_staging_prefix_dir)/lib/
|
||||
cp lib/zstd.h $($(package)_staging_prefix_dir)/include/
|
||||
endef
|
||||
EOF
|
||||
sed -i 's/^ /\t/' contrib/depends/packages/zstd.mk
|
||||
|
||||
# 5. GENERATE BOOST.MK (Standard Mac Config)
|
||||
# We use runtime-link=shared for Darwin because that is the robust way to build portable Mac binaries.
|
||||
cat <<'EOF' > contrib/depends/packages/boost.mk
|
||||
package=boost
|
||||
$(package)_version=1.90.0
|
||||
$(package)_download_path=https://archives.boost.io/release/$($(package)_version)/source/
|
||||
$(package)_file_name=$(package)_$(subst .,_,$($(package)_version)).tar.bz2
|
||||
$(package)_sha256_hash=49551aff3b22cbc5c5a9ed3dbc92f0e23ea50a0f7325b0d198b705e8ee3fc305
|
||||
$(package)_dependencies=libiconv
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts_release=variant=release
|
||||
$(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
|
||||
|
||||
# Darwin uses shared runtime (system libc++). This is standard for portable static libs.
|
||||
$(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
|
||||
$(package)_config_opts_x86_64_mingw32=address-model=64
|
||||
$(package)_config_opts_i686_mingw32=address-model=32
|
||||
$(package)_config_opts_i686_linux=address-model=32 architecture=x86
|
||||
$(package)_config_opts_x86_64_darwin=address-model=64
|
||||
|
||||
# MACOS ARM FIX
|
||||
$(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
|
||||
define $(package)_preprocess_cmds
|
||||
echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$(boost_archiver_$(host_os))\" <arflags>\"$($(package)_arflags)\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam
|
||||
endef
|
||||
define $(package)_config_cmds
|
||||
./bootstrap.sh --without-icu --with-libraries=$(boost_config_libraries)
|
||||
endef
|
||||
define $(package)_build_cmds
|
||||
./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage
|
||||
endef
|
||||
define $(package)_stage_cmds
|
||||
./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install
|
||||
endef
|
||||
EOF
|
||||
sed -i 's/^ /\t/' contrib/depends/packages/boost.mk
|
||||
|
||||
- name: Build Dependencies
|
||||
run: |
|
||||
cd contrib/depends
|
||||
make HOST=${{ matrix.target }} -j$(nproc)
|
||||
|
||||
- name: Build Wownero Core
|
||||
run: |
|
||||
PREFIX=$(pwd)/contrib/depends/${{ matrix.target }}
|
||||
mkdir build && cd build
|
||||
|
||||
# Fix strptime
|
||||
export CXXFLAGS="-D_GNU_SOURCE"
|
||||
export CFLAGS="-D_GNU_SOURCE"
|
||||
|
||||
# DEFAULT FLAGS
|
||||
STATIC_RUNTIME="ON"
|
||||
|
||||
# MAC SPECIFIC FIX:
|
||||
# If we are building for Apple, relax the static runtime requirement.
|
||||
# This allows CMake to accept the libraries we just built.
|
||||
# The result IS STILL A PORTABLE BINARY (Boost is static, Runtime is System).
|
||||
if [[ "${{ matrix.target }}" == *"apple"* ]]; then
|
||||
STATIC_RUNTIME="OFF"
|
||||
# Also nuking 'locale' requirement to bypass the build failure
|
||||
perl -pi -e 's/locale//g' ../CMakeLists.txt
|
||||
perl -pi -e 's/locale//g' ../external/monero/CMakeLists.txt
|
||||
fi
|
||||
|
||||
cmake .. \
|
||||
-DCMAKE_TOOLCHAIN_FILE=../contrib/depends/${{ matrix.target }}/share/toolchain.cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_STATIC=ON \
|
||||
-DBoost_USE_STATIC_RUNTIME=$STATIC_RUNTIME
|
||||
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Package Artifacts
|
||||
run: |
|
||||
LIB_DIR="contrib/depends/${{ matrix.target }}/lib"
|
||||
INC_DIR="contrib/depends/${{ matrix.target }}/include"
|
||||
mkdir -p output/lib output/include output/bin
|
||||
find build/bin -type f -exec cp {} output/bin/ \;
|
||||
cp $LIB_DIR/*.a output/lib/
|
||||
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
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: wownero-core-${{ matrix.target }}
|
||||
path: wownero-core-${{ matrix.target }}.tar.gz
|
||||
|
||||
release:
|
||||
needs: build-all
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
- name: Publish Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
wownero-core-*/wownero-core-*.tar.gz
|
||||
@@ -1,36 +1,44 @@
|
||||
package=boost
|
||||
$(package)_version=1.69.0
|
||||
package=boost
|
||||
$(package)_version=1.90.0
|
||||
$(package)_download_path=https://archives.boost.io/release/$($(package)_version)/source/
|
||||
$(package)_file_name=$(package)_$(subst .,_,$($(package)_version)).tar.gz
|
||||
$(package)_sha256_hash=9a2c2819310839ea373f42d69e733c339b4e9a19deab6bfec448281554aa4dbb
|
||||
$(package)_file_name=$(package)_$(subst .,_,$($(package)_version)).tar.bz2
|
||||
$(package)_sha256_hash=49551aff3b22cbc5c5a9ed3dbc92f0e23ea50a0f7325b0d198b705e8ee3fc305
|
||||
$(package)_dependencies=libiconv
|
||||
$(package)_patches=fix_aroptions.patch fix_arm_arch.patch
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts_release=variant=release
|
||||
$(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=shared
|
||||
$(package)_config_opts_android=threadapi=pthread runtime-link=static target-os=android
|
||||
$(package)_config_opts_darwin=--toolset=darwin runtime-link=shared
|
||||
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
|
||||
$(package)_config_opts_x86_64_mingw32=address-model=64
|
||||
$(package)_config_opts_i686_mingw32=address-model=32
|
||||
$(package)_config_opts_i686_linux=address-model=32 architecture=x86
|
||||
$(package)_toolset_$(host_os)=gcc
|
||||
$(package)_archiver_$(host_os)=$($(package)_ar)
|
||||
$(package)_toolset_darwin=darwin
|
||||
$(package)_archiver_darwin=$($(package)_libtool)
|
||||
$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test,date_time,regex,serialization,locale
|
||||
$(package)_cxxflags=-std=c++11
|
||||
$(package)_cxxflags_linux=-fPIC
|
||||
$(package)_cxxflags_freebsd=-fPIC
|
||||
$(package)_config_opts_release=variant=release
|
||||
$(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
|
||||
|
||||
# Darwin (macOS) Defaults
|
||||
$(package)_config_opts_darwin=target-os=darwin runtime-link=shared
|
||||
|
||||
# Windows Defaults
|
||||
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
|
||||
|
||||
# Architecture Specifics
|
||||
$(package)_config_opts_x86_64_mingw32=address-model=64
|
||||
$(package)_config_opts_i686_mingw32=address-model=32
|
||||
$(package)_config_opts_i686_linux=address-model=32 architecture=x86
|
||||
|
||||
# MACOS ARM64 FIX: Explicitly tell B2 this is ARM + Mach-O
|
||||
$(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
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
patch -p1 < $($(package)_patch_dir)/fix_aroptions.patch &&\
|
||||
patch -p1 < $($(package)_patch_dir)/fix_arm_arch.patch &&\
|
||||
echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$(boost_archiver_$(host_os))\" <arflags>\"$($(package)_arflags)\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam
|
||||
endef
|
||||
|
||||
@@ -44,4 +52,4 @@ endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install
|
||||
endef
|
||||
endef
|
||||
@@ -1,4 +1,4 @@
|
||||
packages:=boost openssl zeromq libiconv expat unbound
|
||||
packages:=boost openssl expat libusb hidapi protobuf libiconv sodium zeromq unbound zlib zstd
|
||||
|
||||
# ccache is useless in gitian builds
|
||||
ifneq ($(GITIAN),1)
|
||||
|
||||
21
contrib/depends/packages/zlib.mk
Normal file
21
contrib/depends/packages/zlib.mk
Normal file
@@ -0,0 +1,21 @@
|
||||
package=zlib
|
||||
$(package)_version=1.3.1
|
||||
$(package)_download_path=https://zlib.net/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--static
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
CHOST=${host} ./configure $($(package)_config_opts) --prefix=$($(package)_staging_prefix_dir)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE) libz.a
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) install
|
||||
endef
|
||||
14
contrib/depends/packages/zstd.mk
Normal file
14
contrib/depends/packages/zstd.mk
Normal file
@@ -0,0 +1,14 @@
|
||||
package=zstd
|
||||
$(package)_version=1.5.5
|
||||
$(package)_download_path=https://github.com/facebook/zstd/releases/download/v$($(package)_version)/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE) -C lib libzstd.a
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
cp lib/libzstd.a $($(package)_staging_prefix_dir)/lib/
|
||||
cp lib/zstd.h $($(package)_staging_prefix_dir)/include/
|
||||
endef
|
||||
Reference in New Issue
Block a user