nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 perlPackages,
6 gettext,
7 libintl,
8}:
9
10# Note: this package is used for bootstrapping fetchurl, and thus
11# cannot use fetchpatch! All mutable patches (generated by GitHub or
12# cgit) that are needed here should be included directly in Nixpkgs as
13# files.
14
15stdenv.mkDerivation (finalAttrs: {
16 pname = "help2man";
17 version = "1.49.3";
18
19 src = fetchurl {
20 url = "mirror://gnu/help2man/help2man-${finalAttrs.version}.tar.xz";
21 sha256 = "sha256-TX5P3vLspq/geiaCFRzqeHgeCk6PliIULZ9wwIOi/U8=";
22 };
23
24 strictDeps = true;
25
26 enableParallelBuilding = true;
27
28 nativeBuildInputs = [
29 gettext
30 perlPackages.perl
31 perlPackages.LocaleGettext
32 ];
33 buildInputs = [
34 perlPackages.LocaleGettext
35 libintl
36 ];
37
38 configureFlags = [
39 "--enable-nls"
40 ];
41
42 doCheck = false; # target `check' is missing
43
44 patches = lib.optional stdenv.hostPlatform.isCygwin ./1.40.4-cygwin-nls.patch;
45
46 # We don't use makeWrapper here because it uses substitutions our
47 # bootstrap shell can't handle.
48 postInstall = ''
49 mv $out/bin/help2man $out/bin/.help2man-wrapped
50 cat > $out/bin/help2man <<EOF
51 #! $SHELL -e
52 export PERL5LIB=\''${PERL5LIB:+:}${perlPackages.LocaleGettext}/${perlPackages.perl.libPrefix}
53 ${lib.optionalString stdenv.hostPlatform.isCygwin ''export PATH=\''${PATH:+:}${gettext}/bin''}
54 exec -a \$0 $out/bin/.help2man-wrapped "\$@"
55 EOF
56 chmod +x $out/bin/help2man
57 '';
58
59 meta = {
60 description = "Generate man pages from `--help' output";
61 mainProgram = "help2man";
62 longDescription = ''
63 help2man produces simple manual pages from the ‘--help’ and ‘--version’ output of other commands.
64 '';
65 homepage = "https://www.gnu.org/software/help2man/";
66 license = lib.licenses.gpl3Plus;
67 platforms = lib.platforms.all;
68 maintainers = with lib.maintainers; [ pSub ];
69 };
70})