Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes Homebrew/legacy-homebrew#31122. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
require "formula" | ||
|
||
class Bokken < Formula | ||
homepage "https://inguma.eu/projects/bokken" | ||
url "https://inguma.eu/attachments/download/197/bokken-1.6.tar.gz" | ||
sha1 "9d7a3f8773f01c26c9db84e00c415dbff063f224" | ||
|
||
depends_on :python | ||
depends_on "graphviz" | ||
depends_on "pygtk" | ||
depends_on "pygtksourceview" | ||
depends_on "radare2" | ||
|
||
resource "distorm64" do | ||
url "http://ftp.de.debian.org/debian/pool/main/d/distorm64/distorm64_1.7.30.orig.tar.gz" | ||
sha1 "420b0750ab23775bf3e4ff0ccd4b9a4ebb498787" | ||
end | ||
|
||
resource "pyew" do | ||
# Upstream only provides binary packages so pull from Debian. | ||
url "http://ftp.de.debian.org/debian/pool/main/p/pyew/pyew_2.0.orig.tar.gz" | ||
sha1 "d158b65c17cccda4dd8b7a3d39f1795dfb8e68c4" | ||
end | ||
|
||
def install | ||
resource("distorm64").stage do | ||
cd "build/mac" do | ||
system "make" | ||
mkdir_p libexec/"distorm64" | ||
(libexec/"distorm64").install "libdistorm64.dylib" | ||
ln_s "libdistorm64.dylib", libexec/"distorm64/libdistorm64.so" | ||
end | ||
end | ||
|
||
resource("pyew").stage do | ||
(libexec/"pyew").install Dir["*"] | ||
# Make sure that the launcher looks for pyew.py in the correct path (fixed | ||
# in pyew ab9ea236335e). | ||
inreplace libexec/"pyew/pyew", "\./pyew.py", "`dirname $0`/pyew.py" | ||
end | ||
|
||
python_path = "#{libexec}/lib/python2.7/site-packages:#{libexec}/pyew" | ||
ld_library_path = "#{libexec}/distorm64" | ||
(libexec/"bokken").install Dir["*"] | ||
(bin/"bokken").write <<-EOS.undent | ||
#!/usr/bin/env bash | ||
env \ | ||
PYTHONPATH=#{python_path}:${PYTHONPATH} \ | ||
LD_LIBRARY_PATH=#{ld_library_path}:${LD_LIBRARY_PATH} \ | ||
python #{libexec}/bokken/bokken.py "${@}" | ||
EOS | ||
end | ||
end |