about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2015-02-04 02:35:13 -0500
committerJohn Wiegley <johnw@newartisans.com>2015-02-04 02:35:13 -0500
commit33ecb3438f517634aad913ef394e9103eb36dd61 (patch)
treebaef5f31a22125aa9a2df16ad31fd097952e7a14
parentcb91cf9ae3fb96280252d59d4fe05c5c168a2563 (diff)
parent58a891afb2bad24e843792d1bda4b70b0cefd708 (diff)
downloadnixlib-33ecb3438f517634aad913ef394e9103eb36dd61.tar
nixlib-33ecb3438f517634aad913ef394e9103eb36dd61.tar.gz
nixlib-33ecb3438f517634aad913ef394e9103eb36dd61.tar.bz2
nixlib-33ecb3438f517634aad913ef394e9103eb36dd61.tar.lz
nixlib-33ecb3438f517634aad913ef394e9103eb36dd61.tar.xz
nixlib-33ecb3438f517634aad913ef394e9103eb36dd61.tar.zst
nixlib-33ecb3438f517634aad913ef394e9103eb36dd61.zip
Merge pull request #6137 from gridaphobe/master
fix clucene on darwin
-rw-r--r--pkgs/development/libraries/clucene-core/2.x.nix1
-rw-r--r--pkgs/development/libraries/clucene-core/fix-darwin.patch75
2 files changed, 76 insertions, 0 deletions
diff --git a/pkgs/development/libraries/clucene-core/2.x.nix b/pkgs/development/libraries/clucene-core/2.x.nix
index 4173b75915cb..e348142f1d8c 100644
--- a/pkgs/development/libraries/clucene-core/2.x.nix
+++ b/pkgs/development/libraries/clucene-core/2.x.nix
@@ -18,6 +18,7 @@ stdenv.mkDerivation rec {
     [ ./Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
       ./Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
       ./Install-contribs-lib.patch
+      ./fix-darwin.patch
     ];
 
   postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
diff --git a/pkgs/development/libraries/clucene-core/fix-darwin.patch b/pkgs/development/libraries/clucene-core/fix-darwin.patch
new file mode 100644
index 000000000000..c06413f3c2e1
--- /dev/null
+++ b/pkgs/development/libraries/clucene-core/fix-darwin.patch
@@ -0,0 +1,75 @@
+--- a/src/shared/CLucene/LuceneThreads.h
++++ b/src/shared/CLucene/LuceneThreads.h
+@@ -7,6 +7,9 @@
+ #ifndef _LuceneThreads_h
+ #define  _LuceneThreads_h
+
++#if defined(_CL_HAVE_PTHREAD)
++	#include <pthread.h>
++#endif
+
+ CL_NS_DEF(util)
+ class CLuceneThreadIdCompare;
+
+--- a/src/shared/CLucene/config/repl_tchar.h
++++ b/src/shared/CLucene/config/repl_tchar.h
+@@ -28,26 +28,26 @@
+         #define _istdigit iswdigit //* digit char check
+         #define _totlower towlower //* convert char to lower case
+         #define _totupper towupper //* convert char to lower case
+-        #define _tcslwr wcslwr //* convert string to lower case
++        #define _tcslwr std::wcslwr //* convert string to lower case
+ 
+         //these are the string handling functions
+         //we may need to create wide-character/multi-byte replacements for these
+-        #define _tcscpy wcscpy //copy a string to another string
+-        #define _tcsncpy wcsncpy //copy a specified amount of one string to another string.
+-        #define _tcscat wcscat //copy a string onto the end of the other string
+-    		#define _tcsncat wcsncat
+-        #define _tcschr wcschr //find location of one character
+-        #define _tcsstr wcsstr //find location of a string
+-        #define _tcslen wcslen //get length of a string
+-        #define _tcscmp wcscmp //case sensitive compare two strings
+-        #define _tcsncmp wcsncmp //case sensitive compare two strings
+-        #define _tcscspn wcscspn //location of any of a set of character in a string
++        #define _tcscpy std::wcscpy //copy a string to another string
++        #define _tcsncpy std::wcsncpy //copy a specified amount of one string to another string.
++        #define _tcscat std::wcscat //copy a string onto the end of the other string
++    		#define _tcsncat std::wcsncat
++        #define _tcschr std::wcschr //find location of one character
++        #define _tcsstr std::wcsstr //find location of a string
++        #define _tcslen std::wcslen //get length of a string
++        #define _tcscmp std::wcscmp //case sensitive compare two strings
++        #define _tcsncmp std::wcsncmp //case sensitive compare two strings
++        #define _tcscspn std::wcscspn //location of any of a set of character in a string
+ 
+ 				//string compare
+         #ifdef _CL_HAVE_FUNCTION_WCSICMP
+-            #define _tcsicmp wcsicmp //* case insensitive compare two string
++            #define _tcsicmp std::wcsicmp //* case insensitive compare two string
+         #else
+-            #define _tcsicmp wcscasecmp //* case insensitive compare two string
++            #define _tcsicmp std::wcscasecmp //* case insensitive compare two string
+         #endif
+ 				#if defined(_CL_HAVE_FUNCTION_WCSDUP)
+ 			  	#define _tcsdup	wcsdup
+@@ -56,8 +56,8 @@
+ 			  #endif
+ 
+         //conversion functions
+-        #define _tcstod wcstod //convert a string to a double
+-        #define _tcstoi64 wcstoll //* convers a string to an 64bit bit integer
++        #define _tcstod std::wcstod //convert a string to a double
++        #define _tcstoi64 std::wcstoll //* convers a string to an 64bit bit integer
+         #define _itot _i64tot
+         #define _i64tot lltow //* converts a 64 bit integer to a string (with base)
+     #else //if defined(_ASCII)
+@@ -105,7 +105,7 @@
+     //some tchar headers miss these...
+     #ifndef _tcstoi64
+         #if defined(_UCS2)
+-        	#define _tcstoi64 wcstoll //* convers a string to an 64bit bit integer
++        	#define _tcstoi64 std::wcstoll //* convers a string to an 64bit bit integer
+         #else
+         	#define _tcstoi64 strtoll
+         #endif