Skip to content

Commit

Permalink
ci: added linux builds
Browse files Browse the repository at this point in the history
  • Loading branch information
lukexor committed May 15, 2024
1 parent 94a83fd commit 3f9c244
Show file tree
Hide file tree
Showing 9 changed files with 237 additions and 49 deletions.
32 changes: 26 additions & 6 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,43 +56,63 @@ category = "Development"
command = "cargo"
args = ["run", "-p", "tetanes", "${@}"]

[tasks.install-web-deps]
description = "Install wasm target"
[tasks.add-wasm-target]
description = "Add wasm target"
category = "Development"
command = "rustup"
args = ["target", "add", "wasm32-unknown-unknown"]

[tasks.install-binstall]
description = "Install cargo binstall"
category = "Development"
command = "cargo"
args = ["install", "cargo-binstall"]

[tasks.install-cargo-tools]
description = "Install cargo tools"
category = "Development"
command = "cargo"
args = ["binstall", "-y", "trunk", "cargo-deb"]
dependencies = ["install-binstall"]

[tasks.create-dist]
description = "Creates dist directory"
category = "Development"
command = "mkdir"
args = ["-p", "dist"]

[tasks.build-web]
description = "Build TetaNES Web"
category = "Build"
command = "trunk"
args = ["build", "--config", "tetanes/Cargo.toml", "--release", "--dist", "dist/web"]
dependencies = ["install-web-deps"]
dependencies = ["create-dist", "add-wasm-target"]

[tasks.build-all]
run_task = { name = ["build", "build-web"], parallel = true }

[tasks.build-artifacts]
command = "cargo"
args = ["run", "--bin", "build_artifacts"]
dependencies = ["install-cargo-tools"]

[tasks.run-web]
description = "Run TetaNES Web in release mode"
category = "Development"
command = "trunk"
args = ["serve", "--release", "--config", "tetanes/Cargo.toml"]
dependencies = ["install-web-deps"]
dependencies = ["add-wasm-target"]

[tasks.profile-web]
description = "Run TetaNES Web in release mode w/profiling"
category = "Development"
command = "trunk"
args = ["serve", "--release", "--features", "profiling", "--config", "tetanes/Cargo.toml"]
dependencies = ["install-web-deps"]
dependencies = ["add-wasm-target"]

[tasks.dev-web]
description = "Run TetaNES Web in development mode"
category = "Development"
command = "trunk"
args = ["serve", "--config", "tetanes/Cargo.toml"]
dependencies = ["install-web-deps"]
dependencies = ["add-wasm-target"]
68 changes: 63 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Issues](#known-issues) - 💬 [Contact](#contact)
> on [unsplash](https://unsplash.com/photos/pEK3AbP8wa4)
`TetaNES` is a cross-platform emulator for the Nintendo Entertainment System
(NES) released in Japan in 1983 and North America in 1986, written using
[Rust][] and [wgpu][]. It runs on Linux, macOS, Windows, and in a web browser
(NES) released in Japan in 1983 and North America in 1986, written in
[Rust][] using [wgpu][]. It runs on Linux, macOS, Windows, and in a web browser
with [Web Assembly][].

It started as a personal curiosity that turned into a passion project. It is
Expand Down Expand Up @@ -88,13 +88,70 @@ time being you can install with `cargo` which comes installed with [Rust][].

### Install

There are multiple options for installation, depending on your operating system,
preference and existing tooling.

#### Linux

##### Ubuntu/Debian

A `.deb` package is provided under `Assets` on the latest [Release][]. Once
downloaded, you can install it and the required dependencies. e.g.

```sh
sudo apt install ./tetanes-0.10.0-1-amd64.deb
```

##### Other Distros

An [AppImage](https://appimage.org/) is provided under `Assets` on the latest
[Release][]. Simply download it and put it wherever you want.

A `.tar.gz` package is also provided under `Assets` on the latest
[Release][]. You can place the `tetanes` binary anywhere in your `PATH`.

The following dependencies are required to be installed:

- ALSA Shared Library
- GTK3

e.g.

`apt install libasound2 libgtk-3-0`
`dnf install alsa-lib gtk3`
`pacman -Sy alsa-lib gtk3`

#### MacOS

##### App Bundle

The easiest is to download the correct app bundle for your processor. The `.dmg`
downloads can be found under the `Assets` section of the latest
[Release][].

##### Homebrew

`TetaNES` can also be installed through [Homebrew](https://brew.sh/).

```sh
brew install lukexor/formulae/tetanes
```

#### Windows

A windows installer is provided under `Assets` on the latest [Release][].

#### Cargo Install

You can also build and install with `cargo` which comes with [rustup](https://www.rust-lang.org/tools/install).

```sh
cargo install tetanes
```

This will install the latest version of the `TetaNES` binary to your `cargo` bin
directory located at either `$HOME/.cargo/bin/` on a Unix-like platform or
`%USERPROFILE%\.cargo\bin` on Windows.
This will install the latest released version of the `TetaNES` binary to your
`cargo` bin directory located at either `$HOME/.cargo/bin/` on a Unix-like
platform or `%USERPROFILE%\.cargo\bin` on Windows.

### Usage

Expand Down Expand Up @@ -444,3 +501,4 @@ series as those helped a ton in some recent refactorings.
[web assembly]: https://webassembly.org/
[github issue tracker]: https://github.com/lukexor/tetanes/issues
[ROADMAP.md]: ROADMAP.md
[Release]: https://github.com/lukexor/tetanes/releases/latest
1 change: 1 addition & 0 deletions assets/linux/.DirIcon
6 changes: 6 additions & 0 deletions assets/linux/TetaNES.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Desktop Entry]
Name=TetaNES
Exec=tetanes
Icon=icon
Type=Application
Categories=Game;
Binary file added assets/linux/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tetanes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version.workspace = true
rust-version.workspace = true
edition.workspace = true
license.workspace = true
description = "A NES Emulator written in Rust with WebAssembly support"
description = "A cross-platform NES Emulator written in Rust using wgpu"
authors.workspace = true
readme.workspace = true
documentation.workspace = true
Expand Down
Loading

0 comments on commit 3f9c244

Please sign in to comment.