From 8268c1cd06e03389b9ded6e78765e9e5bcd1672a Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Wed, 6 Dec 2023 16:16:07 -0500 Subject: [PATCH] feat: install libblst Signed-off-by: Chris Gianelloni --- Dockerfile | 13 +++++++++++++ README.md | 4 ++-- libblst.pc | 11 +++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 libblst.pc diff --git a/Dockerfile b/Dockerfile index d49f82f..eddee92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ ARG CABAL_VERSION=3.8.1.0 ARG GHC_VERSION=8.10.7 ARG LIBSODIUM_REF=dbb48cce ARG SECP256K1_REF=ac83be33 +ARG BLST_REF=v0.3.10 WORKDIR /code @@ -71,4 +72,16 @@ RUN git clone https://github.com/bitcoin-core/secp256k1 && \ make && \ make install +# BLST +COPY libblst.pc /usr/local/lib/pkgconfig/ +RUN git clone https://github.com/supranational/blst && \ + cd blst && \ + git checkout ${BLST_REF} && \ + ./build.sh && \ + cp bindings/blst_aux.h bindings/blst.h bindings/blst.hpp /usr/local/include/ && \ + cp libblst.a /usr/local/lib/ && \ + chmod u=rw,go=r /usr/local/lib/pkgconfig/libblst.pc \ + /usr/local/include/blst_aux.h /usr/local/include/blst.h /usr/local/include/blst.hpp \ + /usr/local/lib/libblst.a + FROM builder as haskell diff --git a/README.md b/README.md index d88dd06..a7e66e1 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,6 @@ A container image with GHC and cabal for developing Haskell applications for Cardano. -This image is based on Debian Slim for ease of extension. +This image is based on Debian Bookworm (Slim) for ease of extension. -Includes libsodium and libsecp256k1 which are commonly used in Cardano. +Includes libsodium, libsecp256k1, and BLST which are also used in Cardano. diff --git a/libblst.pc b/libblst.pc new file mode 100644 index 0000000..97d8d86 --- /dev/null +++ b/libblst.pc @@ -0,0 +1,11 @@ +prefix=/usr/local +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libblst +Description: Multilingual BLS12-381 signature library +URL: https://github.com/supranational/blst +Version: 0.3.10 +Cflags: -I${includedir} +Libs: -L${libdir} -lblst