cosarara.me

The blog

Building dosemu2 to run WordPerfect for DOS on debian

We are going to run wordperfect for dos on dosemu on debian. Overcomplicated adventure building stuff as debs for no reason.

Main source of inspiration is http://www.columbia.edu/~em36/wpdos/ and the linux page there. Apparently there is a new way with dosbox-x which is better, but I don’t seriously intend to use WP, I’m just toying, so I won’t ask.

I wrote down what I did as I went, but reordered sections to be in logical order instead of chronological.

Let’s go with dosemu2. I’m running bedrock linux on this laptop, with debian and void. But dosemu2 is not in either’s repo. We could try to use the ubuntu debs, but it feels wrong and there is no fun in that. So time to build from source.

We’ll need some normal dependencies we can get from apt, but we will also need fdpp.

git clone https://github.com/dosemu2/fdpp.git

The readme claims make is all you need - it’s never that easy

sudo apt install libelf-dev bison flex clang texinfo asciidoc-base xmlto

(note this pulls a ton of tex shit, maybe there’s a way to make it more minimal)

As of writing, fdpp depends on a custom nasm which is hosted on launchpad.

git clone https://git.launchpad.net/nasm-segelf
git checkout elf16
debuild -i -us -uc -b

We could add --lintian-opts --suppress-tags bad-distribution-in-changes-file telling lintian to ignore that because we are building an ubuntu package, but it turns out that lintian doesn’t matter, it gives some errors but the build is fine.

sudo apt install ../nasm-segelf_2.16.01-2_amd64.deb

Back on fdpp:

make deb
sudo apt install ../fdpp_1.7-1_amd64.deb ../fdpp-dev_1.7-1_amd64.deb

Now it turns out that dosemu2 will also want comcom32, so let’s do that:

git clone https://github.com/dosemu2/comcom32.git

New subquest, we need the djgpp toolchain. We are going to need normal nasm this time.

sudo apt install dos2unix nasm

This one will take forever

git clone https://github.com/jwt27/build-gcc.git
debuild -i -us -uc -b
sudo apt install ../binutils-djgpp_2.41+11_amd64.deb \
../djgpp-dev_2.05.cvs.20230827.1621+11_amd64.deb \
../djgpp-utils_2.05.cvs.20230827.1621+11_amd64.deb \
../gcc-djgpp_12.2.0+11_amd64.deb ../gdb-djgpp_8.2.1+11_amd64.deb \
../libwatt-djgpp-dev_2.2.11.git.20230826.1759+11_amd64.deb

Back on comcom32:

debuild -i -us -uc -b
sudo apt install ../comcom32_0.1\~alpha3-1_all.deb

Finally

git clone https://github.com/dosemu2/dosemu2.git
sudo apt install linuxdoc-tools libslang2-dev libgpm-dev \
libsdl2-ttf-dev libfontconfig1-dev ladspa-sdk libfluidsynth-dev \
libao-dev libieee1284-3-dev libslirp-dev libbsd-dev \
libreadline-dev libjson-c-dev libb64-dev binutils-dev binutils-i686-linux-gnu
make deb
sudo apt install ../dosemu2_2.0~pre9-1_amd64.deb

I’m not going to bother with uninstalling all the stuff we installed just for building honestly.

Once I got dosemu2 booting, I fetched a copy of WordPerfect 6.2, extracted the contents of the images:

sudo mkdir -p /mnt/a
mkdir -p out
for i in *.img; do
    echo "$i"
    sudo mount -o loop "$i" /mnt/a
    cp -rv /mnt/a/* out
    sudo umount /mnt/a
done

Then went through the install, selecting the Apple LaserWriter IINTX for the printer, forgetting to select the VESA driver (so I did that part to get high resolution later), and basically following the WPDOS guide as well as I could. I also replaced the binary for the patched version in the archive, which gives me shift+arrow keys selection. The mouse is a bit weird and too fast in my dosemu2, so I have an emumouse line in my USERHOOK.BAT file.

.dosemu/drive_c/USERHOOK.BAT 
emumouse x 2 y 4
CD \COREL\WP62
WP

A screenshot of the result:
Screenshot from WP6 running on dosemu2 on debian

Printing just works, dosemu2 passes down the file to the CUPS default printer. CUPS-PDF can be used to print to PDF.

—cosarara

Got any comments? Send me an email: blog@cosarara.me