-
Notifications
You must be signed in to change notification settings - Fork 35
Building MartyPC
The MartyPC Desktop frontend can be built targeting Windows, Linux, and MacOS. It may be possible to build on other platforms; please consider contributing instructions if you do.
You may not have to compile from source to get the latest version of MartyPC. Automated builds are available via Github Actions - see the using Nightly Builds page for info on how to download one.
If you still want to build from source, read on:
The first step to building MartyPC is installing Rust on your system. Visit the installation instructions at rust-lang.org and follow the instructions for installing Rust via rustup for your platform.
MartyPC uses the nightly toolchain. Switch to nightly with the command: rustup default nightly
You can switch back to the stable toolchain with rustup default stable if you need to.
If you are getting build errors, make sure you have updated recently via rustup update.
Next, make sure you have git installed. If you need to install it, you can use your system's package manager, or install Git directly.
- Make sure you have installed the MSVC build tools
- You don't need to install the entire Visual Studio community edition, but you can as an alternative to installing build tools.
- When installing the build tools, you can select the C++ build option to reduce the amount of disk space you need.
- Open a command prompt
-
cdto an appropriate directory (git will make a new subdirectory here when you clone the MartyPC repo) - Clone the repository
- Type
git clone https://github.com/dbalsom/martypc.git
- Type
- Type
cd martypc/install - Type
cargo run -r --features ega(features may vary - see Cargo.toml for a list)
Building for Linux follows the same basic process, but you must have several development dependencies installed. How you install them depends on your particular distribution.
-
Assuming a minimal install:
- Install git, curl, and build tools
sudo apt install git curl build-essential
- Run the command from the install page linked above. As of this writing, it is:
-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh- Select option
2)to customize installation - Hit enter for
Default host triple? - Hit enter for
Profile - Enter
YforModify PATH variable? - Back at the menu, hit enter to begin installation
- Type
nightlyfor Default toolchain
- Select option
-
- Open a new shell to set new environment variables
- Ensure the following development dependencies are installed with
sudo apt install [packagename1] [packagename2]pkg-configlibasound2-devlibudev-devlibc-dev-
libx11-dev- This dependency is required for hardware accelerated OpenGl!
-
libclang-dev- This dependency is required for building the
oplfeature (for Adlib emulation)
- This dependency is required for building the
-
cdto an appropriate directory for building MartyPC - Clone the MartyPC repo
git clone https://github.com/dbalsom/martypc.git
-
cdinto the install directorycd martypc/install
- Build MartyPC!
cargo run -r
- If you wish to run MartyPC outside of Cargo, copy the
martypcexecutable from the/target/releasedirectory into/install. You can then executemartypcdirectly.martypcmust be run in the install directory to find the configuration files and other resources it needs.
- Install git, curl, and build tools
- Install cargo-flamegraph
cargo install flamegraph
- Profiling the core:
-
cdto install directory cargo flamegraph -p martypc_headless -- --benchmark-mode- A
flamegraph.svgshould be produced
-
- Open a Terminal window
-
cdto an appropriate directory - clone the repository
git clone https://github.com/dbalsom/martypc.git
-
cdinto the /install directory in the newly cloned repository - type
cargo run -r --features ega(features may vary - see Cargo.toml for a list)
- Ensure you have the wasm-unknown-unknown target installed. You can do so with the command:
rustup target add wasm32-unknown-unknown
- Install the
trunkbuild toolcargo install trunk
- Build a front-end that supports wasm, such as
martypc_eframe.-
cdinto thecrates/binaries/martypc_eframedirectory. - Type
trunk buildto build.
-
- IDEs
- If you'd like to use a IDE, I recommend RustRover, which is currently free during EAP. I currently maintain build configurations for RustRover.
- You can also use Visual Studio Code, but I haven't been updating the build configurations in a while, so you may need to update things. Please send a pull request for anything you have to fix.
- Pull Requests
- PRs are welcome! Just be sure that you describe them well and have thoroughly tested them. Please open an issue or discussion before developing any major new functionality or feature.
- Please respect the configured rustfmt settings - I recommend configuring your editor or IDE to perform rustfmt on save.