# Reproducible EDA toolchain for the PM_K-1 core board.
#
# Why this exists: the system KiCad is 7.0 (no CLI ERC). This pins a known,
# rebuildable environment so the design can be checked/simulated identically
# years from now — fitting for a device meant to outlive its tools.
#
#   KiCad 9  -> schematic capture, CLI ERC/DRC, netlist/PDF/Gerber export
#   ngspice  -> SPICE simulation of the analog audio circuits
#   python3  -> scripting / BOM / skidl-style helpers
#
# Build/run via ../eda/run.sh (or: podman build -t pmk1-eda:9.0 .)
FROM docker.io/library/ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN apt-get update && apt-get install -y --no-install-recommends \
        software-properties-common ca-certificates gnupg && \
    add-apt-repository -y ppa:kicad/kicad-9.0-releases && \
    apt-get update && apt-get install -y --no-install-recommends \
        kicad \
        ngspice \
        python3 python3-pip python3-venv \
        git make && \
    apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /work
CMD ["bash"]
