1{ lib
2, stdenv
3, fetchurl
4, fetchpatch
5, groff
6}:
7
8stdenv.mkDerivation rec {
9 pname = "mktemp";
10 version = "1.7";
11
12 # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
13 NROFF = "${groff}/bin/nroff";
14
15 patches = [
16 # Pull upstream fix for parallel install failures.
17 (fetchpatch {
18 name = "parallel-install.patch";
19 url = "https://www.mktemp.org/repos/mktemp/raw-rev/eb87d96ce8b7";
20 hash = "sha256-cJ/0pFj8tOkByUwhlMwLNSQgTHyAU8svEkjKWWwsNmY=";
21 })
22 ];
23
24 # Don't use "install -s"
25 postPatch = ''
26 substituteInPlace Makefile.in --replace " 0555 -s " " 0555 "
27 '';
28
29 src = fetchurl {
30 url = "ftp://ftp.mktemp.org/pub/mktemp/mktemp-${version}.tar.gz";
31 sha256 = "0x969152znxxjbj7387xb38waslr4yv6bnj5jmhb4rpqxphvk54f";
32 };
33
34 enableParallelBuilding = true;
35
36 meta = with lib; {
37 description = "Simple tool to make temporary file handling in shells scripts safe and simple";
38 homepage = "https://www.mktemp.org";
39 license = licenses.isc;
40 platforms = platforms.unix;
41 };
42}