aboutsummaryrefslogtreecommitdiffstats
path: root/databases
diff options
context:
space:
mode:
authoramdmi3 <amdmi3@FreeBSD.org>2014-11-29 08:37:59 +0800
committeramdmi3 <amdmi3@FreeBSD.org>2014-11-29 08:37:59 +0800
commitcb26c3d1c02a60d0d1eee151c24325834db64aa3 (patch)
tree93646ac3983269e907c9610836284be0a69e4ec9 /databases
parente0f300aaaa12e577c4e1b4cabe9367acfbafb49c (diff)
downloadfreebsd-ports-gnome-cb26c3d1c02a60d0d1eee151c24325834db64aa3.tar.gz
freebsd-ports-gnome-cb26c3d1c02a60d0d1eee151c24325834db64aa3.tar.zst
freebsd-ports-gnome-cb26c3d1c02a60d0d1eee151c24325834db64aa3.zip
- Bump PORTREVISION
- Add USE_GCC=yes, fix mysql signal 11 crash - Remove dependency on net/asio, use asio from devel/boost-libs - Remove GARB option (linker problem - upstream notified) - Fix errnos warnings - Fix problem with 'ar' and pass RPATH properly PR: 195457 Submitted by: amdmi3 (but all changes by maintainer) Approved by: horia@racoviceanu.com (maintainer)
Diffstat (limited to 'databases')
-rw-r--r--databases/galera/Makefile59
-rw-r--r--databases/galera/files/garb.in94
-rw-r--r--databases/galera/files/patch-SConstruct21
-rw-r--r--databases/galera/files/patch-galerautils__src__gu_errno.h47
4 files changed, 96 insertions, 125 deletions
diff --git a/databases/galera/Makefile b/databases/galera/Makefile
index 374dd89469db..6bc796a1e1ff 100644
--- a/databases/galera/Makefile
+++ b/databases/galera/Makefile
@@ -4,7 +4,7 @@
PORTNAME= galera
PORTVERSION= 25.3.5
DISTVERSIONSUFFIX= -src
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= databases
MASTER_SITES= https://launchpadlibrarian.net/170877450/
@@ -21,15 +21,16 @@ LIB_DEPENDS= libboost_date_time.so:${PORTSDIR}/devel/boost-libs
USES= execinfo python:build scons shebangfix
USE_CXXSTD= c++11
+USE_GCC= yes
USE_LDCONFIG= yes
USE_OPENSSL= yes
+LDFLAGS+= -lboost_program_options -lboost_system
MAKE_CMD= ${SCONS} -j${MAKE_JOBS_NUMBER} --config=force
SHEBANG_FILES= docs/sphinx-*
-PLIST_FILES= %%GARB%%bin/garbd \
- lib/libgalera_smm.so \
+PLIST_FILES= lib/libgalera_smm.so \
lib/libgalera.so
PORTDOCS= *
@@ -51,31 +52,18 @@ DOCSRCDIR5= ${DOCSRCDIR1}/gcs
DOCSDIR5= ${DOCSDIR}/gcs
DOC_FILES5= ChangeLog README doc/*.txt doc/*.odt doc/*.png
-OPTIONS_DEFINE= BOOSTPOOL BPOSTATIC DEBUG DOCS GARB TEST
+OPTIONS_DEFINE= BOOSTPOOL BPOSTATIC DEBUG DOCS TEST
OPTIONS_GROUP= DOCS
OPTIONS_GROUP_DOCS= EPUB JSON LATEX PICKLE
-OPTIONS_DEFAULT=GARB
OPTIONS_SUB= yes
BOOSTPOOL_DESC= Use boost pool allocator
BPOSTATIC_DESC= Use static boost_program_options
EPUB_DESC= EPUB support
PICKLE_DESC= Pickle support
-GARB_DESC= Galera Arbitrator
-
-GARB_USE= RC_SUBR=garb
.include <bsd.port.pre.mk>
-.if ${OSVERSION} > 1000000
-BUILD_DEPENDS+= asio>=0:${PORTSDIR}/net/asio
-RUN_DEPENDS+= asio>=0:${PORTSDIR}/net/asio
-SUB_LIST= LD_LIBRARY_PATH=$$LD_LIBRARY_PATH
-.else
-USE_GCC= yes
-SUB_LIST= LD_LIBRARY_PATH=${LOCALBASE}/lib/${CC}:$$LD_LIBRARY_PATH
-.endif
-
.if ${OSVERSION} < 900506
IGNORE= need __WORDSIZE found in FreeBSD 9
.endif
@@ -93,19 +81,33 @@ MAKE_CMD+= debug=3
.endif
post-patch:
- @${REINPLACE_CMD} -e '/-Werror/d' ${WRKSRC}/SConstruct
-
-.if ${OSVERSION} > 1000000
- @${REINPLACE_CMD} -e '/#\/asio/d' ${WRKSRC}/SConstruct
+ @${REINPLACE_CMD} -e "/-Werror/d; \
+ s|LINKFLAGS = link_arch|& + ' ' + os.environ['LDFLAGS']|" \
+ ${WRKSRC}/SConstruct
+ @${REINPLACE_CMD} -e '/#\/asio/d; s|asio.hpp|boost/&|; \
+ s|asio/ssl.hpp|boost/&|' ${WRKSRC}/SConstruct
+ @${REINPLACE_CMD} -e 's|asio.hpp|boost/&|; s|asio/ssl.hpp|boost/&|' \
+ ${WRKSRC}/galera/src/ist.hpp \
+ ${WRKSRC}/gcomm/src/asio_protonet.hpp
+ @${REINPLACE_CMD} -e 's|asio::system_error|::boost::system::system_error|g' \
+ ${WRKSRC}/galera/src/ist.cpp \
+ ${WRKSRC}/gcomm/src/asio_tcp.cpp \
+ ${WRKSRC}/gcomm/src/asio_udp.cpp
+ @${REINPLACE_CMD} -e 's|asio::error_code|::boost::system::error_code|g' \
+ ${WRKSRC}/gcomm/src/asio_protonet.*pp \
+ ${WRKSRC}/gcomm/src/asio_tcp.*pp \
+ ${WRKSRC}/gcomm/src/asio_udp.*pp
+ @${REINPLACE_CMD} -e 's|asio::|boost::&|g' \
+ ${WRKSRC}/galera/src/ist.*pp \
+ ${WRKSRC}/galera/src/ist_proto.hpp \
+ ${WRKSRC}/gcomm/src/asio_addr.hpp \
+ ${WRKSRC}/gcomm/src/asio_protonet.*pp \
+ ${WRKSRC}/gcomm/src/asio_tcp.*pp \
+ ${WRKSRC}/gcomm/src/asio_udp.*pp
@${REINPLACE_CMD} -e 's|LLONG_MAX|gu::LOG_MAX|' \
${WRKSRC}/galera/src/monitor.hpp
-.endif
-
-.if ! ${PORT_OPTIONS:MGARB}
@${REINPLACE_CMD} -e "s|'galera/SConscript',|'galera/SConscript'])|; \
/'garb\/SConscript'])/d" ${WRKSRC}/SConscript
-.endif
-
@${REINPLACE_CMD} -e "s|'tests', 1|'tests', 0|" ${WRKSRC}/SConstruct
.if ! ${PORT_OPTIONS:MTEST}
@@ -189,11 +191,6 @@ do-install:
@(cd ${STAGEDIR}${PREFIX}/lib && ${LN} -sf libgalera_smm.so \
libgalera.so)
-.if ${PORT_OPTIONS:MGARB}
- ${INSTALL_PROGRAM} ${WRKDIR}/${DISTNAME}/garb/garbd \
- ${STAGEDIR}${PREFIX}/bin/
-.endif
-
@(cd ${WRKSRC}/docs/build/man/man1 && ${INSTALL_MAN} \
${PORTNAME}.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/)
@(cd ${WRKSRC}/docs/build/man/man3 && ${RM} _*.3 && ${INSTALL_MAN} \
diff --git a/databases/galera/files/garb.in b/databases/galera/files/garb.in
deleted file mode 100644
index 11aa9ed031d6..000000000000
--- a/databases/galera/files/garb.in
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/bin/sh
-#
-# garb.sh for rc.d usage (c) 2013 Codership Oy
-# $Id$
-
-# PROVIDE: garb
-# REQUIRE: LOGIN
-# KEYWORD: shutdown
-
-#
-# Add the following line to /etc/rc.conf to enable Galera Arbitrator Daemon (garbd):
-# garb_enable (bool): Set to "NO" by default.
-# Set it to "YES" to enable Galera Arbitrator Daemon.
-# garb_galera_nodes (str): A space-separated list of node addresses (address[:port]) in the cluster
-# (default empty).
-# garb_galera_group (str): Galera cluster name, should be the same as on the rest of the nodes.
-# (default empty).
-# Optional:
-# garb_galera_options (str): Optional Galera internal options string (e.g. SSL settings)
-# see http://www.codership.com/wiki/doku.php?id=galera_parameters
-# (default empty).
-# garb_log_file (str): Log file for garbd (default empty). Optional, by default logs to syslog
-# garb_pid_file (str): Custum PID file path and name.
-# Default to "/var/run/garb.pid".
-#
-
-. /etc/rc.subr
-
-name="garb"
-rcvar=garb_enable
-
-load_rc_config $name
-
-# set defaults
-: ${garb_enable="NO"}
-: ${garb_galera_nodes=""}
-: ${garb_galera_group=""}
-: ${garb_galera_options=""}
-: ${garb_log_file=""}
-: ${garb_pid_file="/var/run/garb.pid"}
-
-procname="%%PREFIX%%/bin/garbd"
-command="/usr/sbin/daemon"
-command_args="-c -f -u nobody -p $garb_pid_file $procname"
-start_precmd="${name}_prestart"
-start_postcmd="${name}_poststart"
-stop_precmd="${name}_prestop"
-export LD_LIBRARY_PATH=%%LD_LIBRARY_PATH%%
-
-garb_prestart()
-{
- [ "$(id -ur)" != "0" ] && err 4 "root rights are required to start $name"
- [ -r "$garb_pid_file" ] && err 0 "$procname is already running with PID $(cat $garb_pid_file)"
- [ -x "$procname" ] || err 5 "$procname is not found"
-
- # check that node addresses are configured
- [ -z "$garb_galera_nodes" ] && err 6 "List of garb_galera_nodes is not configured"
- [ -z "$garb_galera_group" ] && err 6 "garb_galera_group name is not configured"
-
- GALERA_PORT=${GALERA_PORT:-4567}
-
- # Find a working node
- for ADDRESS in ${garb_galera_nodes} 0; do
- HOST=$(echo $ADDRESS | cut -d \: -f 1)
- PORT=$(echo $ADDRESS | cut -d \: -f 2)
- PORT=${PORT:-$GALERA_PORT}
- nc -z $HOST $PORT >/dev/null 2>&1 && break
- done
- [ ${ADDRESS} == "0" ] && err 1 "None of the nodes in $garb_galera_nodes is accessible"
-
- command_args="$command_args -a gcomm://$ADDRESS"
- [ -n "$garb_galera_group" ] && command_args="$command_args -g $garb_galera_group"
- [ -n "$garb_galera_options" ] && command_args="$command_args -o $garb_galera_options"
- [ -n "$garb_log_file" ] && command_args="$command_args -l $garb_log_file"
- return 0
-}
-
-garb_poststart()
-{
- local timeout=15
- while [ ! -f "$garb_pid_file" -a $timeout -gt 0 ]; do
- timeout=$(( timeout - 1 ))
- sleep 1
- done
- return 0
-}
-
-garb_prestop() {
- [ "$(id -ur)" != "0" ] && err 4 "root rights are required to stop $name"
- [ -r $garb_pid_file ] || err 0 ""
- return 0
-}
-
-run_rc_command "$1"
diff --git a/databases/galera/files/patch-SConstruct b/databases/galera/files/patch-SConstruct
new file mode 100644
index 000000000000..34bdde0e697d
--- /dev/null
+++ b/databases/galera/files/patch-SConstruct
@@ -0,0 +1,21 @@
+--- ./SConstruct.orig 2014-08-01 16:33:09.000000000 -0400
++++ ./SConstruct 2014-08-01 16:34:45.000000000 -0400
+@@ -153,7 +153,7 @@
+
+ # Initialize CPPFLAGS and LIBPATH from environment to get user preferences
+ env.Replace(CPPFLAGS = os.getenv('CPPFLAGS', ''))
+-env.Replace(LIBPATH = [os.getenv('LIBPATH', '')])
++env.Replace(RPATH = [os.getenv('RPATH', '')])
+
+ # Set -pthread flag explicitly to make sure that pthreads are
+ # enabled on all platforms.
+@@ -165,6 +165,9 @@
+ env.Append(CPPFLAGS = ' -I/usr/local/include ')
+ if sysname == 'sunos':
+ env.Replace(SHLINKFLAGS = '-shared ')
++ env.Replace(AR = 'ar')
++ env.Replace(ARFLAGS= 'r')
++ env.Replace(ARCOM = '$AR $ARFLAGS $TARGET $SOURCES')
+
+ # Add paths is extra_sysroot argument was specified
+ extra_sysroot = ARGUMENTS.get('extra_sysroot', '')
diff --git a/databases/galera/files/patch-galerautils__src__gu_errno.h b/databases/galera/files/patch-galerautils__src__gu_errno.h
new file mode 100644
index 000000000000..960205de5c84
--- /dev/null
+++ b/databases/galera/files/patch-galerautils__src__gu_errno.h
@@ -0,0 +1,47 @@
+--- ./galerautils/src/gu_errno.h.orig 2014-07-31 17:55:31.000000000 -0400
++++ ./galerautils/src/gu_errno.h 2014-07-31 17:56:57.000000000 -0400
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (C) 2013 Codership Oy <info@codership.com>
++ * Copyright (C) 2014 Codership Oy <info@codership.com>
+ */
+
+ #ifndef GU_ERRNO_H
+@@ -8,14 +8,29 @@
+ #include <errno.h>
+
+ #if defined(__APPLE__) || defined(__FreeBSD__)
+-# define EBADFD (ELAST+1) /* the largest errno + 1 */
+-# define EREMCHG (ELAST+2)
+-# define ENOTUNIQ (ELAST+3)
+-# define ERESTART (ELAST+4)
+-# if defined(__FreeBSD__)
+-# define ENOTRECOVERABLE (ELAST+5)
+-# define ENODATA (ELAST+6)
+-# endif
++# define GU_ELAST ELAST
++#else
++/* must be high enough to not collide with system errnos but lower than 256 */
++# define GU_ELAST 200
++#endif
++
++#ifndef EBADFD
++# define EBADFD (GU_ELAST+1)
++#endif
++#ifndef EREMCHG
++# define EREMCHG (GU_ELAST+2)
++#endif
++#ifndef ENOTUNIQ
++# define ENOTUNIQ (GU_ELAST+3)
++#endif
++#ifndef ERESTART
++# define ERESTART (GU_ELAST+4)
++#endif
++#ifndef ENOTRECOVERABLE
++# define ENOTRECOVERABLE (GU_ELAST+5)
++#endif
++#ifndef ENODATA
++# define ENODATA (GU_ELAST+6)
+ #endif
+
+ #endif /* GU_STR_H */