Skip to main content

Build bokken with custom prefix

I'm assuming radare is installed already. My radare location is ~/opt/radare2

$ tar xfv r2-bindings-0.9.tar.gz
$ cd r2-bindings-0.9
$ export PKG_CONFIG_PATH=$HOME/opt/radare2/lib/pkgconfig
$ ./configure --prefix=$HOME/opt/r2-bind --enable=python
$ make -C python
$ make install DESTDIR=$HOME/opt/r2-bind PREFIX=/usr PYTHON_PKGDIR=/lib/python/site-packages

The last make invocation looks weird. You may want to take a look at that Makefile, and see how the installation path is constructed.

$ cd ..
$ tar xfvz bokken-1.6.tar.gz
$ cd bokken-1.6
$ patch -p1 ../bokken.patch

The patch is needed for the libraries and modules to be found, since we are installing bokken with a custom prefix.

bokken.patch:

--- bokken-1.6/bokken   2012-01-24 07:59:00.000000000 +0200
+++ bokken-1.6-new/bokken       2012-06-12 15:43:52.000000000 +0300
@@ -10,5 +10,5 @@
 fi
 
 # distorm in bokken+pyew mode needs this for now.
-export LD_LIBRARY_PATH=$BOKKEN_DIR/lib
+export LD_LIBRARY_PATH=$BOKKEN_DIR/lib:$HOME/opt/r2-bind/lib/python/site-packages/r2:$HOME/opt/radare2/lib
 $PYTHON_EXECUTABLE $BOKKEN_DIR/bokken.py $@
Only in bokken-1.6-new: bokken~
diff -u bokken-1.6/bokken.py bokken-1.6-new/bokken.py
--- bokken-1.6/bokken.py        2012-01-24 07:59:00.000000000 +0200
+++ bokken-1.6-new/bokken.py    2012-06-12 15:52:31.000000000 +0300
@@ -21,6 +21,8 @@
 
 import sys, os
 
+sys.path.append(os.getenv("HOME") + "/opt/r2-bind/lib/python/site-packages")
+
 # go with GTK, but first check about DISPLAY environment variable
 if sys.platform != "win32":
     display = os.getenv("DISPLAY").strip()

Update 1: Make sure you have swig installed.

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
            Oo     .oOo  o      O          o      O 
o O O O o .oOOo. O o
O o o o O O o O
oOooOoOo OoO oO o oO
O o o O o Oo OoOOo. Oo
o O O o O o o O O o o
O o o O o O O O o O O
`OoO'o O. O O' O o `OooO' O o

Enter the code depicted in ASCII art style.