Update of /cvsroot/fink/dists/10.3/unstable/main/finkinfo/utils
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23660/10.3/unstable/main/finkinfo/utils

Added Files:
        pbzip2.info pbzip2.patch 
Log Message:
pbzip2 -- multi-cpu bzip2 replacement

--- NEW FILE: pbzip2.info ---
Package: pbzip2
Version: 0.9.4
Revision: 1

BuildDepends: bzip2-dev
Depends: bzip2-shlibs
Source: http://compression.ca/%n/%n-%v.tar.gz
Source-MD5: ba5e06d89ac3fded55d30d33cdfeb872
Patch: %n.patch
PatchScript: <<
  perl -pi -e 's,-pthread,,g' Makefile
<<
CompileScript: make
InstallScript: <<
  install -d -m 755 %i/bin
  install -c -m 755 %n %i/bin/
<<
Description: SMP-capable bzip2
DescDetail: <<
PBZIP2 is a parallel implementation of the bzip2 block-sorting file compressor
that uses pthreads and achieves near-linear speedup on SMP machines.  The
output of this version is fully compatible with bzip2 1.0.2 (ie: anything
compressed with PBZIP2 can be decompressed with bzip2).
<<
DocFiles: AUTHORS COPYING ChangeLog README
License: OSI-Approved
Maintainer: Benjamin Reed <[EMAIL PROTECTED]>
Homepage: http://compression.ca/pbzip2/

--- NEW FILE: pbzip2.patch ---
diff -uNr pbzip2-0.9.4/pbzip2.cpp pbzip2-0.9.4-patched/pbzip2.cpp
--- pbzip2-0.9.4/pbzip2.cpp     2005-08-30 11:30:11.000000000 -0400
+++ pbzip2-0.9.4-patched/pbzip2.cpp     2005-08-30 22:25:58.000000000 -0400
@@ -88,6 +88,9 @@
 #ifdef WIN32
 #include <windows.h>
 #endif
+#ifdef __APPLE__
+#include <sys/sysctl.h>
+#endif
 
 // uncomment for debug output
 //#define PBZIP_DEBUG
@@ -1340,7 +1343,7 @@
        fprintf(stderr, " -f       : force, overwrite existing output file\n");
        fprintf(stderr, " -k       : keep input file, don't delete\n");
        fprintf(stderr, " -p#      : where # is the number of processors 
(default");
-#ifdef _SC_NPROCESSORS_ONLN
+#if defined(_SC_NPROCESSORS_ONLN) || defined(__APPLE__)
        fprintf(stderr, ": autodetect)\n");
 #else
        fprintf(stderr, " 2)\n");
@@ -1424,7 +1427,14 @@
        }
 
        // Autodetect the number of CPUs on a box, if available
-       #ifdef _SC_NPROCESSORS_ONLN
+       #if defined(__APPLE__)
+               size_t len = sizeof(numCPU);
+               int mib[2];
+               mib[0] = CTL_HW;
+               mib[1] = HW_NCPU;
+               if (sysctl(mib, 2, &numCPU, &len, 0, 0) < 0 || len != 
sizeof(numCPU))
+                       numCPU = 1;
+       #elif defined(_SC_NPROCESSORS_ONLN)
                numCPU = sysconf(_SC_NPROCESSORS_ONLN);
        #endif
 



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to