Commit af5b1dbe authored by Sergei Trofimovich's avatar Sergei Trofimovich
Browse files

mktemp: fix parallel installing

Without the upstream patch parallel install fails as:

    mktemp> mkdir /nix/store/k5b7wyhwyv9x3z5i6d88y7l1kdrkkfgj-mktemp-1.7/share/man/man1
    mktemp> cp: cannot create regular file '/nix/store/k5b7wyhwyv9x3z5i6d88y7l1kdrkkfgj-mktemp-1.7/share/man/man1/1185.tmp': No such file or directory
    mktemp> make: *** [Makefile:101: install-man] Error 1
    mktemp> make: *** Waiting for unfinished jobs....
parent d4e6749f
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl, groff }:
{ lib
, stdenv
, fetchurl
, fetchpatch
, groff
}:

stdenv.mkDerivation rec {
  pname = "mktemp";
@@ -7,6 +12,15 @@ stdenv.mkDerivation rec {
  # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
  NROFF = "${groff}/bin/nroff";

  patches = [
    # Pull upstream fix for parallel install failures.
    (fetchpatch {
      name = "parallel-install.patch";
      url = "https://www.mktemp.org/repos/mktemp/raw-rev/eb87d96ce8b7";
      hash = "sha256-cJ/0pFj8tOkByUwhlMwLNSQgTHyAU8svEkjKWWwsNmY=";
    })
  ];

  # Don't use "install -s"
  postPatch = ''
    substituteInPlace Makefile.in --replace " 0555 -s " " 0555 "
@@ -17,6 +31,8 @@ stdenv.mkDerivation rec {
    sha256 = "0x969152znxxjbj7387xb38waslr4yv6bnj5jmhb4rpqxphvk54f";
  };

  enableParallelBuilding = true;

  meta = with lib; {
    description = "Simple tool to make temporary file handling in shells scripts safe and simple";
    homepage = "https://www.mktemp.org";