Skip to content

Commit

Permalink
Merge branch 'master' into monero-v0.18.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCyjaneK authored Aug 14, 2024
2 parents f2569ce + 0620822 commit 923385c
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cake_wallet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand Down Expand Up @@ -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)
[download cake_wallet #${{github.run_id}}](https://nightly.link/MrCyjaneK/monero_c/actions/runs/${{github.run_id}}) (this comment will update whenever you push)
74 changes: 74 additions & 0 deletions .github/workflows/dependencies_matches.yaml
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
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 "[email protected]"
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] zmq && brew link [email protected]` |
| host-apple-darwin | arm64-apple-darwin23 | dependencies: `brew install unbound [email protected] zmq cmake ccache autoconf automake libtool && brew link [email protected]` |
| host-apple-ios | arm64-apple-darwin23 | |

## Design
Expand Down
34 changes: 21 additions & 13 deletions build_single.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -31,15 +40,15 @@ 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

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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions external/libexpat
Submodule libexpat added at 3bab6c
2 changes: 1 addition & 1 deletion external/libzmq
Submodule libzmq updated 1 files
+5 −0 Makefile.am
22 changes: 17 additions & 5 deletions external/macos/build_unbound.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}" \
Expand Down
5 changes: 3 additions & 2 deletions external/macos/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
mkdir -p "$EXTERNAL_MACOS_LIB_DIR" || true
mkdir -p "$EXTERNAL_MACOS_INCLUDE_DIR" || true
2 changes: 1 addition & 1 deletion external/polyseed
Submodule polyseed updated 1 files
+1 −1 src/lang_jp.c

0 comments on commit 923385c

Please sign in to comment.