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