From 55d2daaf3157eda3304f1e96dd367eb0cedc3166 Mon Sep 17 00:00:00 2001 From: Elis Hirwing Date: Sat, 24 Feb 2018 12:23:08 +0100 Subject: [PATCH] libgda: Add optional mysql and postgresql support --- pkgs/desktops/gnome-3/misc/libgda/default.nix | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/pkgs/desktops/gnome-3/misc/libgda/default.nix b/pkgs/desktops/gnome-3/misc/libgda/default.nix index edb34996867b..dd551a1caed6 100644 --- a/pkgs/desktops/gnome-3/misc/libgda/default.nix +++ b/pkgs/desktops/gnome-3/misc/libgda/default.nix @@ -1,4 +1,10 @@ -{ stdenv, fetchurl, fetchpatch, pkgconfig, intltool, itstool, libxml2, gtk3, openssl }: +{ stdenv, fetchurl, fetchpatch, pkgconfig, intltool, itstool, libxml2, gtk3, openssl +, mysqlSupport ? false, mysql ? null +, postgresSupport ? false, postgresql ? null +}: + +assert mysqlSupport -> mysql != null; +assert postgresSupport -> postgresql != null; stdenv.mkDerivation rec { inherit (import ./src.nix fetchurl) name src; @@ -11,16 +17,18 @@ stdenv.mkDerivation rec { }) ]; - configureFlags = [ - "--enable-gi-system-install=no" - ]; + configureFlags = with stdenv.lib; [ "--enable-gi-system-install=no" ] + ++ (optional (mysqlSupport) "--with-mysql=yes") + ++ (optional (postgresSupport) "--with-postgres=yes"); enableParallelBuilding = true; hardeningDisable = [ "format" ]; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ intltool itstool libxml2 gtk3 openssl ]; + nativeBuildInputs = [ pkgconfig intltool itstool libxml2 ]; + buildInputs = with stdenv.lib; [ gtk3 openssl ] + ++ optional (mysqlSupport) mysql.connector-c + ++ optional (postgresSupport) postgresql; meta = with stdenv.lib; { description = "Database access library";