manibuilder: Refresh DJGPP image
Replace the unmaintained anibali/djgpp image with a Debian-based image
that installs the current prebuilt DJGPP GCC 12.2.0 toolchain.
The old container depended on flashprog.org artifact downloads for a
pciutils patch and libgetopt tarball. Those URLs are gone, so build
against pciutils 3.15.0 directly and use the public getopt 2.5 tarball.
Update the manibuilder DJGPP tag and build documentation accordingly.
Tested:
- podman run ... getopt configure && make
- make -C util/manibuilder show-working
- make -C util/manibuilder -n 'djgpp:12.2.0-build'
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: If39a15012dc83b1a2b33e0824b1c44646a6a6964
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/520
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/README.md b/README.md
index 2051810..29d90e4 100644
--- a/README.md
+++ b/README.md
@@ -134,21 +134,28 @@
in one subdirectory. There will be an extra subdirectory libpci-libgetopt
created, which will contain compiled libpci and libgetopt.
- Download pciutils 3.5.6 and apply https://flashprog.org/wiki/File:Pciutils-3.5.6.patch.gz
- Compile pciutils, using following command line:
+ Download pciutils 3.15.0 and compile it using following command line:
make ZLIB=no DNS=no HOST=i386-djgpp-djgpp CROSS_COMPILE=i586-pc-msdosdjgpp- \
- PREFIX=/ DESTDIR=$PWD/../libpci-libgetopt \
- STRIP="--strip-program=i586-pc-msdosdjgpp-strip -s" install install-lib
+ PREFIX=/ DESTDIR=$PWD/../libpci-libgetopt install-lib
- Download and compile with 'make' https://flashprog.org/wiki/File:Libgetopt.tar.gz
+ Download getopt 2.5 from ftp.math.utah.edu and build the static library:
+
+ tar xzf getopt-2.5.tar.gz
+ cd getopt-2.5
+ printf '%s\n' 'char *gettext(const char *msgid);' >posix/gettext.h
+ sed -i -e 's,env/[gs]etenv\.c,,g' Makefile.in
+ AR=i586-pc-msdosdjgpp-ar RANLIB=i586-pc-msdosdjgpp-ranlib \
+ ./configure --host i586-pc-msdosdjgpp
+ make
Copy the libgetopt.a to ../libpci-libgetopt/lib and
- getopt.h to ../libpci-libgetopt/include
+ posix/getopt.h to ../libpci-libgetopt/include
Enter the flashprog directory.
- make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip \
+ make CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar \
+ RANLIB=i586-pc-msdosdjgpp-ranlib STRIP=i586-pc-msdosdjgpp-strip \
LIBS_BASE=../libpci-libgetopt/ HAS_LIBPCI=yes CONFIG_LIBPCI_LDFLAGS=-lpci \
strip
diff --git a/util/manibuilder/Dockerfile.djgpp b/util/manibuilder/Dockerfile.djgpp
index 7547798..602ee8b 100644
--- a/util/manibuilder/Dockerfile.djgpp
+++ b/util/manibuilder/Dockerfile.djgpp
@@ -1,33 +1,49 @@
-FROM anibali/djgpp:6.1.0
+FROM debian:bookworm-slim
USER root
RUN \
- userdel appuser && \
- useradd -p locked -m mani && \
- zypper -q install -y tar make git ccache
+ apt-get update && \
+ apt-get install -y --no-install-recommends \
+ bzip2 ca-certificates ccache curl flex git libfl2 make tar && \
+ rm -rf /var/lib/apt/lists/* && \
+ useradd -p locked -m mani
-RUN mkdir -p -m 1777 /ccache
+RUN mkdir -p -m 1777 /ccache && \
+ mkdir -p /opt/djgpp
+ARG DJGPP_RELEASE=v3.4
+ARG DJGPP_ARCHIVE=djgpp-linux64-gcc1220.tar.bz2
+RUN curl -L --fail \
+ https://github.com/andrewwutw/build-djgpp/releases/download/${DJGPP_RELEASE}/${DJGPP_ARCHIVE} | \
+ tar -xj --strip-components=1 -C /opt/djgpp
+
+ENV PATH=/opt/djgpp/bin:$PATH
ENV GIT_SSL_NO_VERIFY=1
USER mani
ARG ORIGIN=https://review.sourcearcade.org/flashprog.git
+ARG PCIUTILS_TAG=v3.15.0
+ARG GETOPT_VERSION=2.5
RUN cd && \
- mkdir .ccache && chown mani:users .ccache && \
+ mkdir .ccache && \
git clone ${ORIGIN} flashprog && \
- git clone https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git && \
+ git clone --depth 1 --branch ${PCIUTILS_TAG} \
+ https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git && \
cd pciutils && \
- git checkout v3.5.6 && \
- curl --insecure https://flashprog.org/images/6/6a/Pciutils-3.5.6.patch.gz | zcat | git apply && \
make ZLIB=no DNS=no HOST=i386-djgpp-djgpp \
CROSS_COMPILE=i586-pc-msdosdjgpp- \
PREFIX=/ DESTDIR=$PWD/../ \
- STRIP="--strip-program=i586-pc-msdosdjgpp-strip -s" \
- install install-lib && \
+ install-lib && \
cd ../ && \
- curl --insecure https://flashprog.org/images/3/3d/Libgetopt.tar.gz | zcat | tar x && \
- cd libgetopt && \
- make && cp libgetopt.a ../lib/ && cp getopt.h ../include/
+ curl -L --fail https://ftp.math.utah.edu/pub/getopt/getopt-${GETOPT_VERSION}.tar.gz | tar xz && \
+ cd getopt-${GETOPT_VERSION} && \
+ printf '%s\n' 'char *gettext(const char *msgid);' >posix/gettext.h && \
+ sed -i -e 's,env/[gs]etenv\.c,,g' Makefile.in && \
+ AR=i586-pc-msdosdjgpp-ar RANLIB=i586-pc-msdosdjgpp-ranlib \
+ ./configure --host i586-pc-msdosdjgpp && \
+ make && \
+ cp libgetopt.a ../lib/ && \
+ cp posix/getopt.h ../include/
ARG IDENT=mani
ARG CCACHE_MAX=32M
diff --git a/util/manibuilder/Makefile b/util/manibuilder/Makefile
index a9be1fe..b5a35f8 100644
--- a/util/manibuilder/Makefile
+++ b/util/manibuilder/Makefile
@@ -52,7 +52,7 @@
$(foreach tag,$(OFFICIAL_TAGS), \
$(eval $(call build_template,$(tag),$(tag),$(call official_stem,$(tag)),$(call official_plat,$(tag)))))
-djgpp\:6.1.0-build: %-build: Dockerfile.djgpp mani-wrapper.sh
+djgpp\:12.2.0-build: %-build: Dockerfile.djgpp mani-wrapper.sh
$(QUIET_SETUP)docker build . -f $< -t mani/$* --build-arg IDENT=$(call ident,$*)
source-build: Dockerfile.source
diff --git a/util/manibuilder/Makefile.env b/util/manibuilder/Makefile.env
index b6af5ca..b8c87ad 100644
--- a/util/manibuilder/Makefile.env
+++ b/util/manibuilder/Makefile.env
@@ -2,13 +2,13 @@
$(ALMALINUX_TAGS): CC=cc
# DJGPP is very special
-djgpp\:6.1.0: ENV_VARS=CROSS_COMPILE=i586-pc-msdosdjgpp-
-djgpp\:6.1.0: CC=ccache i586-pc-msdosdjgpp-gcc
-djgpp\:6.1.0: STRIP=i586-pc-msdosdjgpp-strip
-djgpp\:6.1.0: LIBS_BASE=../
-djgpp\:6.1.0: MAKEARGS+=HAS_LIBPCI=yes CONFIG_LIBPCI_LDFLAGS=-lpci
-djgpp\:6.1.0: MAKEARGS+=strip WARNERROR=no
-djgpp\:6.1.0: MESONCMD=
+djgpp\:12.2.0: ENV_VARS=CROSS_COMPILE=i586-pc-msdosdjgpp- AR=i586-pc-msdosdjgpp-ar RANLIB=i586-pc-msdosdjgpp-ranlib
+djgpp\:12.2.0: CC=ccache i586-pc-msdosdjgpp-gcc
+djgpp\:12.2.0: STRIP=i586-pc-msdosdjgpp-strip
+djgpp\:12.2.0: LIBS_BASE=../
+djgpp\:12.2.0: MAKEARGS+=HAS_LIBPCI=yes CONFIG_LIBPCI_LDFLAGS=-lpci
+djgpp\:12.2.0: MAKEARGS+=strip WARNERROR=no
+djgpp\:12.2.0: MESONCMD=
# No libftdi1
NO_LIBFTDI1_TAGS := \
diff --git a/util/manibuilder/Makefile.targets b/util/manibuilder/Makefile.targets
index bab78cd..95d9786 100644
--- a/util/manibuilder/Makefile.targets
+++ b/util/manibuilder/Makefile.targets
@@ -37,7 +37,7 @@
$(foreach v,3.22 3.21 3.20 3.19 3.18 3.17 3.16 3.15, \
$(a)/alpine\:$(v))) \
-OTHER_TAGS := djgpp\:6.1.0
+OTHER_TAGS := djgpp\:12.2.0
NONCROSS_TAGS := $(ANITA_TAGS) $(OFFICIAL_TAGS) $(MULTIARCH_TAGS) $(OTHER_TAGS)
diff --git a/util/manibuilder/README.md b/util/manibuilder/README.md
index adbdfe7..104b292 100644
--- a/util/manibuilder/README.md
+++ b/util/manibuilder/README.md
@@ -51,7 +51,7 @@
debian-debootstrap:mips-sid: 2
debian-debootstrap:mips-buster: 2
ubuntu-debootstrap:powerpc-xenial: 2
- djgpp:6.1.0: 2
+ djgpp:12.2.0: 2
For each *tag* that returns with a non-zero exit code, the *tag*
and actual exit code is printed. An exit code of `2` is most likely