2011-10-28 20:40:22 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Libstxxl < Formula
|
|
|
|
homepage 'http://stxxl.sourceforge.net/'
|
2013-06-20 23:08:35 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/stxxl/stxxl/1.3.1/stxxl-1.3.1.tar.gz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '5fba2bb26b919a07e966b2f69ae29aa671892a7d'
|
2011-10-28 20:40:22 +00:00
|
|
|
|
2013-11-12 22:00:35 +00:00
|
|
|
# issue has been rectified in upstream and future 1.4.0 release
|
|
|
|
def patches; DATA; end if MacOS.version >= :mavericks
|
|
|
|
|
2011-10-28 20:40:22 +00:00
|
|
|
def install
|
|
|
|
ENV['COMPILER'] = ENV.cxx
|
2013-11-12 22:00:35 +00:00
|
|
|
if MacOS.version >= :mavericks
|
|
|
|
inreplace 'make.settings.gnu' do |s|
|
|
|
|
s.gsub! /USE_MACOSX.*no/, 'USE_MACOSX ?= yes#'
|
|
|
|
s.gsub! /#STXXL_SPECIFIC\s*\+=.*$/, 'STXXL_SPECIFIC += -std=c++0x'
|
|
|
|
end
|
|
|
|
end
|
2012-02-10 05:15:51 +00:00
|
|
|
system "make", "config_gnu", "USE_MACOSX=yes"
|
|
|
|
system "make", "library_g++", "USE_MACOSX=yes"
|
2011-10-28 20:40:22 +00:00
|
|
|
|
2012-11-11 19:20:09 +00:00
|
|
|
prefix.install 'include'
|
2012-02-10 05:15:51 +00:00
|
|
|
lib.install 'lib/libstxxl.a'
|
2011-10-28 20:40:22 +00:00
|
|
|
end
|
|
|
|
end
|
2013-11-12 22:00:35 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
Index: utils/mlock.cpp
|
|
|
|
===================================================================
|
|
|
|
--- stxxl-1.3.1/utils/mlock.cpp (revision 3229)
|
|
|
|
+++ stxxl-1.3.1/utils/mlock.cpp (working copy)
|
|
|
|
@@ -18,6 +18,9 @@
|
|
|
|
#include <iostream>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
|
|
|
|
+#include <chrono>
|
|
|
|
+#include <thread>
|
|
|
|
+
|
|
|
|
int main(int argc, char ** argv)
|
|
|
|
{
|
|
|
|
if (argc == 2) {
|
|
|
|
@@ -28,8 +31,9 @@
|
|
|
|
c[i] = 42;
|
|
|
|
if (mlock(c, M) == 0) {
|
|
|
|
std::cout << "mlock(, " << M << ") successful, press Ctrl-C to finish" << std::endl;
|
|
|
|
+ std::chrono::seconds duration(86400);
|
|
|
|
while (1)
|
|
|
|
- sleep(86400);
|
|
|
|
+ std::this_thread::sleep_for(duration);
|
|
|
|
} else {
|
|
|
|
std::cerr << "mlock(, " << M << ") failed!" << std::endl;
|
|
|
|
return 1;
|