From f72d7dcf777af3007a1f91916251d56904ec0af9 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sun, 6 Sep 2020 09:06:25 -0500 Subject: [PATCH] mariadb-connector-c: separate .dev output --- .../sql/mariadb/connector-c/default.nix | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/sql/mariadb/connector-c/default.nix b/pkgs/servers/sql/mariadb/connector-c/default.nix index fb41890d4328..8c71514dfba7 100644 --- a/pkgs/servers/sql/mariadb/connector-c/default.nix +++ b/pkgs/servers/sql/mariadb/connector-c/default.nix @@ -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 = {