about summary refs log tree commit diff
path: root/pkgs/by-name/co/coost/package.nix
blob: 648d0f9f4db3a19d698df1c4fdfb276ea611748a (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
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  curl,
  openssl,
  gitUpdater,
  withCurl ? true,
  withOpenSSL ? true,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "coost";
  version = "3.0.2";

  src = fetchFromGitHub {
    owner = "idealvin";
    repo = "coost";
    rev = "v${finalAttrs.version}";
    hash = "sha256-HbMenAL/UWsqQ1o7cMeWfwXkLh4GxIKV7iuZQD3hDA8=";
  };

  postPatch = ''
    substituteInPlace cmake/coost.pc.in \
      --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
      --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ \
  '';

  nativeBuildInputs = [ cmake ];
  buildInputs = lib.optional withCurl curl ++ lib.optional withOpenSSL openssl;

  cmakeFlags = [
    "-DBUILD_SHARED_LIBS=ON"
  ] ++ lib.optional withCurl "-DWITH_LIBCURL=ON" ++ lib.optional withOpenSSL "-DWITH_OPENSSL=ON";

  outputs = [ "out" "dev" ];
  passthru.updateScript = gitUpdater { };

  meta = with lib; {
    description = "A tiny boost library in C++11";
    homepage = "https://github.com/idealvin/coost";
    license = licenses.mit;
    maintainers = [ maintainers.sigmanificient ];
    platforms = platforms.unix;
  };
})