nixpkgs/pkgs/tools/misc/mandoc/default.nix

57 lines
1.7 KiB
Nix
Raw Normal View History

2021-09-19 20:53:16 +03:00
{ lib, stdenv, fetchurl, zlib, perl }:
2016-09-11 23:18:13 +03:00
let
# Name of an UTF-8 locale _always_ present at runtime, used for UTF-8 support
# (locale set by the user may differ). This would usually be C.UTF-8, but
# darwin has no such locale.
utf8Locale =
if stdenv.hostPlatform.isDarwin
then "en_US.UTF-8"
else "C.UTF-8";
in
2016-09-11 23:18:13 +03:00
stdenv.mkDerivation rec {
pname = "mandoc";
2021-09-19 20:49:11 +03:00
version = "1.14.6";
2016-09-11 23:18:13 +03:00
src = fetchurl {
2018-08-27 04:12:59 +03:00
url = "https://mandoc.bsd.lv/snapshots/mandoc-${version}.tar.gz";
2021-09-19 20:49:11 +03:00
sha256 = "8bf0d570f01e70a6e124884088870cbed7537f36328d512909eb10cd53179d9c";
2016-09-11 23:18:13 +03:00
};
buildInputs = [ zlib ];
configureLocal = ''
MANPATH_DEFAULT="/run/current-system/sw/share/man"
OSNAME="NixOS"
PREFIX="$out"
LD_OHASH="-lutil"
2018-08-27 10:21:43 +03:00
CC=${stdenv.cc.targetPrefix}cc
# Bypass the locale(1)-based check for UTF-8 support since it causes trouble:
# * We only have meaningful locale(1) implementations for glibc and macOS
# * NetBSD's locale(1) (used for macOS) depends on mandoc
# * Sandbox and locales cause all kinds of trouble
# * build and host libc (and thus locale handling) may differ
HAVE_WCHAR=1
UTF8_LOCALE=${utf8Locale}
2016-09-11 23:18:13 +03:00
'';
preConfigure = ''
printf '%s' "$configureLocal" > configure.local
2016-09-11 23:18:13 +03:00
'';
2021-09-19 20:53:16 +03:00
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
checkTarget = "regress";
checkInputs = [ perl ];
preCheck = "patchShebangs --build regress/regress.pl";
meta = with lib; {
homepage = "https://mandoc.bsd.lv/";
2016-09-11 23:18:13 +03:00
description = "suite of tools compiling mdoc and man";
2018-08-27 04:12:59 +03:00
downloadPage = "http://mandoc.bsd.lv/snapshots/";
2016-09-11 23:18:13 +03:00
license = licenses.bsd3;
platforms = platforms.all;
2021-09-19 20:52:38 +03:00
maintainers = with maintainers; [ bb010g ramkromberg sternenseemann ];
2016-09-11 23:18:13 +03:00
};
}