mariadb-connector-c: separate .dev output

This commit is contained in:
Thomas Tuegel 2020-09-06 09:06:25 -05:00 committed by Thomas Tuegel
parent 37d29394ec
commit f72d7dcf77
No known key found for this signature in database
GPG Key ID: 22CBF5249D4B4D59

View File

@ -18,6 +18,8 @@ stdenv.mkDerivation {
inherit sha256;
};
outputs = [ "out" "dev" ];
cmakeFlags = [
"-DMARIADB_UNIX_ADDR=/run/mysqld/mysqld.sock"
"-DWITH_CURL=ON"
@ -25,6 +27,12 @@ stdenv.mkDerivation {
"-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.
preConfigure = optionalString stdenv.isDarwin ''
cmakeFlagsArray+=("-DCMAKE_INSTALL_NAME_DIR=$out/lib/mariadb")
@ -36,12 +44,16 @@ stdenv.mkDerivation {
enableParallelBuilding = true;
postInstall = ''
moveToOutput bin/mariadb_config "$dev"
'';
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/include/mysql
ln -sv mariadb_version.h $out/include/mariadb/mysql_version.h
ln -sv libmariadb.pc $out/lib/pkgconfig/mysqlclient.pc
ln -sv mariadb $dev/include/mysql
ln -sv mariadb_version.h $dev/include/mariadb/mysql_version.h
ln -sv libmariadb.pc $dev/lib/pkgconfig/mysqlclient.pc
'';
meta = {