diff --git a/.github/workflows/ares-shared.yml b/.github/workflows/ares-shared.yml index 7c00c5739..1c7e4a77a 100644 --- a/.github/workflows/ares-shared.yml +++ b/.github/workflows/ares-shared.yml @@ -22,6 +22,20 @@ jobs: - name: Format run: cargo fmt --check + # Install third-party dependencies + # + - name: Install dependencies + run: | + sudo apt-get install -y \ + openssl \ + cmake \ + libsecp256k1-dev && + git clone https://github.com/dfoxfranke/libaes_siv.git && + cd libaes_siv && + cmake . && + make && + sudo make install + # See clippy linter docs: https://github.com/rust-lang/rust-clippy # # First linter is set to fail for all warnings, then ignored warnings are diff --git a/README.md b/README.md index 007e8fd15..d0cc2d65b 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,10 @@ A redesigned Mars for the Urth/Mars Urbit runtime. Currently WIP. Read the [proposal](docs/proposal/proposal-nock-performance.md) and [hypotheses](docs/proposal/hypotheses.md) for an overview. Before branching or opening a PR please review the [contribution guidelines](CONTRIBUTING.md). + +## Installation + +Dependencies: +* [`libaes_siv`](https://github.com/dfoxfranke/libaes_siv) +* [`openssl`](https://github.com/openssl/openssl) +* [`libsecp256k1`](https://github.com/bitcoin-core/secp256k1) diff --git a/rust/ares/build.rs b/rust/ares/build.rs index 64a25311d..196f7d99f 100644 --- a/rust/ares/build.rs +++ b/rust/ares/build.rs @@ -1,11 +1,10 @@ -use autotools; - fn main() { use std::env; let profile = env::var("PROFILE").unwrap(); println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=./src/pma"); + println!("cargo:rerun-if-changed=./src/urcrypt"); match profile.as_ref() { "debug" => debug(), @@ -46,8 +45,9 @@ fn debug() { .compile("pma_malloc"); let _urcrypt = autotools::Config::new("./src/urcrypt") + .reconf("-if") + .enable_shared() .disable_static() - .disable_shared() .build(); } diff --git a/rust/ares/src/urcrypt/.gitignore b/rust/ares/src/urcrypt/.gitignore index b464b3f2f..52e6bed98 100644 --- a/rust/ares/src/urcrypt/.gitignore +++ b/rust/ares/src/urcrypt/.gitignore @@ -27,10 +27,12 @@ build-aux/compile /config.cache build-aux/config.guess /config.h.in +/config.h.in~ build-aux/config.log build-aux/config.status build-aux/config.sub /configure +/configure~ /configure.scan build-aux/depcomp build-aux/install-sh @@ -54,3 +56,4 @@ build-aux/m4/lt~obsolete.m4 # can automatically generate from config.status script # (which is called by configure script)) Makefile + diff --git a/rust/ares/src/urcrypt/build-aux/m4/.gitkeep b/rust/ares/src/urcrypt/build-aux/m4/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/rust/ares/src/urcrypt/configure.ac b/rust/ares/src/urcrypt/configure.ac index bdf78c10f..732b7ece7 100644 --- a/rust/ares/src/urcrypt/configure.ac +++ b/rust/ares/src/urcrypt/configure.ac @@ -56,16 +56,19 @@ AC_PROG_CC # Checks for pkg-config capable libraries PKG_CHECK_MODULES([LIBSECP256K1], [libsecp256k1]) +ac_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $LIBSECP256K1_CFLAGS" AC_CHECK_HEADER([secp256k1_recovery.h], [], [AC_MSG_ERROR([libsecp256k1 must have recovery enabled.])]) AC_CHECK_HEADER([secp256k1_schnorrsig.h], [], [AC_MSG_ERROR([libsecp256k1 must have Schnorr signatures enabled.])]) +CPPFLAGS=$ac_save_CPPFLAGS PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto]) AS_IF([test "$enable_shared" == "yes"], [# ensure crypto will be shared for shared object (see README.md) save_LDFLAGS=$LDFLAGS - save_CLAGS=$CFLAGS + save_CFLAGS=$CFLAGS LDFLAGS=$LIBCRYPTO_LIBS CFLAGS=$LIBCRYPTO_CFLAGS AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ],