summary refs log tree commit diff
path: root/pkgs/tools/text/dcs/default.nix
blob: 0f438e4ff571b13e664cab48dd36fda5d4887306 (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
41
42
43
44
45
46
47
{ lib
, buildGoModule
, fetchFromGitHub
, yuicompressor
, zopfli
, stdenv
}:
buildGoModule {
  pname = "dcs";
  version = "unstable-2021-04-07";

  src = fetchFromGitHub {
    owner = "Debian";
    repo = "dcs";
    rev = "da46accc4d55e9bfde1a6852ac5a9e730fcbbb2c";
    hash = "sha256-N+6BXlKn1YTlh0ZdPNWa0nuJNcQtlUIc9TocM8cbzQk=";
  };

  vendorHash = "sha256-l2mziuisx0HzuP88rS5M+Wha6lu8P036wJYZlmzjWfs=";

  # Depends on dcs binaries
  doCheck = false;

  nativeBuildInputs = [
    yuicompressor
    zopfli
  ];

  postBuild = ''
    make -C static -j$NIX_BUILD_CORES
  '';

  postInstall = ''
    mkdir -p $out/share/dcs
    cp -r cmd/dcs-web/templates $out/share/dcs
    cp -r static $out/share/dcs
  '';

  meta = with lib; {
    description = "Debian Code Search";
    homepage = "https://github.com/Debian/dcs";
    license = licenses.bsd3;
    maintainers = [ ];
    broken = stdenv.isAarch64
      || stdenv.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/staging-next/dcs.x86_64-darwin
  };
}