From a70786d7313fd29128a74f5242cf17c9e7abe79c Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Tue, 19 Mar 2024 08:47:27 -0700 Subject: [PATCH] Expand installation instructions Include more installation commands, split out source installation to a separate page. --- manual/src/SUMMARY.md | 1 + manual/src/installation.md | 66 ++++++++++++-------------------------- 2 files changed, 22 insertions(+), 45 deletions(-) diff --git a/manual/src/SUMMARY.md b/manual/src/SUMMARY.md index e03f1e2973..f8f6d8b9fc 100644 --- a/manual/src/SUMMARY.md +++ b/manual/src/SUMMARY.md @@ -2,6 +2,7 @@ - [Introduction](./introduction.md) - [Installation](./installation.md) + - [From Source](./from_source.md) - [Usage](./usage.md) - [Git](./git.md) - [Mercurial](./mercurial.md) diff --git a/manual/src/installation.md b/manual/src/installation.md index e2e4561d3e..fb73f1a7a7 100644 --- a/manual/src/installation.md +++ b/manual/src/installation.md @@ -1,66 +1,42 @@ # Installation -## Installing a binary - Difftastic [provides GitHub releases](https://github.com/Wilfred/difftastic/releases) with -prebuilt binaries. The -[changelog](https://github.com/Wilfred/difftastic/blob/master/CHANGELOG.md) -describes the changes in each release. - -Packages are also available on the following platforms. - -[![Packaging status](https://repology.org/badge/vertical-allrepos/difftastic.svg)](https://repology.org/project/difftastic/versions) - - -## Installing via homebrew (on macOS or Linux) - -Difftastic can be installed with [Homebrew](https://formulae.brew.sh/formula/difftastic) on macOS or Linux. +prebuilt binaries for Windows, macOS and Linux. +If you're a Homebrew user, you can install +[difftastic](https://formulae.brew.sh/formula/difftastic) with `brew`. ``` $ brew install difftastic ``` -## Installing from source - -### Build Requirements +If you're an Arch Linux user, you can install +[difftastic](https://archlinux.org/packages/extra/x86_64/difftastic/) +with `pacman`. -Difftastic is written in Rust, so you will need Rust installed. I -recommend [rustup](https://rustup.rs/) to install Rust. Difftastic -requires Rust version 1.65 or later. - -You will also need a C++ compiler that supports C++14. If you're using -GCC, you need at least version 8. - -### Build +``` +$ sudo pacman -S difftastic +``` -You can download and build [difftastic on -crates.io](https://crates.io/crates/difftastic) with Cargo (which is -part of Rust). +If you're a Nix user, you can install +[difftastic](https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/text/difftastic/default.nix) +with `nix-env`. ``` -$ cargo install --locked difftastic +$ nix-env --install ripgrep ``` -Difftastic uses the `cc` crate for building C/C++ dependencies. This -allows you to use environment variables `CC` and `CXX` to control the -compiler used (see [the cc -docs](https://github.com/alexcrichton/cc-rs#external-configuration-via-environment-variables)). +If you're a Fedora user, you can install [difftastic](https://packages.fedoraproject.org/pkgs/rust-difftastic/difftastic/) with `dnf`. -See [contributing](./contributing.md) for instructions on debug -builds. +``` +$ sudo dnf install difftastic +``` -## (Optional) Install MIME Database +## Full Package Listing -If a MIME database is available, difftastic will use it to detect -binary files more accurately. This is the same database used by the -`file` command, so you probably already have it. +The following table includes a list of all the platforms that provide +difftastic packages. -The MIME database path is [specified in the XDG -specification](https://specifications.freedesktop.org/shared-mime-info-spec/0.11/ar01s03.html). The -database should be at one of the following paths: +[![Packaging status](https://repology.org/badge/vertical-allrepos/difftastic.svg)](https://repology.org/project/difftastic/versions) -* `/usr/share/mime/magic` -* `/usr/local/share/mime/magic` -* `$HOME/.local/share/mime/magic`