about summary refs log tree commit diff
path: root/pkgs/tools/networking
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-03-24 13:30:33 -0500
committerWill Dietz <w@wdtz.org>2018-03-26 12:43:50 -0500
commit5e3e3e985d9046b661b79fec99d657578525d37a (patch)
tree646a2c3080086f8b6ef97cdbb328b235dbe49698 /pkgs/tools/networking
parent9258cea7e0487174077a6951ee9bee39d7fd7572 (diff)
downloadnixlib-5e3e3e985d9046b661b79fec99d657578525d37a.tar
nixlib-5e3e3e985d9046b661b79fec99d657578525d37a.tar.gz
nixlib-5e3e3e985d9046b661b79fec99d657578525d37a.tar.bz2
nixlib-5e3e3e985d9046b661b79fec99d657578525d37a.tar.lz
nixlib-5e3e3e985d9046b661b79fec99d657578525d37a.tar.xz
nixlib-5e3e3e985d9046b661b79fec99d657578525d37a.tar.zst
nixlib-5e3e3e985d9046b661b79fec99d657578525d37a.zip
netcat-openbsd: fix w/musl by providing b64_ntop
It seems many projects have copies of this code--
and AFAICT all are derived from ISC's BIND[2]
although it does not appear present in recent versions.

This is a curious function as it is not documented
nor part of any standard[1].

[1] https://www.lemoda.net/unix/base64/index.html
[2] for example, glibc's copy:
    https://sourceware.org/git/?p=glibc.git;a=blob;f=resolv/README;h=514e9bb617e710f16126c1474561965a2b35653d;hb=HEAD#l104
Diffstat (limited to 'pkgs/tools/networking')
-rw-r--r--pkgs/tools/networking/netcat-openbsd/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/tools/networking/netcat-openbsd/default.nix b/pkgs/tools/networking/netcat-openbsd/default.nix
index 8c9247013778..2d9776abfcfc 100644
--- a/pkgs/tools/networking/netcat-openbsd/default.nix
+++ b/pkgs/tools/networking/netcat-openbsd/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pkgconfig, libbsd}:
+{stdenv, fetchurl, fetchpatch, pkgconfig, libbsd}:
 
 stdenv.mkDerivation rec {
   version = "1.187";
@@ -27,6 +27,13 @@ stdenv.mkDerivation rec {
     done
   '';
 
+  patches = stdenv.lib.optional stdenv.hostPlatform.isMusl [
+    (fetchpatch {
+      url = "https://gitweb.gentoo.org/proj/musl.git/plain/net-analyzer/openbsd-netcat/files/openbsd-netcat-1.105-b64_ntop.patch?id=4a5864922232c7df550c21f2a7b77fe6f8ffc6d6";
+      sha256 = "1cgqb6fxas5yiwf26hq57v627hhmcskl5j6rx30090ha2ksjqyvr";
+    })
+  ];
+
   installPhase = ''
     runHook preInstall
     install -Dm0755 nc $out/bin/nc