nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 perl,
7 gettext,
8 pkg-config,
9 libidn2,
10 libiconv,
11}:
12
13stdenv.mkDerivation rec {
14 version = "5.6.3";
15 pname = "whois";
16
17 src = fetchFromGitHub {
18 owner = "rfc1036";
19 repo = "whois";
20 rev = "v${version}";
21 hash = "sha256-YJAd6s1kq2IJcR7qf7ljntLb5HgsaTH0wsoPKIMxHdg=";
22 };
23
24 patches = [
25 (fetchpatch {
26 url = "https://github.com/macports/macports-ports/raw/93de4e9fc1e5e8427bf98f48209e783a5e8fab57/net/whois/files/implicit.patch";
27 extraPrefix = "";
28 hash = "sha256-ogVylQz//tpXxPNIWIHkhghvToU1z1D1FfnUBdZLyRY=";
29 })
30 ];
31
32 env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
33 # whois fails to link libiconv on Darwin.
34 NIX_LDFLAGS = "-liconv";
35 };
36
37 nativeBuildInputs = [
38 perl
39 gettext
40 pkg-config
41 ];
42 buildInputs = [
43 libidn2
44 libiconv
45 ];
46
47 preConfigure = ''
48 for i in Makefile po/Makefile; do
49 substituteInPlace $i --replace "prefix = /usr" "prefix = $out"
50 done
51 '';
52
53 makeFlags = [ "HAVE_ICONV=1" ];
54 buildFlags = [ "whois" ];
55
56 installTargets = [ "install-whois" ];
57
58 meta = with lib; {
59 description = "Intelligent WHOIS client from Debian";
60 longDescription = ''
61 This package provides a commandline client for the WHOIS (RFC 3912)
62 protocol, which queries online servers for information such as contact
63 details for domains and IP address assignments. It can intelligently
64 select the appropriate WHOIS server for most queries.
65 '';
66
67 homepage = "https://packages.qa.debian.org/w/whois.html";
68 license = licenses.gpl2Plus;
69 maintainers = with maintainers; [ fpletz ];
70 platforms = platforms.unix;
71 mainProgram = "whois";
72 };
73}