1{
2 fetchurl,
3 lib,
4 stdenv,
5 libiconv,
6 libunistring,
7 help2man,
8 texinfo,
9 buildPackages,
10}:
11
12# Note: this package is used for bootstrapping fetchurl, and thus
13# cannot use fetchpatch! All mutable patches (generated by GitHub or
14# cgit) that are needed here should be included directly in Nixpkgs as
15# files.
16
17stdenv.mkDerivation rec {
18 pname = "libidn2";
19 version = "2.3.8";
20
21 src = fetchurl {
22 url = "https://ftp.gnu.org/gnu/libidn/${pname}-${version}.tar.gz";
23 hash = "sha256-9VeRG/YXFiHh9y/zX1sYJbs1tS7UUyXc3ukx5dPAeHo=";
24 };
25
26 strictDeps = true;
27 # Beware: non-bootstrap libidn2 is overridden by ./hack.nix
28 outputs = [
29 "bin"
30 "dev"
31 "out"
32 "info"
33 "devdoc"
34 ];
35
36 enableParallelBuilding = true;
37
38 # The above patch causes the documentation to be regenerated, so the
39 # documentation tools are required.
40 nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
41 help2man
42 texinfo
43 ];
44 buildInputs = [ libunistring ] ++ lib.optional stdenv.hostPlatform.isDarwin libiconv;
45 depsBuildBuild = [ buildPackages.stdenv.cc ];
46
47 meta = {
48 homepage = "https://www.gnu.org/software/libidn/#libidn2";
49 description = "Free software implementation of IDNA2008 and TR46";
50
51 longDescription = ''
52 Libidn2 is believed to be a complete IDNA2008 and TR46 implementation,
53 but has yet to be as extensively used as the IDNA2003 Libidn library.
54
55 The installed C library libidn2 is dual-licensed under LGPLv3+|GPLv2+,
56 while the rest of the package is GPLv3+. See the file COPYING for
57 detailed information.
58 '';
59
60 mainProgram = "idn2";
61 license = with lib.licenses; [
62 lgpl3Plus
63 gpl2Plus
64 gpl3Plus
65 ];
66 platforms = lib.platforms.all;
67 maintainers = with lib.maintainers; [ fpletz ];
68 };
69}