Skip to content

Commit

Permalink
Expand installation instructions
Browse files Browse the repository at this point in the history
Include more installation commands, split out source installation to a
separate page.
  • Loading branch information
Wilfred committed Mar 19, 2024
1 parent 15977f6 commit a70786d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 45 deletions.
1 change: 1 addition & 0 deletions manual/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- [Introduction](./introduction.md)
- [Installation](./installation.md)
- [From Source](./from_source.md)
- [Usage](./usage.md)
- [Git](./git.md)
- [Mercurial](./mercurial.md)
Expand Down
66 changes: 21 additions & 45 deletions manual/src/installation.md
Original file line number Diff line number Diff line change
@@ -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`

0 comments on commit a70786d

Please sign in to comment.