1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 versionCheckHook,
6 nix-update-script,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "maskprocessor";
11 version = "0.73";
12
13 src = fetchFromGitHub {
14 owner = "hashcat";
15 repo = "maskprocessor";
16 tag = "v${finalAttrs.version}";
17 hash = "sha256-LVtMz5y0PbKKuc92W5xW0C84avigR7vS1XL/aXkUYe8=";
18 };
19
20 # upstream Makefile is terrible, this simplifies everything.
21 buildPhase = ''
22 runHook preBuild
23
24 $CC -o maskprocessor src/mp.c -W -Wall -std=c99 -O2 -s -DLINUX
25
26 runHook postBuild
27 '';
28
29 installPhase = ''
30 runHook preInstall
31
32 install -Dm544 -t $out/bin maskprocessor
33
34 runHook postInstall
35 '';
36
37 nativeInstallCheckInputs = [ versionCheckHook ];
38 versionCheckProgramArg = "--version";
39 doInstallCheck = true;
40
41 passthru = {
42 updateScript = nix-update-script { };
43 };
44
45 meta = {
46 homepage = "https://github.com/hashcat/maskprocessor";
47 description = "High-Performance word generator with a per-position configureable charset";
48 license = lib.licenses.mit;
49 platforms = lib.platforms.unix;
50 changelog = "https://github.com/hashcat/maskprocessor/releases/tag/v${finalAttrs.version}";
51 maintainers = with lib.maintainers; [ ethancedwards8 ];
52 mainProgram = "maskprocessor";
53 };
54})