Merge pull request #138560 from sternenseemann/mandoc-1.14.6

mandoc: 1.14.5 -> 1.14.6
This commit is contained in:
sterni 2021-09-24 18:53:53 +02:00 committed by GitHub
commit a5dd5aaf9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 23 deletions

View File

@ -1,41 +1,71 @@
{ lib, stdenv, fetchurl, zlib }:
{ lib, stdenv, fetchurl, zlib, perl }:
let
# check if we can execute binaries for the host platform on the build platform
# even though the platforms aren't the same. mandoc can't be cross compiled
# (easily) because of its configurePhase, but we want to allow “native” cross
# such as pkgsLLVM and pkgsStatic.
executableCross = stdenv.hostPlatform.isCompatible stdenv.buildPlatform;
# 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
assert executableCross ||
throw "mandoc relies on executing compiled programs in configurePhase, can't cross compile";
stdenv.mkDerivation rec {
pname = "mandoc";
version = "1.14.5";
version = "1.14.6";
src = fetchurl {
url = "https://mandoc.bsd.lv/snapshots/mandoc-${version}.tar.gz";
sha256 = "1xyqllxpjj1kimlipx11pzyywf5c25i4wmv0lqm7ph3gnlnb86c2";
sha256 = "8bf0d570f01e70a6e124884088870cbed7537f36328d512909eb10cd53179d9c";
};
buildInputs = [ zlib ];
configureLocal = ''
HAVE_WCHAR=1
MANPATH_DEFAULT="/run/current-system/sw/share/man"
MANPATH_BASE="$MANPATH_DEFAULT"
OSNAME="NixOS"
PREFIX="$out"
HAVE_MANPATH=1
LD_OHASH="-lutil"
BUILD_DB=0
# Use symlinks instead of hardlinks (more commonly used in nixpkgs)
LN="ln -sf"
# nixpkgs doesn't have sbin, install makewhatis to bin
SBINDIR="$PREFIX/bin"
CC=${stdenv.cc.targetPrefix}cc
AR=${stdenv.cc.bintools.targetPrefix}ar
# 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}
'';
patches = [
./remove-broken-cc-check.patch
];
preConfigure = ''
echo $configureLocal > configure.local
printf '%s' "$configureLocal" > configure.local
'';
doCheck = executableCross;
checkTarget = "regress";
checkInputs = [ perl ];
preCheck = "patchShebangs --build regress/regress.pl";
meta = with lib; {
homepage = "https://mandoc.bsd.lv/";
description = "suite of tools compiling mdoc and man";
downloadPage = "http://mandoc.bsd.lv/snapshots/";
license = licenses.bsd3;
platforms = platforms.all;
maintainers = with maintainers; [ bb010g ramkromberg ];
maintainers = with maintainers; [ bb010g ramkromberg sternenseemann ];
};
}

View File

@ -1,11 +0,0 @@
--- mandoc-1.14.4.org/configure 2018-08-08 15:51:51.000000000 +0100
+++ mandoc-1.14.4/configure 2018-08-27 08:19:40.391912427 +0100
@@ -40,7 +40,7 @@
OSNAME=
UTF8_LOCALE=
-CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | env -i make -sf -`
+CC=
CFLAGS=
LDADD=
LDFLAGS=