Skip to content

Commit 676d8fb

Browse files
coinman-devclaude
andcommitted
docs: simplify build section to point at scripts/
The Building from Source section duplicated everything the build scripts already do (apt deps, cargo-xwin install, rustup target, manual cargo tauri build commands). Replace it with a tight set of three-line recipes that just clone the repo and run scripts/build-linux-local.sh or scripts/build-windows-local.sh — the scripts handle prerequisite checks/installs, version stamping, and working-tree cleanup interactively. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6eb7d0c commit 676d8fb

1 file changed

Lines changed: 21 additions & 57 deletions

File tree

README.md

Lines changed: 21 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -58,87 +58,51 @@ Most portfolio tracking services store your data on their servers, where third p
5858

5959
## Building from Source
6060

61-
### Prerequisites
61+
The only host requirement is **Rust** ([install via rustup](https://rustup.rs/)). The build scripts under `scripts/` take care of everything else — system packages, the Windows cross-compile toolchain, Tauri CLI — and prompt before installing anything (default **Y**).
6262

63-
**All platforms:**
64-
- [Rust](https://rustup.rs/) 1.95.0 or newer (MSRV pinned in `src-tauri/Cargo.toml`)
65-
- Tauri CLI v2:
66-
```bash
67-
cargo install tauri-cli --version "^2" --locked
68-
```
63+
> Both scripts run on Debian/Ubuntu-based hosts: Linux directly, or Windows via WSL.
6964
70-
> The frontend is plain vanilla JS — Tauri 2's CLI is a Rust binary, so **Node.js is not required**.
71-
72-
**Linux (Ubuntu/Debian):**
73-
```bash
74-
sudo apt update
75-
sudo apt install -y \
76-
libwebkit2gtk-4.1-dev \
77-
libgtk-3-dev \
78-
libayatana-appindicator3-dev \
79-
librsvg2-dev \
80-
patchelf
81-
```
82-
83-
**Windows:**
84-
- [WebView2 Runtime](https://developer.microsoft.com/en-us/microsoft-edge/webview2/) (bundled in Windows 11)
85-
- [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) with the **Desktop development with C++** workload
86-
87-
**Cross-compiling for Windows from Linux/WSL:**
88-
```bash
89-
sudo apt install -y clang lld llvm
90-
rustup target add x86_64-pc-windows-msvc
91-
cargo install cargo-xwin --locked
92-
```
93-
94-
---
95-
96-
### Development mode
65+
### Linux portable binary
9766

9867
```bash
9968
git clone https://github.com/coinman-dev/portfolio.git
10069
cd portfolio
101-
cargo tauri dev
70+
bash scripts/build-linux-local.sh
10271
```
10372

104-
---
105-
106-
### Building portable binaries (no installer)
73+
Output: `target/release/coinman-portfolio`
10774

108-
#### Quick: scripted Windows build from Linux/WSL
75+
> To run on another Ubuntu machine, the package `libwebkit2gtk-4.1-0` must be present on the target system.
10976
110-
The repo includes [`scripts/build-windows-local.sh`](scripts/build-windows-local.sh) which automates the whole cross-compilation flow — it verifies prerequisites (offering to install any that are missing), stamps the version from the latest `v*` git tag plus the short HEAD SHA (e.g. `0.7.1-beta-69e6f13`), runs the build, and restores the source files afterwards:
77+
### Windows portable `.exe` (cross-compiled from Linux/WSL)
11178

11279
```bash
113-
./scripts/build-windows-local.sh # latest v* tag
114-
./scripts/build-windows-local.sh v0.7.0-beta # specific tag
80+
git clone https://github.com/coinman-dev/portfolio.git
81+
cd portfolio
82+
bash scripts/build-windows-local.sh
11583
```
11684

11785
Output: `target/x86_64-pc-windows-msvc/release/coinman-portfolio.exe`
11886

119-
#### Manual: Windows portable .exe
87+
The script uses [`cargo-xwin`](https://github.com/rust-cross/cargo-xwin), which fetches Microsoft's MSVC SDK on demand (MIT-licensed) — no Windows VM or Visual Studio install required.
12088

121-
Cross-compile from Linux or WSL via `cargo-xwin`:
122-
```bash
123-
cargo tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc --no-bundle --ci
124-
```
89+
### What the scripts do
12590

126-
Native build on Windows:
127-
```bash
128-
cargo tauri build --target x86_64-pc-windows-msvc --no-bundle --ci
129-
```
91+
- Verify prerequisites and offer to install anything missing (`apt`, `rustup target add`, `cargo install`).
92+
- Stamp the binary version from the latest `v*` git tag plus the short HEAD SHA — e.g. `0.7.2-beta-37c3484` — so the version shown in the desktop UI uniquely identifies the build.
93+
- Accept a specific tag as an argument: `bash scripts/build-linux-local.sh v0.7.0-beta`.
94+
- Restore the working tree after the build via a `trap`, even on failure or Ctrl+C.
13095

131-
Output: `target/x86_64-pc-windows-msvc/release/coinman-portfolio.exe`
96+
### Development mode
13297

133-
#### Manual: Linux portable binary
98+
For hot-reload dev iteration:
13499

135100
```bash
136-
cargo tauri build --no-bundle --ci
101+
cd portfolio
102+
cargo tauri dev
137103
```
138104

139-
Output: `target/release/coinman-portfolio`
140-
141-
> To run on another Ubuntu machine, `libwebkit2gtk-4.1-0` must be installed on the target system.
105+
Run the relevant build script once beforehand — it installs the same system packages and Tauri CLI that `cargo tauri dev` needs.
142106

143107
---
144108

0 commit comments

Comments
 (0)