Install a release
Install Cupid from a binary archive on the releases page, without building it. One command does the whole job; the steps it takes are also written out below, for doing them by hand.
Prerequisites
- Linux with glibc 2.35 or later (Ubuntu 22.04, Debian 12, Fedora 36 or
later), or macOS 13 or later; on x86-64 or ARM64. On Linux,
cupidneeds nothing beyond glibc; line editing is built in - or Windows 10 or later, on x86-64
- a C compiler, only to use
cupid --ffi:gccon Linux,ccon macOS (Xcode's command line tools), MinGW-w64 gcc for the UCRT on Windows
The one-line install
On Linux and macOS:
curl -fsSL https://andreabedini.github.io/cupid/install.sh | sh
On Windows, in PowerShell:
irm https://andreabedini.github.io/cupid/install.ps1 | iex
Either script finds the latest release, downloads the archive for your
system, checks it against SHA256SUMS from the same release and unpacks
it. If gh is installed and signed in, it also checks the archive's
build attestation (see Check that CI built it)
and refuses an archive that fails. Nothing needs root or administrator
rights. On Linux and macOS the release goes in
~/.local/opt/cupid-VERSION-TARGET and cupid is linked into
~/.local/bin; if that directory is not on your PATH, the script prints
the line to add. On Windows it goes in %LOCALAPPDATA%\Programs and its
bin directory is added to your user PATH.
Three environment variables change what the scripts do:
| Variable | Meaning | Default |
|---|---|---|
CUPID_VERSION | the version to install, such as 0.1.0 | the latest release |
CUPID_INSTALL_DIR | where the release directory goes | ~/.local/opt or %LOCALAPPDATA%\Programs |
CUPID_BIN_DIR | where the cupid link goes (Linux and macOS only) | ~/.local/bin |
For example, to install a particular version somewhere else:
curl -fsSL https://andreabedini.github.io/cupid/install.sh | CUPID_VERSION=0.1.0 CUPID_INSTALL_DIR="$HOME/opt" sh
Read the script before you run it if you like: install.sh, install.ps1.
The same by hand
1. Download and check the archive
Pick the archive for your system: cupid-VERSION-TARGET.tar.gz with
TARGET one of x86_64-linux, aarch64-linux, x86_64-macos and
aarch64-macos, or cupid-VERSION-x86_64-windows.zip. Check it
against SHA256SUMS from the same release:
sha256sum --ignore-missing -c SHA256SUMS
On macOS, use shasum -a 256 --ignore-missing -c SHA256SUMS. On
Windows, compare the hash PowerShell prints with the line for the
archive in SHA256SUMS:
(Get-FileHash cupid-VERSION-x86_64-windows.zip).Hash
The checksum shows the download is intact. It does not show who made
the file, since SHA256SUMS comes from the same place; the next step
does that.
2. Check that CI built it
When CI publishes a release it records a
build attestation
for every file in it: a statement, signed through Sigstore with a
certificate GitHub issues to the workflow run, that the file was
produced by this repository's ci.yml workflow on main. Checking it
proves the archive is the one CI built, not a substitute. It needs
gh, signed in to any GitHub account:
gh attestation verify cupid-VERSION-TARGET.tar.gz --repo andreabedini/cupid --signer-workflow andreabedini/cupid/.github/workflows/ci.yml
The command fetches the attestation from GitHub, checks the signature
and that the file's digest is the one attested, and exits with a
failure if anything does not match. The --signer-workflow option
pins the identity to the release workflow; without it, an attestation
from any workflow in the repository would pass. The same command
checks SHA256SUMS and the source distribution.
3. Unpack it anywhere
mkdir -p ~/.local/opt ~/.local/bin
tar -xzf cupid-VERSION-TARGET.tar.gz -C ~/.local/opt
On Windows:
Expand-Archive cupid-VERSION-x86_64-windows.zip $env:LOCALAPPDATA\Programs
The archive has one directory, cupid-VERSION-TARGET, with bin,
lib/cupid and share/man inside. cupid finds its libraries
relative to itself, so the directory can go anywhere and move later.
4. Put cupid on your PATH
ln -s ~/.local/opt/cupid-VERSION-TARGET/bin/cupid ~/.local/bin/
On Windows, add the bin directory to your user PATH, then open a new
terminal:
$bin = "$env:LOCALAPPDATA\Programs\cupid-VERSION-x86_64-windows\bin"
[Environment]::SetEnvironmentVariable('Path', "$bin;" + [Environment]::GetEnvironmentVariable('Path', 'User'), 'User')Verify it worked
cupidCupid VERSION, a Haskell interpreter based on Hugs 98
Type :? for help.
If it stops with FATAL ERROR: Unable to load Prelude, CUPIDDIR is
probably set in your environment and points somewhere else; unset it.
See also
- Build Cupid on Linux and macOS and Build Cupid on Windows, to build from source
- Getting started with Cupid, for a first session once it is installed