2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchurl,
|
|
|
|
lynx,
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-08-05 21:33:18 +00:00
|
|
|
pname = "jwhois";
|
|
|
|
version = "4.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-05-15 15:35:15 +00:00
|
|
|
url = "mirror://gnu/jwhois/jwhois-${finalAttrs.version}.tar.gz";
|
|
|
|
hash = "sha256-+pu4Z4K5FcbXMLtyP4dtybNFphfbN1qvNBbsIlU81k4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
patches = [
|
|
|
|
./connect.patch
|
|
|
|
./service-name.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
postPatch = ''
|
|
|
|
# avoids error on darwin where `-Werror=implicit-function-declaration` is set by default
|
|
|
|
sed 1i'void timeout_init();' -i src/jwhois.c
|
|
|
|
|
|
|
|
substituteInPlace example/jwhois.conf \
|
|
|
|
--replace-fail "/usr/bin/lynx" ${lib.getExe lynx}
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
makeFlags = [ "AR=${stdenv.cc.bintools.targetPrefix}ar" ];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
postInstall = ''
|
|
|
|
ln -s $out/bin/jwhois $out/bin/whois
|
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
# Work around error from <stdio.h> on aarch64-darwin:
|
|
|
|
# error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
|
|
|
|
# TODO: this should probably be fixed at a lower level than this?
|
2024-09-26 11:04:55 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-undef-prefix";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Client for the WHOIS protocol allowing you to query the owner of a domain name";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.gnu.org/software/jwhois/";
|
2024-05-15 15:35:15 +00:00
|
|
|
license = lib.licenses.gpl3Only;
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-05-15 15:35:15 +00:00
|
|
|
})
|