Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gem::Installer::ExtensionBuildError on OpenBSD #2

Open
jusplayin opened this issue Sep 2, 2015 · 1 comment
Open

Gem::Installer::ExtensionBuildError on OpenBSD #2

jusplayin opened this issue Sep 2, 2015 · 1 comment

Comments

@jusplayin
Copy link

I have been using xapian-full-alaveteli-1.2.9.7 for some time without any problems...

Environment: OpenBSD 5.6 (amd64 arch) ruby20 Gem xapian-full-alaveteli-1.2.21.1

When I try to run bundle20 install from my RoR app folder I receive: 'Gem::Installer::ExtensionBuildError':

Installing xapian-full-alaveteli 1.2.21.1 with native extensions.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
    "/usr/local/bin/ruby20" -rubygems /usr/local/lib/ruby/gems/2.0/gems/rake-10.4.2/bin/rake RUBYARCHDIR=/usr/local/lib/ruby/gems/2.0/gems/xapian-full-alaveteli-1.2.21.1/lib RUBYLIBDIR=/usr/local/lib/ruby/gems/2.0/gems/xapian-full-alaveteli-1.2.21.1/lib
tar -xJvf xapian-core-1.2.21.tar.xz
tar: unknown option -- J
usage: tar {crtux}[014578befHhjLmNOoPpqsvwXZz]
           [blocking-factor | archive | replstr] [-C directory] [-I file]
           [file ...]
       tar {-crtux} [-014578eHhjLmNOoPpqvwXZz] [-b blocking-factor]
           [-C directory] [-f archive] [-I file] [-s replstr] [file ...]
rake aborted!

The issue is probably due to the fact that OpenBSD doesn't use GNU tar and doesn't support the '-J' flag.

What I did to try to build gem (Full disclosure I don't know that much about Ruby)..

In '/usr/local/lib/ruby/gems/2.0/gems/xapian-full-alaveteli-1.2.21.1':

  • Edit 'Rakefile' change ' system! "tar -xJvf #{x}.tar.xz"' to ' system! "tar -xvf #{x}.tar"'
  • Edit 'xapian-full.gemspec' remove '.xz' from the archives listed in 's.files' array
  • run unxz *.xz
  • run export CPPFLAGS=-I/usr/local/include
  • run export LDFLAGS=-L/usr/local/lib
  • run gem20 build xapian-full.gemspec
  • ran what (I think) 'bundle20' would have ran "/usr/local/bin/ruby20" -rubygems /usr/local/lib/ruby/gems/2.0/gems/rake-10.4.2/bin/rake RUBYARCHDIR=/usr/local/lib/ruby/gems/2.0/gems/xapian-full-alaveteli-1.2.21.1/lib RUBYLIBDIR=/usr/local/lib/ruby/gems/2.0/gems/xapian-full-alaveteli-1.2.21.1/lib

Then I got:

bin/xapian-replicate.o(.text+0x55d): In function `main':
bin/xapian-replicate.cc:176: undefined reference to `ReplicateTcpClient::ReplicateTcpClient(std::basic_string, std::allocator > const&, int, double, double)'
collect2: ld returned 1 exit status
*** Error 1 in . (Makefile:2231 'bin/xapian-replicate')
*** Error 1 in . (Makefile:3334 'all-recursive')
*** Error 1 in /usr/local/lib/ruby/gems/2.0/gems/xapian-full-alaveteli-1.2.21.1/xapian-core-1.2.21 (Makefile:1503 'all')
rake aborted!

I would like to understand how to build gem 'xapian-full-alaveteli-1.2.21.1' on OpenBSD. Any ideas?
Secondly, I would like to know if the Rakefile could be changed to allow more portable installations?

@jusplayin
Copy link
Author

I think I know what caused the linker error.

I had the following OpenBSD ports installed:
xapian-core-1.2.15p0 search engine library
xapian-omega-1.2.15 web search application

I believe that these ports were interfering with the build process. I was able to build successfully by removing these ports and then doing the build.

Perhaps this information will helps someone else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants