Skip to content

Commit

Permalink
Tuneup for CWEB 4.8.
Browse files Browse the repository at this point in the history
  • Loading branch information
ascherer committed Jun 5, 2022
1 parent a777935 commit d0ca712
Show file tree
Hide file tree
Showing 38 changed files with 336 additions and 218 deletions.
4 changes: 2 additions & 2 deletions 0001-Support-extended-syntax-for-numeric-literals.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From ba514ca2a52ab65e46d3477724672564cb492646 Mon Sep 17 00:00:00 2001
From: Andreas Scherer <andreas_github@freenet.de>
Date: Mon, 29 Mar 2021 13:14:34 +0200
Subject: [PATCH 1/3] Support extended syntax for numeric literals.
Subject: [PATCH 1/4] Support extended syntax for numeric literals.

---
ctwimac.tex | 15 ++++++++++-----
Expand Down Expand Up @@ -90,5 +90,5 @@ index 29533b8..dbcf312 100644
\hbox{\strut\kern2pt\.{#1}\kern2pt}}
\hrule}\vrule\kern2pt}} % verbatim string
--
2.33.1
2.35.1

4 changes: 2 additions & 2 deletions 0002-Purge-redundant-TeX-macro.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a5ee9d7e41df5d084cdbd23a9e43cdd9e31c1e6c Mon Sep 17 00:00:00 2001
From: Andreas Scherer <andreas_github@freenet.de>
Date: Thu, 8 Apr 2021 14:44:11 +0200
Subject: [PATCH 2/3] Purge redundant '\TeX' macro.
Subject: [PATCH 2/4] Purge redundant '\TeX' macro.

---
ctwimac.tex | 5 +----
Expand Down Expand Up @@ -68,5 +68,5 @@ index 99ae604..89e3b68 100644
\let\mc=\ninerm % medium caps
\def\CEE/{{\mc C\spacefactor1000}}
--
2.33.1
2.35.1

4 changes: 2 additions & 2 deletions 0003-Adapt-to-CWEB-4.5.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 3e8c31f1e457bb6e9c589a3ae7574a753033d8b6 Mon Sep 17 00:00:00 2001
From: Andreas Scherer <andreas_github@freenet.de>
Date: Wed, 7 Jul 2021 13:57:00 +0200
Subject: [PATCH 3/3] Adapt to CWEB 4.5.
Subject: [PATCH 3/4] Adapt to CWEB 4.5.

---
ctwimac.tex | 40 ++++++++++++++++++++--------------------
Expand Down Expand Up @@ -266,5 +266,5 @@ index 89e3b68..30d4449 100644
\def\normaloutput#1{\shipout\vbox{
\vbox to 3pc{\ifodd\pageno\rightheadline\else\leftheadline\fi\vfill}
--
2.33.1
2.35.1

25 changes: 25 additions & 0 deletions 0004-Add-silent-datecontentspage-macro.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 29dbd33008c665abe8235cca32f73721771a5e6a Mon Sep 17 00:00:00 2001
From: Andreas Scherer <andreas_github@freenet.de>
Date: Thu, 10 Feb 2022 09:24:39 +0100
Subject: [PATCH 4/4] Add silent \datecontentspage macro.

---
ctwimac.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ctwimac.tex b/ctwimac.tex
index df24900..014168b 100644
--- a/ctwimac.tex
+++ b/ctwimac.tex
@@ -460,7 +460,7 @@
\def\I{\par\hangindent 2em}\let\*=*
\readsections}
\def\readsections{\input \jobname.sscn}
-\def\datethis{}
+\def\datethis{} \def\datecontentspage{}

% To produce only a subset of pages, put the page numbers on separate
% lines in a file called pages.tex
--
2.35.1

2 changes: 1 addition & 1 deletion Makefile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ EXTENSION= cxx

# This list of options works for all UNIX compilers tested.
OPT = -DCWEBINPUTS=\"$(CWEBINPUTS)\" -DHAVE_GETTEXT=1 \
-Wall -Wextra -Wno-implicit-fallthrough \
-Wall -Wextra -Wimplicit-fallthrough=2 \
-Wno-format-overflow -Wno-stringop-truncation
# -Wno-char-subscripts # swap the last two lines for LLVM

Expand Down
62 changes: 47 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[cweb system](http://www-cs-faculty.stanford.edu/~uno/cweb.html)
and donald e. knuth's [ctwill program](http://ftp.cs.stanford.edu/pub/ctwill).
it requires the contents of [the original *cweb* source
drop](https://github.com/ascherer/cweb/releases/download/cweb-4.7/cweb-4.7.tar.gz)
drop](https://github.com/ascherer/cweb/releases/download/cweb-4.8/cweb-4.8.tar.gz)
and [the secondary *ctwill* source
drop](http://ftp.cs.stanford.edu/pub/ctwill/ctwill.tar.gz), to which it applies
a set of change files to introduce advanced features. see the extensive
Expand All @@ -14,18 +14,20 @@ a set of change files to introduce advanced features. see the extensive

* includes **ctwill** and its utilities;
* **internationalization** with the “GNU `gettext` utilities”;
* **temporary file output**: check output for differences from former run with new option `+c`;
* [only `cweave` and `ctwill`] option `-l` to change the first line in the tex output; options `-i` and `-o` for slightly customizable code layout;
* **temporary file output**: check output for differences from former run with
new option `+c`;
* [only `cweave` and `ctwill`] option `-l` to change the first line in the tex
output; options `-i` and `-o` for slightly customizable code layout;
* [only `ctangle`] output can be redirected to `@(/dev/{stdout,stderr,null}@>`;
* [only in “tex live”] file lookup with the **kpathsea** library.

## manual compilation

extract `ctwill.tar.gz` and add the contents of `cweb-4.7.tar.gz` (overwriting
outdated source files) and `cwebbin-2022.1.tar.gz` (overwriting `README.md`)
for the full set of source files.
extract `ctwill.tar.gz` and add the contents of `cweb-4.8.tar.gz` (overwriting
outdated source files `Makefile`, `common.h`, `common.w`, and `prod.w`) and
`cwebbin-2022.2.tar.gz` for the full set of source files.
replace `@@VERSION@@` in line 129 of the `Makefile.unix` with something like
`Version 4.7 [CWEBbin 2022.1]`.
`Version 4.8 [CWEBbin 2022.2]`.
`touch *.cxx`.
unix/linux users should work with [`make -f Makefile.unix`](Makefile.unix)
exclusively (targets `boot`, `cautiously`, and `all`).
Expand All @@ -34,21 +36,40 @@ things work.

## advanced packaging

alternatively, you may want to use *rpmbuild* or *debbuild* for compiling the
sources and for creating installable packages in *rpm* and *deb* format. clone
alternatively, you may want to use
[rpmbuild](https://github.com/rpm-software-management/rpm) or
[debbuild](https://github.com/debbuild/debbuild) for compiling the sources and
for creating installable packages in *rpm* and *deb* format.
set up your *build arena* with `mkdir BUILD BUILDROOT RPMS SOURCES SPECS SRPMS`
for *rpmbuild* (plus `mkdir DEBS SDEBS` for *debbuild*).

clone
[cweb](https://github.com/ascherer/cweb) and
[cwebbin](https://github.com/ascherer/cwebbin), create the source drops with
```
git archive -o cweb-4.7.tar.gz cweb-4.7
git archive -o cwebbin-2022.1.tar.gz cwebbin-2022.1
git archive -o cweb-4.8.tar.gz cweb-4.8
git archive -o cwebbin-2022.2.tar.gz cwebbin-2022.2
```
respectively, put these two tarballs and the original `ctwill.tar.gz` in the
*SOURCES* directory and `cwebbin.spec` in the *SPECS* directory of your build
arena, and run
*SOURCES* directory, add the patch files
* `0001-Support-extended-syntax-for-numeric-literals.patch`
* `0002-Purge-redundant-TeX-macro.patch`
* `0003-Adapt-to-CWEB-4.5.patch`
* `0004-Add-silent-datecontentspage-macro.patch`

to *SOURCES* also, and place `cwebbin.spec` in the *SPECS* directory of your
build arena.

the four patch files upgrade the *ctwill* macros for modern cweb. originally,
they come from branch
[update-macros-for-cweb-4](https://github.com/ascherer/ctwill/tree/update-macros-for-cweb-4)
and can be recreated by `git format-patch master` in the archived
[ctwill project](https://github.com/ascherer/ctwill).

depending on your preferences run the magic incantation
```
{deb|rpm}build -ba SPECS/cwebbin.spec
```
depending on your preferences.

## cweb for texlive

Expand All @@ -61,7 +82,18 @@ by invoking
you receive a small tarball `cweb-texlive.tar.gz`, which should be extracted in
texlive's source directory
[`texlive-source`](https://github.com/TeX-Live/texlive-source) (or the
[subversion equivalent](https://tug.org/svn/texlive/trunk/Build/source)).
[subversion equivalent](https://tug.org/svn/texlive/trunk/Build/source)) with
```
cd /path/to/texlive-source
pax -rzf /path/to/cweb-texlive.tar.gz
```

this tarball contains `*-w2c.ch` files that modify the original cweb sources
for the texlive ecosystem. additionally, it contains language catalogs, tex
macros, and cweb include files.

updated versions of **cweb** are added to the texlive source tree with
```
cd /path/to/texlive-source/texk/web2c/cwebdir
pax -rzf /path/to/cweb-4.8.tar.gz
```
8 changes: 4 additions & 4 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-*-Text-*-
%%% LEGALESE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% This file is part of CWEBbin (Version 4.7 [2022]).
% This file is part of CWEBbin (Version 4.8 [2022]).
% (Set TAB to 8 spaces to get the spacing right.)
% The CWEB programs by Silvio Levy are based on programs by D. E. Knuth.
% They are distributed WITHOUT ANY WARRANTY, express or implied.

% This README file was last updated February 5, 2022 by Andreas Scherer.
% This README file was last updated June 5, 2022 by Andreas Scherer.

% The following copyright notices extend to the respective parts of the
% changed or added source code introduced in this patch only, not to the
Expand Down Expand Up @@ -382,7 +382,7 @@ So here are some words about the `special features':
'evil twin' CTWILL, together with its utility programs 'refsort' and
'twinx', and the associated TeX macros.

- [GENERAL] CWEB 4.7 introduced full support for
- [GENERAL] CWEB 4.8 introduced full support for
Martin Ruckert's HiTeX and its HINT output format; see
https://hint.userweb.mwn.de/hint/hitex.html for details.

Expand All @@ -395,7 +395,7 @@ and co-workers on whose initial ideas and contributions this package is based.

Happy CWEBbin'!

February 5, 2022
June 5, 2022

Andreas Scherer

Expand Down
4 changes: 2 additions & 2 deletions comm-extensions.ch
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ switch (program) {
case ctangle: fatal(
"! Usage: ctangle [options] "@|
"webfile[.w] [{changefile[.ch]|-} [outfile[.c]]]\n"
,"");
,""); break;
@.Usage:@>
case cweave: fatal(
"! Usage: cweave [options] "@|
"webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
,"");
,""); break;
default: fatal(
"! Usage: ctwill [options] "@|
"webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
Expand Down
8 changes: 4 additions & 4 deletions comm-i18n.ch
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ switch (program) {
case ctangle: fatal(
"! Usage: ctangle [options] "@|
"webfile[.w] [{changefile[.ch]|-} [outfile[.c]]]\n"
,"");
,""); break;
@.Usage:@>
case cweave: fatal(
"! Usage: cweave [options] "@|
"webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
,"");
,""); break;
default: fatal(
"! Usage: ctwill [options] "@|
"webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
Expand All @@ -273,12 +273,12 @@ switch (program) {
case ctangle: fatal(
_("! Usage: ctangle [options] "@|
"webfile[.w] [{changefile[.ch]|-} [outfile[.c]]]\n")
,"");
,""); break;
@.Usage:@>
case cweave: fatal(
_("! Usage: cweave [options] "@|
"webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n")
,"");
,""); break;
default: fatal(
_("! Usage: ctwill [options] "@|
"webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n")
Expand Down
4 changes: 2 additions & 2 deletions comm-mini.ch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Limbo.

@x
\def\title{Common code for CTANGLE and CWEAVE (Version 4.7 [CWEBbin 2022])}
\def\title{Common code for CTANGLE and CWEAVE (Version 4.8 [CWEBbin 2022])}
@y
\def\title{COMMON (Version 4.7 [CWEBbin 2022])}
\def\title{COMMON (Version 4.8 [CWEBbin 2022])}
\def\contentspagenumber{0}
@z

Expand Down
7 changes: 4 additions & 3 deletions comm-patch.ch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-*-Web-*-
This file, COMM-FOO.CH, is part of CWEBBIN (@VERSION@).
It is a changefile for COMMON.W, Version 4.7.
It is a changefile for COMMON.W, Version 4.8.

Technically, COMM-FOO.CH is constructed from a multitude of separate change
files by applying Klaus Guntermann's TIE processor. Any comments (like this
Expand Down Expand Up @@ -181,17 +181,18 @@ p21 29 October 2005 AS ANSI C++ patches to patch level [p21].
25 December 2021 AS Tuneup for CWEB 4.6 [2021].

2022 05 February 2022 AS Tuneup for CWEB 4.7 [2022].
05 June 2022 AS Tuneup for CWEB 4.8 [2022].
------------------------------------------------------------------------------
Material in limbo.

@x l.25
\def\title{Common code for CTANGLE and CWEAVE (Version 4.7)}
\def\title{Common code for CTANGLE and CWEAVE (Version 4.8)}
@y
\def\title{Common code for CTANGLE and CWEAVE (@VERSION@)}
@z

@x l.30
\centerline{(Version 4.7)}
\centerline{(Version 4.8)}
@y
\centerline{(@VERSION@)}
@z
Expand Down
8 changes: 4 additions & 4 deletions comm-texlive.ch
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Material in limbo.
\def\title{Common code for CTANGLE and CWEAVE (@VERSION@)}
@y
\def\Kpathsea/{{\mc KPATHSEA\spacefactor1000}} \ifacro\sanitizecommand\Kpathsea{KPATHSEA}\fi
\def\title{Common code for CTANGLE and CWEAVE (4.7 [\TeX~Live])}
\def\title{Common code for CTANGLE and CWEAVE (4.8 [\TeX~Live])}
@z

@x l.30 and l.191 of COMM-PATCH.CH
\centerline{(@VERSION@)}
@y
\centerline{(Version 4.7 [\TeX~Live])}
\centerline{(Version 4.8 [\TeX~Live])}
@z

@x l.32
Expand Down Expand Up @@ -276,12 +276,12 @@ switch (program) {
case ctangle: fatal(
_("! Usage: ctangle [options] "@|
"webfile[.w] [{changefile[.ch]|-} [outfile[.c]]]\n")
,"");
,""); break;
@.Usage:@>
case cweave: fatal(
_("! Usage: cweave [options] "@|
"webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n")
,"");
,""); break;
default: fatal(
_("! Usage: ctwill [options] "@|
"webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n")
Expand Down
Loading

0 comments on commit d0ca712

Please sign in to comment.