summary refs log tree commit diff
path: root/pkgs/development/libraries/opendbx/default.nix
blob: 9a7877a9938a38e7b9a5e8d8d01f402bd5fddd84 (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
{ lib, stdenv, fetchurl, readline, libmysqlclient, postgresql, sqlite }:

let inherit (lib) getDev; in

stdenv.mkDerivation rec {
  pname = "opendbx";
  version = "1.4.6";

  src = fetchurl {
    url = "https://linuxnetworks.de/opendbx/download/opendbx-${version}.tar.gz";
    sha256 = "0z29h6zx5f3gghkh1a0060w6wr572ci1rl2a3480znf728wa0ii2";
  };

  preConfigure = ''
    export CPPFLAGS="-I${getDev libmysqlclient}/include/mysql"
    export LDFLAGS="-L${libmysqlclient}/lib/mysql -L${postgresql}/lib"
    configureFlagsArray=(--with-backends="mysql pgsql sqlite3")
  '';

  buildInputs = [ readline libmysqlclient postgresql sqlite ];

  meta = with lib; {
    description = "Extremely lightweight but extensible database access library written in C";
    license = licenses.lgpl21;
    platforms = platforms.all;
  };
}