1{ lib, stdenv
2, fetchurl
3, autoreconfHook
4, docbook_xsl
5, docbook_xml_dtd_43
6, gtk-doc
7, lzip
8, libidn2
9, libunistring
10, libxslt
11, pkg-config
12, python3
13, valgrind
14, publicsuffix-list
15}:
16
17stdenv.mkDerivation rec {
18 pname = "libpsl";
19 version = "0.21.5";
20
21 src = fetchurl {
22 url = "https://github.com/rockdaboot/libpsl/releases/download/${version}/libpsl-${version}.tar.lz";
23 hash = "sha256-mp9qjG7bplDPnqVUdc0XLdKEhzFoBOnHMgLZdXLNOi0=";
24 };
25
26 # bin/psl-make-dafsa brings a large runtime closure through python3
27 outputs = [ "bin" "out" "dev" ];
28
29 nativeBuildInputs = [
30 autoreconfHook
31 docbook_xsl
32 docbook_xml_dtd_43
33 gtk-doc
34 lzip
35 pkg-config
36 python3
37 libxslt
38 ];
39
40 buildInputs = [
41 libidn2
42 libunistring
43 libxslt
44 ];
45
46 propagatedBuildInputs = [
47 publicsuffix-list
48 ];
49
50 postPatch = ''
51 patchShebangs src/psl-make-dafsa
52 '';
53
54 preAutoreconf = ''
55 gtkdocize
56 '';
57
58 configureFlags = [
59 # "--enable-gtk-doc"
60 "--enable-man"
61 "--with-psl-distfile=${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat"
62 "--with-psl-file=${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat"
63 "--with-psl-testfile=${publicsuffix-list}/share/publicsuffix/test_psl.txt"
64 ];
65
66 enableParallelBuilding = true;
67
68 doCheck = true;
69
70 meta = with lib; {
71 description = "C library for the Publix Suffix List";
72 longDescription = ''
73 libpsl is a C library for the Publix Suffix List (PSL). A "public suffix"
74 is a domain name under which Internet users can directly register own
75 names. Browsers and other web clients can use it to avoid privacy-leaking
76 "supercookies" and "super domain" certificates, for highlighting parts of
77 the domain in a user interface or sorting domain lists by site.
78 '';
79 homepage = "https://rockdaboot.github.io/libpsl/";
80 changelog = "https://raw.githubusercontent.com/rockdaboot/${pname}/${pname}-${version}/NEWS";
81 license = licenses.mit;
82 maintainers = [ maintainers.c0bw3b ];
83 mainProgram = "psl";
84 platforms = platforms.unix ++ platforms.windows;
85 pkgConfigModules = [ "libpsl" ];
86 };
87}