Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / libhsts / default.nix
blob2150bbd24bfbf8a2ece023083b638c1d4a116e23
1 { lib, stdenv, fetchFromGitLab, fetchurl, autoconf-archive, autoreconfHook, pkg-config, python3 }:
2 let
3   chromium_version = "90.0.4417.1";
5   hsts_list = fetchurl {
6     url = "https://raw.github.com/chromium/chromium/${chromium_version}/net/http/transport_security_state_static.json";
7     sha256 = "09f24n30x5dmqk8zk7k2glcilgr27832a3304wj1yp97158sqsfx";
8   };
11 stdenv.mkDerivation rec {
12   pname = "libhsts";
13   version = "0.1.0";
15   src = fetchFromGitLab {
16     owner = "rockdaboot";
17     repo = pname;
18     rev = "libhsts-${version}";
19     sha256 = "0gbchzf0f4xzb6zjc56dk74hqrmdgyirmgxvvsqp9vqn9wb5kkx4";
20   };
22   postPatch = ''
23     pushd tests
24     cp ${hsts_list} transport_security_state_static.json
25     sed 's/^ *\/\/.*$//g' transport_security_state_static.json >hsts.json
26     popd
27     patchShebangs src/hsts-make-dafsa
28   '';
30   nativeBuildInputs = [ autoconf-archive autoreconfHook pkg-config python3 ];
32   outputs = [ "out" "dev" ];
34   meta = with lib; {
35     description = "Library to easily check a domain against the Chromium HSTS Preload list";
36     homepage = "https://gitlab.com/rockdaboot/libhsts";
37     license = with licenses; [ mit bsd3 ];
38     maintainers = with maintainers; [ ];
39   };