]> git.pld-linux.org Git - packages/RegexKit.git/blame - RegexKit-Linux.patch
- optflags missing
[packages/RegexKit.git] / RegexKit-Linux.patch
CommitLineData
71304ae6 1diff -Nur RegexKit_0.6.0_source.orig/GNUstep/GNUmakefile RegexKit_0.6.0_source.Linux/GNUstep/GNUmakefile
2--- RegexKit_0.6.0_source.orig/GNUstep/GNUmakefile 2008-01-23 15:32:38.000000000 -0700
3+++ RegexKit_0.6.0_source.Linux/GNUstep/GNUmakefile 2008-02-02 20:42:50.000000000 -0700
4@@ -11,14 +11,6 @@
5
6 PCRE_LIBS = $(shell pcre-config --libs)
7 PCRE_CFLAGS = $(shell pcre-config --cflags)
8-PCRE_HEADER = $(shell perl -e '$$x = "${PCRE_CFLAGS}"; $$x =~ /\-I(.*?\/include\b)/; print("$$1/pcre.h");')
9-
10-ORIGINAL_RK_PCRE_HEADER = $(shell diff -q '${REGEXKIT_HEADERS_DIR}/RegexKit/pcre.h' '${REGEXKIT_SOURCE_DIR}/Build/Distribution/distribution_pcre.h')
11-
12-ifeq (${ORIGINAL_RK_PCRE_HEADER},)
13-$(info Copying the installed PCRE's '${PCRE_HEADER}' to RegexKit's Headers directory at '${REGEXKIT_HEADERS_DIR}/RegexKit/pcre.h')
14-$(shell cp '${PCRE_HEADER}' '${REGEXKIT_HEADERS_DIR}/RegexKit/pcre.h')
15-endif
16
17 vpath %.m ${REGEXKIT_SOURCE_DIR}
18 vpath %.h ${REGEXKIT_HEADERS_DIR}/RegexKit
19@@ -29,7 +21,7 @@
20 LIBRARY_NAME = libRegexKit
21 PACKAGE_NAME = RegexKit
22
23-libRegexKit_HEADER_FILES = NSArray.h NSData.h NSDictionary.h NSObject.h NSSet.h NSString.h RKEnumerator.h RKCache.h RKEnumerator.h RKRegex.h RKUtility.h RegexKit.h RegexKitDefines.h RegexKitTypes.h pcre.h
24+libRegexKit_HEADER_FILES = NSArray.h NSData.h NSDictionary.h NSObject.h NSSet.h NSString.h RKEnumerator.h RKCache.h RKEnumerator.h RKRegex.h RKUtility.h RegexKit.h RegexKitDefines.h RegexKitTypes.h
25 libRegexKit_OBJC_FILES = NSArray.m NSData.m NSDictionary.m NSObject.m NSSet.m NSString.m RKAutoreleasedMemory.m RKCache.m RKCoder.m RKEnumerator.m RKLock.m RKPlaceholder.m RKPrivate.m RKRegex.m RKSortedRegexCollection.m RKThreadPool.m RKUtility.m
26 libRegexKit_HEADER_FILES_DIR = ${REGEXKIT_HEADERS_DIR}/RegexKit
27 libRegexKit_HEADER_FILES_INSTALL_DIR = /RegexKit
28diff -Nur RegexKit_0.6.0_source.orig/GNUstep/GNUmakefile.postamble RegexKit_0.6.0_source.Linux/GNUstep/GNUmakefile.postamble
29--- RegexKit_0.6.0_source.orig/GNUstep/GNUmakefile.postamble 2007-10-09 21:03:17.000000000 -0600
30+++ RegexKit_0.6.0_source.Linux/GNUstep/GNUmakefile.postamble 2008-02-02 20:43:19.000000000 -0700
31@@ -20,7 +20,7 @@
32 export PERL=${PERL}; \
33 export SHELL=${SHELL}; \
34 export SED=${SED}; \
35- export TARGET_BUILD_DIR=${GNUSTEP_INSTALLATION_DIR}/Library/Headers; \
36+ export TARGET_BUILD_DIR=${GNUSTEP_HEADERS}${GNUSTEP_HEADERS_INSTALL}; \
37 export PUBLIC_HEADERS_FOLDER_PATH=${libRegexKit_HEADER_FILES_INSTALL_DIR}; \
38 export TEMP_FILES_DIR=${GNUSTEP_BUILD_DIR}; \
39 ${REGEXKIT_SOURCE_DIR}/Build/Scripts/stripHeaderdoc.sh $(HEADERDOC_REDIRECT)"$(END_ECHO)
40diff -Nur RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/NSStringPrivate.h RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/NSStringPrivate.h
41--- RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/NSStringPrivate.h 2008-01-21 02:28:09.000000000 -0700
42+++ RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/NSStringPrivate.h 2008-02-02 20:42:50.000000000 -0700
43@@ -219,7 +219,7 @@
44 NSString *RKStringFromReferenceString(id self, const SEL _cmd, RKRegex * const RK_C99(restrict) regex, RK_STRONG_REF const NSRange * const RK_C99(restrict) matchRanges, RK_STRONG_REF const RKStringBuffer * const RK_C99(restrict) matchStringBuffer, RK_STRONG_REF const RKStringBuffer * const RK_C99(restrict) referenceStringBuffer) RK_ATTRIBUTES(malloc, used, visibility("hidden"));
45 BOOL RKExtractCapturesFromMatchesWithKeyArguments(id self, const SEL _cmd, RK_STRONG_REF const RKStringBuffer * const RK_C99(restrict) stringBuffer, RKRegex * const RK_C99(restrict) regex, RK_STRONG_REF const NSRange * const RK_C99(restrict) matchRanges, const RKCaptureExtractOptions captureExtractOptions, NSString * const firstKey, va_list useVarArgsList) RK_ATTRIBUTES(used, visibility("hidden"));
46
47-#endif _REGEXKIT_NSSTRINGPRIVATE_H_
48+#endif // _REGEXKIT_NSSTRINGPRIVATE_H_
49
50 #ifdef __cplusplus
51 } /* extern "C" */
52diff -Nur RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/RegexKitDefines.h RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/RegexKitDefines.h
53--- RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/RegexKitDefines.h 2008-01-28 17:42:24.000000000 -0700
54+++ RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/RegexKitDefines.h 2008-02-02 20:42:50.000000000 -0700
55@@ -43,8 +43,6 @@
56 #ifndef _REGEXKIT_REGEXKITDEFINES_H_
57 #define _REGEXKIT_REGEXKITDEFINES_H_ 1
58
59-#import <mach-o/loader.h>
60-
61 #define __REGEXKIT__
62
63
64@@ -67,6 +65,11 @@
65 #error Unable to determine run time environment, automatic Mac OS X and GNUstep detection failed
66 #endif
67
68+#if defined(__MACOSX_RUNTIME__)
69+#import <mach-o/loader.h>
70+#endif
71+
72+
73 /*!
74 @defined RKInteger
75 @tocgroup Constants Preprocessor Macros
76diff -Nur RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/RegexKit.h RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/RegexKit.h
77--- RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/RegexKit.h 2008-01-21 02:28:12.000000000 -0700
78+++ RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/RegexKit.h 2008-02-02 20:42:50.000000000 -0700
79@@ -65,7 +65,7 @@
80 @class RKRegexPlaceholder;
81 #endif
82
83-#import <RegexKit/pcre.h>
84+#import <pcre.h>
85
86 #import <RegexKit/RKCache.h>
87 #import <RegexKit/RKRegex.h>
88diff -Nur RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/RegexKitPrivateAtomic.h RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/RegexKitPrivateAtomic.h
89--- RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/RegexKitPrivateAtomic.h 2008-01-21 02:28:12.000000000 -0700
90+++ RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/RegexKitPrivateAtomic.h 2008-02-02 20:42:50.000000000 -0700
91@@ -164,7 +164,7 @@
92 #define RKAtomicIncrementIntBarrier(ptr) __sync_add_and_fetch(ptr, 1)
93 #define RKAtomicDecrementIntBarrier(ptr) __sync_sub_and_fetch(ptr, 1)
94 #define RKAtomicCompareAndSwapInt(oldValue, newValue, ptr) __sync_bool_compare_and_swap(ptr, oldValue, newValue)
95-#define RKAtomicCompareAndSwapPtr(oldp, newp, ptr) __sync_bool_compare_and_swap(ptr, oldValue, newValue)
96+#define RKAtomicCompareAndSwapPtr(oldp, newp, ptr) __sync_bool_compare_and_swap(ptr, oldp, newp)
97
98 #define RKAtomicIncrementInteger(ptr) __sync_add_and_fetch(ptr, 1)
99 #define RKAtomicDecrementInteger(ptr) __sync_sub_and_fetch(ptr, 1)
100diff -Nur RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/RegexKitPrivateThreads.h RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/RegexKitPrivateThreads.h
101--- RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/RegexKitPrivateThreads.h 2008-01-21 02:28:12.000000000 -0700
102+++ RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/RegexKitPrivateThreads.h 2008-02-02 20:42:50.000000000 -0700
103@@ -95,7 +95,6 @@
104 #warning Unable to determine platform specific thread operations. Trying sched_yield() and pthread_main_np().
105
106 #import <pthread.h>
107-#import <pthread_np.h>
108
109 #define HAVE_RKREGEX_THREAD_OPS
110
111diff -Nur RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/RKRegex.h RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/RKRegex.h
112--- RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/RKRegex.h 2008-01-27 02:43:10.000000000 -0700
113+++ RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/RKRegex.h 2008-02-02 20:42:50.000000000 -0700
114@@ -51,7 +51,7 @@
115 #import <RegexKit/RegexKitDefines.h>
116 #import <RegexKit/RegexKitTypes.h>
117 #import <RegexKit/RegexKit.h>
118-#import <RegexKit/pcre.h>
119+#import <pcre.h>
120
121
122 /*!
123diff -Nur RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/RKThreadPool.h RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/RKThreadPool.h
124--- RegexKit_0.6.0_source.orig/Source/Headers/RegexKit/RKThreadPool.h 2008-01-27 02:06:27.000000000 -0700
125+++ RegexKit_0.6.0_source.Linux/Source/Headers/RegexKit/RKThreadPool.h 2008-02-02 20:42:50.000000000 -0700
126@@ -56,10 +56,12 @@
127 #import <sys/time.h>
128 #import <stdlib.h>
129 #import <sys/sysctl.h>
130+#if defined(__MACOSX_RUNTIME__)
131 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
132 #import <mach/thread_act.h>
133 #import <mach/thread_policy.h>
134 #endif // MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
135+#endif
136
137 @class RKLock, RKConditionLock;
138
139diff -Nur RegexKit_0.6.0_source.orig/Source/RKCache.m RegexKit_0.6.0_source.Linux/Source/RKCache.m
140--- RegexKit_0.6.0_source.orig/Source/RKCache.m 2008-01-25 17:42:50.000000000 -0700
141+++ RegexKit_0.6.0_source.Linux/Source/RKCache.m 2008-02-02 20:42:50.000000000 -0700
142@@ -47,7 +47,6 @@
143
144 as a visual reminder that code within the comments is sensitive to lock based programming problems.
145 */
146-
147 #import <RegexKit/RKCache.h>
148 #import <RegexKit/RegexKitPrivate.h>
149 // Not placed in RKCache.h because that's a public include which would require RKLock.h to be public, but it's only used internally.
150@@ -97,7 +96,7 @@
151 if(RKCacheLoadInitialized == 1) { return; }
152
153 if(RKAtomicCompareAndSwapInt(0, 1, &RKCacheLoadInitialized)) {
154- if((cacheMapKeyCallBacks = dlsym(RTLD_DEFAULT, "NSIntegerMapKeyCallBacks")) == NULL) { cacheMapKeyCallBacks = dlsym(RTLD_DEFAULT, "NSIntMapKeyCallBacks"); }
155+ cacheMapKeyCallBacks = &NSIntMapKeyCallBacks;
156
157 #ifdef ENABLE_MACOSX_GARBAGE_COLLECTION
158 id garbageCollector = objc_getClass("NSGarbageCollector");
159diff -Nur RegexKit_0.6.0_source.orig/Source/RKLock.m RegexKit_0.6.0_source.Linux/Source/RKLock.m
160--- RegexKit_0.6.0_source.orig/Source/RKLock.m 2008-01-28 22:11:00.000000000 -0700
161+++ RegexKit_0.6.0_source.Linux/Source/RKLock.m 2008-02-02 20:42:50.000000000 -0700
162@@ -45,6 +45,7 @@
163
164 #import <RegexKit/RKLock.h>
165 #import <sys/time.h>
166+#import <math.h>
167
168 #pragma mark Exceptions
169
170@@ -116,7 +117,7 @@
171
172 if((pthreadError = pthread_mutexattr_init(&threadMutexAttribute)) != 0) { NSLog(@"pthread_mutexattr_init returned #%d, %s.", pthreadError, strerror(pthreadError)); goto errorExit; }
173 mutexAttributeInitialized = YES;
174- if((pthreadError = pthread_mutexattr_settype(&threadMutexAttribute, PTHREAD_MUTEX_ERRORCHECK)) != 0) { NSLog(@"pthread_mutexattr_settype returned #%d, %s.", pthreadError, strerror(pthreadError)); goto errorExit; }
175+ if((pthreadError = pthread_mutexattr_settype(&threadMutexAttribute, PTHREAD_MUTEX_ERRORCHECK_NP)) != 0) { NSLog(@"pthread_mutexattr_settype returned #%d, %s.", pthreadError, strerror(pthreadError)); goto errorExit; }
176
177 while((pthreadError = pthread_mutex_init(&lock, &threadMutexAttribute)) != 0) {
178 if(pthreadError == EAGAIN) { initTryCount++; if(initTryCount > 5) { NSLog(@"pthread_mutex_init returned EAGAIN 5 times, giving up."); goto errorExit; } RKThreadYield(); continue; }
179@@ -480,7 +481,7 @@
180
181 if((pthreadError = pthread_mutexattr_init(&threadMutexAttribute)) != 0) { NSLog(@"pthread_mutexattr_init returned #%d, %s.", pthreadError, strerror(pthreadError)); goto errorExit; }
182 mutexAttributeInitialized = YES;
183- if((pthreadError = pthread_mutexattr_settype(&threadMutexAttribute, PTHREAD_MUTEX_ERRORCHECK)) != 0) { NSLog(@"pthread_mutexattr_settype returned #%d, %s.", pthreadError, strerror(pthreadError)); goto errorExit; }
184+ if((pthreadError = pthread_mutexattr_settype(&threadMutexAttribute, PTHREAD_MUTEX_ERRORCHECK_NP)) != 0) { NSLog(@"pthread_mutexattr_settype returned #%d, %s.", pthreadError, strerror(pthreadError)); goto errorExit; }
185
186 while((pthreadError = pthread_mutex_init(&pthreadMutex, &threadMutexAttribute)) != 0) {
187 if(pthreadError == EAGAIN) { initTryCount++; if(initTryCount > 5) { NSLog(@"pthread_mutex_init returned EAGAIN 5 times, giving up."); goto errorExit; } RKThreadYield(); continue; }
188diff -Nur RegexKit_0.6.0_source.orig/Source/RKRegex.m RegexKit_0.6.0_source.Linux/Source/RKRegex.m
189--- RegexKit_0.6.0_source.orig/Source/RKRegex.m 2008-01-29 03:18:59.000000000 -0700
190+++ RegexKit_0.6.0_source.Linux/Source/RKRegex.m 2008-02-02 20:42:50.000000000 -0700
191@@ -420,10 +420,6 @@
192 NSNumber *kernNumber = [NSNumber numberWithFloat:2.0f];
193 NSNumber *underlineStyleNumber = [NSNumber numberWithInt:(NSSingleUnderlineStyle | NSUnderlinePatternSolid)];
194 NSColor *underlineColor = [[NSColor redColor] colorWithAlphaComponent:0.75f];
195- NSShadow *errorShadow = [[[NSShadow alloc] init] autorelease];
196- [errorShadow setShadowOffset:NSMakeSize(0.0f, 0.0f)];
197- [errorShadow setShadowBlurRadius:3.0f];
198- [errorShadow setShadowColor:[NSColor redColor]];
199
200
201 RKStringBuffer abreviatedRegexStringBuffer = RKStringBufferWithString(abreviatedRegexString);
202@@ -437,7 +433,6 @@
203 [abreviatedAttributedRegexString addAttribute:NSKernAttributeName value:kernNumber range:abreviatedRegexStringUTF16KernRange];
204 [abreviatedAttributedRegexString addAttribute:NSUnderlineStyleAttributeName value:underlineStyleNumber range:abreviatedRegexStringUTF16ErrorRange];
205 [abreviatedAttributedRegexString addAttribute:NSUnderlineColorAttributeName value:underlineColor range:abreviatedRegexStringUTF16ErrorRange];
206- [abreviatedAttributedRegexString addAttribute:NSShadowAttributeName value:errorShadow range:abreviatedRegexStringUTF16ErrorRange];
207
208 NSRange regexStringUTF8KernRange = RKRangeForUTF8CharacterAtLocation(regexStringBuffer, (regexStringUTF8ErrorRange.location > 0) ? regexStringUTF8ErrorRange.location - 1 : 0);
209 regexStringUTF8KernRange = NSMakeRange(regexStringUTF8KernRange.location, NSMaxRange(regexStringUTF8ErrorRange) - regexStringUTF8KernRange.location);
210@@ -447,7 +442,6 @@
211 [attributedRegexString addAttribute:NSKernAttributeName value:kernNumber range:regexStringUTF16KernRange];
212 [attributedRegexString addAttribute:NSUnderlineStyleAttributeName value:underlineStyleNumber range:regexStringUTF16ErrorRange];
213 [attributedRegexString addAttribute:NSUnderlineColorAttributeName value:underlineColor range:regexStringUTF16ErrorRange];
214- [attributedRegexString addAttribute:NSShadowAttributeName value:errorShadow range:regexStringUTF16ErrorRange];
215
216 #else // not defined(__MACOSX_RUNTIME__) || (GNUSTEP_GUI_MINOR_VERSION < 12)
217
218@@ -579,7 +573,7 @@
219 if(RK_EXPECTED(compiledRegexStringBuffer.characters == NULL, 0)) { [[NSException rkException:NSInternalInconsistencyException for:self selector:_cmd localizeReason:@"Unable to get string buffer from object '%@', which is a copy of the passed object '%@'.", RKPrettyObjectDescription(compiledRegexString), RKPrettyObjectDescription(regexString)] raise]; }
220
221 RK_PROBE(BEGINREGEXCOMPILE, self, (unsigned long)hash, (char *)compiledRegexStringBuffer.characters, (int)compileOption);
222- _compiledPCRE = pcre_compile2(compiledRegexStringBuffer.characters, (int)compileOption, (int *)&compileErrorCode, &errorCharPtr, &(int)compileErrorOffset, NULL);
223+ _compiledPCRE = pcre_compile2(compiledRegexStringBuffer.characters, (int)compileOption, (int *)&compileErrorCode, &errorCharPtr, (int)&compileErrorOffset, NULL);
224 RK_PROBE(ENDREGEXCOMPILE, self, (unsigned long)hash, (char *)compiledRegexStringBuffer.characters, (int)compileOption, (int)compileErrorCode, (char *)RKCharactersFromCompileErrorCode(compileErrorCode), (compileErrorCode == RKCompileErrorNoError) ? "" : (char *)errorCharPtr, (compileErrorCode == RKCompileErrorNoError) ? 0 : (int)compileErrorOffset);
225
226 if(RK_EXPECTED(RK_EXPECTED((compileErrorCode != RKCompileErrorNoError), 0) || RK_EXPECTED((_compiledPCRE == NULL), 0), 0)) { initRegexError = RKErrorForCompileInitFailure(self, _cmd, &compiledRegexStringBuffer, compileErrorOffset, compileErrorCode, compileOption, 5); NSParameterAssert(initRegexError != NULL); goto errorExit; }
227diff -Nur RegexKit_0.6.0_source.orig/Source/RKSortedRegexCollection.m RegexKit_0.6.0_source.Linux/Source/RKSortedRegexCollection.m
228--- RegexKit_0.6.0_source.orig/Source/RKSortedRegexCollection.m 2008-01-25 15:10:00.000000000 -0700
229+++ RegexKit_0.6.0_source.Linux/Source/RKSortedRegexCollection.m 2008-02-02 20:42:50.000000000 -0700
230@@ -178,7 +178,7 @@
231 if(collectionType == RKArrayCollection) { CFArrayGetValues((CFArrayRef)collection, (CFRange){0, (CFIndex)collectionCount}, (const void **)(&regexObjects[0])); }
232 else { CFSetGetValues((CFSetRef)collection, (const void **)(&regexObjects[0])); }
233 #else
234- if(collectionType == RKArrayCollection) { [collection getObjects:&arrayObjects[0] range:NSMakeRange(0, collectionCount)]; }
235+ if(collectionType == RKArrayCollection) { [collection getObjects:&regexObjects[0] range:NSMakeRange(0, collectionCount)]; }
236 else { [[collection allObjects] getObjects:&regexObjects[0]]; }
237 #endif
238
This page took 0.125924 seconds and 4 git commands to generate.