mariadb-embedded: add override to enable building libmysqld.so

This commit is contained in:
Yorick van Pelt 2022-10-11 18:28:55 +02:00
parent 44cbcce412
commit 9517864e93
No known key found for this signature in database
GPG Key ID: A36E70F9DC014A15
2 changed files with 12 additions and 2 deletions

View File

@ -13,6 +13,7 @@
, fmt_8
, withStorageMroonga ? true, kytea, libsodium, msgpack, zeromq
, withStorageRocks ? true
, withEmbedded ? false
}:
let
@ -103,7 +104,7 @@ commonOptions = packageSettings: rec { # attributes common to both builds
"-DCMAKE_CROSSCOMPILING_EMULATOR=${stdenv.hostPlatform.emulator buildPackages}"
];
postInstall = ''
postInstall = lib.optionalString (!withEmbedded) ''
# Remove Development components. Need to use libmysqlclient.
rm "$out"/lib/mysql/plugin/daemon_example.ini
rm "$out"/lib/{libmariadb.a,libmariadbclient.a,libmysqlclient.a,libmysqlclient_r.a,libmysqlservices.a}
@ -184,6 +185,10 @@ in stdenv.mkDerivation (common // {
++ lib.optionals withStorageMroonga [ kytea libsodium msgpack zeromq ]
++ lib.optionals (lib.versionAtLeast common.version "10.7") [ fmt_8 ];
propagatedBuildInputs = lib.optionals withEmbedded
(lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64) pmdk.lib
++ lib.optional (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32) numactl);
patches = common.patches;
postPatch = ''
@ -196,7 +201,7 @@ in stdenv.mkDerivation (common // {
"-DENABLED_LOCAL_INFILE=OFF"
"-DWITH_READLINE=ON"
"-DWITH_EXTRA_CHARSETS=all"
"-DWITH_EMBEDDED_SERVER=OFF"
"-DWITH_EMBEDDED_SERVER=${if withEmbedded then "ON" else "OFF"}"
"-DWITH_UNIT_TESTS=OFF"
"-DWITH_WSREP=ON"
"-DWITH_INNODB_DISALLOW_WRITES=ON"

View File

@ -23693,6 +23693,11 @@ with pkgs;
mariadb_109
;
mariadb = mariadb_106;
mariadb-embedded = (callPackage ../servers/sql/mariadb {
inherit (darwin) cctools;
inherit (darwin.apple_sdk.frameworks) CoreServices;
withEmbedded = true;
}).mariadb_106;
mongodb = hiPrio mongodb-3_4;