1 { lib, stdenv, fetchFromGitHub, runCommand, inflow, diffutils }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
8 owner = "stephen-huan";
11 hash = "sha256-xKUqkrPwITai8g6U1NiNieAip/AzISgFfFtvR30hLNk=";
17 $CXX -Wall -Wpedantic -Wextra -O3 -o inflow inflow.cpp
25 install -Dm755 inflow -t $out/bin
31 reflowWithLineLength = runCommand "${pname}-test"
33 nativeBuildInputs = [ inflow ];
34 buildInputs = [ diffutils ];
37 xxxxx xxx xxx xxxx xxxxxxxxx xx x xxxxxxxxx x xxxx xxxx xxxxxxx xxxxxxxx xxx
38 xxxxxxxxx xxxxxxxx xx xx xxxxx xxxxx xxxx xx x xxxx xx xxxxxxxx xxxxxxxx xxxx
39 xxx xxxx xxxx xxx xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxx xxx xxxxx xx xxxx x xxxx
40 xxxxxxxx xxxx xxxx xx xxxxx xxxx xxxxx xxxx xxxxxxxxx xxx xxxxxxxxxxx xxxxxx
41 xxx xxxxxxxxx xxxx xxxx xx x xx xxxx xxx xxxx xx xxx xxx xxxxxxxxxxx xxxx xxxxx
42 x xxxxx xxxxxxx xxxxxxx xx xx xxxxxx xx xxxxx
45 inflow 72 < input.txt > actual.txt
47 cat <<EOF > expected.txt
48 xxxxx xxx xxx xxxx xxxxxxxxx xx x xxxxxxxxx x xxxx xxxx xxxxxxx
49 xxxxxxxx xxx xxxxxxxxx xxxxxxxx xx xx xxxxx xxxxx xxxx xx x xxxx
50 xx xxxxxxxx xxxxxxxx xxxx xxx xxxx xxxx xxx xxxxxxxxxxxxxxxxxxx
51 xxxxxxxxxxxxx xxx xxxxx xx xxxx x xxxx xxxxxxxx xxxx xxxx xx xxxxx
52 xxxx xxxxx xxxx xxxxxxxxx xxx xxxxxxxxxxx xxxxxx xxx xxxxxxxxx
53 xxxx xxxx xx x xx xxxx xxx xxxx xx xxx xxx xxxxxxxxxxx xxxx xxxxx
54 x xxxxx xxxxxxx xxxxxxx xx xx xxxxxx xx xxxxx
57 if ! cmp --silent expected.txt actual.txt
59 echo "Error: actual.txt and expected.txt are different"
60 diff actual.txt expected.txt
69 description = "Variance-optimal paragraph formatter";
70 homepage = "https://github.com/stephen-huan/inflow";
71 license = licenses.unlicense;
72 mainProgram = "inflow";
73 maintainers = with maintainers; [ fbrs ];
74 platforms = platforms.all;