commit bb5e5f034804abb465fefcecd449fd7e9824a981 Author: Victor Bodinaud Date: Mon Jan 19 15:31:59 2026 +0100 Initial commit - Basilisk II auto-installer - install.sh: script d'installation automatique pour Arch/Debian - Quadra.ROM: ROM Macintosh Quadra - HDD.img: image disque System 7 - CLAUDE.md: documentation du projet diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..6a63bdf --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,11 @@ +{ + "permissions": { + "allow": [ + "Bash(git init:*)", + "Bash(git checkout:*)", + "Bash(git remote add:*)", + "Bash(git add:*)", + "Bash(git commit -m \"$\\(cat <<''EOF''\nInitial commit - Basilisk II auto-installer\n\n- install.sh: script d''installation automatique pour Arch/Debian\n- Quadra.ROM: ROM Macintosh Quadra\n- HDD.img: image disque System 7\n- CLAUDE.md: documentation du projet\nEOF\n\\)\")" + ] + } +} diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..2887dc6 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,45 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +Basilisk II auto-installer for Linux (Arch and Debian/Ubuntu). Compiles Basilisk II from source and configures it to run classic Macintosh System 7 with a Quadra 900 emulation. + +## Repository Contents + +- `install.sh` - Main installer script (French comments) +- `Quadra.ROM` - Macintosh Quadra ROM file +- `HDD.img` - Hard disk image with System 7 + +## Running the Installer + +```bash +./install.sh +``` + +Requires `sudo` for package installation. Supported distributions: Arch Linux, Debian/Ubuntu. + +## Configuration + +Before running, update the placeholder URL in `install.sh`: +```bash +GIT_BASE_URL="https://ton-git-perso.com/basilisk" # Replace with actual URL +``` + +## Installation Output + +Files are installed to `~/.basilisk2/`: +- `bin/BasiliskII` - Compiled emulator binary +- `basilisk2_prefs` - Generated configuration +- `shared/` - Directory shared with emulated Mac (extfs) + +Launch with `~/.basilisk2/run.sh` or `basilisk2` if `~/bin` is in PATH. + +## Emulator Configuration + +Default settings in generated `basilisk2_prefs`: +- RAM: 16 MB +- Model: Quadra 900 (modelid 14, cpu 4, fpu enabled) +- Display: 800x600 DGA +- Network: disabled diff --git a/HDD.img b/HDD.img new file mode 100644 index 0000000..c5ea289 Binary files /dev/null and b/HDD.img differ diff --git a/Quadra.ROM b/Quadra.ROM new file mode 100644 index 0000000..b135104 Binary files /dev/null and b/Quadra.ROM differ diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..d582986 --- /dev/null +++ b/install.sh @@ -0,0 +1,229 @@ +#!/bin/bash +#=============================================================================== +# Basilisk II Auto-Installer +# Installe, compile et configure Basilisk II sur Arch Linux ou Debian/Ubuntu +#=============================================================================== + +set -e + +#------------------------------------------------------------------------------- +# Configuration - À adapter avec tes URLs +#------------------------------------------------------------------------------- +GIT_BASE_URL="https://ton-git-perso.com/basilisk" # Remplace par ton URL +ROM_URL="${GIT_BASE_URL}/quadra900.rom" +HDD_URL="${GIT_BASE_URL}/system7.img" + +INSTALL_DIR="${HOME}/.basilisk2" +ROM_FILE="${INSTALL_DIR}/quadra900.rom" +HDD_FILE="${INSTALL_DIR}/system7.img" +CONFIG_FILE="${INSTALL_DIR}/basilisk2_prefs" +SHARED_DIR="${INSTALL_DIR}/shared" + +#------------------------------------------------------------------------------- +# Détection de la distribution +#------------------------------------------------------------------------------- +detect_distro() { + if [ -f /etc/arch-release ]; then + echo "arch" + elif [ -f /etc/debian_version ]; then + echo "debian" + else + echo "unknown" + fi +} + +#------------------------------------------------------------------------------- +# Installation des dépendances +#------------------------------------------------------------------------------- +install_deps_arch() { + echo ">>> Installation des dépendances (Arch)..." + sudo pacman -S --needed --noconfirm \ + base-devel git sdl2 gtk2 \ + autoconf automake pkg-config +} + +install_deps_debian() { + echo ">>> Installation des dépendances (Debian/Ubuntu)..." + sudo apt-get update + sudo apt-get install -y \ + build-essential git libsdl2-dev libgtk2.0-dev \ + autoconf automake pkg-config wget +} + +#------------------------------------------------------------------------------- +# Compilation de Basilisk II +#------------------------------------------------------------------------------- +compile_basilisk() { + echo ">>> Compilation de Basilisk II..." + + local build_dir="/tmp/basilisk2-build" + rm -rf "${build_dir}" + mkdir -p "${build_dir}" + cd "${build_dir}" + + git clone --depth 1 https://github.com/cebix/macemu.git + cd macemu/BasiliskII/src/Unix + + ./autogen.sh + ./configure --enable-sdl-video --enable-sdl-audio --with-gtk=gtk2 + make -j$(nproc) + + # Installation du binaire + mkdir -p "${INSTALL_DIR}/bin" + cp BasiliskII "${INSTALL_DIR}/bin/" + + echo ">>> Compilation terminée" + cd / + rm -rf "${build_dir}" +} + +#------------------------------------------------------------------------------- +# Téléchargement des ressources +#------------------------------------------------------------------------------- +download_resources() { + echo ">>> Téléchargement de la ROM et de l'image disque..." + + mkdir -p "${INSTALL_DIR}" + mkdir -p "${SHARED_DIR}" + + if [ ! -f "${ROM_FILE}" ]; then + echo " Téléchargement ROM..." + wget -q --show-progress -O "${ROM_FILE}" "${ROM_URL}" + else + echo " ROM déjà présente, skip" + fi + + if [ ! -f "${HDD_FILE}" ]; then + echo " Téléchargement image disque..." + wget -q --show-progress -O "${HDD_FILE}" "${HDD_URL}" + else + echo " Image disque déjà présente, skip" + fi +} + +#------------------------------------------------------------------------------- +# Génération de la configuration +#------------------------------------------------------------------------------- +generate_config() { + echo ">>> Génération de la configuration..." + + cat > "${CONFIG_FILE}" << EOF +# Basilisk II Configuration +# Généré automatiquement + +# ROM et disque +rom ${ROM_FILE} +disk ${HDD_FILE} + +# Mémoire (16 Mo) +ramsize 16777216 + +# Modèle Quadra 900 +modelid 14 +cpu 4 +fpu true + +# Affichage (plein écran, 800x600, 256 couleurs) +screen dga/800/600/8 +frameskip 1 + +# Audio +nosound false + +# Réseau (désactivé par défaut) +nonet true + +# Dossier partagé avec l'hôte +extfs ${SHARED_DIR} + +# Presse-papier partagé +enableextfs true +EOF + + echo ">>> Configuration générée: ${CONFIG_FILE}" +} + +#------------------------------------------------------------------------------- +# Création du lanceur +#------------------------------------------------------------------------------- +create_launcher() { + echo ">>> Création des lanceurs..." + + # Script de lancement + local launcher="${INSTALL_DIR}/run.sh" + cat > "${launcher}" << EOF +#!/bin/bash +cd "${INSTALL_DIR}" +exec "${INSTALL_DIR}/bin/BasiliskII" --config "${CONFIG_FILE}" +EOF + chmod +x "${launcher}" + + # Lien symbolique dans ~/bin si existe + if [ -d "${HOME}/bin" ]; then + ln -sf "${launcher}" "${HOME}/bin/basilisk2" + echo " Lien créé: ~/bin/basilisk2" + fi + + # Fichier .desktop + local desktop_file="${HOME}/.local/share/applications/basilisk2.desktop" + mkdir -p "$(dirname "${desktop_file}")" + cat > "${desktop_file}" << EOF +[Desktop Entry] +Name=Basilisk II +Comment=Émulateur Macintosh 68k - System 7 +Exec=${launcher} +Icon=computer +Terminal=false +Type=Application +Categories=Emulator;System; +EOF + + echo " Raccourci bureau créé" +} + +#------------------------------------------------------------------------------- +# Main +#------------------------------------------------------------------------------- +main() { + echo "==============================================" + echo " Basilisk II - Installation automatique" + echo "==============================================" + echo + + local distro=$(detect_distro) + echo ">>> Distribution détectée: ${distro}" + + case "${distro}" in + arch) + install_deps_arch + ;; + debian) + install_deps_debian + ;; + *) + echo "ERREUR: Distribution non supportée" + echo "Supportées: Arch Linux, Debian/Ubuntu" + exit 1 + ;; + esac + + compile_basilisk + download_resources + generate_config + create_launcher + + echo + echo "==============================================" + echo " Installation terminée !" + echo "==============================================" + echo + echo " Dossier: ${INSTALL_DIR}" + echo " Lancer: ${INSTALL_DIR}/run.sh" + echo " Dossier partagé: ${SHARED_DIR}" + echo + echo " Tu peux aussi lancer depuis le menu applications" + echo " ou taper 'basilisk2' si ~/bin est dans ton PATH" + echo +} + +main "$@"