nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildDubPackage,
4 fetchFromGitHub,
5 versionCheckHook,
6}:
7
8buildDubPackage rec {
9 pname = "dscanner";
10 version = "0.15.2";
11
12 src = fetchFromGitHub {
13 owner = "dlang-community";
14 repo = "D-Scanner";
15 tag = "v${version}";
16 hash = "sha256-7lZhYlK07VWpSRnzawJ2RL69/U/AH/qPyQY4VfbnVn4=";
17 };
18
19 preBuild = ''
20 mkdir -p bin/
21 echo "v${version}" > bin/dubhash.txt
22 '';
23
24 patches = [
25 ./fix_version.patch
26 ];
27
28 dubLock = ./dub-lock.json;
29
30 doCheck = true;
31
32 installPhase = ''
33 runHook preInstall
34 install -Dm755 bin/dscanner -t $out/bin
35 runHook postInstall
36 '';
37
38 nativeInstallCheckInputs = [
39 versionCheckHook
40 ];
41
42 doInstallCheck = true;
43
44 meta = {
45 description = "Swiss-army knife for D source code";
46 changelog = "https://github.com/dlang-community/D-Scanner/releases/tag/v${version}";
47 homepage = "https://github.com/dlang-community/D-Scanner";
48 mainProgram = "dscanner";
49 maintainers = with lib.maintainers; [ ipsavitsky ];
50 license = lib.licenses.boost;
51 };
52}