summaryrefslogtreecommitdiff
path: root/databases/mysql56-client/Makefile.common
blob: 7c95204332510176dec5930c2f5a69551b1838c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# $NetBSD: Makefile.common,v 1.4 2013/04/20 08:06:01 adam Exp $
#
# used by databases/mysql56-client/Makefile
# used by databases/mysql56-server/Makefile

DISTNAME=	mysql-5.6.11
CATEGORIES=	databases
MASTER_SITES=	${MASTER_SITE_MYSQL:=MySQL-5.6/}

MAINTAINER?=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.mysql.com/
LICENSE=	gnu-gpl-v2

DISTINFO_FILE?=		${.CURDIR}/../../databases/mysql56-client/distinfo
PATCHDIR?=		${.CURDIR}/../../databases/mysql56-client/patches

USE_CMAKE=		yes
USE_GNU_READLINE=	yes
USE_LANGUAGES=		c c++
USE_TOOLS+=		bash gmake perl:run

.include "../../mk/bsd.prefs.mk"

.include "options.mk"

# MYSQL_USER		username of the database administrator
# MYSQL_GROUP		group of the database administrator
# MYSQL_DATADIR		home directory (location of the databases)
# MYSQL_CHARSET		default character set
# MYSQL_EXTRA_CHARSET	additional character set to be compiled in
MYSQL_USER?=		mysql
MYSQL_GROUP?=		mysql
MYSQL_DATADIR?=		${VARBASE}/mysql
MYSQL_CHARSET?=		latin1
MYSQL_COLLATION?=	latin1_swedish_ci
MYSQL_EXTRA_CHARSET?=	all

PKG_USERS_VARS+=	MYSQL_USER
PKG_GROUPS_VARS+=	MYSQL_GROUP

CONFIG_SHELL=		${TOOLS_PATH.bash}

.if ${OPSYS} == "IRIX"
CFLAGS+=		-DIRIX5 -DNEEDS_BSTRING_H
.endif

BUILD_DEFS+=		VARBASE

# paths
CMAKE_ARGS+=		-DINSTALL_DOCDIR="share/doc/mysql"
CMAKE_ARGS+=		-DINSTALL_DOCREADMEDIR="share/doc/mysql"
CMAKE_ARGS+=		-DINSTALL_INCLUDEDIR="include/mysql"
CMAKE_ARGS+=		-DINSTALL_INFODIR="info"
CMAKE_ARGS+=		-DINSTALL_MANDIR="${PKGMANDIR}"
CMAKE_ARGS+=		-DINSTALL_MYSQLSHAREDIR="share/mysql"
CMAKE_ARGS+=		-DINSTALL_MYSQLTESTDIR="share/mysql/test"
CMAKE_ARGS+=		-DINSTALL_PLUGINDIR="lib/mysql/plugin"
CMAKE_ARGS+=		-DINSTALL_SBINDIR="sbin"
CMAKE_ARGS+=		-DINSTALL_SCRIPTDIR="bin"
CMAKE_ARGS+=		-DINSTALL_SQLBENCHDIR="share/mysql/sql-bench"
CMAKE_ARGS+=		-DINSTALL_SUPPORTFILESDIR="share/mysql"
CMAKE_ARGS+=		-DMYSQL_DATADIR=${MYSQL_DATADIR}

# always use our own readline, not MySQL bundled one
CMAKE_ARGS+=		-DWITH_LIBEDIT=OFF
CMAKE_ARGS+=		-DUSE_NEW_READLINE_INTERFACE=ON
CMAKE_ARGS+=		-DREADLINE_LIBRARY=readline
CMAKE_ARGS+=		-DWITH_ZLIB="system"
CMAKE_ARGS+=		-DDEFAULT_CHARSET=${MYSQL_CHARSET:Q}
CMAKE_ARGS+=		-DDEFAULT_COLLATION=${MYSQL_COLLATION:Q}
CMAKE_ARGS+=		-DWITH_EXTRA_CHARSETS=${MYSQL_EXTRA_CHARSET:Q}
BROKEN_READLINE_DETECTION=	yes # At least on RHEL 5.6

# MySQL 5 depends on builtin functions enabled with i486 and later with GCC.
.if ${OPSYS} == "NetBSD" && !empty(MACHINE_ARCH:Mi386)
GNU_ARCH.i386=		i486
CFLAGS+=		-march=i486
.endif

# Ensure the correct DTrace ABI is used.
.if !empty(ABI)
CMAKE_ARGS+=		-DDTRACE_FLAGS="-${ABI}"
.endif

CPPFLAGS+=		-Dunix
CFLAGS+=		-DUSE_OLD_FUNCTIONS # 3.23.x compat
CFLAGS+=		-D__STDC_FORMAT_MACROS=1 # always defined too late

.if ${OPSYS} != "Interix"
CFLAGS+=		-fPIC -DPIC
CXXFLAGS+=		-fPIC -DPIC
.endif

# force HAVE_CURSES_H on Solaris since the configure script is broken
# and does not properly detect this, breaking the build later on.
.if ${OPSYS} == "SunOS"
CFLAGS+=		-DHAVE_CURSES_H
CXXFLAGS+=		-DHAVE_CURSES_H
.endif

.include "../../mk/pthread.buildlink3.mk"

.if defined(PTHREAD_TYPE) && (${PTHREAD_TYPE} == "pth")
CFLAGS+=		-DSIGNALS_DONT_BREAK_READ
CXXFLAGS+=		-DSIGNALS_DONT_BREAK_READ
.endif

LDFLAGS+=		${COMPILER_RPATH_FLAG}${PREFIX}/lib/mysql

SUBST_CLASSES+=		scr
SUBST_STAGE.scr=	pre-configure
SUBST_FILES.scr=	scripts/mysql_install_db.sh scripts/mysqld_safe.sh \
			scripts/mysql_secure_installation.sh \
			support-files/mysql.server.sh
SUBST_SED.scr=		-e "s,chown,${CHOWN},g"
SUBST_SED.scr+=		-e "s,/bin/sh,${RCD_SCRIPTS_SHELL},g"
SUBST_MESSAGE.scr=	Fixing scripts.

.include "../../devel/zlib/buildlink3.mk"