nixpkgs/pkgs/by-name/tc/tcpflow/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

48 lines
1.4 KiB
Nix

{ stdenv, lib, fetchFromGitHub, automake, autoconf
, openssl, zlib, libpcap, boost
, useCairo ? false, cairo
}:
stdenv.mkDerivation rec {
pname = "tcpflow";
version = "1.6.1";
src = fetchFromGitHub {
owner = "simsong";
repo = pname;
rev = "${pname}-${version}";
sha256 = "0vbm097jhi5n8pg08ia1yhzc225zv9948blb76f4br739l9l22vq";
fetchSubmodules = true;
};
nativeBuildInputs = [ automake autoconf ];
buildInputs = [ openssl zlib libpcap boost ]
++ lib.optional useCairo cairo;
prePatch = ''
substituteInPlace bootstrap.sh \
--replace ".git" "" \
--replace "/bin/rm" "rm"
# Temporary fix for a build error:
# https://src.fedoraproject.org/rpms/tcpflow/blob/979e250032b90de2d6b9e5b94b5203d98cccedad/f/tcpflow-1.6.1-format.patch
substituteInPlace src/datalink.cpp \
--replace 'DEBUG(6)(s.c_str());' 'DEBUG(6) ("%s", s.c_str());'
'';
preConfigure = "bash ./bootstrap.sh";
meta = with lib; {
description = "TCP stream extractor";
longDescription = ''
tcpflow is a program that captures data transmitted as part of TCP
connections (flows), and stores the data in a way that is convenient for
protocol analysis and debugging.
'';
inherit (src.meta) homepage;
license = licenses.gpl3;
maintainers = with maintainers; [ raskin obadz ];
platforms = platforms.unix;
mainProgram = "tcpflow";
};
}