Merge pull request #146220 from Izorkin/update-mariadb

mariadb: cleanup build configuration

authored by

ajs124 and committed by
GitHub
623cfa87 41aaf69b

+35 -26
pkgs/servers/sql/mariadb/cmake-includedir.patch pkgs/servers/sql/mariadb/patch/cmake-includedir.patch
pkgs/servers/sql/mariadb/cmake-plugin-includedir.patch pkgs/servers/sql/mariadb/patch/cmake-plugin-includedir.patch
+30 -23
pkgs/servers/sql/mariadb/default.nix
··· 1 - { lib, stdenv, fetchurl, fetchFromGitHub, cmake, pkg-config, makeWrapper, ncurses, nixosTests 2 - , libiconv, openssl, pcre2, boost, judy, bison, libxml2, libkrb5, linux-pam, curl 3 - , liburing, libevent, jemalloc, cracklib, systemd, perl 4 , bzip2, lz4, lzo, snappy, xz, zlib, zstd 5 - , fixDarwinDylibNames, cctools, CoreServices, less 6 - , numactl # NUMA Support 7 , withStorageMroonga ? true, kytea, libsodium, msgpack, zeromq 8 , withStorageRocks ? true 9 }: ··· 30 }; 31 32 nativeBuildInputs = [ cmake pkg-config ] 33 - ++ optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; 34 35 buildInputs = [ 36 - ncurses openssl zlib pcre2 libiconv curl 37 - ] ++ optionals stdenv.hostPlatform.isLinux [ liburing systemd libkrb5 ] 38 - ++ optionals stdenv.hostPlatform.isDarwin [ perl cctools CoreServices ] 39 ++ optional (!stdenv.hostPlatform.isDarwin) [ jemalloc ]; 40 41 prePatch = '' ··· 43 ''; 44 45 patches = [ 46 - ./cmake-includedir.patch 47 ] 48 # Fixes a build issue as documented on 49 # https://jira.mariadb.org/browse/MDEV-26769?focusedCommentId=206073&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-206073 50 - ++ lib.optional (!stdenv.isLinux) ./macos-MDEV-26769-regression-fix.patch; 51 52 cmakeFlags = [ 53 "-DBUILD_CONFIG=mysql_release" ··· 94 rm "$out"/bin/{mariadb-config,mariadb_config,mysql_config} 95 rm -r $out/include 96 rm -r $out/lib/pkgconfig 97 ''; 98 99 passthru.mysqlVersion = "5.7"; ··· 122 outputs = [ "out" "man" ]; 123 124 patches = common.patches ++ [ 125 - ./cmake-plugin-includedir.patch 126 ]; 127 128 cmakeFlags = common.cmakeFlags ++ [ ··· 146 147 outputs = [ "out" "man" ]; 148 149 - nativeBuildInputs = common.nativeBuildInputs ++ [ bison boost.dev ] ++ optional (!stdenv.hostPlatform.isDarwin) makeWrapper; 150 151 buildInputs = common.buildInputs ++ [ 152 bzip2 lz4 lzo snappy xz zstd 153 - libxml2 judy libevent cracklib 154 ] ++ optional (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32) numactl 155 - ++ optionals withStorageMroonga [ kytea libsodium msgpack zeromq ] 156 - ++ optional stdenv.hostPlatform.isLinux linux-pam 157 - ++ optional (!stdenv.hostPlatform.isDarwin) mytopEnv; 158 159 patches = common.patches; 160 ··· 196 ''; 197 198 postInstall = common.postInstall + '' 199 - rm -rf "$out"/share/aclocal 200 chmod +x "$out"/bin/wsrep_sst_common 201 rm "$out"/bin/{mariadb-client-test,mariadb-test,mysql_client_test,mysqltest} 202 '' + optionalString withStorageMroonga '' ··· 205 mv "$out"/OFF/suite/plugins/pam/pam_mariadb_mtr.so "$out"/share/pam/lib/security 206 mv "$out"/OFF/suite/plugins/pam/mariadb_mtr "$out"/share/pam/etc/security 207 rm -r "$out"/OFF 208 - ''; 209 - 210 - # perlPackages.DBDmysql is broken on darwin 211 - postFixup = optionalString (!stdenv.hostPlatform.isDarwin) '' 212 - wrapProgram $out/bin/mytop --set PATH ${makeBinPath [ less ncurses ]} 213 ''; 214 215 CXXFLAGS = optionalString stdenv.hostPlatform.isi686 "-fpermissive";
··· 1 + { lib, stdenv, fetchurl, nixosTests 2 + # Native buildInputs components 3 + , bison, boost, cmake, fixDarwinDylibNames, flex, makeWrapper, pkg-config 4 + # Common components 5 + , curl, libiconv, ncurses, openssl, pcre2 6 + , libkrb5, liburing, systemd 7 + , CoreServices, cctools, perl 8 + , jemalloc, less 9 + # Server components 10 , bzip2, lz4, lzo, snappy, xz, zlib, zstd 11 + , cracklib, judy, libevent, libxml2 12 + , linux-pam, numactl, pmdk 13 , withStorageMroonga ? true, kytea, libsodium, msgpack, zeromq 14 , withStorageRocks ? true 15 }: ··· 36 }; 37 38 nativeBuildInputs = [ cmake pkg-config ] 39 + ++ optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames 40 + ++ optional (!stdenv.hostPlatform.isDarwin) makeWrapper; 41 42 buildInputs = [ 43 + curl libiconv ncurses openssl pcre2 zlib 44 + ] ++ optionals stdenv.hostPlatform.isLinux [ libkrb5 liburing systemd ] 45 + ++ optionals stdenv.hostPlatform.isDarwin [ CoreServices cctools perl ] 46 ++ optional (!stdenv.hostPlatform.isDarwin) [ jemalloc ]; 47 48 prePatch = '' ··· 50 ''; 51 52 patches = [ 53 + ./patch/cmake-includedir.patch 54 ] 55 # Fixes a build issue as documented on 56 # https://jira.mariadb.org/browse/MDEV-26769?focusedCommentId=206073&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-206073 57 + ++ lib.optional (!stdenv.isLinux) ./patch/macos-MDEV-26769-regression-fix.patch; 58 59 cmakeFlags = [ 60 "-DBUILD_CONFIG=mysql_release" ··· 101 rm "$out"/bin/{mariadb-config,mariadb_config,mysql_config} 102 rm -r $out/include 103 rm -r $out/lib/pkgconfig 104 + ''; 105 + 106 + # perlPackages.DBDmysql is broken on darwin 107 + postFixup = optionalString (!stdenv.hostPlatform.isDarwin) '' 108 + wrapProgram $out/bin/mytop --set PATH ${makeBinPath [ less ncurses ]} 109 ''; 110 111 passthru.mysqlVersion = "5.7"; ··· 134 outputs = [ "out" "man" ]; 135 136 patches = common.patches ++ [ 137 + ./patch/cmake-plugin-includedir.patch 138 ]; 139 140 cmakeFlags = common.cmakeFlags ++ [ ··· 158 159 outputs = [ "out" "man" ]; 160 161 + nativeBuildInputs = common.nativeBuildInputs ++ [ bison boost.dev flex ]; 162 163 buildInputs = common.buildInputs ++ [ 164 bzip2 lz4 lzo snappy xz zstd 165 + cracklib judy libevent libxml2 166 ] ++ optional (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32) numactl 167 + ++ optionals stdenv.hostPlatform.isLinux [ linux-pam pmdk.dev ] 168 + ++ optional (!stdenv.hostPlatform.isDarwin) mytopEnv 169 + ++ optionals withStorageMroonga [ kytea libsodium msgpack zeromq ]; 170 171 patches = common.patches; 172 ··· 208 ''; 209 210 postInstall = common.postInstall + '' 211 + rm -r "$out"/share/aclocal 212 chmod +x "$out"/bin/wsrep_sst_common 213 rm "$out"/bin/{mariadb-client-test,mariadb-test,mysql_client_test,mysqltest} 214 '' + optionalString withStorageMroonga '' ··· 217 mv "$out"/OFF/suite/plugins/pam/pam_mariadb_mtr.so "$out"/share/pam/lib/security 218 mv "$out"/OFF/suite/plugins/pam/mariadb_mtr "$out"/share/pam/etc/security 219 rm -r "$out"/OFF 220 ''; 221 222 CXXFLAGS = optionalString stdenv.hostPlatform.isi686 "-fpermissive";
+5 -3
pkgs/servers/sql/mariadb/galera/default.nix
··· 4 5 stdenv.mkDerivation rec { 6 pname = "mariadb-galera"; 7 - version = "26.4.9"; 8 9 src = fetchFromGitHub { 10 owner = "codership"; 11 repo = "galera"; 12 rev = "release_${version}"; 13 - sha256 = "1nf8vv0b9v7rjsxl93avgvv0lz5jjg91brnric0dhlnp2dzzxi6g"; 14 fetchSubmodules = true; 15 }; 16 17 - buildInputs = [ asio boost check openssl cmake ]; 18 19 preConfigure = '' 20 # make sure bundled asio cannot be used, but leave behind license, because it gets installed
··· 4 5 stdenv.mkDerivation rec { 6 pname = "mariadb-galera"; 7 + version = "26.4.10"; 8 9 src = fetchFromGitHub { 10 owner = "codership"; 11 repo = "galera"; 12 rev = "release_${version}"; 13 + sha256 = "sha256-v3fKadoHCAKHZGPjuh/uLnmAaaPESrax73GEI/mH39g="; 14 fetchSubmodules = true; 15 }; 16 17 + nativeBuildInputs = [ cmake ]; 18 + 19 + buildInputs = [ asio boost.dev check openssl ]; 20 21 preConfigure = '' 22 # make sure bundled asio cannot be used, but leave behind license, because it gets installed
pkgs/servers/sql/mariadb/macos-MDEV-26769-regression-fix.patch pkgs/servers/sql/mariadb/patch/macos-MDEV-26769-regression-fix.patch