about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/gl/glauth/package.nix
blob: 7f279e8613e76c8e88671e2223b03127dfd56031 (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
48
49
50
51
52
53
54
{ lib
, fetchFromGitHub
, buildGoModule
, oath-toolkit
, openldap
}:

buildGoModule rec {
  pname = "glauth";
  version = "2.3.0";

  src = fetchFromGitHub {
    owner = "glauth";
    repo = "glauth";
    rev = "v${version}";
    hash = "sha256-XYNNR3bVLNtAl+vbGRv0VhbLf+em8Ay983jqcW7KDFU=";
  };

  vendorHash = "sha256-SFmGgxDokIbVl3ANDPMCqrB0ck8Wyva2kSV2mgNRogo=";

  nativeCheckInputs = [
    oath-toolkit
    openldap
  ];

  modRoot = "v2";

  # Disable go workspaces to fix build.
  env.GOWORK = "off";

  # Fix this build error:
  #   main module (github.com/glauth/glauth/v2) does not contain package github.com/glauth/glauth/v2/vendored/toml
  excludedPackages = [ "vendored/toml" ];

  # Based on ldflags in <glauth>/Makefile.
  ldflags = [
    "-s"
    "-w"
    "-X main.GitClean=1"
    "-X main.LastGitTag=v${version}"
    "-X main.GitTagIsCommit=1"
  ];

  # Tests fail in the sandbox.
  doCheck = false;

  meta = with lib; {
    description = "A lightweight LDAP server for development, home use, or CI";
    homepage = "https://github.com/glauth/glauth";
    license = licenses.mit;
    maintainers = with maintainers; [ bjornfor ];
    mainProgram = "glauth";
  };
}