joeylib2/installer/components/kpcomm.sh
2026-10-13 14:01:46 -05:00

43 lines
1.4 KiB
Bash

# Part of JoeyLib, Copyright (c) 2026 Scott Duensing, under the MIT License.
# See LICENSE.md for license information.
# SPDX-License-Identifier: MIT
#
# KPCOMM.DRV, the communications driver the win16 port's Windows runs with
# in place of Windows 3.1's COMM.DRV: both 16550A FIFOs, 115200 baud, any
# common IRQ. Built (installer/lib/winDriver.sh) from the mscomm project's
# drv folder, a checkout beside this repository (../mscomm/drv, or
# KPCOMM_DIR), with its Open Watcom makefile (watcom.mk), into
# toolchains/opt/kpcomm/kpcomm.drv; scripts/lib/win16Gate.sh installs it in
# each run's Windows as comm.drv.
compDescription="win16: KPCOMM.DRV comm driver for its Windows, built from ../mscomm/drv (KPCOMM_DIR)"
compGroups="emulator:win16"
compRequires="openWatcom"
compHostDeps="make"
# shellcheck source=installer/lib/winDriver.sh
source "$JOEY_INSTALLER/lib/winDriver.sh"
kpcommDir="${KPCOMM_DIR:-$(cd "$JOEY_REPO/.." && pwd)/mscomm/drv}"
compPin="dir:$kpcommDir:$(winDriverPin "$kpcommDir")"
compInstall() {
winDriverBuild "$kpcommDir" watcom.mk kpcomm.drv
}
compInstalled() {
[ -s "$compDir/kpcomm.drv" ]
}
compVerify() {
# A Windows module whose name is COMM (USER imports it by that name).
[ "$(head -c 2 "$compDir/kpcomm.drv")" = "MZ" ] && LC_ALL=C grep -q -a 'KPCOMM' "$compDir/kpcomm.drv"
}
compEnv() {
envVar KPCOMM_DRV "$compDir/kpcomm.drv"
}