diff options
Diffstat (limited to 'docs/Writerside/topics')
| -rw-r--r-- | docs/Writerside/topics/Android.md | 52 | ||||
| -rw-r--r-- | docs/Writerside/topics/Building.md | 99 | ||||
| -rw-r--r-- | docs/Writerside/topics/Linux.md | 71 | ||||
| -rw-r--r-- | docs/Writerside/topics/Using-prebuilds.md | 48 | ||||
| -rw-r--r-- | docs/Writerside/topics/Windows.md | 63 | ||||
| -rw-r--r-- | docs/Writerside/topics/about.md | 59 | ||||
| -rw-r--r-- | docs/Writerside/topics/macOS.md | 84 |
7 files changed, 476 insertions, 0 deletions
diff --git a/docs/Writerside/topics/Android.md b/docs/Writerside/topics/Android.md new file mode 100644 index 0000000..c02b14f --- /dev/null +++ b/docs/Writerside/topics/Android.md @@ -0,0 +1,52 @@ +# Android + +Building on linux has been tested on +- `ubuntu:22.04` (docker tag) + +## Install dependencies + +```bash +$ apt update +$ apt install -y build-essential pkg-config autoconf libtool \ + ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf \ + unzip python-is-python3 +``` + +## Prepare source + +> If you are running in docker or have not configured git you may need to do the following: +> ```bash +> git config --global --add safe.directory '*' +> git config --global user.email "ci@mrcyjanek.net" +> git config --global user.name "CI mrcyjanek.net" +> ``` + +```bash +$ git clone https://github.com/mrcyjanek/monero_c --recursive +$ cd monero_c +$ ./apply_patches.sh monero +``` + +## Building + +<tabs> +<tab title="x86_64"> +<code-block> +$ ./build_single.sh monero x86_64-linux-android -j$(nproc) +</code-block> +</tab> +<tab title="aarch64"> +<code-block> +$ ./build_single.sh monero aarch64-linux-android -j$(nproc) +</code-block> +</tab> +<tab title="armv7a"> +<code-block> +$ ./build_single.sh monero armv7a-linux-androideabi -j$(nproc) +</code-block> +</tab> +</tabs> + +## Known issues + +None. Open an issue if you find something not working.
\ No newline at end of file diff --git a/docs/Writerside/topics/Building.md b/docs/Writerside/topics/Building.md new file mode 100644 index 0000000..f44f1f3 --- /dev/null +++ b/docs/Writerside/topics/Building.md @@ -0,0 +1,99 @@ +# Building + +Building monero_c comes down to these simple steps: +```bash +$ git clone https://github.com/mrcyjanek/monero_c --recursive +$ ./apply_patches.sh monero # patch the libraries +$ ./build_single x86_64-linux-gnu -j$(nproc) +``` + +To get detailed information about building please select your host platform (the one that you will use to build the +monero wallet) + +- [I'm scared. How can I use prebuilds?](Using-prebuilds.md) +- [Linux](#linux) +- [macOS](#macos) +- [Windows](#windows) + +## Supported systems + +| Target | Builder | Notes | +|------------------|-----------------------------|----------------------------------------------------------------------------------| +| Windows | Linux, Docker, WSL2 | msys2 builds are not supported, there are hardcoded DLL paths in build_single.sh | +| macOS | Native, Linux, Docker, WSL2 | Native builds are being widely used, but are not endorsed by me personally. | +| iOS | macOS | | +| Android | Linux, Docker, WSL2 | | +| Linux | Native, Docker, WSL2 | | +| Linux/SailfishOS | Native, Docker | Required meego toolchain. | + +All supported systems are built on CI, so for the most up-to-date list of all supported systems, together with proper +dependencies please take a look at [full_check.yml](https://github.com/MrCyjaneK/monero_c/blob/master/.github/workflows/full_check.yaml) +file. + +### Linux + +Linux builds should be built on as old of a distro as possible - targeting `debian:oldoldstable`, main reason for that +is GLIBC compatibility (or lack of it). For some reason software compiled with newer GLIBC won't work on devices with +older GLIBC, so the solution is to simply build on the oldest possible os (or abandon GLIBC and use musl). + +- x86-64-linux-gnu +- i686-linux-gnu - deprecated by monero +- aarch64-linux-gnu + +[More details](Linux.md) + +#### SailfishOS + +Fully supported (except for armv7l devices). + +- i686-meego-linux-gnu +- aarch64-meego-linux-gnu + +More details: TBD + +#### Alpine Linux + +Requires dependency removed by upstream - it is preserved in `external/alpine/libexecinfo`. It could easily +be brought back - but since nobody uses it and nobody complained about it missing it kind of never landed in monero_c +after rewrite fully. That being said it should mostly work. + +- ~~x86_64-alpine-linux-musl~~ +- ~~aarch64-alpine-linux-musl~~ + +More details: TBD + +### Android + +Includes bumped NDK version + +- x86_64-linux-android +- ~~i686-linux-android~~ - unsupported, fails to build +- aarch64-linux-android +- armv7a-linux-androideabi + +[More details](Android.md) + +### Windows + +Msys2 shell is not supported, docker or WSL2 is requried to build + +- i686-w64-mingw32 - deprecated by monero +- x86_64-w64-mingw32 +- aarch64-w64-unknown - unsupported. + Though - if somebody can grab and send me a decent CopilotPC I'll be happy to work on that. As for now using x86_64 + build should be fine (but slower in runtime) solution. + +[More details](Windows.md) + +### macOS + +- x86_64-apple-darwin11 +- aarch64-apple-darwin11 +- host-apple-darwin +- x86_64-host-apple-darwin - alias for host-apple-darwin +- aarch64-host-apple-darwin alias for host-apple-darwin + +[More details](macOS.md) + +### iOS +- host-apple-ios - probably will be renamed to `aarch64-apple-ios`
\ No newline at end of file diff --git a/docs/Writerside/topics/Linux.md b/docs/Writerside/topics/Linux.md new file mode 100644 index 0000000..7d3a2f1 --- /dev/null +++ b/docs/Writerside/topics/Linux.md @@ -0,0 +1,71 @@ +# Linux + +Building on linux has been tested on +- `debian:bullseye` (docker tag) + +## Install dependencies + +<tabs> +<tab title="x86_64"> +<code-block> +$ apt update +$ apt install -y build-essential pkg-config autoconf libtool \ + ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf +</code-block> +</tab> +<tab title="aarch64"> +<code-block> +$ apt update +$ apt install -y build-essential pkg-config autoconf libtool \ + ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf \ + gcc-aarch64-linux-gnu g++-aarch64-linux-gnu +</code-block> +</tab> +<tab title="i686"> +<code-block> +$ apt update +$ apt install -y build-essential pkg-config autoconf libtool \ + ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf \ + gcc-i686-linux-gnu g++-i686-linux-gnu +</code-block> +</tab> +</tabs> + +## Prepare source + +> If you are running in docker or have not configured git you may need to do the following: +> ```bash +> git config --global --add safe.directory '*' +> git config --global user.email "ci@mrcyjanek.net" +> git config --global user.name "CI mrcyjanek.net" +> ``` + +```bash +$ git clone https://github.com/mrcyjanek/monero_c --recursive +$ cd monero_c +$ ./apply_patches.sh monero +``` + +## Building + +<tabs> +<tab title="x86_64"> +<code-block> +$ ./build_single.sh monero x86_64-linux-gnu -j$(nproc) +</code-block> +</tab> +<tab title="aarch64"> +<code-block> +$ ./build_single.sh monero aarch64-linux-gnu -j$(nproc) +</code-block> +</tab> +<tab title="i686"> +<code-block> +$ ./build_single.sh monero i686-linux-gnu -j$(nproc) +</code-block> +</tab> +</tabs> + +## Known issues + +None. Open an issue if you find something not working.
\ No newline at end of file diff --git a/docs/Writerside/topics/Using-prebuilds.md b/docs/Writerside/topics/Using-prebuilds.md new file mode 100644 index 0000000..f4ff35e --- /dev/null +++ b/docs/Writerside/topics/Using-prebuilds.md @@ -0,0 +1,48 @@ +# Using prebuilds + +Prebuilds are more convenient way of using monero_c in your code (although these builds should **NOT** be used in +production). There are several ways in which you can use prebuilds + +## The monero_c way + +1. Go to https://github.com/MrCyjaneK/monero_c/releases +2. Click on the release that you are interested in +3. Download release-bundle.zip +4. Unzip it in monero_c directory + +That zip file contains all builds that monero_c supports prepared in the exactly same way as you would prepare them if +building on your own. This is the easiest way to get started. + +> Keep in mind that release-bundle.zip contains .xz files inside, so if you want to actually use them you need to use +> them you need to unxz them first +> ```bash +> $ unxz -f -k release/*/*.xz +> ``` + +## The monero_c way (different) + +Alternatively you can go to releases tab and grab whatever you need, there are over 40 libraries. Surely one will fit +your use case. + +## The build_moneroc.sh way + +This method is used by [xmruw](https://github.com/mrcyjanek/unnamed_monero_wallet) and +[monero-tui](https://github.com/Im-Beast/monero-tui). + +It supports both building and downloading prebuilds and putting them in correct location, [have a look at the code +yourself](https://github.com/MrCyjaneK/unnamed_monero_wallet/blob/master-rewrite/build_moneroc.sh) + +```bash +$ ./build_moneroc.sh + --prebuild # allow downloads of prebuilds + --coin # monero/wownero + --tag v0.18.3.3-RC45 # which tag to build / download + --triplet x86_64-linux-android # which triplet to build / download + --location android/.../jniLibs/x86_64 # where to but the libraries +``` + +## The cake wallet way + +There is a simple script in cake_wallet written in `dart` that runs on all platform (including windows) which downloads +all required libraries for selected platforms in one go. +[You can take look at it here](https://github.com/cake-tech/cake_wallet/blob/main/tool/download_moneroc_prebuilds.dart)
\ No newline at end of file diff --git a/docs/Writerside/topics/Windows.md b/docs/Writerside/topics/Windows.md new file mode 100644 index 0000000..1cb931c --- /dev/null +++ b/docs/Writerside/topics/Windows.md @@ -0,0 +1,63 @@ +# Windows + +Building on windows has been tested on +- `debian:bullseye` (docker tag) +- `Ubuntu 22.04 WSL` + +## Install dependencies + +<tabs> +<tab title="x86_64"> +<code-block> +$ apt update +$ apt install -y build-essential pkg-config autoconf libtool \ + ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf \ + gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 +</code-block> +</tab> +<tab title="i686"> +<code-block> +$ apt update +$ apt install -y build-essential pkg-config autoconf libtool \ + ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf \ + gcc-mingw-w64-i686 g++-mingw-w64-i686 +</code-block> +</tab> +</tabs> + +## Prepare source + +> If you are running in docker or have not configured git you may need to do the following: +> ```bash +> git config --global --add safe.directory '*' +> git config --global user.email "ci@mrcyjanek.net" +> git config --global user.name "CI mrcyjanek.net" +> ``` + +```bash +$ git clone https://github.com/mrcyjanek/monero_c --recursive +$ cd monero_c +$ ./apply_patches.sh monero +``` + +## Building + +<tabs> +<tab title="x86_64"> +<code-block> +$ ./build_single.sh monero x86_64-w64-mingw32 -j$(nproc) +</code-block> +</tab> +<tab title="i686"> +<code-block> +$ ./build_single.sh monero i686-w64-mingw32 -j$(nproc) +</code-block> +</tab> +</tabs> + +## Known issues + +### Dynamically loaded dependencies + +There are some dynamically loaded dependencies which are copied over from the OS package repository. All of them are +available in `release/` directory.
\ No newline at end of file diff --git a/docs/Writerside/topics/about.md b/docs/Writerside/topics/about.md new file mode 100644 index 0000000..448e70f --- /dev/null +++ b/docs/Writerside/topics/about.md @@ -0,0 +1,59 @@ +# About + + + +## Goal + +The goal of monero_c is simple, at least on the surface +- Build monero for all platforms +- Access monero functions from all languages +- Bring in new features used by wallets but still not merged upstream + +To achieve these tasks some major changes had to happen to monero. + +## Building + +For the most part `contrib/depends` directory of `monero` was used, as it is in perfect shape (that being said it's +terrible to debug when something goes wrong). But it doesn't work with iOS, and it doesn't work on macOS, so some +dependencies had to be pulled as a submodules. But that being said, linux can be used to build for all platforms (except +for iOS - you need macOS for that, and you also need that 100EUR/year license to actually be able to do something with +said library). + +This is especially good because any device can run linux, on WSL2 or under docker. + +## Accessing monero functions + +Though just building the library is not enough, if you just `make wallet_api` in the upstream code you end up in a +place where you technically have the functions in a dynamic library, but you can only use C++ ABI to interact with it. +Which is not ideal. Of course, it is doable, if you want to deal with `__ZNK6Monero10WalletImpl7addressEjj` instead of +`MONERO_Wallet_address`, and make sure that the way you pass in variables is what C++ expects. +I went with the simplest and most standard way of doing that - C ABI (which is what monero should offer in the first +place). Now with any language that supports C interop you can just go ahead and use monero wallet. + +All functionality is simplified to use only the following types: + +- bool +- int +- uint64_t +- void* +- const char* +- void + +## Bring in new features + +There are some extra features inside of the code like +- Polyseed support +- Background sync +- Airgap functions +- Coin control +- UR support +- Ledger support (on android and iSO) +- many fixes + +These features land in the `patches` directory, and are applied to the upstream monero code. + +## Summary + +monero_c extends monero functionality and also simplifies it by a huge extent, if you want to use monero - monero_c is +probably the way to go. +Are you ready to start? Let's see how to build the binary.
\ No newline at end of file diff --git a/docs/Writerside/topics/macOS.md b/docs/Writerside/topics/macOS.md new file mode 100644 index 0000000..52b6be8 --- /dev/null +++ b/docs/Writerside/topics/macOS.md @@ -0,0 +1,84 @@ +# macOS + +Building on linux has been tested on +- `macos-14` (github runner) +- `MacOS 15.0.1 Sequoia` (Native) +- `debian:bookworm` (docker tag) + +## Install dependencies + +<tabs> +<tab title="Native"> +<code-block> +$ # install xcode 15.4 (or current latest) +$ brew install ccache unbound zmq autoconf automake libtool +</code-block> +</tab> +<tab title="Native (Rosetta2)"> +<code-block> +$ # install xcode 15.4 (or current latest) +$ brew install ccache unbound zmq autoconf automake libtool +$ arch -x86_64 brew install ccache unbound zmq autoconf automake libtool +$ arch -x86_64 brew link +</code-block> +</tab> +<tab title="Linux"> +<code-block> +$ apt update +$ apt install -y build-essential pkg-config autoconf libtool \ + ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf \ + python-is-python3 +</code-block> +</tab> +</tabs> + +## Prepare source + +> If you are running in docker or have not configured git you may need to do the following: +> ```bash +> git config --global --add safe.directory '*' +> git config --global user.email "ci@mrcyjanek.net" +> git config --global user.name "CI mrcyjanek.net" +> ``` + +```bash +$ git clone https://github.com/mrcyjanek/monero_c --recursive +$ cd monero_c +$ ./apply_patches.sh monero +``` + +## Building + +<tabs> +<tab title="Native for x86_64 macOS"> +<code-block> +$ ./build_single.sh monero x86_64-host-apple-darwin -j$(nproc) +</code-block> +</tab> +<tab title="Native for aarch64 macOS"> +<code-block> +$ ./build_single.sh monero aarch64-host-apple-darwin -j$(nproc) +</code-block> +</tab> +<tab title="Native for x86_64 macOS (Rosseta2)"> +<code-block> +$ arch -x86_64 ./build_single.sh monero x86_64-host-apple-darwin -j$(nproc) +</code-block> +</tab> +<tab title="Linux for x86_64 macOS"> +<code-block> +$ ./build_single.sh monero x86_64-apple-darwin11 -j$(nproc) +</code-block> +</tab> +<tab title="Linux for aarch64 macOS"> +<code-block> +$ ./build_single.sh monero aarch64-apple-darwin-11 -j$(nproc) +</code-block> +</tab> +</tabs> + +## Known issues + +### Creating fat library + +[Check cake_wallet solution](https://github.com/cake-tech/cake_wallet/blob/main/scripts/macos/build_monero_all.sh) |
