1{ lib, stdenv, fetchFromGitHub, perl }:
2
3stdenv.mkDerivation rec {
4 pname = "uthash";
5 version = "2.3.0";
6
7 src = fetchFromGitHub {
8 owner = "troydhanson";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "sha256-F0M5ENT3bMn3dD16Oaq9mBFYOWzVliVWupAIrLc2nkQ=";
12 };
13
14 doCheck = true;
15 nativeCheckInputs = [ perl ];
16 checkTarget = "all";
17 preCheck = "cd tests";
18
19 installPhase = ''
20 install -Dm644 $src/include/*.h -t $out/include
21 '';
22
23 meta = with lib; {
24 description = "A hash table for C structures";
25 homepage = "http://troydhanson.github.io/uthash";
26 license = licenses.bsd2; # it's one-clause, actually, as it's source-only
27 platforms = platforms.all;
28 };
29}