Skip to content

Instantly share code, notes, and snippets.

@tecnovert
Last active June 15, 2021 18:22
Show Gist options
  • Save tecnovert/dab8272c055828a8177c47e37bf09711 to your computer and use it in GitHub Desktop.
Save tecnovert/dab8272c055828a8177c47e37bf09711 to your computer and use it in GitHub Desktop.
Compile particl core statically using depends
git clone --depth=1 https://github.com/tecnovert/particl-core.git particl_src
mkdir out
cat << EOF > Dockerfile
from ubuntu:focal
RUN apt-get update && \
apt-get upgrade -y && \
DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 curl libudev-dev
ARG USER_ID
ARG GROUP_ID
RUN groupadd -g ${GROUP_ID} particl && \
useradd -l -u ${USER_ID} -g particl particl
USER particl
EOF
docker build \
--build-arg USER_ID=$(id -u ${USER}) \
--build-arg GROUP_ID=$(id -g ${USER}) \
-t particl_compile .
docker run --mount type=bind,source="$(pwd)"/particl_src,target=/particl_src --mount type=bind,source="$(pwd)"/out,target=/out -it particl_compile /bin/bash
cd /particl_src
# Optionally checkout a branch
cd /particl_src/depends
make
cd ..
./autogen.sh
CONFIG_SITE="$(pwd)"/depends/x86_64-pc-linux-gnu/share/config.site ./configure --prefix=/ --enable-usbdevice --disable-fuzz --disable-fuzz-binary LDFLAGS="-static-libstdc++"
make -j$(nproc)
make install DESTDIR=/out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment