nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 fetchpatch,
6 libtool,
7 bison,
8 groff,
9 ghostscript,
10 gettext,
11 acl,
12 libcap,
13 lsof,
14}:
15stdenv.mkDerivation rec {
16 pname = "explain";
17 version = "1.4";
18
19 src = fetchurl {
20 url = "mirror://sourceforge/libexplain/libexplain-${version}.tar.gz";
21 hash = "sha256-KIY7ZezMdJNOI3ysQTZMs8GALDbJ4jGO0EF0YP7oP4A=";
22 };
23
24 patches =
25 let
26 debian-src = "https://sources.debian.org/data/main";
27 debian-ver = "${version}.D001-12";
28 debian-patch =
29 fname: hash:
30 fetchpatch {
31 name = fname;
32 url = "${debian-src}/libe/libexplain/${debian-ver}/debian/patches/${fname}";
33 hash = hash;
34 };
35 in
36 [
37 (debian-patch "sanitize-bison.patch" "sha256-gU6JG32j2yIOwehZTUSvIr4TSDdlg+p1U3bhfZHMEDY=")
38 (debian-patch "03_fsflags-4.5.patch" "sha256-ML7Qvf85vEBp+iwm6PSosMAn/frYdEOSHRToEggmR8M=")
39 (debian-patch "linux5.11.patch" "sha256-N7WwnTfwOxBfIiKntcFOqHTH9r2gd7NMEzic7szzR+Y=")
40 (debian-patch "termiox-no-more-exists-since-kernel-5.12.patch" "sha256-cocgEYKoDMDnGk9VNQDtgoVxMGnnNpdae0hzgUlacOw=")
41 (debian-patch "gcc-10.patch" "sha256-YNcYGyOOqPUuwpUpXGcR7zsWbepVg8SAqcVKlxENSQk=")
42 ];
43
44 nativeBuildInputs = [
45 libtool
46 bison
47 groff
48 ghostscript
49 gettext
50 ];
51 buildInputs = [
52 acl
53 libcap
54 lsof
55 ];
56
57 outputs = [
58 "bin"
59 "dev"
60 "out"
61 "man"
62 "doc"
63 ];
64
65 meta = {
66 description = "Library and utility to explain system call errors";
67 mainProgram = "explain";
68 homepage = "https://libexplain.sourceforge.net";
69 license = lib.licenses.lgpl3Plus;
70 maintainers = with lib.maintainers; [ McSinyx ];
71 platforms = lib.platforms.unix;
72 # never built on aarch64-linux since first introduction in nixpkgs
73 broken = stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64;
74 };
75}