Files
monero_c/build_single.sh
cyan 2a38bf2961 cleanup patches (and other stuff) (#79)
* cleanup patches
* fix polyseed patch
* Fix iOS builds
* fix polyseed dependencies
* fix polyseed patch for macOS
* update ledger patch
* update wownero patches and version
* update checksums
* wip"
* update gitmodules
* update boost build script
* update build_single.sh
* vix verbosey_copy
* fix __clear_cache bug on wownero
* update randomwow
* migrate build system
* fix cross compilation issues
* some more build issue
* update polyseed
* cleanup cmakelists
* fix toolchain.cmake.in
* add ssp
* another attempt at building windows on CI
* fix package name
* migrate mirror to my own hosting
* change download mirror priority (fallback first)
* link ssp in monero module as well by using CMAKE_{C,CXX}_FLAGS
* fix android builds
* update polyseed source
* 13 -> trixie
* fix package name conflicts, update runner to sid
* update boost to 1_84_0, disable patch that's no longer needed
* switch to ubuntu:24.04
* add POLYSEED_STATIC to toolchain.cmake.in in order to properly link
* drop patches
* fixes to darwin
* link missing wowner-seed library
* a litte bit more of experiments
* build locale only on windows
* update iconv
* update definitions
* update ci builds
* update my progress
* ios fix, update depends, ci
* multithread build system
* fix android, mingw and linux build issues
* remove dependency check
* update Dockerfile to include pigz
* show a message when pigz is missing
* fix devcontainer mingw setup (missing ENV)
* update android build runner
* sailfishos dropped (you better go behave yourself and run actual linux programs)
* fiz pigz issues
* install llvm-ranlib for android
* fix iOS build issues
* fix dummy ledger patch
* fix macos and darwin
* fix macos ci
* fix macos build command
* install autoconf
* add automake
* add libtool
* macos fixes, wownero fixes, idk what else, please help me
* fix wownero iOS build
* Cleanup patches
* add try-catch into monero code
* fix error handling
* update checksums
2024-12-04 10:22:48 -05:00

102 lines
3.2 KiB
Bash
Executable File

#!/bin/bash
cd "$(realpath $(dirname $0))"
proccount=1
if [[ "x$(uname)" == "xDarwin" ]];
then
proccount=$(sysctl -n hw.physicalcpu)
elif [[ "x$(uname)" == "xLinux" ]];
then
proccount=$(nproc)
fi
function verbose_copy() {
echo "==> cp $1 $2"
cp $1 $2
}
set -e
repo=$1
if [[ "x$repo" == "x" ]];
then
echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$proccount"
exit 1
fi
if [[ "x$repo" != "xwownero" && "x$repo" != "xmonero" ]];
then
echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$proccount"
echo "Invalid target given, only monero and wownero are supported targets"
exit 1
fi
if [[ ! -d "$repo" ]]
then
echo "no '$repo' directory found. clone with --recursive or run:"
echo "$ git submodule init && git submodule update --force";
exit 1
fi
HOST_ABI="$2"
if [[ "x$HOST_ABI" == "x" ]];
then
echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$proccount"
exit 1
fi
NPROC="$3"
if [[ "x$NPROC" == "x" ]];
then
echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$proccount"
exit 1
fi
cd $(dirname $0)
WDIR=$PWD
pushd contrib/depends
env -i PATH="$PATH" CC=gcc CXX=g++ make "$NPROC" HOST="$HOST_ABI"
popd
buildType=Debug
pushd ${repo}_libwallet2_api_c
rm -rf build/${HOST_ABI} || true
mkdir -p build/${HOST_ABI} -p
pushd build/${HOST_ABI}
cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -DUSE_DEVICE_TREZOR=OFF -DMONERO_FLAVOR=$repo -DCMAKE_BUILD_TYPE=Debug -DHOST_ABI=${HOST_ABI} ../..
make $NPROC
popd
popd
mkdir -p release/$repo 2>/dev/null || true
pushd release/$repo
APPENDIX=""
if [[ "${HOST_ABI}" == "x86_64-w64-mingw32" || "${HOST_ABI}" == "i686-w64-mingw32" ]];
then
echo "TODO: check if it's still needed"
APPENDIX="${APPENDIX}dll"
# cp ../../$repo/build/${HOST_ABI}/external/polyseed/libpolyseed.${APPENDIX} ${HOST_ABI}_libpolyseed.${APPENDIX}
# rm ${HOST_ABI}_libpolyseed.${APPENDIX}.xz || true
# xz -e ${HOST_ABI}_libpolyseed.${APPENDIX}
elif [[ "${HOST_ABI}" == "x86_64-apple-darwin11" || "${HOST_ABI}" == "aarch64-apple-darwin11" || "${HOST_ABI}" == "host-apple-darwin" || "${HOST_ABI}" == "x86_64-host-apple-darwin" || "${HOST_ABI}" == "aarch64-apple-darwin" || "${HOST_ABI}" == "x86_64-apple-darwin" || "${HOST_ABI}" == "host-apple-ios" || "${HOST_ABI}" == "aarch64-apple-ios" ]];
then
APPENDIX="${APPENDIX}dylib"
else
APPENDIX="${APPENDIX}so"
fi
xz -e ../../${repo}_libwallet2_api_c/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX}
mv ../../${repo}_libwallet2_api_c/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX}.xz ${HOST_ABI}_libwallet2_api_c.${APPENDIX}.xz
# Extra libraries
if [[ "$HOST_ABI" == "x86_64-w64-mingw32" || "$HOST_ABI" == "i686-w64-mingw32" ]];
then
cp /usr/${HOST_ABI}/lib/libwinpthread-1.dll ${HOST_ABI}_libwinpthread-1.dll
rm ${HOST_ABI}_libwinpthread-1.dll.xz || true
xz -e ${HOST_ABI}_libwinpthread-1.dll
####
cp /usr/lib/gcc/${HOST_ABI}/*-posix/libssp-0.dll ${HOST_ABI}_libssp-0.dll
rm ${HOST_ABI}_libssp-0.dll.xz || true
xz -e ${HOST_ABI}_libssp-0.dll
fi
popd