Skip to content

Commit

Permalink
urcrypt builds
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-levan committed Sep 25, 2023
1 parent 6b7e21b commit b601e9e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ares-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 3 additions & 3 deletions rust/ares/build.rs
Original file line number Diff line number Diff line change
@@ -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(),
Expand Down Expand Up @@ -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();
}

Expand Down
3 changes: 3 additions & 0 deletions rust/ares/src/urcrypt/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -54,3 +56,4 @@ build-aux/m4/lt~obsolete.m4
# can automatically generate from config.status script
# (which is called by configure script))
Makefile

Empty file.
5 changes: 4 additions & 1 deletion rust/ares/src/urcrypt/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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 <openssl/sha.h>],
Expand Down

0 comments on commit b601e9e

Please sign in to comment.