Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Install bindings along with radare2 #26938

Closed
wants to merge 1 commit into from

3 participants

@dholm

This change depends on valabind (#26936).

Library/Formula/radare2.rb
((17 lines not shown))
def install
- system "./configure", "--prefix=#{prefix}"
- system "make"
- system "make install"
+ # Temporarily disable PKG_CONFIG_PATH or build will fail.
+ old_pkg_config_path = ENV['PKG_CONFIG_PATH']
+ ENV['PKG_CONFIG_PATH'] = ''
+
+ system './configure', "--prefix=#{prefix}"
+ system 'make'
@mikemcquaid Owner

Why?

@dholm
dholm added a note

Without it Clang claims that libewf does not provide x86-64 support. I couldn't figure out why.

@mikemcquaid Owner

I meant the change to single quotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Library/Formula/radare2.rb
((6 lines not shown))
depends_on 'libewf'
depends_on 'libmagic'
depends_on 'gmp'
depends_on 'lua'
+ # Fixes:
+ # * r2-bindings/configure using invalid C++ code to detect compiler.
+ def patches
+ DATA
@mikemcquaid Owner

Has this been submitted upstream?

@dholm
dholm added a note

Not yet. I have been struggling with getting the latest version to build on OSX but it fails brew audit. The fix will only help the next release and until we can build it properly nobody will be able to use the bindings.

@mikemcquaid Owner

Please submit patches upstream before making PRs for us to use them.

@dholm
dholm added a note

It's already fixed upstream apparently.

@mikemcquaid Owner

Any chance of using the upstream commit here as the patch?

@dholm
dholm added a note

It might be tricky as it contains incompatible changes.
radare/radare2-bindings@593a2a5#diff-e2d5a00791bce9a01f99bc6fd613a39d

@mikemcquaid Owner

If we can use that patch, great. If not, let's use as close to it as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@mikemcquaid
Owner

Please read the Ruby Style Guide for any new lines: https://github.com/styleguide/ruby

@mikemcquaid
Owner

Error: No available formula for vagabond

What tap is it from?

@dholm

@mikemcquaid You mean valabind? It's in a separate pull request, #26936.

@adamv
Owner

@BrewTestBot test this please

Library/Formula/radare2.rb
((17 lines not shown))
def install
+ # Temporarily disable PKG_CONFIG_PATH or build will fail.
@adamv Owner
adamv added a note

Fail how? Need more information here.

@dholm
dholm added a note

I will need to update this patch for the new radare2 release (0.9.7). I'll check if the workaround is even needed anymore. Right now I can't remember why I needed it for the previous version. ^^

@dholm
dholm added a note

@adamv Fixed! That workaround is not needed with the new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@mikemcquaid
Owner

vagabind is failing on Lion it seems. Also, this is failing brew audit as it needs the dylib files renamed properly (and this submitted upstream). Thanks!

@dholm

@mikemcquaid I'll have a look at valabind on Lion. The dylib files are installed by the existing radare2 formula and fail brew audit even on master. This patch simply adds the missing bindings.

@mikemcquaid
Owner

@dholm Given it's a pretty simple rename it would be good if we could clean them up.

@dholm

@mikemcquaid Should they be renamed to .so? Do you have a reference as to why .dylib is bad as I'd like to understand the problem?

@mikemcquaid
Owner

Instead of e.g. libr_anal.dylib.0.9.7 it should be libr_anal.0.9.7.dylib

@dholm

@mikemcquaid Oh, that makes more sense. :)
I'll try to fix it and submit upstream + separate pull request.

@mikemcquaid
Owner

Cheers. Feel free to put in this PR though.

@dholm

@mikemcquaid I'm debugging the issue on Lion. The radare2-people likes to use custom made scripts for their build systems (as opposed to i.e. autoconf). Is it possible to get buildbot to run an instrumented build (i.e. me adding some echos in the scripts) without jumping through a ton of hoops?

@mikemcquaid
Owner

It'll print out the brew install -v output if it fails so: yeh, I guess so.

@dholm

Libraries fixed. Next up, valabind on Lion.

@dholm

@mikemcquaid The reason valabind fails on Lion is because vala appears to be broken:

http://bot.brew.sh/job/Homebrew%20Pull%20Requests/8362/version=lion/testReport/junit/brew-test-bot/lion/install_valabind/
strings: object: /usr/local/opt/vala/bin/valac malformed object (unknown load command 17)

This looks unrelated to both valabind and radare2.

@adamv
Owner

@BrewTestBot test this please

@dholm

@BrewTestBot test this please

@adamv adamv self-assigned this
@adamv
Owner

"test this please" only works for a maintainer, but pushing new commits to an existing pull request will also trigger the build bot

@adamv
Owner

@BrewTestBot test this please

@adamv
Owner

@BrewTestBot test this please

@adamv
Owner

Copying in Lion build error:

==> Installing radare2 dependency: valabind
==> Downloading https://github.com/radare/valabind/archive/0.8.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/valabind-0.8.0.tar.gz
==> Verifying valabind-0.8.0.tar.gz checksum
tar xf /Library/Caches/Homebrew/valabind-0.8.0.tar.gz
==> make
strings: object: /usr/local/opt/vala/bin/valac malformed object (unknown load command 17)
Cannot find valac version string
fatal: Not a git repository (or any of the parent directories): .git
Generating config.vala
mkdir -p build
Generating main.vala -> build/main.vapi
Generating valabindwriter.vala -> build/valabindwriter.vapi
Generating nodeffiwriter.vala -> build/nodeffiwriter.vapi
Generating utils.vala -> build/utils.vapi
Generating girwriter.vala -> build/girwriter.vapi
Generating swigwriter.vala -> build/swigwriter.vapi
Generating cxxwriter.vala -> build/cxxwriter.vapi
Generating ctypeswriter.vala -> build/ctypeswriter.vapi
Generating dlangwriter.vala -> build/dlangwriter.vapi
Generating config.vala -> build/config.vapi
Compiling config.vala main.vala valabindwriter.vala nodeffiwriter.vala utils.vala girwriter.vala swigwriter.vala cxxwriter.vala ctypeswriter.vala dlangwriter.vala -> valabind
valac -g --cc="clang"  -o valabind --pkg posix --pkg  --save-temps  config.vala main.vala valabindwriter.vala nodeffiwriter.vala utils.vala girwriter.vala swigwriter.vala cxxwriter.vala ctypeswriter.vala dlangwriter.vala 
error: Package `--save-temps' not found in specified Vala API directories or GObject-Introspection GIR directories
Compilation failed: 1 error(s), 0 warning(s)
make: *** [valabind] Error 1
Error: valabind 0.8.0 did not build
@adamv
Owner

There's a 0.24.0 version of Vala; is every version stable or does Vala have that even/odd versioning scheme?

@adamv adamv removed their assignment
@adamv
Owner

@BrewTestBot test this please

@adamv
Owner

Is valabind expected to work on Lion or no?

@adamv
Owner

MacPorts doesn't seem to be doing anything special: https://trac.macports.org/browser/trunk/dports/devel/valabind/Portfile

@dholm

@adamv I still think it's an issue in vala on Lion. I am planning to push an update to the vala recipe with a better test case than the current in order to try to verify this is the case.

@dholm

Hmm, I'm reevaluating the build output of valabind on Lion and it actually looks like one of the package parameters to valac is messed up, triggering the build error:

valac -g --cc="clang"  -o valabind --pkg posix --pkg  --save-temps

The second package name is missing so it is interpreting --save-temps as a package name and not another option. Digging deeper..

@dholm

Issue identified and fix submitted upstream.

@adamv
Owner

@BrewTestBot test this please

@adamv adamv closed this pull request from a commit
@dholm dholm radare2: install bindings
Closes #26938.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
6a99dfd
@adamv adamv closed this in 6a99dfd
@wjlroe wjlroe referenced this pull request from a commit in wjlroe/homebrew
@dholm dholm radare2: install bindings
Closes #26938.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
509d9de
@dholm dholm deleted the dholm:radare2-bindings branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 17, 2014
  1. @dholm
This page is out of date. Refresh to see the latest.
Showing with 34 additions and 5 deletions.
  1. +34 −5 Library/Formula/radare2.rb
View
39 Library/Formula/radare2.rb
@@ -7,14 +7,43 @@ class Radare2 < Formula
head 'http://radare.org/hg/radare2', :using => :hg
- depends_on 'libewf'
- depends_on 'libmagic'
- depends_on 'gmp'
- depends_on 'lua'
+ depends_on "pkg-config" => :build
+ depends_on "valabind" => :build
+ depends_on "swig" => :build
+ depends_on "gobject-introspection" => :build
+ depends_on "libewf"
+ depends_on "libmagic"
+ depends_on "gmp"
+ depends_on "lua"
+
+ def patches
+ # Fixes file name of dynamic libraries so that version goes before .dylib.
+ # * radare2 pull request #693
+ "https://github.com/radare/radare2/commit/f0dbeb9950c55cdb75a2515b1cf6add4e0f4a591.diff"
+ end
+
+ resource("bindings") do
+ url "http://radare.org/get/radare2-bindings-0.9.7.tar.xz"
+ sha1 "b425e3faeebd3f212e6542a64dafa3b629535e7a"
+ end
def install
system "./configure", "--prefix=#{prefix}"
system "make"
- system "make install"
+ system "make", "install"
+
+ resource("bindings").stage do
+ ENV.append_path "PKG_CONFIG_PATH", "#{lib}/pkgconfig"
+
+ # OSX build fix from pull request #18.
+ # * https://github.com/radare/radare2-bindings/pull/18
+ inreplace "python-config-wrapper" do |s|
+ s.gsub! "\s", "\ "
+ end
+
+ system "./configure", "--prefix=#{prefix}"
+ system "make"
+ system "make", "install", "DESTDIR=#{prefix}"
+ end
end
end
Something went wrong with that request. Please try again.