Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / misc / debian-goodies / default.nix
blob897881dec46ce5a387b5a452c4d6a4fd0212baa6
1 { lib
2 , stdenv
3 , fetchFromGitLab
4 , curl
5 , dialog
6 , installShellFiles
7 , perl
8 , python3
9 }:
11 stdenv.mkDerivation rec {
12   pname = "debian-goodies";
13   version = "0.88.1";
15   src = fetchFromGitLab {
16     domain = "salsa.debian.org";
17     owner = "debian";
18     repo = "debian-goodies";
19     rev = "debian/${version}";
20     sha256 = "sha256-g1xeWhCkC7HEHHOJpcZ6JFA9jmavJE0lUX1Cmp5A0QQ=";
21   };
23   postPatch = ''
24     substituteInPlace debmany/debmany \
25       --replace "/usr/bin/dialog" "${dialog}/bin/dialog" \
26       --replace "/usr/bin/whiptail" "${python3.pkgs.snack}/bin/whiptail"
28     substituteInPlace dman \
29       --replace "curl" "${curl}/bin/curl"
30   '';
32   nativeBuildInputs = [
33     installShellFiles
34   ];
36   buildInputs = [
37     perl
38     python3
39   ];
41   installPhase = ''
42     runHook preInstall
44     # see https://salsa.debian.org/debian/debian-goodies/-/blob/master/debian/install
45     for bin in checkrestart dgrep dglob debget dpigs debman dman popbugs which-pkg-broke which-pkg-broke-build dhomepage debmany/debmany check-enhancements find-dbgsym-packages; do
46       install -Dm755 $bin -t $out/bin
47     done
49     install -Dm644 find-dbgsym-packages-templates/* -t $out/share/debian-goodies/find-dbgsym-packages-templates/
51     installShellCompletion --bash \
52       debmany/bash_completion/debmany \
53       debian/bash-completion
55     installManPage \
56       *.1 \
57       debmany/man/*.1 \
58       *.8
60     runHook postInstall
61   '';
63   meta = with lib; {
64     description = "Small toolbox-style utilities for Debian systems";
65     homepage = "https://salsa.debian.org/debian/debian-goodies";
66     license = licenses.gpl2Plus;
67     platforms = platforms.unix;
68     maintainers = with maintainers; [ SuperSandro2000 ];
69   };