svn commit: r307941 - in head/textproc/sphinxsearch: . files
Matthew Seaman
matthew at FreeBSD.org
Wed Nov 28 21:51:55 UTC 2012
Author: matthew
Date: Wed Nov 28 21:51:55 2012
New Revision: 307941
URL: http://svnweb.freebsd.org/changeset/ports/307941
Log:
Update to 2.0.6 release (1)
- trim Makefile headers
- remove files/patch-configure as it has been incorporated upstream
- Import a FreeBSD specific fix for shared mutex suppport from the
project SVN repo (2):
https://code.google.com/p/sphinxsearch/source/detail?r=3519
Feature safe: yes
Submitted by: (1) Portscout
(2) Denis <devzone.my at gmail.com>
Added:
head/textproc/sphinxsearch/files/patch-src__sphinxstd.cpp (contents, props changed)
head/textproc/sphinxsearch/files/patch-src__sphinxstd.h (contents, props changed)
Deleted:
head/textproc/sphinxsearch/files/patch-configure
Modified:
head/textproc/sphinxsearch/Makefile (contents, props changed)
head/textproc/sphinxsearch/distinfo (contents, props changed)
Modified: head/textproc/sphinxsearch/Makefile
==============================================================================
--- head/textproc/sphinxsearch/Makefile Wed Nov 28 21:46:10 2012 (r307940)
+++ head/textproc/sphinxsearch/Makefile Wed Nov 28 21:51:55 2012 (r307941)
@@ -1,7 +1,4 @@
-# New ports collection makefile for: Sphinx full-text search engine
-# Date created: 12 November 2006
-# Whom: Matthew Seaman <m.seaman at infracaninophile.co.uk>
-#
+# Created by: Matthew Seaman
# $FreeBSD$
#
# Note: the Sphinx Storage Engine MySQL plugin is not supported by
@@ -9,7 +6,7 @@
# See http://www.infracaninophile.co.uk/articles/sphinxse.html
PORTNAME= sphinxsearch
-PORTVERSION= 2.0.5
+PORTVERSION= 2.0.6
CATEGORIES= textproc databases
MASTER_SITES= http://sphinxsearch.com/files/
DISTNAME= sphinx-${PORTVERSION}-release
Modified: head/textproc/sphinxsearch/distinfo
==============================================================================
--- head/textproc/sphinxsearch/distinfo Wed Nov 28 21:46:10 2012 (r307940)
+++ head/textproc/sphinxsearch/distinfo Wed Nov 28 21:51:55 2012 (r307941)
@@ -1,4 +1,4 @@
-SHA256 (sphinx-2.0.5-release.tar.gz) = 45d89b9112cf52adb2a7289df3b6f4d37371bad8f892b9da4b75b574c7e6ba90
-SIZE (sphinx-2.0.5-release.tar.gz) = 1959258
+SHA256 (sphinx-2.0.6-release.tar.gz) = de943c397efda706661b3a12e12e9f8cc8a03bf6c02c5a6ba967a06384feede2
+SIZE (sphinx-2.0.6-release.tar.gz) = 1972728
SHA256 (libstemmer_c.tgz) = 19f1ef2a7ee03246f10dd963bcaa5a401a10b7f85f7488415e309e5dbe9f4cf9
SIZE (libstemmer_c.tgz) = 129520
Added: head/textproc/sphinxsearch/files/patch-src__sphinxstd.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/textproc/sphinxsearch/files/patch-src__sphinxstd.cpp Wed Nov 28 21:51:55 2012 (r307941)
@@ -0,0 +1,107 @@
+--- ./src/sphinxstd.cpp.orig 2012-11-28 21:23:23.177922214 +0000
++++ ./src/sphinxstd.cpp 2012-11-28 21:23:34.961920201 +0000
+@@ -1,5 +1,5 @@
+ //
+-// $Id: sphinxstd.cpp 3445 2012-10-12 10:45:41Z kevg $
++// $Id$
+ //
+
+ //
+@@ -737,6 +737,24 @@
+ {
+ m_pMutex = NULL;
+
++#ifdef __FreeBSD__
++ CSphString sError, sWarning;
++ if ( !m_pStorage.Alloc ( sizeof(sem_t) + iExtraSize, sError, sWarning ) )
++ {
++ m_sError.SetSprintf ( "storage.alloc, error='%s', warning='%s'", sError.cstr(), sWarning.cstr() );
++ return;
++ }
++
++ m_pMutex = (sem_t*) m_pStorage.GetWritePtr ();
++ int iRes = sem_init ( m_pMutex, 1, 1 );
++ if ( iRes )
++ {
++ m_sError.SetSprintf ( "sem_init, errno=%d ", iRes );
++ m_pMutex = NULL;
++ m_pStorage.Reset ();
++ return;
++ }
++#else
+ pthread_mutexattr_t tAttr;
+ int iRes = pthread_mutexattr_init ( &tAttr );
+ if ( iRes )
+@@ -767,6 +785,7 @@
+ m_pStorage.Reset ();
+ return;
+ }
++#endif // __FreeBSD__
+ }
+ #else
+ CSphProcessSharedMutex::CSphProcessSharedMutex ( int )
+@@ -777,18 +796,28 @@
+ void CSphProcessSharedMutex::Lock () const
+ {
+ #if !USE_WINDOWS
++#ifdef __FreeBSD__
++ if ( m_pMutex )
++ sem_wait ( m_pMutex );
++#else
+ if ( m_pMutex )
+ pthread_mutex_lock ( m_pMutex );
+ #endif
++#endif
+ }
+
+
+ void CSphProcessSharedMutex::Unlock () const
+ {
+ #if !USE_WINDOWS
++#ifdef __FreeBSD__
++ if ( m_pMutex )
++ sem_post ( m_pMutex );
++#else
+ if ( m_pMutex )
+ pthread_mutex_unlock ( m_pMutex );
+ #endif
++#endif
+ }
+
+
+@@ -802,6 +831,20 @@
+ if ( !m_pMutex )
+ return false;
+
++#ifdef __FreeBSD__
++ struct timespec tp;
++ clock_gettime ( CLOCK_REALTIME, &tp );
++
++ tp.tv_nsec += tmSpin * 1000;
++ if ( tp.tv_nsec > 1000000 )
++ {
++ int iDelta = (int)( tp.tv_nsec / 1000000 );
++ tp.tv_sec += iDelta * 1000000;
++ tp.tv_nsec -= iDelta * 1000000;
++ }
++
++ return ( sem_timedwait ( m_pMutex, &tp )==0 );
++#else
+ #if defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) && defined(HAVE_CLOCK_GETTIME)
+ struct timespec tp;
+ clock_gettime ( CLOCK_REALTIME, &tp );
+@@ -830,6 +873,7 @@
+
+ return iRes==0;
+ #endif // HAVE_PTHREAD_MUTEX_TIMEDLOCK && HAVE_CLOCK_GETTIME
++#endif // __FreeBSD__
+ #endif // USE_WINDOWS
+ }
+
+@@ -1338,5 +1382,5 @@
+ #endif
+
+ //
+-// $Id: sphinxstd.cpp 3445 2012-10-12 10:45:41Z kevg $
++// $Id$
+ //
Added: head/textproc/sphinxsearch/files/patch-src__sphinxstd.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/textproc/sphinxsearch/files/patch-src__sphinxstd.h Wed Nov 28 21:51:55 2012 (r307941)
@@ -0,0 +1,50 @@
+--- ./src/sphinxstd.h.orig 2012-11-28 21:23:17.008920478 +0000
++++ ./src/sphinxstd.h 2012-11-28 21:23:38.979912416 +0000
+@@ -1,5 +1,5 @@
+ //
+-// $Id: sphinxstd.h 3461 2012-10-19 09:48:07Z kevg $
++// $Id$
+ //
+
+ //
+@@ -62,6 +62,9 @@
+ #include <sys/mman.h>
+ #include <errno.h>
+ #include <pthread.h>
++#ifdef __FreeBSD__
++#include <semaphore.h>
++#endif
+ #endif
+
+ /////////////////////////////////////////////////////////////////////////////
+@@ -2032,7 +2035,11 @@
+ protected:
+ #if !USE_WINDOWS
+ CSphSharedBuffer<BYTE> m_pStorage;
++#ifdef __FreeBSD__
++ sem_t * m_pMutex;
++#else
+ pthread_mutex_t * m_pMutex;
++#endif
+ CSphString m_sError;
+ #endif
+ };
+@@ -2050,7 +2057,11 @@
+ {
+ if ( m_pMutex )
+ {
++#ifdef __FreeBSD__
++ m_pValue = reinterpret_cast<T*> ( m_pStorage.GetWritePtr () + sizeof ( sem_t ) );
++#else
+ m_pValue = reinterpret_cast<T*> ( m_pStorage.GetWritePtr () + sizeof ( pthread_mutex_t ) );
++#endif
+ *m_pValue = tInitValue;
+ }
+ }
+@@ -2478,5 +2489,5 @@
+ #endif // _sphinxstd_
+
+ //
+-// $Id: sphinxstd.h 3461 2012-10-19 09:48:07Z kevg $
++// $Id$
+ //
More information about the svn-ports-all
mailing list