treewide: generalise for both mysql & mariadb

This commit is contained in:
Robin Gloster 2017-12-27 17:00:39 +01:00
parent 6903ea6050
commit 572b2bda4e
13 changed files with 23 additions and 21 deletions

View File

@ -2,7 +2,7 @@
, pcre, libevent, gd, curl, libxml2, icu, flex, bison, openssl, zlib, php , pcre, libevent, gd, curl, libxml2, icu, flex, bison, openssl, zlib, php
, expat, libcap, oniguruma, libdwarf, libmcrypt, tbb, gperftools, glog, libkrb5 , expat, libcap, oniguruma, libdwarf, libmcrypt, tbb, gperftools, glog, libkrb5
, bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam, libpng , bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam, libpng
, libxslt, freetype, gdb, git, perl, mariadb, gmp, libyaml, libedit , libxslt, freetype, gdb, git, perl, mysql, gmp, libyaml, libedit
, libvpx, imagemagick, fribidi, gperf, which, ocamlPackages , libvpx, imagemagick, fribidi, gperf, which, ocamlPackages
}: }:
@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
}; };
buildInputs = buildInputs =
[ cmake pkgconfig boost libunwind mariadb.client libmemcached pcre gdb git perl [ cmake pkgconfig boost libunwind mysql.connector-c libmemcached pcre gdb git perl
libevent gd curl libxml2 icu flex bison openssl zlib php expat libcap libevent gd curl libxml2 icu flex bison openssl zlib php expat libcap
oniguruma libdwarf libmcrypt tbb gperftools bzip2 openldap readline oniguruma libdwarf libmcrypt tbb gperftools bzip2 openldap readline
libelf uwimap binutils cyrus_sasl pam glog libpng libxslt libkrb5 libelf uwimap binutils cyrus_sasl pam glog libpng libxslt libkrb5

View File

@ -12,8 +12,8 @@ stdenv.mkDerivation rec {
}; };
preConfigure = '' preConfigure = ''
export CPPFLAGS="-I${mysql.connector-c}/include/mariadb" export CPPFLAGS="-I${mysql.connector-c}/include/mysql"
export LDFLAGS="-L${mysql.connector-c}/lib/mariadb -L${postgresql}/lib" export LDFLAGS="-L${mysql.connector-c}/lib/mysql -L${postgresql}/lib"
configureFlagsArray=(--with-backends="mysql pgsql sqlite3") configureFlagsArray=(--with-backends="mysql pgsql sqlite3")
''; '';

View File

@ -49,7 +49,7 @@ stdenv.mkDerivation {
-I${randrproto}/include" else "-no-xrandr"} -I${randrproto}/include" else "-no-xrandr"}
${if xineramaSupport then "-xinerama -L${libXinerama.out}/lib -I${libXinerama.dev}/include" else "-no-xinerama"} ${if xineramaSupport then "-xinerama -L${libXinerama.out}/lib -I${libXinerama.dev}/include" else "-no-xinerama"}
${if cursorSupport then "-L${libXcursor.out}/lib -I${libXcursor.dev}/include" else ""} ${if cursorSupport then "-L${libXcursor.out}/lib -I${libXcursor.dev}/include" else ""}
${if mysqlSupport then "-qt-sql-mysql -L${mysql.connector-c}/lib/mariadb -I${mysql.connector-c}/include/mariadb" else ""} ${if mysqlSupport then "-qt-sql-mysql -L${mysql.connector-c}/lib/mysql -I${mysql.connector-c}/include/mysql" else ""}
${if xftSupport then "-xft ${if xftSupport then "-xft
-L${libXft.out}/lib -I${libXft.dev}/include -L${libXft.out}/lib -I${libXft.dev}/include
-L${libXft.freetype.out}/lib -I${libXft.freetype.dev}/include -L${libXft.freetype.out}/lib -I${libXft.freetype.dev}/include

View File

@ -56,8 +56,8 @@ in
propagatedBuildInputs = with pkgs; [mysql postgresql sqlite zlib]; propagatedBuildInputs = with pkgs; [mysql postgresql sqlite zlib];
overrides = y: (x.overrides y) // { overrides = y: (x.overrides y) // {
preConfigure = ((x.overrides y).preConfigure or "") + '' preConfigure = ((x.overrides y).preConfigure or "") + ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${pkgs.mysql.connector-c}/include/mariadb" export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${pkgs.mysql.connector-c}/include/mysql"
export NIX_LDFLAGS="$NIX_LDFLAGS -L${pkgs.mysql.connector-c}/lib/mariadb" export NIX_LDFLAGS="$NIX_LDFLAGS -L${pkgs.mysql.connector-c}/lib/mysql"
''; '';
}; };
}; };

View File

@ -5,11 +5,11 @@ self = rec {
env = buildEnv { name = name; paths = buildInputs; }; env = buildEnv { name = name; paths = buildInputs; };
buildInputs = [ buildInputs = [
gcc stdenv gcc stdenv
openssl fuse libuv mariadb libfixposix libev sqlite openssl fuse libuv mysql.connector-c libfixposix libev sqlite
freetds freetds
lispPackages.quicklisp-to-nix lispPackages.quicklisp-to-nix-system-info lispPackages.quicklisp-to-nix lispPackages.quicklisp-to-nix-system-info
]; ];
CPATH = "${libfixposix}/include"; CPATH = "${libfixposix}/include";
LD_LIBRARY_PATH = "${openssl.out}/lib:${fuse}/lib:${libuv}/lib:${libev}/lib:${mariadb}/lib:${postgresql.lib}/lib:${sqlite.out}/lib:${libfixposix}/lib:${freetds}/lib"; LD_LIBRARY_PATH = "${openssl.out}/lib:${fuse}/lib:${libuv}/lib:${libev}/lib:${mysql.connector-c}/lib:${postgresql.lib}/lib:${sqlite.out}/lib:${libfixposix}/lib:${freetds}/lib";
}; };
in stdenv.mkDerivation self in stdenv.mkDerivation self

View File

@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
preConfigure = '' preConfigure = ''
substituteInPlace configure \ substituteInPlace configure \
--replace /usr/include/mysql ${mysql.connector-c}/include/mariadb --replace /usr/include/mysql ${mysql.connector-c}/include/mysql
''; '';
configureFlags = [ "--enable-dl" configureFlags = [ "--enable-dl"
"--enable-odbc" "--enable-odbc"

View File

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub { stdenv, fetchFromGitHub
, withMySQL ? false, withPSQL ? false, withSQLite ? false , withMySQL ? false, withPSQL ? false, withSQLite ? false
, mariadb, postgresql, sqlite, gawk, which , mysql, postgresql, sqlite, gawk, which
, lib , lib
}: }:
@ -20,7 +20,7 @@ stdenv.mkDerivation {
patchShebangs . patchShebangs .
substituteInPlace shmig \ substituteInPlace shmig \
--replace "\`which mysql\`" "${lib.optionalString withMySQL "${mariadb}/bin/mysql"}" \ --replace "\`which mysql\`" "${lib.optionalString withMySQL "${mysql.client}/bin/mysql"}" \
--replace "\`which psql\`" "${lib.optionalString withPSQL "${postgresql}/bin/psql"}" \ --replace "\`which psql\`" "${lib.optionalString withPSQL "${postgresql}/bin/psql"}" \
--replace "\`which sqlite3\`" "${lib.optionalString withSQLite "${sqlite}/bin/sqlite3"}" \ --replace "\`which sqlite3\`" "${lib.optionalString withSQLite "${sqlite}/bin/sqlite3"}" \
--replace "awk" "${gawk}/bin/awk" \ --replace "awk" "${gawk}/bin/awk" \

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, pkgconfig, { stdenv, fetchurl, pkgconfig,
boost, libyamlcpp, libsodium, sqlite, protobuf, boost, libyamlcpp, libsodium, sqlite, protobuf,
libmysql, postgresql, lua, openldap, geoip, curl mysql57, postgresql, lua, openldap, geoip, curl
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ boost libmysql postgresql lua openldap sqlite protobuf geoip libyamlcpp libsodium curl ]; buildInputs = [ boost mysql57.connector-c postgresql lua openldap sqlite protobuf geoip libyamlcpp libsodium curl ];
# nix destroy with-modules arguments, when using configureFlags # nix destroy with-modules arguments, when using configureFlags
preConfigure = '' preConfigure = ''

View File

@ -56,7 +56,9 @@ self = stdenv.mkDerivation rec {
''; '';
passthru = { passthru = {
client = self;
connector-c = self; connector-c = self;
server = self;
mysqlVersion = "5.7"; mysqlVersion = "5.7";
}; };

View File

@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ buildInputs = [
nettools gettext readline openssl python2 flex ncurses sqlite postgresql nettools gettext readline openssl python2 flex ncurses sqlite postgresql
libmysql zlib lzo jansson acl glusterfs libceph libcap rocksdb mysql.connector-c zlib lzo jansson acl glusterfs libceph libcap rocksdb
]; ];
postPatch = '' postPatch = ''

View File

@ -1,5 +1,5 @@
{ stdenv, fetchFromGitHub, cmake, pkgconfig { stdenv, fetchFromGitHub, cmake, pkgconfig
, glib, zlib, pcre, mariadb, libressl, }: , glib, zlib, pcre, mysql, libressl }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "0.9.3"; version = "0.9.3";
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake pkgconfig ]; nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [ glib zlib pcre mariadb.client.dev libressl ]; buildInputs = [ glib zlib pcre mysql.connector-c libressl ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = ''High-perfomance MySQL backup tool''; description = ''High-perfomance MySQL backup tool'';

View File

@ -54,14 +54,14 @@ in stdenv.mkDerivation rec {
sed -i -e '/chown root:mail/d' \ sed -i -e '/chown root:mail/d' \
-e 's/chmod [24]755/chmod 0755/' \ -e 's/chmod [24]755/chmod 0755/' \
*/Makefile{.in,.am} */Makefile{.in,.am}
sed -i 's:/usr/lib/mysql:${mysql.connector-c}/lib/mariadb:' configure.ac sed -i 's:/usr/lib/mysql:${mysql.connector-c}/lib/mysql:' configure.ac
sed -i 's/0\.18/0.19/' configure.ac sed -i 's/0\.18/0.19/' configure.ac
sed -i -e 's:mysql/mysql.h:mysql.h:' \ sed -i -e 's:mysql/mysql.h:mysql.h:' \
-e 's:mysql/errmsg.h:errmsg.h:' \ -e 's:mysql/errmsg.h:errmsg.h:' \
sql/mysql.c sql/mysql.c
''; '';
NIX_CFLAGS_COMPILE = "-L${mysql.connector-c}/lib/mariadb -I${mysql.connector-c}/include/mariadb"; NIX_CFLAGS_COMPILE = "-L${mysql.connector-c}/lib/mysql -I${mysql.connector-c}/include/mysql";
preCheck = '' preCheck = ''
# Add missing test files # Add missing test files

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, bash, makeWrapper, git, mariadb, diffutils, which, coreutils, procps, nettools }: { stdenv, lib, fetchFromGitHub, bash, makeWrapper, git, mysql, diffutils, which, coreutils, procps, nettools }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "snabb-${version}"; name = "snabb-${version}";
@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
done done
# We need a way to pass $PATH to the scripts # We need a way to pass $PATH to the scripts
sed -i '2iexport PATH=${stdenv.lib.makeBinPath [ git mariadb which procps coreutils ]}' src/program/snabbnfv/neutron_sync_master/neutron_sync_master.sh.inc sed -i '2iexport PATH=${stdenv.lib.makeBinPath [ git mysql.client which procps coreutils ]}' src/program/snabbnfv/neutron_sync_master/neutron_sync_master.sh.inc
sed -i '2iexport PATH=${stdenv.lib.makeBinPath [ git coreutils diffutils nettools ]}' src/program/snabbnfv/neutron_sync_agent/neutron_sync_agent.sh.inc sed -i '2iexport PATH=${stdenv.lib.makeBinPath [ git coreutils diffutils nettools ]}' src/program/snabbnfv/neutron_sync_agent/neutron_sync_agent.sh.inc
''; '';