depot/third_party/nixpkgs/pkgs/tools/networking/socat/default.nix
Default email a0cb138ada Project import generated by Copybara.
GitOrigin-RevId: a100acd7bbf105915b0004427802286c37738fef
2023-02-02 18:25:31 +00:00

45 lines
1 KiB
Nix

{ lib
, fetchurl
, nettools
, openssl
, readline
, stdenv
, which
, buildPackages
}:
stdenv.mkDerivation rec {
pname = "socat";
version = "1.7.4.4";
src = fetchurl {
url = "http://www.dest-unreach.org/socat/download/${pname}-${version}.tar.bz2";
sha256 = "sha256-+9Qr0vDlSjr20BvfFThThKuC28Dk8aXhU7PgvhtjgKw=";
};
postPatch = ''
patchShebangs test.sh
substituteInPlace test.sh \
--replace /bin/rm rm \
--replace /sbin/ifconfig ifconfig
'';
buildInputs = [ openssl readline ];
hardeningEnable = [ "pie" ];
nativeCheckInputs = [ which nettools ];
doCheck = false; # fails a bunch, hangs
passthru.tests = lib.optionalAttrs stdenv.buildPlatform.isLinux {
musl = buildPackages.pkgsMusl.socat;
};
meta = with lib; {
description = "Utility for bidirectional data transfer between two independent data channels";
homepage = "http://www.dest-unreach.org/socat/";
platforms = platforms.unix;
license = with licenses; [ gpl2Only ];
maintainers = with maintainers; [ eelco ];
};
}