diff options
| author | cyan <cyjan@mrcyjanek.net> | 2024-08-14 13:44:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-14 13:44:05 +0200 |
| commit | 923385c1890bc5717c65cedee1f32976445c173e (patch) | |
| tree | f1169f4474803e3a6acdb47832d7d395cf6d717c | |
| parent | f2569ceef934ed6a1e6d689523d7e2005ed70cf5 (diff) | |
| parent | 06208221de515e75136c882b97dc7623487d17c8 (diff) | |
Merge branch 'master' into monero-v0.18.3.4
| -rw-r--r-- | .devcontainer/Dockerfile | 2 | ||||
| -rw-r--r-- | .github/workflows/cake_wallet.yaml | 6 | ||||
| -rw-r--r-- | .github/workflows/dependencies_matches.yaml | 74 | ||||
| -rw-r--r-- | .gitmodules | 3 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rwxr-xr-x | build_single.sh | 34 | ||||
| m--------- | external/libexpat | 0 | ||||
| m--------- | external/libzmq | 0 | ||||
| -rwxr-xr-x | external/macos/build_unbound.sh | 22 | ||||
| -rwxr-xr-x | external/macos/config.sh | 5 | ||||
| m--------- | external/polyseed | 0 |
11 files changed, 123 insertions, 25 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 232e912..da945f3 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/cirruslabs/flutter:3.22.2 +FROM ghcr.io/cirruslabs/flutter:3.22.3 # FROM debian:bookworm # Install dependencies diff --git a/.github/workflows/cake_wallet.yaml b/.github/workflows/cake_wallet.yaml index bc1ebe1..987a7cc 100644 --- a/.github/workflows/cake_wallet.yaml +++ b/.github/workflows/cake_wallet.yaml @@ -177,7 +177,7 @@ jobs: - name: Rename app run: | - echo -e "id=com.cakewallet.moneroc_${{ env.PR_NUMBER }}\nname=${{ github.ref_name }}" | tr '.-' '_' | tr '/' '_' | sed 's/com_cakewallet_/com.cakewallet./g'> /opt/android/cake_wallet/android/app.properties + echo -e "id=com.cakewallet.moneroc_${{ env.PR_NUMBER }}\nname=${{ github.ref_name }}" | sed 's/[^a-zA-Z0-9=\n.]//g' > /opt/android/cake_wallet/android/app.properties - name: Build run: | @@ -188,7 +188,7 @@ jobs: run: | cd /opt/android/cake_wallet/build/app/outputs/flutter-apk mkdir test-apk - cp app-arm64-v8a-release.apk "test-apk/$(echo ${{ github.ref_name }} | tr '/-' '_').apk" + cp app-arm64-v8a-release.apk "test-apk/$(echo ${{ github.ref_name }} | sed 's/[^a-zA-Z0-9]//g').apk" - name: Upload Artifact uses: kittaakos/upload-artifact-as-is@v0 @@ -246,4 +246,4 @@ jobs: with: issue-number: ${{steps.get_issue_number.outputs.result}} body: | - [download cake_wallet #${{github.run_id}}](https://nightly.link/MrCyjaneK/monero_c/actions/runs/${{github.run_id}}) (this comment will update whenever you push)
\ No newline at end of file + [download cake_wallet #${{github.run_id}}](https://nightly.link/MrCyjaneK/monero_c/actions/runs/${{github.run_id}}) (this comment will update whenever you push) diff --git a/.github/workflows/dependencies_matches.yaml b/.github/workflows/dependencies_matches.yaml new file mode 100644 index 0000000..5552539 --- /dev/null +++ b/.github/workflows/dependencies_matches.yaml @@ -0,0 +1,74 @@ +name: Check if dependencies match +# Sometimes we have the libraries in two (or more) places +# at the same time, this check makes sure that we do use +# the same version of said libraries. +on: [push] + +jobs: + wownero-seed: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + - name: Patch sources + run: | + git config --global --add safe.directory '*' + git config --global user.email "ci@mrcyjanek.net" + git config --global user.name "CI mrcyjanek.net" + ./apply_patches.sh monero + ./apply_patches.sh wownero + - name: obtain hashes + run: | + set -x + pushd external/wownero-seed + echo "EXTERNAL_WOWNEROSEED=$(git rev-parse HEAD)" >> $GITHUB_ENV + popd + echo "WOWNERO_WOWNEROSEED=$(cat wownero/contrib/depends/packages/wownero_seed.mk | grep _download_file | tr '=.' '\n' | head -2 | tail -1)" >> $GITHUB_ENV + - name: compare hashes + run: | + if [[ "x$WOWNERO_WOWNEROSEED" == "x" ]]; + then + echo "Unable to obtain wownero seed from wownero repo" + exit 1 + fi + if [[ ! "x$EXTERNAL_WOWNEROSEED" == "x$WOWNERO_WOWNEROSEED" ]]; + then + echo "external/wownero-seed doesn't match wownero/contrib/depends/packages/wownero_seed.mk checksum" + exit 1 + fi + polyseed: + strategy: + matrix: + coin: [monero, wownero] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + - name: Patch sources + run: | + git config --global --add safe.directory '*' + git config --global user.email "ci@mrcyjanek.net" + git config --global user.name "CI mrcyjanek.net" + ./apply_patches.sh ${{ matrix.coin }} + - name: prepare + run: | + set -x + pushd ${{ matrix.coin }}/contrib/depends + make download # sorry, this is the easiest way + mkdir sources/polyseed + pushd sources/polyseed + tar xzf ../polyseed*.tar.gz + popd + popd + - name: diff + run: | + OUTPUT=$(diff -ra external/polyseed ${{ matrix.coin }}/contrib/depends/sources/polyseed/* | grep -v .git | wc -l) + if [[ ! "x$OUTPUT" == "x0" ]]; + then + diff -ra external/polyseed ${{ matrix.coin }}/contrib/depends/sources/polyseed/* + exit 1 + fi diff --git a/.gitmodules b/.gitmodules index cbb27eb..d9a8e69 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,3 +31,6 @@ [submodule "external/libzmq"] path = external/libzmq url = https://github.com/zeromq/libzmq +[submodule "external/libexpat"] + path = external/libexpat + url = https://github.com/libexpat/libexpat.git @@ -57,7 +57,7 @@ While building I aim to compile the code at oldest supported release of debian, | x86_64-w64-mingw32 | debian:buster | -"- | | x86_64-apple-darwin11 | debian:bookworm | extra build step: `${HOST_ABI}-ranlib $PWD/$repo/contrib/depends/${HOST_ABI}/lib/libpolyseed.a` | | aarch64-apple-darwin11 | debian:bookworm | -"- | -| host-apple-darwin | arm64-apple-darwin23 | dependencies: `brew install unbound boost@1.76 zmq && brew link boost@1.76` | +| host-apple-darwin | arm64-apple-darwin23 | dependencies: `brew install unbound boost@1.76 zmq cmake ccache autoconf automake libtool && brew link boost@1.76` | | host-apple-ios | arm64-apple-darwin23 | | ## Design diff --git a/build_single.sh b/build_single.sh index d98af2a..a8368da 100755 --- a/build_single.sh +++ b/build_single.sh @@ -2,6 +2,15 @@ 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 @@ -11,13 +20,13 @@ set -e repo=$1 if [[ "x$repo" == "x" ]]; then - echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$(nproc)" + 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$(nproc)" + echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$proccount" echo "Invalid target given, only monero and wownero are supported targets" fi @@ -31,7 +40,7 @@ fi HOST_ABI="$2" if [[ "x$HOST_ABI" == "x" ]]; then - echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$(nproc)" + echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$proccount" exit 1 fi @@ -39,7 +48,7 @@ NPROC="$3" if [[ "x$NPROC" == "x" ]]; then - echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$(nproc)" + echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$proccount" exit 1 fi cd $(dirname $0) @@ -181,20 +190,19 @@ pushd $repo/contrib/depends make $NPROC popd fi - pushd ../../../external/macos - ./build_unbound.sh - popd MACOS_LIBS_DIR="${PWD}/${HOST_ABI}" rm -rf ${MACOS_LIBS_DIR} mkdir -p ${MACOS_LIBS_DIR}/lib - if [[ "x$HOMEBREW_PREFIX" == "x" ]]; + if [[ "$(uname -m)" == "arm64" ]]; then - export HOMEBREW_PREFIX=/opt/homebrew - if [[ ! -d "$HOMEBREW_PREFIX" ]]; - then - export HOMEBREW_PREFIX=/usr/local - fi + export HOMEBREW_PREFIX="/opt/homebrew" + elif [[ "$(uname -m)" == "x86_64" ]]; + then + export HOMEBREW_PREFIX="/usr/local" fi + pushd ../../../external/macos + ./build_unbound.sh + popd # NOTE: we can use unbound from brew but app store rejects the app because of nghttp2 symbols being included # verbose_copy "${HOMEBREW_PREFIX}/lib/libunbound.a" ${MACOS_LIBS_DIR}/lib/libunbound.a verbose_copy "../../../external/macos/build/MACOS/lib/libunbound.a" ${MACOS_LIBS_DIR}/lib/libunbound.a diff --git a/external/libexpat b/external/libexpat new file mode 160000 +Subproject 3bab6c09bbe8bf42d84b81563ddbcf4cca4be83 diff --git a/external/libzmq b/external/libzmq -Subproject 59c91227b46b60b7f965816544b25fe0a3cc8bb +Subproject b95d94935ed107679fd0ad9efd2f3d47309b6fd diff --git a/external/macos/build_unbound.sh b/external/macos/build_unbound.sh index e9e1ff8..d1c3825 100755 --- a/external/macos/build_unbound.sh +++ b/external/macos/build_unbound.sh @@ -9,9 +9,15 @@ EXPAT_VERSION=R_2_4_8 EXPAT_HASH="3bab6c09bbe8bf42d84b81563ddbcf4cca4be838" EXPAT_SRC_DIR=${EXTERNAL_MACOS_SOURCE_DIR}/libexpat rm -rf $EXPAT_SRC_DIR -git clone https://github.com/libexpat/libexpat.git -b ${EXPAT_VERSION} ${EXPAT_SRC_DIR} +if [ -d "$EXPAT_SRC_DIR" ]; then + echo "Unbound directory already exists." +else + echo "Cloning Unbound from $Unbound_URL" + mkdir -p ${EXPAT_SRC_DIR} || true + rm -rf ${EXPAT_SRC_DIR} + cp -r "${MONEROC_DIR}/external/libexpat" ${EXPAT_SRC_DIR} +fi cd $EXPAT_SRC_DIR -test `git rev-parse HEAD` = ${EXPAT_HASH} || exit 1 cd $EXPAT_SRC_DIR/expat ./buildconf.sh @@ -28,10 +34,16 @@ UNBOUND_DIR_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/unbound-1.16.2" echo "============================ Unbound ============================" rm -rf ${UNBOUND_DIR_PATH} -git clone https://github.com/NLnetLabs/unbound.git -b ${UNBOUND_VERSION} ${UNBOUND_DIR_PATH} +# Check if the directory already exists. +if [ -d "$UNBOUND_DIR_PATH" ]; then + echo "Unbound directory already exists." +else + echo "Cloning Unbound from $Unbound_URL" + mkdir -p ${UNBOUND_DIR_PATH} || true + rm -rf ${UNBOUND_DIR_PATH} + cp -r "${MONEROC_DIR}/external/unbound" ${UNBOUND_DIR_PATH} +fi cd $UNBOUND_DIR_PATH -test `git rev-parse HEAD` = ${UNBOUND_HASH} || exit 1 - ./configure --prefix="${EXTERNAL_MACOS_DIR}" \ --with-ssl="${HOMEBREW_PREFIX}" \ --with-libexpat="${EXTERNAL_MACOS_DIR}" \ diff --git a/external/macos/config.sh b/external/macos/config.sh index dcdf462..3c40625 100755 --- a/external/macos/config.sh +++ b/external/macos/config.sh @@ -7,6 +7,7 @@ export EXTERNAL_MACOS_DIR="${EXTERNAL_DIR}/MACOS" export EXTERNAL_MACOS_SOURCE_DIR="${EXTERNAL_MACOS_DIR}/sources" export EXTERNAL_MACOS_LIB_DIR="${EXTERNAL_MACOS_DIR}/lib" export EXTERNAL_MACOS_INCLUDE_DIR="${EXTERNAL_MACOS_DIR}/include" +export MONEROC_DIR="$(pwd)/../.." -mkdir -p "$EXTERNAL_MACOS_LIB_DIR" -mkdir -p "$EXTERNAL_MACOS_INCLUDE_DIR"
\ No newline at end of file +mkdir -p "$EXTERNAL_MACOS_LIB_DIR" || true +mkdir -p "$EXTERNAL_MACOS_INCLUDE_DIR" || true
\ No newline at end of file diff --git a/external/polyseed b/external/polyseed -Subproject b7c35bb3c6b91e481ecb04fc235eaff69c507fa +Subproject 3ef366993258a6f1c837d4908e3e4afb2cfefff |
