lol
1{ lib, stdenv, fetchurl, readline, libmysqlclient, postgresql, sqlite }:
2
3let inherit (lib) getDev; in
4
5stdenv.mkDerivation rec {
6 pname = "opendbx";
7 version = "1.4.6";
8
9 src = fetchurl {
10 url = "https://linuxnetworks.de/opendbx/download/opendbx-${version}.tar.gz";
11 sha256 = "0z29h6zx5f3gghkh1a0060w6wr572ci1rl2a3480znf728wa0ii2";
12 };
13
14 preConfigure = ''
15 export CPPFLAGS="-I${getDev libmysqlclient}/include/mysql"
16 export LDFLAGS="-L${libmysqlclient}/lib/mysql -L${postgresql}/lib"
17 configureFlagsArray=(--with-backends="mysql pgsql sqlite3")
18 '';
19
20 buildInputs = [ readline libmysqlclient postgresql sqlite ];
21
22 env.NIX_CFLAGS_COMPILE = toString [
23 # Needed with GCC 12
24 "-std=c++14"
25 ];
26
27 meta = with lib; {
28 broken = stdenv.isDarwin;
29 description = "Extremely lightweight but extensible database access library written in C";
30 mainProgram = "odbx-sql";
31 license = licenses.lgpl21;
32 platforms = platforms.all;
33 };
34}