Skip to content

Instantly share code, notes, and snippets.

@piquan
Created May 20, 2018 21:34
Show Gist options
  • Save piquan/937fbc682090838870210af996102e85 to your computer and use it in GitHub Desktop.
Save piquan/937fbc682090838870210af996102e85 to your computer and use it in GitHub Desktop.
Bootstrap problem during cwebbin build

To use this:

  1. Install Docker if needed:
  2. Create a directory containing the files in this gist (Dockerfile and cwebbin.diff)
  3. Download the distfiles into that directory
  4. docker pull debian:stretch-slim
  5. In the directory containing the Dockerfile, cwebbin.diff, and dist files, run docker build .

To see the problem I'm trying to fix, comment out the RUN patch line in the Dockerfile and build.

If you need to test against a different version of cwebbin, you may need to edit or remove the Prereq: line at the top of cwebbin.diff.

Prereq: [22p]
diff -Naur cwebbin-cwebbin-22p.orig/Makefile.unix cwebbin-cwebbin-22p/Makefile.unix
--- cwebbin-cwebbin-22p.orig/Makefile.unix 2017-09-25 22:46:14.000000000 -0700
+++ cwebbin-cwebbin-22p/Makefile.unix 2018-05-20 13:34:54.117241682 -0700
@@ -140,8 +140,8 @@
########## You shouldn't have to change anything after this point #######
-CWEAVE = ./cweave $(WFLAGS)
-CTANGLE = ./ctangle $(TFLAGS)
+CWEAVE = env CWEBINPUTS=$(INCLUDE) ./cweave $(WFLAGS)
+CTANGLE = env CWEBINPUTS=$(INCLUDE) ./ctangle $(TFLAGS)
# The following files come from the original CWEB distribution and
# are left completely unmodified.
@@ -210,7 +210,7 @@
.tex.pdf:
case "$(PDFTEX)" in \
- dvipdfm ) TEXINPUTS=.//: tex "\let\pdf+ \input $*"; dvipdfm $* ;; \
+ dvipdfm ) TEXINPUTS=.//: tex "\let\pdf+ \input $*"; dvipdfm $*.dvi ;; \
pdftex ) TEXINPUTS=.//: pdftex $* ;; \
esac
FROM debian:stretch-slim
RUN apt-get update && apt-get install -y texlive-binaries build-essential
# Note that ADD will automatically extract tarballs.
ADD cwebbin-22p.tar.gz /tmp/
ADD cweb-3.64c.tar.gz /tmp/cwebbin-cwebbin-22p/
ADD cwebbin.diff /tmp/cwebbin-cwebbin-22p/
WORKDIR /tmp/cwebbin-cwebbin-22p/
RUN patch -p1 < cwebbin.diff
RUN touch common.cxx ctangle.cxx
RUN make -f Makefile.unix boot
RUN make -f Makefile.unix all
RUN make -f Makefile.unix cautiously
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment