From 794e12824339a440b6037a53c879e19695b08698 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 3 Oct 2021 00:03:46 +0200 Subject: ci/synth: use yosys container from hdl/containers --- ci.sh | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/ci.sh b/ci.sh index a1cd8d1..a3d1471 100755 --- a/ci.sh +++ b/ci.sh @@ -26,17 +26,37 @@ do_plugin () { gstart "[Build] ghdl/synth:beta" "$ANSI_MAGENTA" docker build -t ghdl/synth:beta . -f- <<-EOF -FROM ghdl/cache:yosys-gnat AS build -COPY --from=ghdl/pkg:buster-mcode / /opt/ghdl +ARG REGISTRY='gcr.io/hdl-containers/debian/bullseye' + +#--- + +# WORKAROUND: this is required because 'COPY --from' does not support ARGs +FROM \$REGISTRY/pkg/ghdl AS pkg-ghdl + +FROM \$REGISTRY/yosys AS base + +RUN apt-get update -qq \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ + libgnat-9 \ + && apt-get autoclean && apt-get clean && apt-get -y autoremove \ + && rm -rf /var/lib/apt/lists + +COPY --from=pkg-ghdl /ghdl / + +#--- + +FROM base AS build + COPY . /ghdlsynth -RUN cp -vr /opt/ghdl/* /usr/local \ - && cd /ghdlsynth \ +RUN cd /ghdlsynth \ && make \ - && cp ghdl.so /opt/ghdl/lib/ghdl_yosys.so + && cp ghdl.so /tmp/ghdl_yosys.so + +#--- -FROM ghdl/cache:yosys-gnat -COPY --from=build /opt/ghdl /usr/local +FROM base +COPY --from=build /tmp/ghdl_yosys.so /usr/local/lib/ RUN yosys-config --exec mkdir -p --datdir/plugins \ && yosys-config --exec ln -s /usr/local/lib/ghdl_yosys.so --datdir/plugins/ghdl.so EOF -- cgit v1.2.3