about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/soci/default.nix
blob: 007a4fbaf7bf407b30f1e85d9a75a75f35458abe (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
49
50
51
{ cmake
, fetchFromGitHub
, fetchpatch
, sqlite
, postgresql
, boost
, darwin
, lib, stdenv
}:
let
  inherit (darwin.apple_sdk_11_0.frameworks) Kerberos;
in
stdenv.mkDerivation rec {
  pname = "soci";
  version = "4.0.2";

  src = fetchFromGitHub {
    owner = "SOCI";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-NE0ApbX8HG2VAQ9cg9+kX3kJQ4PR1XvWL9BlT8NphmE=";
  };

  patches = [
    (fetchpatch {
      name = "fix-backend-search-path.patch";
      url = "https://github.com/SOCI/soci/commit/56c93afc467bdba8ffbe68739eea76059ea62f7a.patch";
      sha256 = "sha256-nC/39pn3Cv5e65GgIfF3l64/AbCsfZHPUPIWETZFZAY=";
    })
  ];

  # Do not build static libraries
  cmakeFlags = [ "-DSOCI_STATIC=OFF" "-DCMAKE_CXX_STANDARD=11" "-DSOCI_TESTS=off" ];

  nativeBuildInputs = [ cmake ];
  buildInputs = [
    sqlite
    postgresql
    boost
  ] ++ lib.optionals stdenv.isDarwin [
    Kerberos
  ];

  meta = with lib; {
    description = "Database access library for C++";
    homepage = "https://soci.sourceforge.net/";
    license = licenses.boost;
    platforms = platforms.all;
    maintainers = with maintainers; [ jluttine ];
  };
}