about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc/checkbashisms/default.nix
blob: a9840a7cf27717c99450def7c8e5eb9f18167dfe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ lib, stdenv, fetchurl, perl, installShellFiles }:
stdenv.mkDerivation rec {
  version = "2.22.1";
  pname = "checkbashisms";

  src = fetchurl {
    url = "mirror://debian/pool/main/d/devscripts/devscripts_${version}.tar.xz";
    hash = "sha256-Nd1eYCnSe+NblujG44uKpvunkaITcdrC3g+M3uX+M9U=";
  };

  nativeBuildInputs = [ installShellFiles ];
  buildInputs = [ perl ];

  buildPhase = ''
    runHook preBuild

    substituteInPlace ./scripts/checkbashisms.pl \
      --replace '###VERSION###' "$version"

    runHook postBuild
  '';
  installPhase = ''
    runHook preInstall

    installManPage scripts/$pname.1
    installShellCompletion --bash --name $pname scripts/$pname.bash_completion
    install -D -m755 scripts/$pname.pl $out/bin/$pname

    runHook postInstall
  '';

  meta = {
    homepage = "https://sourceforge.net/projects/checkbaskisms/";
    description = "Check shell scripts for non-portable syntax";
    mainProgram = "checkbashisms";
    license = lib.licenses.gpl2Plus;
    maintainers = with lib.maintainers; [ kaction ];
    platforms = lib.platforms.unix;
  };
}