Merge pull request #97672 from ttuegel/mariadb-connector-c-multiple-outputs

mariadb-connector-c: multiple outputs
This commit is contained in:
Thomas Tuegel 2020-09-15 05:38:28 -05:00 committed by GitHub
commit c0825ddbe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 59 additions and 26 deletions

View File

@ -3,6 +3,8 @@
, proj, gdal, geos, sqlite, postgresql, libmysqlclient, python2Packages, libLAS, proj-datumgrid , proj, gdal, geos, sqlite, postgresql, libmysqlclient, python2Packages, libLAS, proj-datumgrid
}: }:
let inherit (stdenv) lib; in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "grass"; name = "grass";
version = "7.6.1"; version = "7.6.1";
@ -42,7 +44,7 @@ stdenv.mkDerivation rec {
"--with-postgres-libs=${postgresql.lib}/lib/" "--with-postgres-libs=${postgresql.lib}/lib/"
# it complains about missing libmysqld but doesn't really seem to need it # it complains about missing libmysqld but doesn't really seem to need it
"--with-mysql" "--with-mysql"
"--with-mysql-includes=${libmysqlclient}/include/mysql" "--with-mysql-includes=${lib.getDev libmysqlclient}/include/mysql"
"--with-mysql-libs=${libmysqlclient}/lib/mysql" "--with-mysql-libs=${libmysqlclient}/lib/mysql"
"--with-blas" "--with-blas"
"--with-liblas=${libLAS}/bin/liblas-config" "--with-liblas=${libLAS}/bin/liblas-config"

View File

@ -19,16 +19,17 @@ stdenv.mkDerivation rec {
preConfigure = '' preConfigure = ''
export QMAKEFEATURES=${libcommuni}/features export QMAKEFEATURES=${libcommuni}/features
qmakeFlags="$qmakeFlags \
COMMUNI_INSTALL_PREFIX=$out \
COMMUNI_INSTALL_BINS=$out/bin \
COMMUNI_INSTALL_PLUGINS=$out/lib/communi/plugins \
COMMUNI_INSTALL_ICONS=$out/share/icons/hicolor \
COMMUNI_INSTALL_DESKTOP=$out/share/applications \
COMMUNI_INSTALL_THEMES=$out/share/communi/themes
"
''; '';
qmakeFlags = [
"COMMUNI_INSTALL_PREFIX=${placeholder "out"}"
"COMMUNI_INSTALL_BINS=${placeholder "out"}/bin"
"COMMUNI_INSTALL_PLUGINS=${placeholder "out"}/lib/communi/plugins"
"COMMUNI_INSTALL_ICONS=${placeholder "out"}/share/icons/hicolor"
"COMMUNI_INSTALL_DESKTOP=${placeholder "out"}/share/applications"
"COMMUNI_INSTALL_THEMES=${placeholder "out"}/share/communi/themes"
];
postInstall = stdenv.lib.optionalString stdenv.isLinux '' postInstall = stdenv.lib.optionalString stdenv.isLinux ''
substituteInPlace "$out/share/applications/communi.desktop" \ substituteInPlace "$out/share/applications/communi.desktop" \
--replace "/usr/bin" "$out/bin" --replace "/usr/bin" "$out/bin"

View File

@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
"--with-poppler=${poppler.dev}" # optional "--with-poppler=${poppler.dev}" # optional
"--with-libz=${zlib.dev}" # optional "--with-libz=${zlib.dev}" # optional
"--with-pg=${postgresql}/bin/pg_config" "--with-pg=${postgresql}/bin/pg_config"
"--with-mysql=${libmysqlclient}/bin/mysql_config" "--with-mysql=${getDev libmysqlclient}/bin/mysql_config"
"--with-geotiff=${libgeotiff.dev}" "--with-geotiff=${libgeotiff.dev}"
"--with-sqlite3=${sqlite.dev}" "--with-sqlite3=${sqlite.dev}"
"--with-spatialite=${libspatialite}" "--with-spatialite=${libspatialite}"

View File

@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
"--with-poppler=${poppler.dev}" # optional "--with-poppler=${poppler.dev}" # optional
"--with-libz=${zlib.dev}" # optional "--with-libz=${zlib.dev}" # optional
"--with-pg=yes" # since gdal 3.0 doesn't use ${postgresql}/bin/pg_config "--with-pg=yes" # since gdal 3.0 doesn't use ${postgresql}/bin/pg_config
"--with-mysql=${libmysqlclient}/bin/mysql_config" "--with-mysql=${getDev libmysqlclient}/bin/mysql_config"
"--with-geotiff=${libgeotiff}" "--with-geotiff=${libgeotiff}"
"--with-sqlite3=${sqlite.dev}" "--with-sqlite3=${sqlite.dev}"
"--with-spatialite=${libspatialite}" "--with-spatialite=${libspatialite}"

View File

@ -1,6 +1,7 @@
{ stdenv { stdenv
, fetchurl , fetchurl
, fetchpatch , fetchpatch
, libmysqlclient
# Excerpt from glpk's INSTALL file: # Excerpt from glpk's INSTALL file:
# This feature allows the exact simplex solver to use the GNU MP # This feature allows the exact simplex solver to use the GNU MP
# bignum library. If it is disabled, the exact simplex solver uses the # bignum library. If it is disabled, the exact simplex solver uses the
@ -21,9 +22,11 @@ stdenv.mkDerivation rec {
sha256 = "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"; sha256 = "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2";
}; };
buildInputs = stdenv.lib.optionals withGmp [ buildInputs =
gmp [ libmysqlclient
]; ] ++ stdenv.lib.optionals withGmp [
gmp
];
configureFlags = stdenv.lib.optionals withGmp [ configureFlags = stdenv.lib.optionals withGmp [
"--with-gmp" "--with-gmp"
@ -47,6 +50,13 @@ stdenv.mkDerivation rec {
}) })
]; ];
postPatch =
# Do not hardcode the include path for libmysqlclient.
''
substituteInPlace configure \
--replace '-I/usr/include/mysql' '$(mysql_config --include)'
'';
doCheck = true; doCheck = true;
meta = { meta = {

View File

@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
"--with-dbi-libdir=${libdbi}/lib" "--with-dbi-libdir=${libdbi}/lib"
] ++ optionals (libmysqlclient != null) [ ] ++ optionals (libmysqlclient != null) [
"--with-mysql" "--with-mysql"
"--with-mysql-incdir=${libmysqlclient}/include/mysql" "--with-mysql-incdir=${getDev libmysqlclient}/include/mysql"
"--with-mysql-libdir=${libmysqlclient}/lib/mysql" "--with-mysql-libdir=${libmysqlclient}/lib/mysql"
] ++ optionals (sqlite != null) [ ] ++ optionals (sqlite != null) [
"--with-sqlite3" "--with-sqlite3"

View File

@ -1,5 +1,7 @@
{ stdenv, fetchurl, readline, libmysqlclient, postgresql, sqlite }: { stdenv, fetchurl, readline, libmysqlclient, postgresql, sqlite }:
let inherit (stdenv.lib) getDev; in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "opendbx-1.4.6"; name = "opendbx-1.4.6";
@ -9,7 +11,7 @@ stdenv.mkDerivation rec {
}; };
preConfigure = '' preConfigure = ''
export CPPFLAGS="-I${libmysqlclient}/include/mysql" export CPPFLAGS="-I${getDev libmysqlclient}/include/mysql"
export LDFLAGS="-L${libmysqlclient}/lib/mysql -L${postgresql}/lib" export LDFLAGS="-L${libmysqlclient}/lib/mysql -L${postgresql}/lib"
configureFlagsArray=(--with-backends="mysql pgsql sqlite3") configureFlagsArray=(--with-backends="mysql pgsql sqlite3")
''; '';

View File

@ -169,7 +169,7 @@ with super;
luadbi-mysql = super.luadbi-mysql.override({ luadbi-mysql = super.luadbi-mysql.override({
extraVariables = { extraVariables = {
# Can't just be /include and /lib, unfortunately needs the trailing 'mysql' # Can't just be /include and /lib, unfortunately needs the trailing 'mysql'
MYSQL_INCDIR="${pkgs.libmysqlclient}/include/mysql"; MYSQL_INCDIR="${pkgs.libmysqlclient.dev}/include/mysql";
MYSQL_LIBDIR="${pkgs.libmysqlclient}/lib/mysql"; MYSQL_LIBDIR="${pkgs.libmysqlclient}/lib/mysql";
}; };
buildInputs = [ buildInputs = [

View File

@ -18,6 +18,8 @@ stdenv.mkDerivation {
inherit sha256; inherit sha256;
}; };
outputs = [ "out" "dev" ];
cmakeFlags = [ cmakeFlags = [
"-DMARIADB_UNIX_ADDR=/run/mysqld/mysqld.sock" "-DMARIADB_UNIX_ADDR=/run/mysqld/mysqld.sock"
"-DWITH_CURL=ON" "-DWITH_CURL=ON"
@ -25,6 +27,12 @@ stdenv.mkDerivation {
"-DWITH_MYSQLCOMPAT=ON" "-DWITH_MYSQLCOMPAT=ON"
]; ];
postPatch = ''
substituteInPlace mariadb_config/mariadb_config.c.in \
--replace '@CMAKE_SYSROOT@@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@' "$dev/include" \
--replace '@CMAKE_SYSROOT@@CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@' "$out/lib/mariadb"
'';
# The cmake setup-hook uses $out/lib by default, this is not the case here. # The cmake setup-hook uses $out/lib by default, this is not the case here.
preConfigure = optionalString stdenv.isDarwin '' preConfigure = optionalString stdenv.isDarwin ''
cmakeFlagsArray+=("-DCMAKE_INSTALL_NAME_DIR=$out/lib/mariadb") cmakeFlagsArray+=("-DCMAKE_INSTALL_NAME_DIR=$out/lib/mariadb")
@ -36,12 +44,16 @@ stdenv.mkDerivation {
enableParallelBuilding = true; enableParallelBuilding = true;
postInstall = ''
moveToOutput bin/mariadb_config "$dev"
'';
postFixup = '' postFixup = ''
ln -sv mariadb_config $out/bin/mysql_config ln -sv mariadb_config $dev/bin/mysql_config
ln -sv mariadb $out/lib/mysql ln -sv mariadb $out/lib/mysql
ln -sv mariadb $out/include/mysql ln -sv mariadb $dev/include/mysql
ln -sv mariadb_version.h $out/include/mariadb/mysql_version.h ln -sv mariadb_version.h $dev/include/mariadb/mysql_version.h
ln -sv libmariadb.pc $out/lib/pkgconfig/mysqlclient.pc ln -sv libmariadb.pc $dev/lib/pkgconfig/mysqlclient.pc
''; '';
meta = { meta = {

View File

@ -1,6 +1,8 @@
{ stdenv, fetchFromGitHub, cmake, pkgconfig { stdenv, fetchFromGitHub, cmake, pkgconfig
, glib, zlib, pcre, libmysqlclient, libressl }: , glib, zlib, pcre, libmysqlclient, libressl }:
let inherit (stdenv.lib) getDev; in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "0.9.5"; version = "0.9.5";
pname = "mydumper"; pname = "mydumper";
@ -16,6 +18,8 @@ stdenv.mkDerivation rec {
buildInputs = [ glib zlib pcre libmysqlclient libressl ]; buildInputs = [ glib zlib pcre libmysqlclient libressl ];
cmakeFlags = [ "-DMYSQL_INCLUDE_DIR=${getDev libmysqlclient}/include/mysql" ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = ''High-perfomance MySQL backup tool''; description = ''High-perfomance MySQL backup tool'';
homepage = "https://github.com/maxbube/mydumper"; homepage = "https://github.com/maxbube/mydumper";

View File

@ -1,6 +1,8 @@
{ stdenv, fetchurl, autoreconfHook, pkgconfig, openssl, botan2, log4cplus { stdenv, fetchurl, autoreconfHook, pkgconfig, openssl, botan2, log4cplus
, boost, python3, postgresql, libmysqlclient, gmp, bzip2 }: , boost, python3, postgresql, libmysqlclient, gmp, bzip2 }:
let inherit (stdenv) lib; in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "kea"; pname = "kea";
version = "1.5.0-P1"; version = "1.5.0-P1";
@ -20,7 +22,7 @@ stdenv.mkDerivation rec {
configureFlags = [ configureFlags = [
"--localstatedir=/var" "--localstatedir=/var"
"--with-pgsql=${postgresql}/bin/pg_config" "--with-pgsql=${postgresql}/bin/pg_config"
"--with-mysql=${libmysqlclient}/bin/mysql_config" "--with-mysql=${lib.getDev libmysqlclient}/bin/mysql_config"
]; ];
nativeBuildInputs = [ autoreconfHook pkgconfig ]; nativeBuildInputs = [ autoreconfHook pkgconfig ];

View File

@ -18,9 +18,6 @@ stdenv.mkDerivation rec {
*/Makefile{.in,.am} */Makefile{.in,.am}
sed -i 's:/usr/lib/mysql:${libmysqlclient}/lib/mysql:' configure.ac sed -i 's:/usr/lib/mysql:${libmysqlclient}/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:' \
-e 's:mysql/errmsg.h:errmsg.h:' \
sql/mysql.c
''; '';
nativeBuildInputs = [ nativeBuildInputs = [

View File

@ -19,7 +19,7 @@ assert withSQLite -> sqlite != null;
assert withPgSQL -> postgresql != null; assert withPgSQL -> postgresql != null;
assert withMysql -> libmysqlclient != null; assert withMysql -> libmysqlclient != null;
let inherit (stdenv.lib) optional; in let inherit (stdenv.lib) getDev optional optionalString; in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "1.7.5"; version = "1.7.5";
@ -40,6 +40,9 @@ stdenv.mkDerivation rec {
++ optional withPgSQL postgresql ++ optional withPgSQL postgresql
++ optional withMysql [ libmysqlclient zlib ]; ++ optional withMysql [ libmysqlclient zlib ];
MYSQL_CONFIG =
optionalString withMysql "${getDev libmysqlclient}/bin/mysql_config";
configureFlags = [ configureFlags = [
"--with-pcap-includes=${libpcap}/include" "--with-pcap-includes=${libpcap}/include"
] ++ optional withJansson "--enable-jansson" ] ++ optional withJansson "--enable-jansson"