Guide to Building AppleWin on Linux - FujiNetWIFI/fujinet-firmware GitHub Wiki

Totally Fine Guide For Building AppleWin Linux Version to use with FujiNet-PC

Enjoy the Apple2 FujiNet experience in the comfort of your own modern PC.

Just the Facts TL;DR Version

build AppleWin

git clone https://github.com/FujiNetWIFI/AppleWin.git
cd AppleWin
git fetch --all
git checkout linux
git submodule update --init --recursive
# c = clean, b = build. use -h for help
./build.sh -cb

For requisite packages read the full directions below...

build fujinet-pc

git clone https://github.com/FujiNetWIFI/fujinet-firmware.git
cd fujinet-firmware
./build.sh -cp APPLE

run them

cd fujinet-firmware/build/dist
./run-fujinet

# another shell
cd AppleWin/build
./sa2 --log

Back to the regular version

Note

When you have finished this you will also need to run FujiNet-PC (and build it) from the fujinet-firmware repo. There may be guides for that but it boils down to checking out the repo if you don't have it and then building with: $./build.sh -cp APPLE

Prereqs

Note

May not be all, but build for me on a base Ubuntu 22.x Linux machine]

sudo apt install -y build-essential checkinstall zlib1g-dev libpcap-dev libssl-dev libyaml-dev libtool autoconf libslirp-dev libminizip-dev libboost-all-dev libsdl2-image-dev unzip curl wget git python3.10-venv libmbedtls-dev default-jre

sudo snap install cmake --classic

Clone repos

This assumes you have your own forks of each of these, if not just clone the direct repo in the FujiNet Org Area.

I am just clonging AppleWin directly as I'm going to assume not many people expect to commit to that repo. But if you do want to you know what you should do.

mkdir code
cd code
git clone https://github.com/dillera/fujinet-firmware
git clone https://github.com/dillera/fujinet-apps
git clone https://github.com/dillera/AppleWin

cd fujinet-apps
git remote upstream https://github.com/FujiNetWIFI/fujinet-apps

cd fujinet-firmware
git remote upstream https://github.com/FujiNetWIFI/fujinet-firmware

cd AppleWin
git remote upstream https://github.com/FujiNetWIFI/AppleWin

Building

cd AppleWin
git remote add upstream https://github.com/FujiNetWIFI/AppleWin.git
git fetch --all
git checkout linux
# checkout submodules
git submodule update --init --recursive
mkdir build
cd build
# You can also use RELEASE instead of DEBUG if you're not going to be doing any gdb style debugging
cmake -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_SA2=on .. 
make

Running

To run it:

# logs are hardcoded to /tmp/AppleWin.log by the app if you specify --log
# the configuration file is at ~/.applewin/applewin.conf, you can remove slots if you have issues in that file
# sa2 stands for "SDL Apple 2", i.e. sa2
# use "./sa2 -h" to see help, defaults to x11:

./sa2 --log

# OPTIONAL! you can also specify a gfx driver specifically, e.g. x11, wayland.
SDL_VIDEODRIVER=wayland ./sa2

Once running, open the configuration menu (System/Settings), open the Hardware TAB, In an empty slot (I've been using slot 5), choose "SPoverSLIP". This will load the card. If you exit AppleWin, your config is saved to the previously mentioned applwin.conf. Then when you run it again, it'll auto start with the card in.

You can preconfigure your config to load SPoverSLIP with the following section: [Configuration\Slot 5] Card type=25

change the Slot number as you desire.

Good Config Files

BenK already has a nice set of good config files that will make using this much easier. Head over to: https://github.com/FujiNetWIFI/fujinet-vm/blob/main/scripts/install-applewin-linux.sh and take a look at that script which he uses to build the VM for all this. Those HERE docs should be used for your system to setup and configure AppleWin so that it does all the SLIP networking to talk to the FujiNet-PC instance that you also built and are running.

Config Files are here


mkdir -p ~/.applewin
cat <<EOF > ~/.applewin/applewin.conf
[Configuration\Slot 0]
Card type=17

# FujiNet-PC
[Configuration\Slot 7]
Card type=25

[Configuration\Slot Auxiliary]
Card type=13

[sa2\geometry]
width=800
height=600
x=324
y=88

[Configuration]
Video Emulation=1
Video Style=0
Monochrome Color=12632256
Video Refresh Rate=2
EOF

Then this:

cat <<EOF > ~/start-applewin.sh
#!/usr/bin/env bash 

LOAD_DISK=""
if [[ -n "\$1" ]]
then
  LOAD_DISK="-1 \$1"
fi 

/usr/local/bin/sa2 --log \$LOAD_DISK

EOF

Then:

chmod +x ~/start-applewin.sh

Make a Launcher:

cat <<EOF > "$LAUNCHER_PATH"
[Desktop Entry]
Encoding=UTF-8
Name=FujiNet AppleWin
Comment=FujiNet connected to AppleWin for Linux
Type=Application
Exec=$INSTALL_PATH/start-applewin.sh
Icon=/usr/local/share/applewin/resource/APPLEWIN.ICO
EOF

chmod +x "$LAUNCHER_PATH"
gio set -t string "$LAUNCHER_PATH" metadata::xfce-exe-checksum "$(sha256sum "$LAUNCHER_PATH" | awk '{print $1}')"

cat <<EOF > "$WEB_URL_PATH"
[Desktop Entry]
Version=1.0
Name=FujiNet Apple Web UI
Comment=Web UI admin console for FujiNet Apple
Type=Link
Icon=/home/$P_USERNAME/Pictures/fn-logo-black.png
URL=http://localhost:8001
EOF

And Finally:

chmod +x "$WEB_URL_PATH"
gio set -t string "$WEB_URL_PATH" metadata::xfce-exe-checksum "$(sha256sum "$WEB_URL_PATH" | awk '{print $1}')"
⚠️ **GitHub.com Fallback** ⚠️