Skip to content

Instantly share code, notes, and snippets.

@kalbasit
Created March 5, 2015 00:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kalbasit/2b880c719fc755c371bf to your computer and use it in GitHub Desktop.
Save kalbasit/2b880c719fc755c371bf to your computer and use it in GitHub Desktop.
Installing notmuch with Ruby binding on OSX
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')
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
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