···11+{
22+ fetchFromGitHub,
33+ lib,
44+ nix-update-script,
55+ pkgs,
66+ stdenv,
77+ # nativeBuildInputs
88+ gettext,
99+ meson,
1010+ ninja,
1111+ pkg-config,
1212+ python3,
1313+ sphinx,
1414+ # buildInputs
1515+ boost,
1616+ # nativeCheckInputs
1717+ bash,
1818+ coreutils,
1919+ diffutils,
2020+ findutils,
2121+ glibcLocales,
2222+}:
2323+2424+stdenv.mkDerivation (finalAttrs: {
2525+ pname = "dtee";
2626+ version = "1.1.3";
2727+2828+ src = fetchFromGitHub {
2929+ owner = "nomis";
3030+ repo = "dtee";
3131+ tag = finalAttrs.version;
3232+ hash = "sha256-trREhITO3cY4j75mpudWhOA3GXI0Q8GkUxNq2s6154w=";
3333+ };
3434+3535+ passthru.updateScript = nix-update-script { };
3636+3737+ # Make "#!/usr/bin/env bash" work in tests
3838+ postPatch = "patchShebangs tests";
3939+4040+ nativeBuildInputs = [
4141+ gettext
4242+ meson
4343+ ninja
4444+ pkg-config
4545+ python3
4646+ sphinx # For the man page
4747+ ];
4848+4949+ buildInputs = [ boost ];
5050+5151+ nativeCheckInputs = [
5252+ bash
5353+ coreutils
5454+ diffutils
5555+ findutils
5656+ glibcLocales # For tests that check translations work
5757+ ];
5858+5959+ # Use the correct copyright year on the man page (workaround for https://github.com/sphinx-doc/sphinx/issues/13231)
6060+ preBuild = ''
6161+ SOURCE_DATE_EPOCH=$(python3 $NIX_BUILD_TOP/$sourceRoot/release_date.py -e ${finalAttrs.version}) || exit 1
6262+ export SOURCE_DATE_EPOCH
6363+ '';
6464+6565+ mesonFlags = [ "--unity on" ];
6666+ doCheck = true;
6767+6868+ meta = {
6969+ description = "Run a program with standard output and standard error copied to files";
7070+ longDescription = ''
7171+ Run a program with standard output and standard error copied to files
7272+ while maintaining the original standard output and standard error in
7373+ the original order. When invoked as "cronty", allows programs to be run
7474+ from cron, suppressing all output unless the process outputs an error
7575+ message or has a non-zero exit status whereupon the original output
7676+ will be written as normal and the exit code will be appended to standard
7777+ error.
7878+ '';
7979+8080+ homepage = "https://dtee.readthedocs.io/";
8181+ downloadPage = "https://github.com/nomis/dtee/releases/tag/${finalAttrs.version}";
8282+ changelog = "https://dtee.readthedocs.io/en/${finalAttrs.version}/changelog.html";
8383+8484+ license = lib.licenses.gpl3Plus;
8585+ sourceProvenance = [ lib.sourceTypes.fromSource ];
8686+ maintainers = with lib.maintainers; [ nomis ];
8787+ mainProgram = "dtee";
8888+ # Only Linux has reliable local datagram sockets
8989+ platforms = lib.platforms.linux;
9090+ };
9191+})