1{ lib, stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 pname = "which";
5 version = "2.21";
6
7 src = fetchurl {
8 url = "mirror://gnu/which/which-${version}.tar.gz";
9 hash = "sha256-9KJFuUEks3fYtJZGv0IfkVXTaqdhS26/g3BdP/x26q0=";
10 };
11
12 strictDeps = true;
13 enableParallelBuilding = true;
14
15 env.NIX_CFLAGS_COMPILE = toString (
16 # Enable 64-bit file API. Otherwise `which` fails to find tools
17 # on filesystems with 64-bit inodes (like `btrfs`) when running
18 # binaries from 32-bit systems (like `i686-linux`).
19 lib.optional stdenv.hostPlatform.is32bit "-D_FILE_OFFSET_BITS=64"
20 );
21
22 meta = {
23 homepage = "https://www.gnu.org/software/which/";
24 description = "Shows the full path of (shell) commands";
25 license = lib.licenses.gpl3Plus;
26 mainProgram = "which";
27 platforms = lib.platforms.all;
28 };
29}