Skip to content

Instantly share code, notes, and snippets.

@languitar
Created August 28, 2013 16:43
Show Gist options
  • Save languitar/6368210 to your computer and use it in GitHub Desktop.
Save languitar/6368210 to your computer and use it in GitHub Desktop.
Erroneous python dependency check in homebrew
languitar@miles:/usr/local$ cat Library/Taps/languitar-formulas/rst-proto.rb
require 'formula'
class RstProto < Formula
homepage 'https://toolkit.cit-ec.uni-bielefeld.de/components/generic/robotics-system-types'
url 'https://code.cor-lab.de/git/rst.git.proto.git', :using => :git, :branch => '0.9'
version '0.9'
head 'https://code.cor-lab.de/git/rst.git.proto.git', :using => :git
option :universal
depends_on 'cmake' => :build
depends_on 'rsc'
depends_on 'protobuf'
depends_on :python
depends_on LanguageModuleDependency.new :python, 'protobuf', 'google.protobuf'
def install
# ENV.x11 # if your formula requires any X11 headers
# ENV.j1 # if your formula's build system can't parallelize
ENV.universal_binary if build.universal?
system "cmake", ".", "-DPYTHON_EXECUTABLE=#{python.binary}", "-DBUILD_JAVA=OFF", "-DBUILD_MATLAB=OFF", *std_cmake_args
system "make install" # if this fails, try separate make/make install steps
rm "#{prefix}/lib/python2.7/site-packages/site.py"
end
def test
# This test will fail and we won't accept that! It's enough to just replace
# "false" with the main program this formula installs, but it'd be nice if you
# were more thorough. Run the test with `brew test rsc`.
system "false"
end
end
languitar@miles:/usr/local$ which python
/usr/local/bin/python
languitar@miles:/usr/local$ python -c "import google.protobuf"
languitar@miles:/usr/local$ echo $?
0
languitar@miles:/usr/local$ brew install --verbose --debug rst-proto
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/rst-proto.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/cmake.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/rsc.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/boost.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/python.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/protobuf.rb
/usr/bin/env python -c import google.protobuf
rst-proto: Unsatisfied dependency: protobuf
Homebrew does not provide Python dependencies; install with:
pip install protobuf
Error: An unsatisfied requirement failed this build.
/usr/local/Library/Homebrew/formula_installer.rb:160:in `check_requirements'
/usr/local/Library/Homebrew/formula_installer.rb:89:in `install'
/usr/local/Library/Homebrew/cmd/install.rb:75:in `install_formula'
/usr/local/Library/Homebrew/cmd/install.rb:22:in `install'
/usr/local/Library/Homebrew/cmd/install.rb:22:in `each'
/usr/local/Library/Homebrew/cmd/install.rb:22:in `install'
/usr/local/Library/brew.rb:95:in `send'
/usr/local/Library/brew.rb:95
languitar@miles:/usr/local$ git cherry-pick 3e0a44b
[master fde69cb] Quote test command for python dependencies
1 file changed, 2 insertions(+), 2 deletions(-)
languitar@miles:/usr/local$ brew install --verbose --debug rst-proto
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/rst-proto.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/cmake.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/rsc.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/boost.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/python.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/protobuf.rb
/usr/bin/env python -c 'import google.protobuf'
/usr/local/Library/Formula/rst-proto.rb: loading /usr/local/Library/Formula/cmake.rb
/usr/local/Library/Formula/rst-proto.rb: loading /usr/local/Library/Formula/rsc.rb
/usr/local/Library/Formula/rst-proto.rb: loading /usr/local/Library/Formula/boost.rb
/usr/local/Library/Formula/rst-proto.rb: loading /usr/local/Library/Formula/protobuf.rb
/usr/local/Library/Formula/rst-proto.rb: loading /usr/local/Library/Formula/python.rb
/usr/bin/env python -c 'import google.protobuf'
==> Writing /usr/local/lib/python2.7/site-packages/sitecustomize.py
==> Writing /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/distutils.cfg
==> Cloning https://code.cor-lab.de/git/rst.git.proto.git
git --git-dir /Library/Caches/Homebrew/rst-proto--git/.git status -s
Updating /Library/Caches/Homebrew/rst-proto--git
git config remote.origin.url https://code.cor-lab.de/git/rst.git.proto.git
git config remote.origin.fetch +refs/heads/0.9:refs/remotes/origin/0.9
git fetch origin
git checkout -f 0.9
Already on '0.9'
git reset --hard origin/0.9
HEAD is now at 92e21a0 Prepare for release script
==> Checking out branch 0.9
git checkout-index -a -f --prefix=/private/tmp/rst-proto-hnu9/
==> cmake . -DPYTHON_EXECUTABLE=/usr/local/opt/python/bin/python2 -DBUILD_JAVA=OFF -DBUILD_MATLAB=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/rst-proto/0.9 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev
cmake . -DPYTHON_EXECUTABLE=/usr/local/opt/python/bin/python2 -DBUILD_JAVA=OFF -DBUILD_MATLAB=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/rst-proto/0.9 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev
-- The C compiler identification is Clang 4.2.0
-- The CXX compiler identification is Clang 4.2.0
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment