nixpkgs/pkgs/development/libraries/udns/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.6 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl }:
2016-05-08 06:49:48 +00:00
# this expression is mostly based on debian's packaging
# https://tracker.debian.org/media/packages/u/udns/rules-0.4-1
stdenv.mkDerivation rec {
pname = "udns";
2016-05-08 06:49:48 +00:00
version = "0.4";
configurePhase = "./configure --enable-ipv6";
buildPhase = "make staticlib sharedlib rblcheck_s dnsget_s";
src = fetchurl {
url = "http://www.corpit.ru/mjt/udns/${pname}-${version}.tar.gz";
2016-05-08 06:49:48 +00:00
sha256 = "0447fv1hmb44nnchdn6p5pd9b44x8p5jn0ahw6crwbqsg7f0hl8i";
};
2022-08-12 02:19:12 +00:00
# udns uses a very custom build and hardcodes a .so name in a few places.
# Instead of fighting with it to apply the standard dylib script, change
# the right place in the Makefile itself.
postPatch =
if stdenv.isDarwin
then
''
substituteInPlace Makefile.in \
--replace --soname, -install_name,$out/lib/
''
else "";
2016-05-08 06:49:48 +00:00
installPhase = ''
2022-08-12 02:19:12 +00:00
runHook preInstall
2016-05-08 06:49:48 +00:00
mkdir -p $out/bin
mkdir -p $out/include
mkdir -p $out/lib
mkdir -p $out/share/man/man1
mkdir -p $out/share/man/man3
cp dnsget_s $out/bin/dnsget
cp rblcheck_s $out/bin/rblcheck
cp udns.h $out/include/
cp libudns.a $out/lib/
cp libudns.so.0 $out/lib/
ln -rs $out/lib/libudns.so.0 $out/lib/libudns.so
cp dnsget.1 rblcheck.1 $out/share/man/man1
cp udns.3 $out/share/man/man3
2022-08-12 02:19:12 +00:00
runHook postInstall
2016-05-08 06:49:48 +00:00
'';
# keep man3
outputDevdoc = "out";
2016-05-08 06:49:48 +00:00
meta = with lib; {
homepage = "http://www.corpit.ru/mjt/udns.html";
2016-05-08 06:49:48 +00:00
description = "Async-capable DNS stub resolver library";
license = licenses.lgpl21Plus;
maintainers = [ maintainers.womfoo ];
2022-08-12 02:19:12 +00:00
platforms = platforms.unix;
2016-05-08 06:49:48 +00:00
};
}