nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchurl,
4 net-tools,
5 openssl,
6 readline,
7 stdenv,
8 which,
9 buildPackages,
10}:
11
12stdenv.mkDerivation rec {
13 pname = "socat";
14 version = "1.8.1.0";
15
16 src = fetchurl {
17 url = "http://www.dest-unreach.org/socat/download/${pname}-${version}.tar.bz2";
18 hash = "sha256-kfIi7mVVkDZgDCUFuZms6+1IuJnw4uU64cnDHWmGtqQ=";
19 };
20
21 patches = [
22 ./musl.patch
23 ];
24
25 postPatch = ''
26 patchShebangs test.sh
27 substituteInPlace test.sh \
28 --replace /bin/rm rm \
29 --replace /sbin/ifconfig ifconfig
30 '';
31
32 configureFlags =
33 lib.optionals (!stdenv.hostPlatform.isLinux) [
34 "--disable-posixmq"
35 ]
36 ++ lib.optionals stdenv.hostPlatform.isFreeBSD [
37 "--disable-dccp"
38 ];
39
40 buildInputs = [
41 openssl
42 readline
43 ];
44
45 enableParallelBuilding = true;
46
47 nativeCheckInputs = [
48 which
49 net-tools
50 ];
51 doCheck = false; # fails a bunch, hangs
52
53 passthru.tests = lib.optionalAttrs stdenv.buildPlatform.isLinux {
54 musl = buildPackages.pkgsMusl.socat;
55 };
56
57 meta = {
58 description = "Utility for bidirectional data transfer between two independent data channels";
59 homepage = "http://www.dest-unreach.org/socat/";
60 platforms = lib.platforms.unix;
61 license = with lib.licenses; [ gpl2Only ];
62 maintainers = with lib.maintainers; [ ryan4yin ];
63 mainProgram = "socat";
64 };
65}