1 { lib, stdenv, fetchFromGitHub, fetchpatch, perl, gettext, pkg-config, libidn2, libiconv }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 hash = "sha256-c/Mx2HXAj6mHH8rElG7+F94sSrVSL1N9HZBvaMWUjlw=";
16 url = "https://github.com/macports/macports-ports/raw/93de4e9fc1e5e8427bf98f48209e783a5e8fab57/net/whois/files/implicit.patch";
18 hash = "sha256-ogVylQz//tpXxPNIWIHkhghvToU1z1D1FfnUBdZLyRY=";
22 env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
23 # whois fails to link libiconv on Darwin.
24 NIX_LDFLAGS = "-liconv";
27 nativeBuildInputs = [ perl gettext pkg-config ];
28 buildInputs = [ libidn2 libiconv ];
31 for i in Makefile po/Makefile; do
32 substituteInPlace $i --replace "prefix = /usr" "prefix = $out"
36 makeFlags = [ "HAVE_ICONV=1" ];
37 buildFlags = [ "whois" ];
39 installTargets = [ "install-whois" ];
42 description = "Intelligent WHOIS client from Debian";
44 This package provides a commandline client for the WHOIS (RFC 3912)
45 protocol, which queries online servers for information such as contact
46 details for domains and IP address assignments. It can intelligently
47 select the appropriate WHOIS server for most queries.
50 homepage = "https://packages.qa.debian.org/w/whois.html";
51 license = licenses.gpl2Plus;
52 maintainers = with maintainers; [ fpletz ];
53 platforms = platforms.unix;
54 mainProgram = "whois";