about summary refs log tree commit diff
path: root/pkgs/by-name/li/libeduvpn-common/package.nix
blob: bc011a3410ea028f014abb59ce9ad5eedf6dcf0f (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
{ lib
, buildGoModule
, fetchurl
}:

buildGoModule rec {
  pname = "libeduvpn-common";
  version = "2.0.2";

  src = fetchurl {
    url = "https://github.com/eduvpn/eduvpn-common/releases/download/${version}/eduvpn-common-${version}.tar.xz";
    hash = "sha256-cD2WqxKCQkDL4lNbFKcbKygvmmd5FT8mZe5DDw+kizg=";
  };

  vendorHash = null;

  buildPhase = ''
    runHook preBuild
    go build -o ${pname}-${version}.so -buildmode=c-shared -tags=release ./exports
    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall
    install -Dt $out/lib ${pname}-${version}.so
    runHook postInstall
  '';

  meta = with lib; {
    changelog = "https://raw.githubusercontent.com/eduvpn/eduvpn-common/${version}/CHANGES.md";
    description = "Code to be shared between eduVPN clients";
    homepage = "https://github.com/eduvpn/eduvpn-common";
    maintainers = with maintainers; [ benneti jwijenbergh ];
    license = licenses.mit;
    platforms = platforms.linux;
  };
}