about summary refs log tree commit diff
path: root/pkgs/development/libraries/sexp/default.nix
blob: 9f9eb1f8973c9378a3d12731c8a1657fc9d60514 (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
{ lib
, stdenv
, bzip2
, cmake
, fetchFromGitHub
, gtest
, pkg-config
, zlib
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "sexp";
  version = "0.8.6";

  src = fetchFromGitHub {
    owner = "rnpgp";
    repo = "sexp";
    rev = "v${finalAttrs.version}";
    hash = "sha256-NpDSoBxEM8g/SugLmT8E5+YZPDFIGHa4eXLjdzQxaiw=";
  };

  buildInputs = [ zlib bzip2 ];

  cmakeFlags = [
    "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
    "-DBUILD_SHARED_LIBS=on"
    "-DWITH_SEXP_TESTS=on"
    "-DDOWNLOAD_GTEST=off"
    "-DWITH_SEXP_CLI=on"
    "-DWITH_SANITIZERS=off"
  ];

  nativeBuildInputs = [ cmake gtest pkg-config ];

  outputs = [ "out" "lib" "dev" ];

  preConfigure = ''
    echo "v${finalAttrs.version}" > version.txt
  '';

  meta = with lib; {
    homepage = "https://github.com/rnpgp/sexp";
    description = "S-expressions parser and generator C++ library, fully compliant to [https://people.csail.mit.edu/rivest/Sexp.txt]";
    license = licenses.mit;
    platforms = platforms.all;
    maintainers = with maintainers; [ ribose-jeffreylau ];
  };
})