tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
dspam: switch from mysql57 to mariadb-connector-c
Yorick van Pelt
3 years ago
44cbcce4
4a90d82f
+56
-3
2 changed files
expand all
collapse all
unified
split
pkgs
servers
mail
dspam
default.nix
mariadb.patch
+14
-3
pkgs/servers/mail/dspam/default.nix
···
1
{ stdenv, lib, fetchurl, makeWrapper
2
, gawk, gnused, gnugrep, coreutils, which
3
, perlPackages
4
-
, withMySQL ? false, zlib, mysql57
5
, withPgSQL ? false, postgresql
6
, withSQLite ? false, sqlite
7
, withDB ? false, db
···
25
url = "mirror://sourceforge/dspam/dspam/${pname}-${version}/${pname}-${version}.tar.gz";
26
sha256 = "1acklnxn1wvc7abn31l3qdj8q6k13s51k5gv86vka7q20jb5cxmf";
27
};
0
0
0
0
28
29
buildInputs = [ perlPackages.perl ]
30
-
++ lib.optionals withMySQL [ zlib mysql57.connector-c ]
31
++ lib.optional withPgSQL postgresql
32
++ lib.optional withSQLite sqlite
33
++ lib.optional withDB db;
34
nativeBuildInputs = [ makeWrapper ];
0
0
0
0
35
36
configureFlags = [
37
"--with-storage-driver=${drivers}"
···
50
"--enable-preferences-extension"
51
"--enable-long-usernames"
52
"--enable-external-lookup"
53
-
] ++ lib.optional withMySQL "--with-mysql-includes=${mysql57.connector-c}/include/mysql"
0
0
0
54
++ lib.optional withPgSQL "--with-pgsql-libraries=${postgresql.lib}/lib";
55
56
# Workaround build failure on -fno-common toolchains like upstream
···
1
{ stdenv, lib, fetchurl, makeWrapper
2
, gawk, gnused, gnugrep, coreutils, which
3
, perlPackages
4
+
, withMySQL ? false, zlib, mariadb-connector-c
5
, withPgSQL ? false, postgresql
6
, withSQLite ? false, sqlite
7
, withDB ? false, db
···
25
url = "mirror://sourceforge/dspam/dspam/${pname}-${version}/${pname}-${version}.tar.gz";
26
sha256 = "1acklnxn1wvc7abn31l3qdj8q6k13s51k5gv86vka7q20jb5cxmf";
27
};
28
+
patches = [
29
+
# https://gist.github.com/WhiteAnthrax/613136c76882e0ead3cb3bdad6b3d551
30
+
./mariadb.patch
31
+
];
32
33
buildInputs = [ perlPackages.perl ]
34
+
++ lib.optionals withMySQL [ zlib mariadb-connector-c.out ]
35
++ lib.optional withPgSQL postgresql
36
++ lib.optional withSQLite sqlite
37
++ lib.optional withDB db;
38
nativeBuildInputs = [ makeWrapper ];
39
+
# patch out libmysql >= 5 check, since mariadb-connector is at 3.x
40
+
postPatch = ''
41
+
sed -i 's/atoi(m) >= 5/1/g' configure m4/mysql_drv.m4
42
+
'';
43
44
configureFlags = [
45
"--with-storage-driver=${drivers}"
···
58
"--enable-preferences-extension"
59
"--enable-long-usernames"
60
"--enable-external-lookup"
61
+
] ++ lib.optionals withMySQL [
62
+
"--with-mysql-includes=${mariadb-connector-c.dev}/include/mysql"
63
+
"--with-mysql-libraries=${mariadb-connector-c.out}/lib/mysql"
64
+
]
65
++ lib.optional withPgSQL "--with-pgsql-libraries=${postgresql.lib}/lib";
66
67
# Workaround build failure on -fno-common toolchains like upstream
+42
pkgs/servers/mail/dspam/mariadb.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
diff -ur dspam-3.10.2.orig/configure dspam-3.10.2/configure
2
+
--- dspam-3.10.2.orig/configure 2012-04-24 02:53:49.000000000 +0900
3
+
+++ dspam-3.10.2/configure 2019-05-24 01:59:06.557890494 +0900
4
+
@@ -13280,7 +13280,7 @@
5
+
#include <mysql.h>
6
+
#include <mysqld_error.h>
7
+
#include <errmsg.h>
8
+
- #if defined(PROTOCOL_VERSION) && defined(ER_LOCK_DEADLOCK) && defined(ER_LOCK_WAIT_TIMEOUT) && defined(ER_LOCK_OR_ACTIVE_TRANSACTION) && defined(CR_ERROR_FIRST)
9
+
+ #if defined(PROTOCOL_VERSION) && defined(ER_LOCK_DEADLOCK) && defined(ER_LOCK_WAIT_TIMEOUT) && defined(ER_LOCK_OR_ACTIVE_TRANSACTION) && defined(CR_MIN_ERROR)
10
+
/* Success */
11
+
#else
12
+
#error Unsupported version of MySQL
13
+
@@ -13293,7 +13293,7 @@
14
+
15
+
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16
+
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
17
+
-as_fn_error $? "Unsupported version of MySQL (no PROTOCOL_VERSION or ER_LOCK_DEADLOCK or ER_LOCK_WAIT_TIMEOUT or ER_LOCK_OR_ACTIVE_TRANSACTION or CR_ERROR_FIRST defined)
18
+
+as_fn_error $? "Unsupported version of MySQL (no PROTOCOL_VERSION or ER_LOCK_DEADLOCK or ER_LOCK_WAIT_TIMEOUT or ER_LOCK_OR_ACTIVE_TRANSACTION or CR_MIN_ERROR defined)
19
+
See \`config.log' for more details" "$LINENO" 5; }
20
+
mysql_headers_success=no
21
+
22
+
diff -ur dspam-3.10.2.orig/m4/mysql_drv.m4 dspam-3.10.2/m4/mysql_drv.m4
23
+
--- dspam-3.10.2.orig/m4/mysql_drv.m4 2011-08-17 07:38:30.000000000 +0900
24
+
+++ dspam-3.10.2/m4/mysql_drv.m4 2019-05-24 02:00:08.301217506 +0900
25
+
@@ -80,7 +80,7 @@
26
+
#include <mysql.h>
27
+
#include <mysqld_error.h>
28
+
#include <errmsg.h>
29
+
- #if defined(PROTOCOL_VERSION) && defined(ER_LOCK_DEADLOCK) && defined(ER_LOCK_WAIT_TIMEOUT) && defined(ER_LOCK_OR_ACTIVE_TRANSACTION) && defined(CR_ERROR_FIRST)
30
+
+ #if defined(PROTOCOL_VERSION) && defined(ER_LOCK_DEADLOCK) && defined(ER_LOCK_WAIT_TIMEOUT) && defined(ER_LOCK_OR_ACTIVE_TRANSACTION) && defined(CR_MIN_ERROR)
31
+
/* Success */
32
+
#else
33
+
#error Unsupported version of MySQL
34
+
@@ -88,7 +88,7 @@
35
+
]])],
36
+
[],
37
+
[
38
+
- AC_MSG_FAILURE([Unsupported version of MySQL (no PROTOCOL_VERSION or ER_LOCK_DEADLOCK or ER_LOCK_WAIT_TIMEOUT or ER_LOCK_OR_ACTIVE_TRANSACTION or CR_ERROR_FIRST defined)])
39
+
+ AC_MSG_FAILURE([Unsupported version of MySQL (no PROTOCOL_VERSION or ER_LOCK_DEADLOCK or ER_LOCK_WAIT_TIMEOUT or ER_LOCK_OR_ACTIVE_TRANSACTION or CR_MIN_ERROR defined)])
40
+
mysql_headers_success=no
41
+
])
42
+
fi