diff --git a/Dockerfile b/Dockerfile index 94bf4d3..6acdb3b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,13 +2,23 @@ FROM devkitpro/devkita64:20260215 SHELL ["/bin/bash", "-c"] +ARG GIMP_VERSION=2 + # Build tools + GIMP (for BCn texture conversion) -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN if [ "$GIMP_VERSION" = "3" ]; then \ + echo 'deb http://deb.debian.org/debian trixie main' > /etc/apt/sources.list.d/trixie.list \ + && printf 'Package: *\nPin: release n=trixie\nPin-Priority: 100\n' > /etc/apt/preferences.d/trixie; \ + fi \ + && apt-get update && apt-get install -y --no-install-recommends \ autoconf automake libtool \ bison flex \ - python3-pip python3-mako ninja-build \ + python3-pip ninja-build \ wget ca-certificates \ - gimp \ + && if [ "$GIMP_VERSION" = "3" ]; then \ + apt-get install -y -t trixie --no-install-recommends gimp python3-mako; \ + else \ + apt-get install -y --no-install-recommends gimp python3-mako; \ + fi \ && pip3 install --break-system-packages meson \ && rm -rf /var/lib/apt/lists/* diff --git a/Dockerfile.gimp3 b/Dockerfile.gimp3 deleted file mode 100644 index 2c5189c..0000000 --- a/Dockerfile.gimp3 +++ /dev/null @@ -1,45 +0,0 @@ -FROM devkitpro/devkita64:20260215 - -SHELL ["/bin/bash", "-c"] - -# Build tools + GIMP 3 from trixie (for testing GIMP 3 texture conversion) -RUN echo 'deb http://deb.debian.org/debian trixie main' > /etc/apt/sources.list.d/trixie.list \ - && printf 'Package: *\nPin: release n=trixie\nPin-Priority: 100\n' > /etc/apt/preferences.d/trixie \ - && apt-get update && apt-get install -y --no-install-recommends \ - autoconf automake libtool \ - bison flex \ - python3-pip ninja-build \ - wget ca-certificates \ - && apt-get install -y -t trixie --no-install-recommends gimp python3-mako \ - && pip3 install --break-system-packages meson \ - && rm -rf /var/lib/apt/lists/* - -ENV DEVKITPRO=/opt/devkitpro -ENV PORTLIBS_PREFIX=${DEVKITPRO}/portlibs/switch - -# Build libusbhsfs (GPL) -RUN git clone --depth 1 https://github.com/DarkMatterCore/libusbhsfs.git /tmp/libusbhsfs \ - && cd /tmp/libusbhsfs \ - && source ${DEVKITPRO}/switchvars.sh \ - && make BUILD_TYPE=gpl install \ - && rm -rf /tmp/libusbhsfs - -# Build libsmb2 -RUN git clone --depth 1 https://github.com/sahlberg/libsmb2.git /tmp/libsmb2 \ - && cd /tmp/libsmb2 \ - && make -f Makefile.platform switch_install \ - && rm -rf /tmp/libsmb2 - -# Build libnfs v5.0.2 -COPY misc/libnfs/switch.patch /tmp/libnfs-switch.patch -RUN wget -qO- https://github.com/sahlberg/libnfs/archive/refs/tags/libnfs-5.0.2.tar.gz | tar xz -C /tmp \ - && cd /tmp/libnfs-libnfs-5.0.2 \ - && patch -Np1 -i /tmp/libnfs-switch.patch \ - && source ${DEVKITPRO}/switchvars.sh \ - && ./bootstrap \ - && ./configure --prefix="${PORTLIBS_PREFIX}" --host=aarch64-none-elf \ - --disable-shared --enable-static --disable-werror --disable-utils --disable-examples \ - && make && make install \ - && rm -rf /tmp/libnfs-libnfs-5.0.2 /tmp/libnfs-switch.patch - -WORKDIR /mnt diff --git a/README.md b/README.md index a00416c..d50e0ab 100644 --- a/README.md +++ b/README.md @@ -40,10 +40,9 @@ A hardware-accelerated media player for the Nintendo Switch, built on mpv and FF ``` This builds the toolchain image and compiles everything automatically. Output will be found in `build/`. -To test with GIMP 3 instead of the default GIMP 2, use `Dockerfile.gimp3`: +To build with GIMP 3 instead of the default GIMP 2: ```sh -docker build -f Dockerfile.gimp3 -t switchwave-builder . -./build-docker.sh +GIMP_VERSION=3 ./build-docker.sh ``` ### Manual diff --git a/build-docker.sh b/build-docker.sh index f8181e0..530a43c 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -1,7 +1,7 @@ #!/bin/bash set -eo pipefail -docker build -t switchwave-builder . +docker build --build-arg GIMP_VERSION="${GIMP_VERSION:-2}" -t switchwave-builder . docker run --rm --name devkitpro-switchwave \ -v "$(pwd)":/mnt/ \