Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,48 @@ A Commodore 64 PETSCII graphics editor written in React/Redux/Electron.
Documentation & downloads: [https://nurpax.github.io/petmate/](https://nurpax.github.io/petmate/)

The rest of this document is intended for Petmate developers.

## Building and running on Linux

These instructions assume Node.js v18+ and npm. `yarn` is not required.

### System dependencies

Building a `.deb` package requires `fakeroot` and `dpkg-dev`:

```bash
sudo apt install fakeroot dpkg-dev
```

### Install Node dependencies

```bash
npm install
```

### Run in development mode

```bash
npm start
```

This starts the React dev server and launches Electron pointing at it.

> **Note:** The `start` script sets `NODE_OPTIONS=--openssl-legacy-provider` scoped to the React dev server only (required for webpack compatibility with Node.js v17+), and passes `--no-sandbox` to Electron (required on Linux systems where the Chrome sandbox setuid binary is not configured).

### Package as a .deb

First build the production React bundle, then run electron-builder:

```bash
npm run build
npm run dist-linux
```

This produces a `.deb` package at `dist/petmate_<version>_amd64.deb`.

To install it:

```bash
sudo apt install ./dist/petmate_*_amd64.deb
```
20 changes: 20 additions & 0 deletions build-scripts/afterInstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# Post-install script: replace the /usr/bin/petmate symlink with a wrapper
# that passes --no-sandbox to Electron (required on systems where the Chrome
# sandbox setuid binary is not configured).

set -euo pipefail

WRAPPER=/usr/bin/petmate
BINARY=/opt/Petmate/petmate

# Remove the symlink (or existing file) created by the deb package
rm -f "$WRAPPER"

# Write a small wrapper script in its place
cat > "$WRAPPER" <<'EOF'
#!/bin/sh
exec /opt/Petmate/petmate --no-sandbox "$@"
EOF

chmod 755 "$WRAPPER"
Loading