Skip to content

Instantly share code, notes, and snippets.

@springmeyer
Created November 5, 2013 17:23
Show Gist options
  • Save springmeyer/7322699 to your computer and use it in GitHub Desktop.
Save springmeyer/7322699 to your computer and use it in GitHub Desktop.
diff --git a/Library/Formula/libstxxl.rb b/Library/Formula/libstxxl.rb
index b5c095b..4e6369b 100644
--- a/Library/Formula/libstxxl.rb
+++ b/Library/Formula/libstxxl.rb
@@ -5,13 +5,52 @@ class Libstxxl < Formula
url 'http://downloads.sourceforge.net/project/stxxl/stxxl/1.3.1/stxxl-1.3.1.tar.gz'
sha1 '5fba2bb26b919a07e966b2f69ae29aa671892a7d'
+ def patches
+ if MacOS.version >= :mavericks
+ DATA
+ end
+ end
+
def install
ENV['COMPILER'] = ENV.cxx
- system "make", "config_gnu", "USE_MACOSX=yes"
- system "make", "library_g++", "USE_MACOSX=yes"
+ 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
+ system "make", "config_gnu"
+ system "make", "library_g++"
prefix.install 'include'
lib.install 'lib/libstxxl.a'
end
end
+
+__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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment