about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJanne Heß <dasJ@users.noreply.github.com>2022-08-24 22:53:49 +0200
committerGitHub <noreply@github.com>2022-08-24 22:53:49 +0200
commit3852b03bbc16879866574be824d387c4236dde97 (patch)
treec88e52a9a0234362ff723249691ebcb7a0310518
parent8db2e7bb026a5a89f11c23b7c713ef9ab4eb03ef (diff)
parent7f930f85a16afe2cf044c4ebacb267ef34cc23bd (diff)
Merge pull request #179790 from NickCao/mariadb-cross
mariadb{,-client}: fix cross compilation and build on riscv
-rw-r--r--pkgs/servers/sql/mariadb/default.nix9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix
index 706188b403059..672354051d40f 100644
--- a/pkgs/servers/sql/mariadb/default.nix
+++ b/pkgs/servers/sql/mariadb/default.nix
@@ -94,6 +94,10 @@ commonOptions = packageSettings: rec { # attributes common to both builds
     # to pass in java explicitly.
     "-DCONNECT_WITH_JDBC=OFF"
     "-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib"
+  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    # revisit this if nixpkgs supports any architecture whose stack grows upwards
+    "-DSTACK_DIRECTION=-1"
+    "-DCMAKE_CROSSCOMPILING_EMULATOR=${stdenv.hostPlatform.emulator buildPackages}"
   ];
 
   postInstall = ''
@@ -211,10 +215,6 @@ in stdenv.mkDerivation (common // {
     "-DPLUGIN_AUTH_PAM_V1=NO"
     "-DWITHOUT_OQGRAPH=1"
     "-DWITHOUT_PLUGIN_S3=1"
-  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
-    # revisit this if nixpkgs supports any architecture whose stack grows upwards
-    "-DSTACK_DIRECTION=-1"
-    "-DCMAKE_CROSSCOMPILING_EMULATOR=${stdenv.hostPlatform.emulator buildPackages}"
   ];
 
   preConfigure = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
@@ -234,6 +234,7 @@ in stdenv.mkDerivation (common // {
   '';
 
   CXXFLAGS = lib.optionalString stdenv.hostPlatform.isi686 "-fpermissive";
+  NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isRiscV "-latomic";
 });
 in {
   mariadb_104 = mariadbPackage {