2021-01-15 22:18:51 +00:00
|
|
|
{ lib
|
|
|
|
, fetchurl
|
|
|
|
, nettools
|
|
|
|
, openssl
|
|
|
|
, readline
|
|
|
|
, stdenv
|
|
|
|
, which
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-01-15 22:18:51 +00:00
|
|
|
pname = "socat";
|
2022-01-22 01:22:15 +00:00
|
|
|
version = "1.7.4.3";
|
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";
|
2022-01-22 01:22:15 +00:00
|
|
|
sha256 = "sha256-1HMYEEQVB3Y1EZ3+5EvPtB3jSXN0qaABsa/24vCFgAc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs test.sh
|
|
|
|
substituteInPlace test.sh \
|
|
|
|
--replace /bin/rm rm \
|
|
|
|
--replace /sbin/ifconfig ifconfig
|
|
|
|
'';
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
configureFlags = lib.optionals stdenv.hostPlatform.isMusl [
|
|
|
|
# musl doesn't have getprotobynumber_r
|
|
|
|
"sc_cv_getprotobynumber_r=2"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ openssl readline ];
|
|
|
|
|
|
|
|
hardeningEnable = [ "pie" ];
|
|
|
|
|
|
|
|
checkInputs = [ which nettools ];
|
|
|
|
doCheck = false; # fails a bunch, hangs
|
|
|
|
|
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/";
|
|
|
|
repositories.git = "git://repo.or.cz/socat.git";
|
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
|
|
|
};
|
|
|
|
}
|