git.iko.soy/typeable/nixpkgs
on master help sign in
Merge #17413: mariadb rework

It includes security updates to mariadb/mysql.

commit5951fc63611e8b23b9a3c5fcb9d0140eed06708a authorVladimír Čunát <vcunat@gmail.com> dateSun 7 Aug 2016, 22:30 (10 years ago) parent50f909cf21ff73
18 files changed+142−128
pkgs/applications/audio/amarok/default.nix+3−1 pkgs/applications/gis/grass/default.nix+3−2 pkgs/development/compilers/hhvm/default.nix+1−3 pkgs/development/compilers/urweb/default.nix+4−4 pkgs/development/interpreters/php/default.nix+1−1 pkgs/development/libraries/libdbi-drivers/default.nix−2 pkgs/development/libraries/opendbx/default.nix+6−3 pkgs/development/libraries/qt-3/default.nix+1−1 pkgs/development/lisp-modules/lisp-packages.nix+3−3 pkgs/development/ocaml-modules/mysql/default.nix+2−6 pkgs/development/pure-modules/glpk/default.nix+1−1 pkgs/games/zod/default.nix+1−1 pkgs/servers/games/ghost-one/default.nix+4−2 pkgs/servers/mail/dspam/default.nix+1−1 pkgs/servers/mail/postfix/default.nix+1−1 pkgs/servers/restund/default.nix+1−1 pkgs/servers/sql/mariadb/default.nix+108−94 pkgs/top-level/all-packages.nix+1−1
pkgs/applications/audio/amarok/default.nix+3−1
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
2121 nativeBuildInputs = [ automoc4 cmake perl pkgconfig ];
2222
2323 buildInputs = [
24− qtscriptgenerator stdenv.cc.libc gettext curl libxml2 mysql.lib
24+ qtscriptgenerator stdenv.cc.libc gettext curl libxml2 mysql.server/*libmysqld*/
2525 taglib taglib_extras loudmouth kdelibs phonon strigi soprano qca2
2626 libmtp liblastfm libgpod qjson ffmpeg libofa nepomuk_core
2727 lz4 lzo snappy libaio pcre
@@ -34,6 +34,8 @@ stdenv.mkDerivation rec {
3434
3535 cmakeFlags = "-DKDE4_BUILD_TESTS=OFF";
3636
37+ enableParallelBuilding = true;
38+
3739 propagatedUserEnvPkgs = [ qtscriptgenerator ];
3840
3941 meta = {
pkgs/applications/gis/grass/default.nix+3−2
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
1111 };
1212
1313 buildInputs = [ flex bison zlib proj gdal libtiff libpng fftw sqlite pkgconfig cairo
14− readline ffmpeg makeWrapper wxGTK30 netcdf geos postgresql mysql.lib blas ]
14+ readline ffmpeg makeWrapper wxGTK30 netcdf geos postgresql mysql.client blas ]
1515 ++ (with pythonPackages; [ python dateutil wxPython30 numpy sqlite3 ]);
1616
1717 configureFlags = [
@@ -22,7 +22,8 @@ stdenv.mkDerivation {
2222 "--with-netcdf"
2323 "--with-geos"
2424 "--with-postgres" "--with-postgres-libs=${postgresql.lib}/lib/"
25− "--with-mysql" "--with-mysql-includes=${mysql.lib}/include/mysql"
25+ # it complains about missing libmysqld but doesn't really seem to need it
26+ "--with-mysql" "--with-mysql-includes=${stdenv.lib.getDev mysql.client}/include/mysql"
2627 "--with-blas"
2728 ];
2829
pkgs/development/compilers/hhvm/default.nix+1−3
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
1919 };
2020
2121 buildInputs =
22− [ cmake pkgconfig boost libunwind mariadb libmemcached pcre gdb git perl
22+ [ cmake pkgconfig boost libunwind mariadb.client libmemcached pcre gdb git perl
2323 libevent gd curl libxml2 icu flex bison openssl zlib php expat libcap
2424 oniguruma libdwarf libmcrypt tbb gperftools bzip2 openldap readline
2525 libelf uwimap binutils cyrus_sasl pam glog libpng libxslt ocaml libkrb5
@@ -29,8 +29,6 @@ stdenv.mkDerivation rec {
2929 enableParallelBuilding = false; # occasional build problems;
3030 dontUseCmakeBuildDir = true;
3131 NIX_LDFLAGS = "-lpam -L${pam}/lib";
32− MYSQL_INCLUDE_DIR="${mariadb}/include/mysql";
33− MYSQL_DIR=mariadb;
3432
3533 # work around broken build system
3634 NIX_CFLAGS_COMPILE = "-I${freetype.dev}/include/freetype2";
pkgs/development/compilers/urweb/default.nix+4−4
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, file, openssl, mlton
1+{ stdenv, lib, fetchurl, file, openssl, mlton
22, mysql, postgresql, sqlite
33}:
44
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
1111 sha256 = "08km96hli5yp754nsxxjzih2la0m89j5wc2cq12rkas43nqqgr65";
1212 };
1313
14− buildInputs = [ openssl mlton mysql postgresql sqlite ];
14+ buildInputs = [ openssl mlton mysql.client postgresql sqlite ];
1515
1616 prePatch = ''
1717 sed -e 's@/usr/bin/file@${file}/bin/file@g' -i configure
@@ -21,11 +21,11 @@ stdenv.mkDerivation rec {
2121
2222 preConfigure = ''
2323 export PGHEADER="${postgresql}/include/libpq-fe.h";
24− export MSHEADER="${mysql.lib}/include/mysql/mysql.h";
24+ export MSHEADER="${lib.getDev mysql.client}/include/mysql/mysql.h";
2525 export SQHEADER="${sqlite.dev}/include/sqlite3.h";
2626
2727 export CCARGS="-I$out/include \
28− -L${mysql.lib}/lib/mysql \
28+ -L${lib.getLib mysql.client}/lib/mysql \
2929 -L${postgresql.lib}/lib \
3030 -L${sqlite.out}/lib";
3131 '';
pkgs/development/interpreters/php/default.nix+1−1
@@ -107,7 +107,7 @@ let
107107 };
108108
109109 mysql = {
110− configureFlags = ["--with-mysql=${mysql.lib}"];
110+ configureFlags = ["--with-mysql"];
111111 buildInputs = [ mysql.lib ];
112112 };
113113
pkgs/development/libraries/libdbi-drivers/default.nix−2
@@ -26,8 +26,6 @@ stdenv.mkDerivation rec {
2626 "--with-dbi-libdir=${libdbi}/lib"
2727 ] ++ optionals (libmysql != null) [
2828 "--with-mysql"
29− "--with-mysql-incdir=${libmysql}/include/mysql"
30− "--with-mysql-libdir=${libmysql}/lib/mysql"
3129 ] ++ optionals (postgresql != null) [
3230 "--with-pgsql"
3331 "--with-pgsql_incdir=${postgresql}/include"
pkgs/development/libraries/opendbx/default.nix+6−3
@@ -1,5 +1,8 @@
11{ stdenv, fetchurl, readline, mysql, postgresql, sqlite }:
22
3+let
4+ inherit (stdenv.lib) getDev getLib;
5+in
36stdenv.mkDerivation rec {
47 name = "opendbx-1.4.6";
58
@@ -9,10 +12,10 @@ stdenv.mkDerivation rec {
912 };
1013
1114 preConfigure = ''
12− export CPPFLAGS="-I${mysql.lib}/include/mysql"
13− export LDFLAGS="-L${mysql.lib}/lib/mysql"
15+ export CPPFLAGS="-I${getDev mysql.client}/include/mysql"
16+ export LDFLAGS="-L${getLib mysql.client}/lib/mysql -L${getLib postgresql}/lib"
1417 configureFlagsArray=(--with-backends="mysql pgsql sqlite3")
1518 '';
1619
17− buildInputs = [ readline mysql.lib postgresql sqlite ];
20+ buildInputs = [ readline mysql.client postgresql sqlite ];
1821}
pkgs/development/libraries/qt-3/default.nix+1−1
@@ -47,7 +47,7 @@ stdenv.mkDerivation {
4747 -I${randrproto}/include" else "-no-xrandr"}
4848 ${if xineramaSupport then "-xinerama -L${libXinerama.out}/lib -I${libXinerama.dev}/include" else "-no-xinerama"}
4949 ${if cursorSupport then "-L${libXcursor.out}/lib -I${libXcursor.dev}/include" else ""}
50− ${if mysqlSupport then "-qt-sql-mysql -L${mysql.lib}/lib/mysql -I${mysql.lib}/include/mysql" else ""}
50+ ${if mysqlSupport then "-qt-sql-mysql -L${stdenv.lib.getLib mysql.client}/lib/mysql -I${mysql.client}/include/mysql" else ""}
5151 ${if xftSupport then "-xft
5252 -L${libXft.out}/lib -I${libXft.dev}/include
5353 -L${libXft.freetype.out}/lib -I${libXft.freetype.dev}/include
pkgs/development/lisp-modules/lisp-packages.nix+3−3
@@ -192,7 +192,7 @@ let lispPackages = rec {
192192 version = "git-20150514";
193193 description = "Common Lisp SQL Interface library";
194194 deps = [uffi];
195− buildInputs = [pkgs.mysql.lib pkgs.zlib];
195+ buildInputs = [pkgs.mysql.client pkgs.zlib];
196196 # Source type: git
197197 src = pkgs.fetchgit {
198198 url =
@@ -204,8 +204,8 @@ let lispPackages = rec {
204204 };
205205 overrides = x:{
206206 preConfigure = ''
207− export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${pkgs.mysql.lib}/include/mysql"
208− export NIX_LDFLAGS="$NIX_LDFLAGS -L${pkgs.mysql.lib}/lib/mysql"
207+ export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${stdenv.lib.getDev pkgs.mysql.client}/include/mysql"
208+ export NIX_LDFLAGS="$NIX_LDFLAGS -L${stdenv.lib.getLib pkgs.mysql.client}/lib/mysql"
209209 '';
210210 };
211211 };
pkgs/development/ocaml-modules/mysql/default.nix+2−6
@@ -23,15 +23,11 @@ stdenv.mkDerivation {
2323 "--libdir=$out/lib/ocaml/${ocaml_version}/site-lib/mysql"
2424 ];
2525
26− buildInputs = [ocaml findlib mysql.lib camlp4 ];
26+ buildInputs = [ocaml findlib camlp4 ];
2727
2828 createFindlibDestdir = true;
2929
30− propagatedBuildInputs = [ mysql.lib ];
31−
32− preConfigure = ''
33− export LDFLAGS="-L${mysql.lib}/lib/mysql"
34− '';
30+ propagatedBuildInputs = [ mysql.client ];
3531
3632 buildPhase = ''
3733 make
pkgs/development/pure-modules/glpk/default.nix+1−1
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
1616
1717 preConfigure = ''
1818 substituteInPlace configure \
19− --replace /usr/include/mysql ${libmysql}/include/mysql
19+ --replace /usr/include/mysql ${lib.getDev libmysql}/include/mysql
2020 '';
2121 configureFlags = [ "--enable-dl"
2222 "--enable-odbc"
pkgs/games/zod/default.nix+1−1
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
2525 buildInputs = [ unrar unzip SDL SDL_image SDL_ttf SDL_mixer libmysql
2626 makeWrapper ];
2727
28− NIX_LDFLAGS="-L${libmysql}/lib/mysql";
28+ NIX_LDFLAGS="-L${stdenv.lib.getLib libmysql}/lib/mysql";
2929
3030 installPhase = ''
3131 mkdir -p $out/bin $out/share/zod
pkgs/servers/games/ghost-one/default.nix+4−2
@@ -9,10 +9,11 @@ stdenv.mkDerivation rec {
99 sha256 = "1sm2ca3lcdr4vjg7v94d8zhqz8cdp44rg8yinzzwkgsr0hj74fv2";
1010 };
1111
12− buildInputs = [ unzip gmp zlib bzip2 boost mysql.lib ];
12+ buildInputs = [ unzip gmp zlib bzip2 boost mysql.client ];
1313
1414 patchPhase = ''
15− substituteInPlace ghost/Makefile --replace "/usr/local/lib/mysql" "${mysql.lib}/lib/mysql"
15+ substituteInPlace ghost/Makefile --replace "/usr/local/lib/mysql" \
16+ "${stdenv.lib.getLib mysql.client}/lib/mysql"
1617 '';
1718
1819 buildPhase = ''
@@ -49,5 +50,6 @@ stdenv.mkDerivation rec {
4950 description = "A Warcraft III: Reign of Chaos and Warcraft III: The Frozen Throne game hosting bot";
5051 license = licenses.asl20;
5152 maintainers = [ maintainers.phreedom ];
53+ broken = true; # can't even get downloaded
5254 };
5355}
pkgs/servers/mail/dspam/default.nix+1−1
@@ -49,7 +49,7 @@ in stdenv.mkDerivation rec {
4949 "--enable-preferences-extension"
5050 "--enable-long-usernames"
5151 "--enable-external-lookup"
52− ] ++ lib.optional withMySQL "--with-mysql-includes=${libmysql}/include/mysql"
52+ ] ++ lib.optional withMySQL "--with-mysql-includes=${lib.getDev libmysql}/include/mysql"
5353 ++ lib.optional withPgSQL "--with-pgsql-libraries=${postgresql.lib}/lib";
5454
5555 # Lots of things are hardwired to paths like sysconfdir. That's why we install with both "prefix" and "DESTDIR"
pkgs/servers/mail/postfix/default.nix+1−1
@@ -11,7 +11,7 @@ let
1111 "-DHAS_DB_BYPASS_MAKEDEFS_CHECK"
1212 "-fPIE" "-fstack-protector-all" "--param" "ssp-buffer-size=4" "-O2" "-D_FORTIFY_SOURCE=2"
1313 ] ++ lib.optional withPgSQL "-DHAS_PGSQL"
14− ++ lib.optionals withMySQL [ "-DHAS_MYSQL" "-I${libmysql}/include/mysql" ]
14+ ++ lib.optionals withMySQL [ "-DHAS_MYSQL" "-I${lib.getDev libmysql}/include/mysql" ]
1515 ++ lib.optional withSQLite "-DHAS_SQLITE");
1616 auxlibs = lib.concatStringsSep " " ([
1717 "-ldb" "-lnsl" "-lresolv" "-lsasl2" "-lcrypto" "-lssl" "-pie" "-Wl,-z,relro,-z,now"
pkgs/servers/restund/default.nix+1−1
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
1818 ++ stdenv.lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}"
1919 ++ stdenv.lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.cc.libc}"
2020 ;
21− NIX_LDFLAGS='' -L${mysql.lib}/lib/mysql '';
21+ NIX_LDFLAGS='' -L${stdenv.lib.getLib mysql.client}/lib/mysql '';
2222 meta = {
2323 homepage = "http://www.creytiv.com/restund.html";
2424 platforms = with stdenv.lib.platforms; linux;
pkgs/servers/sql/mariadb/default.nix+108−94
@@ -1,55 +1,135 @@
1−{ stdenv, fetchurl, cmake, ncurses, zlib, xz, lzo, lz4, bzip2, snappy
1+{ stdenv, fetchurl, cmake, pkgconfig, ncurses, zlib, xz, lzo, lz4, bzip2, snappy
22, openssl, pcre, boost, judy, bison, libxml2
33, libaio, libevent, groff, jemalloc, cracklib, systemd, numactl, perl
44, fixDarwinDylibNames, cctools, CoreServices
5−, makeWrapper
65}:
76
87with stdenv.lib;
9−stdenv.mkDerivation rec {
10− name = "mariadb-${version}";
11− version = "10.1.9";
8+
9+let # in mariadb # spans the whole file
10+
11+mariadb = {
12+ inherit client # libmysqlclient.so in .out, necessary headers in .dev and utils in .bin
13+ server; # currently a full build, including everything in `client` again
14+ lib = client; # compat. with the old mariadb split
15+};
16+
17+
18+common = rec { # attributes common to both builds
19+ version = "10.1.16";
1220
1321 src = fetchurl {
1422 url = "https://downloads.mariadb.org/interstitial/mariadb-${version}/source/mariadb-${version}.tar.gz";
15− sha256 = "0471vwg9c5c17m7679krjha16ib6d48fcsphkchb9v9cf8k5i74f";
23+ sha256 = "14s3wq1c25n62n75hkixl8n7cni4m73w055nsx4czm655k33bjv7";
1624 };
1725
26+ prePatch = ''
27+ substituteInPlace cmake/libutils.cmake \
28+ --replace /usr/bin/libtool libtool
29+ sed -i 's,[^"]*/var/log,/var/log,g' storage/mroonga/vendor/groonga/CMakeLists.txt
30+ '';
31+
32+ patches = stdenv.lib.optional stdenv.isDarwin ./my_context_asm.patch;
33+
34+ nativeBuildInputs = [ cmake pkgconfig ];
35+
1836 buildInputs = [
19− cmake ncurses openssl zlib xz lzo lz4 bzip2
20− # temporary due to https://mariadb.atlassian.net/browse/MDEV-9000
21− (if stdenv.is64bit then snappy else null)
22− pcre libxml2 boost judy bison libevent cracklib
23− makeWrapper
37+ ncurses openssl zlib pcre
2438 ] ++ stdenv.lib.optionals stdenv.isLinux [ jemalloc libaio systemd ]
25− ++ stdenv.lib.optionals (stdenv.isLinux && !stdenv.isArm) [ numactl ]
2639 ++ stdenv.lib.optionals stdenv.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ];
2740
28− patches = stdenv.lib.optional stdenv.isDarwin ./my_context_asm.patch;
29−
3041 cmakeFlags = [
3142 "-DBUILD_CONFIG=mysql_release"
43+ "-DMANUFACTURER=NixOS.org"
3244 "-DDEFAULT_CHARSET=utf8"
3345 "-DDEFAULT_COLLATION=utf8_general_ci"
34− "-DENABLED_LOCAL_INFILE=ON"
46+ "-DSECURITY_HARDENED=ON"
47+
3548 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
49+ "-DINSTALL_MYSQLSHAREDIR=share/mysql"
50+
51+ "-DWITH_ZLIB=system"
52+ "-DWITH_SSL=system"
53+ "-DWITH_PCRE=system"
54+ ]
55+ ++ optional stdenv.isDarwin "-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib"
56+ ;
57+
58+ preConfigure = ''
59+ cmakeFlags="$cmakeFlags -DINSTALL_INCLUDEDIR=''${!outputDev}/include/mysql"
60+ '';
61+
62+ postInstall = ''
63+ rm "$out"/lib/*.a
64+ find "''${!outputBin}/bin" -name '*test*' -delete
65+ '';
66+
67+ passthru.mysqlVersion = "5.6";
68+
69+ meta = with stdenv.lib; {
70+ description = "An enhanced, drop-in replacement for MySQL";
71+ homepage = https://mariadb.org/;
72+ license = licenses.gpl2;
73+ maintainers = with maintainers; [ thoughtpolice wkennington ];
74+ platforms = platforms.all;
75+ };
76+};
77+
78+
79+client = stdenv.mkDerivation (common // {
80+ name = "mariadb-client-${common.version}";
81+
82+ outputs = [ "dev" "out" "bin" ];
83+
84+ propagatedBuildInputs = [ openssl zlib ]; # required from mariadb.pc
85+
86+ cmakeFlags = common.cmakeFlags ++ [
87+ "-DWITHOUT_SERVER=ON"
88+ ];
89+
90+ preConfigure = common.preConfigure + ''
91+ cmakeFlags="$cmakeFlags \
92+ -DINSTALL_BINDIR=$bin/bin -DINSTALL_SCRIPTDIR=$bin/bin \
93+ -DINSTALL_SUPPORTFILESDIR=$bin/share/mysql \
94+ -DINSTALL_DOCDIR=$bin/share/doc/mysql -DINSTALL_DOCREADMEDIR=$bin/share/doc/mysql \
95+ "
96+ '';
97+
98+ # prevent cycle; it needs to reference $dev
99+ postInstall = common.postInstall + ''
100+ moveToOutput bin/mysql_config "$dev"
101+ '';
102+
103+ enableParallelBuilding = true; # the client should be OK
104+});
105+
106+
107+server = stdenv.mkDerivation (common // {
108+ name = "mariadb-${common.version}";
109+
110+ nativeBuildInputs = common.nativeBuildInputs ++ [ bison ];
111+
112+ buildInputs = common.buildInputs ++ [
113+ xz lzo lz4 bzip2 snappy
114+ libxml2 boost judy libevent cracklib
115+ ]
116+ ++ optionals (stdenv.isLinux && !stdenv.isArm) [ numactl ]
117+ ;
118+
119+ cmakeFlags = common.cmakeFlags ++ [
36120 "-DMYSQL_DATADIR=/var/lib/mysql"
37121 "-DINSTALL_SYSCONFDIR=etc/mysql"
38122 "-DINSTALL_INFODIR=share/mysql/docs"
39123 "-DINSTALL_MANDIR=share/man"
40124 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
41125 "-DINSTALL_SCRIPTDIR=bin"
42− "-DINSTALL_INCLUDEDIR=include/mysql"
43− "-DINSTALL_DOCREADMEDIR=share/mysql"
44126 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
45− "-DINSTALL_MYSQLSHAREDIR=share/mysql"
46− "-DINSTALL_DOCDIR=share/mysql/docs"
127+ "-DINSTALL_DOCREADMEDIR=share/doc/mysql"
128+ "-DINSTALL_DOCDIR=share/doc/mysql"
47129 "-DINSTALL_SHAREDIR=share/mysql"
130+
131+ "-DENABLED_LOCAL_INFILE=ON"
48132 "-DWITH_READLINE=ON"
49− "-DWITH_ZLIB=system"
50− "-DWITH_SSL=system"
51− "-DWITH_PCRE=system"
52− "-DWITH_EMBEDDED_SERVER=yes"
53133 "-DWITH_EXTRA_CHARSETS=complex"
54134 "-DWITH_EMBEDDED_SERVER=ON"
55135 "-DWITH_ARCHIVE_STORAGE_ENGINE=1"
@@ -58,83 +138,17 @@ stdenv.mkDerivation rec {
58138 "-DWITH_PARTITION_STORAGE_ENGINE=1"
59139 "-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1"
60140 "-DWITHOUT_FEDERATED_STORAGE_ENGINE=1"
61− "-DSECURITY_HARDENED=ON"
62141 "-DWITH_WSREP=ON"
63142 ] ++ stdenv.lib.optionals stdenv.isDarwin [
64143 "-DWITHOUT_OQGRAPH_STORAGE_ENGINE=1"
65144 "-DWITHOUT_TOKUDB=1"
66− "-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib"
67145 ];
68146
69− # fails to find lex_token.h sometimes
70− enableParallelBuilding = false;
71−
72− outputs = [ "out" "lib" ];
73− setOutputFlags = false;
74− moveToDev = false;
75−
76− prePatch = ''
77− substituteInPlace cmake/libutils.cmake \
78− --replace /usr/bin/libtool libtool
79− sed -i "s,SET(DEFAULT_MYSQL_HOME.*$,SET(DEFAULT_MYSQL_HOME /not/a/real/dir),g" CMakeLists.txt
80− sed -i "s,SET(PLUGINDIR.*$,SET(PLUGINDIR $lib/lib/mysql/plugin),g" CMakeLists.txt
81−
82− sed -i "s,SET(pkgincludedir.*$,SET(pkgincludedir $lib/include),g" scripts/CMakeLists.txt
83− sed -i "s,SET(pkglibdir.*$,SET(pkglibdir $lib/lib),g" scripts/CMakeLists.txt
84− sed -i "s,SET(pkgplugindir.*$,SET(pkgplugindir $lib/lib/mysql/plugin),g" scripts/CMakeLists.txt
85−
86− sed -i "s,set(libdir.*$,SET(libdir $lib/lib),g" storage/mroonga/vendor/groonga/CMakeLists.txt
87− sed -i "s,set(includedir.*$,SET(includedir $lib/include),g" storage/mroonga/vendor/groonga/CMakeLists.txt
88− sed -i "/\"\$[{]CMAKE_INSTALL_PREFIX}\/\$[{]GRN_RELATIVE_PLUGINS_DIR}\"/d" storage/mroonga/vendor/groonga/CMakeLists.txt
89− sed -i "s,set(GRN_PLUGINS_DIR.*$,SET(GRN_PLUGINS_DIR $lib/\$\{GRN_RELATIVE_PLUGINS_DIR}),g" storage/mroonga/vendor/groonga/CMakeLists.txt
90− sed -i 's,[^"]*/var/log,/var/log,g' storage/mroonga/vendor/groonga/CMakeLists.txt
147+ postInstall = common.postInstall + ''
148+ rm -r "$out"/{mysql-test,sql-bench,data} # Don't need testing data
149+ rm "$out"/share/man/man1/mysql-test-run.pl.1
91150 '';
151+});
92152
93− postInstall = ''
94− substituteInPlace $out/bin/mysql_install_db \
95− --replace basedir=\"\" basedir=\"$out\"
96−
97− # Wrap mysqld with --basedir, but as last flag
98− wrapProgram $out/bin/mysqld
99− sed -i "s,\(^exec.*$\),\1 --basedir=$out,g" $out/bin/mysqld
100−
101− # Remove superfluous files
102− rm -r $out/mysql-test $out/sql-bench $out/data # Don't need testing data
103− rm $out/share/man/man1/mysql-test-run.pl.1
104− rm $out/bin/rcmysql # Not needed with nixos units
105− rm $out/bin/mysqlbug # Encodes a path to gcc and not really useful
106− find $out/bin -name \*test\* -exec rm {} \;
107−
108− # Separate libs and includes into their own derivation
109− mkdir -p $lib
110− mv $out/lib $lib
111− mv $out/include $lib
112−
113− # Fix the mysql_config
114− sed -i $out/bin/mysql_config \
115− -e 's,-lz,-L${zlib.out}/lib -lz,g' \
116− -e 's,-lssl,-L${openssl.out}/lib -lssl,g'
117−
118− # Add mysql_config to libs since configure scripts use it
119− mkdir -p $lib/bin
120− cp $out/bin/mysql_config $lib/bin
121− sed -i "/\(execdir\|bindir\)/ s,'[^\"']*',$lib/bin,g" $lib/bin/mysql_config
122−
123− # Make sure to propagate lib for compatability
124− mkdir -p $out/nix-support
125− echo "$lib" > $out/nix-support/propagated-native-build-inputs
126−
127− # Don't install static libraries.
128− rm $lib/lib/libmysqlclient.a $lib/lib/libmysqld.a
129− '';
130−
131− passthru.mysqlVersion = "5.6";
153+in mariadb
132154
133− meta = with stdenv.lib; {
134− description = "An enhanced, drop-in replacement for MySQL";
135− homepage = https://mariadb.org/;
136− license = stdenv.lib.licenses.gpl2;
137− maintainers = with stdenv.lib.maintainers; [ thoughtpolice wkennington ];
138− platforms = stdenv.lib.platforms.all;
139− };
140−}
pkgs/top-level/all-packages.nix+1−1
@@ -10438,7 +10438,7 @@ in
1043810438 };
1043910439
1044010440 mysql = mariadb;
10441− libmysql = mysql.lib;
10441+ libmysql = mysql.client; # `libmysql` is a slight misnomer ATM
1044210442
1044310443 mysql_jdbc = callPackage ../servers/sql/mysql/jdbc { };
1044410444