commit 1968b5191276457a45ed7235f85d7191b916c3e3 Author: Isuldor Date: Tue May 26 14:35:45 2026 -0700 init: EQLogParser diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/README.md b/README.md new file mode 100644 index 0000000..411f478 --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +# nix-everquest + +Nix flake packaging EverQuest-related tools for Linux. Packages wrap prebuilt Windows releases (Wine) or native builds where applicable. + +## Packages + +| Flake output | Description | +|--------------|-------------| +| `eqlogparser` | [EQLogParser](https://github.com/kauffman12/EQLogParser) via Wine (matches Bottles/Flatpak setup) | + +More apps will be added over time. + +## Quick start + +```bash +nix run .#eqlogparser +# or +nix profile install .#eqlogparser +eqlogparser +``` + +See [docs/eqlogparser.md](docs/eqlogparser.md) for first-run setup, logs, and troubleshooting ([Wine notes](docs/eqlogparser-wine.md)). + +## Custom nixpkgs + +The flake pins `github:NixOS/nixpkgs/nixos-unstable`. To use a local checkout, override the input: + +```bash +nix run .#eqlogparser --override-input nixpkgs path:/path/to/nixpkgs +``` + +Or edit `flake.nix` / `flake.lock` to point `nixpkgs` at your fork. + +## Layout + +``` +flake.nix +packages/ + eqlogparser/ + package.nix +docs/ + eqlogparser.md + eqlogparser-wine.md +``` diff --git a/docs/eqlogparser-wine.md b/docs/eqlogparser-wine.md new file mode 100644 index 0000000..bfd3f4c --- /dev/null +++ b/docs/eqlogparser-wine.md @@ -0,0 +1,281 @@ +# Wine on Nix — notes for EQLogParser + +This document captures troubleshooting lessons from packaging EQLogParser on Linux with Wine and Nix. It is meant for maintainers and anyone running the app outside Bottles/Flatpak. + +For day-to-day usage, see [eqlogparser.md](./eqlogparser.md). The reference implementation is [packages/eqlogparser/package.nix](../packages/eqlogparser/package.nix), which mirrors the upstream [Bottles manifest](https://github.com/kauffman12/EQLogParser/blob/master/bottles/Games/eqlogparser.yml). + +--- + +## What EQLogParser needs under Wine + +EQLogParser is a **.NET 8 WPF** Windows app. Under Wine that implies: + +| Requirement | Why | +|-------------|-----| +| **64-bit Wine prefix** (`WINEARCH=win64`) | Release builds are x64 ([`bottles/Games/eqlogparser.yml`](https://github.com/kauffman12/EQLogParser/blob/master/bottles/Games/eqlogparser.yml)) | +| **wine-mono** in the prefix | Wine’s `mscoree` shim; without it you get the interactive *“Wine could not find a wine-mono package”* dialog | +| **.NET Desktop Runtime 8 (x64)** | WPF needs the *desktop* runtime, not plain `dotnet-runtime` or wine-mono alone | +| **GDI D3D renderer** | WPF on Wine is unstable with default GL/Vulkan paths; Bottles sets `renderer=gdi` | +| **No DXVK / VKD3D** | Bottles explicitly disables them for this app | +| **Piper TTS installer** (recommended) | Wine x64 cannot use Windows SAPI voices; use `EQLogParser-install-pipertts-*.exe` | + +The app also expects **`WINELOADER`** to be set so it disables hardware acceleration (software rendering only). See upstream `EQLogParser/App.xaml.cs` — this matches [Linux known issues](https://github.com/kauffman12/EQLogParser/blob/master/website/documentation.md#known-issues-with-linux). + +--- + +## Choosing a Wine package in nixpkgs + +nixpkgs exposes several Wine variants. They are **not** interchangeable for this project. + +| Package | Use for EQLogParser? | Notes | +|---------|----------------------|-------| +| `pkgs.wine64` | **No** (alone) | Often breaks during `wineboot` / `winetricks` (`syswow64\rundll32.exe` / `ntdll.dll` errors). Prefix may be half-initialized. | +| `pkgs.wineWow64Packages.stableFull` | **Yes** | WOW64 + `embedInstallers = true` bundles **wine-mono** and gecko MSIs under `share/wine/mono/`. This is what the flake uses. | +| `pkgs.wine` (default 32-bit WOW) | **No** | Wrong architecture for a win64-only bottle. | +| `pkgs.wine64Packages.full` | **Maybe** | Has `embedInstallers`, but lacks the 32-bit side WOW64 often needs for installers and `msiexec`. Prefer `wineWow64`. | + +**Rule of thumb:** match Bottles — **64-bit bottle, Wine runner, no DXVK**. On Nix that is `wineWow64Packages.stableFull` with no DXVK in `PATH` or `WINEDLLOVERRIDES`. + +```nix +wine = pkgs.wineWow64Packages.stableFull; +``` + +Verify mono is present: + +```bash +ls "$(nix-build '' -A wineWow64Packages.stableFull --no-out-link)/share/wine/mono/" +# e.g. wine-mono-10.0.0-x86.msi +``` + +--- + +## wine-mono vs .NET Desktop Runtime + +These solve **different** problems. Installing only one leads to confusing errors. + +### wine-mono + +- Ships with Wine when `embedInstallers = true` (`stableFull`, `full` variants). +- Installed **into the prefix** via MSI, e.g. + `wine msiexec /i "$WINE_PKG/share/wine/mono/wine-mono-"*.msi /qn` +- Satisfies Wine’s .NET Framework / `mscoree` path and stops the mono download dialog. +- **Not** a substitute for .NET 8. + +### .NET 8 Desktop Runtime + +- Microsoft installer, same as Bottles dependency `dotnetcoredesktop8` + ([`dotnetcoredesktop8.yml`](https://github.com/bottlesdevs/dependencies/blob/main/Essentials/dotnetcoredesktop8.yml)). +- For win64 bottles, the **x64** installer is enough (Bottles also installs x86; we only install x64). +- Example (version pinned in the package): + `windowsdesktop-runtime-8.0.12-win-x64.exe /quiet` +- Winetricks verb `dotnetdesktop8` is equivalent but failed in our tests (see below). + +### Install order (important) + +``` +1. wineboot -u +2. wine-mono MSI (/qn) +3. .NET Desktop Runtime (/quiet) +4. renderer=gdi (registry) +5. EQLogParser installer (/VERYSILENT …) +``` + +Installing EQLogParser or the .NET runtime **before** mono triggers the mono dialog and can leave a broken prefix. + +--- + +## Mapping Bottles settings to Nix/Wine + +| Bottles (`eqlogparser.yml` + deps) | Nix / shell equivalent | +|-----------------------------------|-------------------------| +| `Arch: win64` | `export WINEARCH=win64` | +| `Runner: Wine`, `dxvk: false`, `vkd3d: false` | `wineWow64Packages.stableFull`; do not add DXVK to the environment | +| `dotnetcoredesktop8` | `windowsdesktop-runtime-8.0.12-win-x64.exe /quiet` | +| `allfonts` | Copy Nix font packages into `drive_c/windows/Fonts`, register them, and avoid `winetricks allfonts` | +| `renderer=gdi` | `wine reg add 'HKCU\Software\Wine\Direct3D' /v renderer /t REG_SZ /d gdi /f` | +| Piper TTS installer | `EQLogParser-install-pipertts-*.exe` with Inno flags | +| (implicit) wine-mono | `msiexec` on bundled `wine-mono-*.msi` | + +Inno Setup silent flags used successfully: + +```text +/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- +``` + +--- + +## Prefix location and mutability + +### Do not use `/nix/store` as `WINEPREFIX` during setup + +Wine refuses to create a configuration directory when ownership checks fail: + +```text +wine: '/nix/store' is not owned by you, refusing to create a configuration directory there +``` + +This happens if: + +- `WINEPREFIX` points at `$out` before copy, or +- `HOME` is unset and defaults under `/nix/store`. + +**Build-time prefix in the Nix store:** possible in theory (build under `$NIX_BUILD_TOP`, then `cp` to `$out`), but the EQLogParser package uses **first-run setup** in `$XDG_DATA_HOME/eqlogparser/wine` instead — simpler and avoids sandbox/fontconfig/XDG issues. + +### Recommended layout + +| Variable | Value | +|----------|--------| +| `WINEPREFIX` | `$XDG_DATA_HOME/eqlogparser/wine` (or `~/.local/share/eqlogparser/wine`) | +| `HOME` | User’s real home (or a writable temp dir during one-off setup) | +| `WINEARCH` | `win64` | +| `WINELOADER` | Path to `wine` binary (EQLogParser uses this to detect Wine) | + +Reset a bad prefix: + +```bash +rm -rf ~/.local/share/eqlogparser/wine +nix run .#eqlogparser +``` + +--- + +## Winetricks on Nix + +`winetricks` from nixpkgs works, but several verbs failed in testing **even after** a healthy `wineboot` and mono install: + +```text +warning: wine cmd.exe /c echo '%AppData%' returned empty string +``` + +Affected verbs included `allfonts`, `renderer=gdi`, and `dotnetdesktop8`. The prefix was usable; winetricks’ `%AppData%` probe was not. + +**Workarounds:** + +- **GDI renderer:** set the registry directly (see table above). +- **.NET Desktop Runtime:** use Microsoft’s `.exe` from Bottles’ dependency URL, not winetricks. +- **Fonts:** copy Nix font packages into `drive_c/windows/Fonts`, register them under the Windows `Fonts` registry key, and set Wine font replacements for common Windows UI fonts. + +--- + +## Graphics: GDI, DXVK, and WPF + +WPF on Wine is sensitive to the renderer: + +- Bottles sets **`renderer=gdi`** via winetricks; we set the same registry value. +- **Do not enable DXVK/VKD3D** for this app (Bottles `dxvk: false`, `vkd3d: false`). +- EQLogParser forces **software rendering** when `WINELOADER` is set. Confirm in logs: + `RenderMode: SoftwareOnly` under + `…/AppData/Roaming/EQLogParser/logs`. + +If you see rendering glitches, verify GDI is set: + +```bash +WINEPREFIX=~/.local/share/eqlogparser/wine wine reg query 'HKCU\Software\Wine\Direct3D' /v renderer +``` + +--- + +## Common errors and fixes + +### “Wine could not find a wine-mono package” + +**Cause:** Prefix has no mono MSI installed, or wrong Wine package (no embedded MSI). + +**Fix:** + +1. Use `wineWow64Packages.stableFull`. +2. Install mono before anything else: + `wine msiexec /i "$(wine --prefix 2>/dev/null; echo $WINE_PKG)/share/wine/mono/wine-mono-"*.msi /qn` +3. Or use `nix run .#eqlogparser` and let [package.nix](../packages/eqlogparser/package.nix) run setup. + +### `failed to start L"C:\\windows\\syswow64\\rundll32.exe": c0000135` + +**Cause:** `pkgs.wine64` prefix without proper WOW64 support. + +**Fix:** Switch to `wineWow64Packages.stableFull` and recreate the prefix. + +### App installs but crashes on start / “.NET not found” + +**Cause:** Desktop Runtime 8 x64 missing (only mono or only ASP.NET runtime installed). + +**Fix:** Install `windowsdesktop-runtime-8.0.x-win-x64.exe` with `/quiet`. + +### `wine cmd.exe` / `%AppData%` empty (winetricks) + +**Cause:** Known winetricks + Wine prefix quirk on Nix; not always fatal. + +**Fix:** Avoid winetricks for dotnet/gdi; use direct installers and `reg add`. + +### Fontconfig / `XDG_RUNTIME_DIR` during Nix builds + +**Cause:** Building a Wine prefix inside `runCommand` without a full graphics/font stack. + +**Fix:** Prefer **runtime** prefix creation (current package design), or add `fontconfig` / `XDG_RUNTIME_DIR` to the builder if you revisit store-time prefixes. + +--- + +## Debugging checklist + +1. **Wine version:** `wine --version` (from the wrapped `PATH`). +2. **Prefix arch:** `grep '#arch=' "$WINEPREFIX"/*.reg` → expect `win64`. +3. **Mono installed:** + `test -d "$WINEPREFIX/drive_c/windows/mono"` or check Add/Remove in `wine uninstaller`. +4. **.NET 8 desktop:** + `ls "$WINEPREFIX/drive_c/Program Files/dotnet/shared/Microsoft.WindowsDesktop.App/8.*"` +5. **App binary:** + `test -f "$WINEPREFIX/drive_c/Program Files/EQLogParser/EQLogParser.exe"` +6. **EQLogParser log:** + `$WINEPREFIX/drive_c/users/$USER/AppData/Roaming/EQLogParser/logs` +7. **Render mode:** log line should show `SoftwareOnly` under Wine. +8. **Piper TTS:** log should mention `piper-tts` if using the piper installer. + +Run with more Wine noise: + +```bash +WINEDEBUG=+pid,+process wine … +``` + +--- + +## Why the package uses first-run setup + +We tried baking the prefix into the Nix store at build time. Blockers included: + +- Wine refusing `/nix/store` paths for initial config +- Fontconfig and `XDG_RUNTIME_DIR` in the sandbox +- Long, brittle builds that still produced prefixes winetricks could not post-process + +**Current approach:** ship Wine + installers in the store; run `eqlogparser-setup-prefix` on first launch (and on version bumps). Trade-off: first start takes several minutes; later starts are fast. + +--- + +## Manual reproduction (without Nix) + +Equivalent to Bottles + [upstream manual install docs](https://github.com/kauffman12/EQLogParser/blob/master/website/documentation.md#manually-installing-without-flatpakbottles): + +```bash +# Use wine-wow64 from your distro or nix shell wineWow64Packages.stableFull +export WINEARCH=win64 +export WINEPREFIX="$HOME/.local/share/eqlogparser/wine" +export PATH="/path/to/wine-wow64/bin:$PATH" + +wineboot -u +wine msiexec /i /path/to/wine-mono-*.msi /qn +wine windowsdesktop-runtime-8.0.12-win-x64.exe /quiet +wine reg add 'HKCU\Software\Wine\Direct3D' /v renderer /t REG_SZ /d gdi /f +wine EQLogParser-install-pipertts-2.3.54.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- + +export WINELOADER="$(command -v wine)" +wine "$WINEPREFIX/drive_c/Program Files/EQLogParser/EQLogParser.exe" +``` + +--- + +## References + +- [EQLogParser Linux support (website)](https://github.com/kauffman12/EQLogParser/blob/master/website/documentation.md#linux-support) +- [Bottles game manifest](https://github.com/kauffman12/EQLogParser/blob/master/bottles/Games/eqlogparser.yml) +- [Bottles `dotnetcoredesktop8` dependency](https://github.com/bottlesdevs/dependencies/blob/main/Essentials/dotnetcoredesktop8.yml) +- [Wine Mono wiki](https://gitlab.winehq.org/wine/wine/-/wikis/Wine-Mono) +- [Nix usage](./eqlogparser.md) +- [packages/eqlogparser/package.nix](../packages/eqlogparser/package.nix) — maintained install script diff --git a/docs/eqlogparser.md b/docs/eqlogparser.md new file mode 100644 index 0000000..94f12d8 --- /dev/null +++ b/docs/eqlogparser.md @@ -0,0 +1,46 @@ +# EQLogParser (Linux + Wine) + +Runs [EQLogParser](https://github.com/kauffman12/EQLogParser) using the same pieces as the upstream [Flatpak + Bottles](https://github.com/kauffman12/EQLogParser/blob/master/website/documentation.md#linux-support) setup (`bottles/Games/eqlogparser.yml`). + +For Wine troubleshooting (mono, WOW64, winetricks, Nix sandbox pitfalls), see [eqlogparser-wine.md](./eqlogparser-wine.md). + +| Bottles | This flake | +|---------|------------| +| 64-bit Wine, no DXVK/VKD3D | `wineWow64Packages.stableFull` (no DXVK in env) | +| `dotnetcoredesktop8` | `windowsdesktop-runtime-8.0.12-win-x64.exe` | +| `renderer=gdi` | Wine registry `Direct3D` → `gdi` | +| `EQLogParser-install-pipertts-*.exe` | Same release installer | +| wine-mono (for .NET) | Bundled MSI from Nix wine (`embedInstallers`), installed silently on first run | +| `allfonts` | Nix font packages copied and registered in the Wine prefix | + +## Usage + +From this repository: + +```bash +# Build and run +nix run .#eqlogparser + +# Or install into profile +nix profile install .#eqlogparser +eqlogparser +``` + +The first launch creates `$XDG_DATA_HOME/eqlogparser/wine` and installs wine-mono, Windows-compatible fonts, .NET 8 Desktop Runtime, and EQLogParser (silent). This takes a few minutes once. Upgrades re-run setup when the package version or prefix setup changes. + +Logs (Wine): `$XDG_DATA_HOME/eqlogparser/wine/drive_c/users/$USER/AppData/Roaming/EQLogParser/logs` + +## “Wine could not find a wine-mono package” + +That dialog appears if **wine-mono** was never installed into the prefix before running a .NET app. This package uses **`wineWow64Packages.stableFull`** (mono MSI under `share/wine/mono/`) and runs `msiexec /i … /qn` during first-time setup **before** the .NET Desktop Runtime installer. + +If you still see the prompt: + +1. Use `nix run .#eqlogparser` from this repo (not a bare `wine` from another package). +2. Remove a broken prefix and re-run: `rm -rf ~/.local/share/eqlogparser/wine && nix run .#eqlogparser` + +EQLogParser also needs the **.NET 8 Desktop Runtime** in the prefix (wine-mono alone is not enough). + +## Known limitations + +Same as [Linux known issues](https://github.com/kauffman12/EQLogParser/blob/master/website/documentation.md#known-issues-with-linux): software rendering under Wine, Piper TTS instead of Windows voices. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4070242 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1779560665, + "narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..6665e21 --- /dev/null +++ b/flake.nix @@ -0,0 +1,47 @@ +{ + description = "Nix packages for EverQuest-related tools on Linux"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = + { + self, + nixpkgs, + }: + let + supportedSystems = [ + "x86_64-linux" + ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + in + { + packages = forAllSystems ( + system: + let + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + in + { + eqlogparser = pkgs.callPackage ./packages/eqlogparser/package.nix { }; + default = self.packages.${system}.eqlogparser; + } + ); + + apps = forAllSystems ( + system: + { + eqlogparser = { + type = "app"; + program = "${self.packages.${system}.eqlogparser}/bin/eqlogparser"; + }; + default = self.apps.${system}.eqlogparser; + } + ); + + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixpkgs-fmt); + }; +} diff --git a/packages/eqlogparser/package.nix b/packages/eqlogparser/package.nix new file mode 100644 index 0000000..43709eb --- /dev/null +++ b/packages/eqlogparser/package.nix @@ -0,0 +1,189 @@ +# EQLogParser on Linux via Wine. +# +# Mirrors bottles/Games/eqlogparser.yml and Bottles dependencies: +# - win64, Wine runner (no DXVK/VKD3D) +# - dotnetcoredesktop8 -> windowsdesktop-runtime-8.0.12-win-x64.exe +# - renderer=gdi (WPF stability under Wine) +# - EQLogParser-install-pipertts (Piper TTS; Wine x64 has no Windows TTS) +# +# wine-mono: wineWow64Packages.stableFull bundles the MSI (embedInstallers). +# Install it into the prefix before .NET Desktop Runtime — otherwise Wine shows +# the interactive "wine-mono package" dialog. +{ lib +, fetchurl +, runCommand +, writeShellScript +, writeShellScriptBin +, makeDesktopItem +, wineWow64Packages +, corefonts +, vista-fonts +, liberation_ttf +, dejavu_fonts +, noto-fonts +, symlinkJoin +, +}: + +let + version = "2.3.54"; + setupVersion = "${version}-nix-fonts2"; + + wine = wineWow64Packages.stableFull; + + installer = fetchurl { + url = "https://github.com/kauffman12/EQLogParser/releases/download/${version}/EQLogParser-install-pipertts-${version}.exe"; + hash = "sha256-d4kXv6tjR4Um/ELsJ5C0uX3q0ZE5A/4EDACmsk6/Uuk="; + }; + + # bottlesdevs/dependencies Essentials/dotnetcoredesktop8.yml (x64) + dotnetDesktopRuntime = fetchurl { + url = "https://download.visualstudio.microsoft.com/download/pr/f1e7ffc8-c278-4339-b460-517420724524/f36bb75b2e86a52338c4d3a90f8dac9b/windowsdesktop-runtime-8.0.12-win-x64.exe"; + hash = "sha256-y1G1WfNDy1biPK0uWvjE0XAeIhoKKkEWGToqk3VWiBQ="; + }; + + installFonts = writeShellScript "eqlogparser-install-fonts" '' + set -euo pipefail + + font_dir="$WINEPREFIX/drive_c/windows/Fonts" + mkdir -p "$font_dir" + + for font_source in \ + "${wine}/share/wine/fonts" \ + "${corefonts}/share/fonts/truetype" \ + "${vista-fonts}/share/fonts/truetype" \ + "${liberation_ttf}/share/fonts/truetype" \ + "${dejavu_fonts}/share/fonts/truetype" \ + "${noto-fonts}/share/fonts/noto" + do + [ -d "$font_source" ] || continue + + while IFS= read -r -d "" font; do + cp -f "$font" "$font_dir/" + done < <(find "$font_source" -type f \( -iname "*.ttf" -o -iname "*.ttc" -o -iname "*.otf" \) -print0) + done + + font_reg="$WINEPREFIX/eqlogparser-fonts.reg" + { + printf 'Windows Registry Editor Version 5.00\r\n\r\n' + printf '[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts]\r\n' + + for font in "$font_dir"/*.[tT][tT][fFcC] "$font_dir"/*.[oO][tT][fF]; do + [ -f "$font" ] || continue + + file_name="$(basename "$font")" + font_name="''${file_name%.*}" + font_name="''${font_name//_/ }" + font_type="TrueType" + case "$file_name" in + *.[oO][tT][fF]) + font_type="OpenType" + ;; + esac + + printf '"%s (%s)"="%s"\r\n' "$font_name" "$font_type" "$file_name" + done + } > "$font_reg" + + wine regedit /S "$font_reg" + ''; + + setupPrefix = writeShellScript "eqlogparser-setup-prefix" '' + set -euo pipefail + + export WINEARCH=win64 + export WINEDEBUG=-all + export PATH="${wine}/bin:$PATH" + + data_home="''${XDG_DATA_HOME:-$HOME/.local/share}" + export WINEPREFIX="''${data_home}/eqlogparser/wine" + version_file="''${WINEPREFIX}/.eqlogparser-nix-version" + + if [ -f "$version_file" ] && [ "$(cat "$version_file")" = "${setupVersion}" ]; then + exit 0 + fi + + echo "eqlogparser: creating Wine prefix (${version}) — one-time setup, may take several minutes..." + rm -rf "$WINEPREFIX" + mkdir -p "$WINEPREFIX" + + WINEDLLOVERRIDES="mscoree,mshtml=" wineboot -u + wineserver -w + + mono_msi=$(echo ${wine}/share/wine/mono/wine-mono-*.msi) + echo "eqlogparser: installing wine-mono..." + wine msiexec /i "$mono_msi" /qn + wineserver -w + + echo "eqlogparser: installing Windows-compatible fonts..." + ${installFonts} + wine reg add "HKCU\\Software\\Wine\\Fonts\\Replacements" /v "Segoe UI" /t REG_SZ /d "Arial" /f + wine reg add "HKCU\\Software\\Wine\\Fonts\\Replacements" /v "Calibri" /t REG_SZ /d "Arial" /f + wine reg add "HKCU\\Software\\Wine\\Fonts\\Replacements" /v "MS Shell Dlg" /t REG_SZ /d "Tahoma" /f + wine reg add "HKCU\\Software\\Wine\\Fonts\\Replacements" /v "MS Shell Dlg 2" /t REG_SZ /d "Tahoma" /f + wineboot -u + wineserver -w + + echo "eqlogparser: installing .NET 8 Desktop Runtime..." + wine ${dotnetDesktopRuntime} /quiet + wineserver -w + + echo "eqlogparser: configuring GDI renderer (Bottles renderer=gdi)..." + wine reg add "HKCU\\Software\\Wine\\Direct3D" /v renderer /t REG_SZ /d gdi /f + + echo "eqlogparser: installing EQLogParser (Piper TTS)..." + wine ${installer} /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- + wineserver -w + + test -f "$WINEPREFIX/drive_c/Program Files/EQLogParser/EQLogParser.exe" + echo "${setupVersion}" > "$version_file" + echo "eqlogparser: setup complete." + ''; + + launcher = writeShellScriptBin "eqlogparser" '' + set -euo pipefail + + export WINEARCH=win64 + export WINEDEBUG="''${WINEDEBUG:--all}" + export PATH="${wine}/bin:$PATH" + + data_home="''${XDG_DATA_HOME:-$HOME/.local/share}" + export WINEPREFIX="''${data_home}/eqlogparser/wine" + + # App disables hardware acceleration when WINELOADER is set (App.xaml.cs). + export WINELOADER=${wine}/bin/wine + + ${setupPrefix} + + exec wine "$WINEPREFIX/drive_c/Program Files/EQLogParser/EQLogParser.exe" "$@" + ''; + + desktopItem = makeDesktopItem { + name = "eqlogparser"; + desktopName = "EQLogParser"; + comment = "EverQuest log parser (Wine)"; + exec = "eqlogparser"; + categories = [ "Game" ]; + }; + + desktopFiles = runCommand "eqlogparser-desktop" { } '' + mkdir -p $out/share/applications + ln -s ${desktopItem}/share/applications/eqlogparser.desktop $out/share/applications/ + ''; + +in +symlinkJoin { + name = "eqlogparser-${version}"; + paths = [ + launcher + desktopFiles + ]; + + meta = { + description = "EverQuest Log Parser ${version} (Wine; matches Bottles/Flatpak setup)"; + homepage = "https://github.com/kauffman12/EQLogParser"; + license = lib.licenses.unfree; + platforms = lib.platforms.linux; + mainProgram = "eqlogparser"; + }; +}