Created
March 5, 2015 00:56
-
-
Save kalbasit/2b880c719fc755c371bf to your computer and use it in GitHub Desktop.
Installing notmuch with Ruby binding on OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb | |
index 6160db2..9374a60 100644 | |
--- a/bindings/ruby/extconf.rb | |
+++ b/bindings/ruby/extconf.rb | |
@@ -11,7 +11,7 @@ dir = File.join('..', '..', 'lib') | |
$INCFLAGS = "-I#{dir} #{$INCFLAGS}" | |
# make sure there are no undefined symbols | |
-$LDFLAGS += ' -Wl,--no-undefined' | |
+$LDFLAGS += ' -Wl' | |
def have_local_library(lib, path, func, headers = nil) | |
checking_for checking_message(func, lib) do | |
@@ -22,9 +22,7 @@ def have_local_library(lib, path, func, headers = nil) | |
end | |
end | |
-if not have_local_library('libnotmuch.so', dir, 'notmuch_database_create', 'notmuch.h') | |
- exit 1 | |
-end | |
+$LOCAL_LIBS+= File.join(dir, 'libnotmuch.dylib') | |
# Create Makefile | |
dir_config('notmuch') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir /tmp/build | |
cd /tmp | |
curl -LO http://zlib.net/zlib-1.2.8.tar.gz | |
tar xf zlib-1.2.8.tar.gz | |
cd /tmp/zlib-1.2.8 | |
./configure --prefix=/tmp/build/zlib --static | |
make install | |
cd /tmp | |
git clone https://github.com/notmuch/notmuch.git | |
cd notmuch | |
export PKG_CONFIG_PATH="/tmp/build/zlib/lib/pkgconfig" | |
./configure --prefix=/usr | |
make | |
sudo make install | |
cd bindings/ruby | |
patch extconf.rb < extconf.patch | |
rbenv shell system | |
ruby extconf.rb --vendor | |
patch Makefile < Makefile.patch | |
make | |
sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/bindings/ruby/Makefile b/bindings/ruby/Makefile | |
index c0070b7..f456523 100644 | |
--- a/bindings/ruby/Makefile | |
+++ b/bindings/ruby/Makefile | |
@@ -85,7 +85,7 @@ CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REE | |
CXXFLAGS = $(CCDLFLAGS) $(ARCH_FLAG) -g -Os -pipe $(ARCH_FLAG) | |
ldflags = -L. -L/usr/local/lib -Wl | |
dldflags = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress | |
-ARCH_FLAG = -arch x86_64 -arch i386 | |
+ARCH_FLAG = -arch x86_64 | |
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG) | |
LDSHARED = $(CC) -dynamic -bundle | |
LDSHAREDXX = $(CXX) -dynamic -bundle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment