diff options
author | Dmitry Bogatov <serenity@kaction.cc> | 2022-08-25 20:39:04 -0400 |
---|---|---|
committer | Dmitry Bogatov <serenity@kaction.cc> | 2022-10-20 01:24:48 +0000 |
commit | c5e6503128c12c99ae4ab3a777bb5e6ab411cfea (patch) | |
tree | 4cbf60f1a2eec0c7f0821d1f0ac63cf216782477 | |
parent | 5637a2f5a37e6625d41cbb879f8d0b2434fb6244 (diff) | |
download | nixpkgs-c5e6503128c12c99ae4ab3a777bb5e6ab411cfea.tar nixpkgs-c5e6503128c12c99ae4ab3a777bb5e6ab411cfea.tar.gz nixpkgs-c5e6503128c12c99ae4ab3a777bb5e6ab411cfea.tar.bz2 nixpkgs-c5e6503128c12c99ae4ab3a777bb5e6ab411cfea.tar.lz nixpkgs-c5e6503128c12c99ae4ab3a777bb5e6ab411cfea.tar.xz nixpkgs-c5e6503128c12c99ae4ab3a777bb5e6ab411cfea.tar.zst nixpkgs-c5e6503128c12c99ae4ab3a777bb5e6ab411cfea.zip |
deheader: init at 1.8
-rw-r--r-- | pkgs/development/tools/misc/deheader/default.nix | 68 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
2 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/development/tools/misc/deheader/default.nix b/pkgs/development/tools/misc/deheader/default.nix new file mode 100644 index 00000000000..ad1cb909b0d --- /dev/null +++ b/pkgs/development/tools/misc/deheader/default.nix @@ -0,0 +1,68 @@ +{ lib +, stdenv +, python3 +, xmlto +, docbook-xsl-nons +, fetchFromGitLab +, installShellFiles +}: + +stdenv.mkDerivation rec { + pname = "deheader"; + version = "1.8"; + outputs = [ "out" "man" ]; + + src = fetchFromGitLab { + owner = "esr"; + repo = "deheader"; + rev = version; + sha256 = "sha256-sjxgUtdsi/sfxOViDj7l8591TSYwtCzDQcHsk9ClXuM="; + }; + + buildInputs = [ python3 ]; + + nativeBuildInputs = [ xmlto docbook-xsl-nons installShellFiles ]; + + # With upstream Makefile, xmlto is called without "--skip-validation". It + # makes it require a lot of dependencies, yet ultimately it fails + # nevertheless in attempt to fetch something from SourceForge. + # + # Need to set "foundMakefile" so "make check" tests are run. + buildPhase = '' + runHook preBuild + + xmlto man --skip-validation deheader.xml + patchShebangs ./deheader + foundMakefile=1 + + runHook postBuild + ''; + + doCheck = true; + + installPhase = '' + runHook preInstall + + install -Dm755 ./deheader -t $out/bin + installManPage ./deheader.1 + + runHook postInstall + ''; + + meta = with lib; { + description = "Tool to find and optionally remove unneeded includes in C or C++ source files"; + longDescription = '' + This tool takes a list of C or C++ sourcefiles and generates a report + on which #includes can be omitted from them -- the test, for each foo.c + or foo.cc or foo.cpp, is simply whether 'rm foo.o; make foo.o' returns a + zero status. Optionally, with the -r option, the unneeded headers are removed. + The tool also reports on headers required for strict portability. + ''; + homepage = "http://catb.org/~esr/deheader"; + changelog = "https://gitlab.com/esr/deheader/-/blob/master/NEWS.adoc"; + license = licenses.bsd2; + maintainers = with maintainers; [ kaction ]; + + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 93554e795c6..f8e9c723f07 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3679,6 +3679,8 @@ with pkgs; dedup = callPackage ../tools/backup/dedup { }; + deheader = callPackage ../development/tools/misc/deheader { }; + dehydrated = callPackage ../tools/admin/dehydrated { }; deja-dup = callPackage ../applications/backup/deja-dup { }; |