Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Tapping a custom repo with cmake results in building in a wrong directory #50276

Closed
keithyipkw opened this issue Mar 20, 2016 · 1 comment
Closed

Comments

@keithyipkw
Copy link

I tried to install a build from a custom repository. During building, cmake was ran in the root of copied repository even after cd. I tried copied the contents to /tmp and install again. I got another error. CMAKE_INSTALL_PREFIX was passed to make (even with : instead of =). I am not sure if the problem was in brew, cmake, make or the repository.

brew --version
Homebrew 0.9.5 (git revision 2038e; last commit 2016-03-20)
make --version
GNU Make 3.81
This program built for i386-apple-darwin11.3.0
cmake --version
cmake version 3.5.0
uname -a
Darwin MacBook-Pro 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64

brew tap git/lazytiger https://github.com/lazytiger/gumbo-query
brew install gumbo-query
==> Installing gumbo-query from git/lazytiger
==> Cloning https://github.com/Falven/gumbo-query.git
Updating /Library/Caches/Homebrew/gumbo-query--git
==> Checking out branch master
==> cd build
==> cmake ..
Last 15 lines from /Users/keithyip/Library/Logs/Homebrew/gumbo-query/02.cmake:
2016-03-20 19:09:42 +0800

cmake ..

CMake Error: The source directory "/tmp" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

brew gist-logs gumbo-query
Error: undefined method strip' for ["keithyipkw", "git30624"]:Array Please report this bug: https://git.io/brew-troubleshooting /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/header.rb:17:inblock in initialize_http_header'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/header.rb:15:in each' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/header.rb:15:ininitialize_http_header'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/generic_request.rb:44:in initialize' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/request.rb:14:ininitialize'
/usr/local/Library/Homebrew/cmd/gist-logs.rb:121:in new' /usr/local/Library/Homebrew/cmd/gist-logs.rb:121:inmake_request'
/usr/local/Library/Homebrew/cmd/gist-logs.rb:130:in post' /usr/local/Library/Homebrew/cmd/gist-logs.rb:96:increate_gist'
/usr/local/Library/Homebrew/cmd/gist-logs.rb:35:in gistify_logs' /usr/local/Library/Homebrew/cmd/gist-logs.rb:157:ingist_logs'
/usr/local/Library/brew.rb:83:in `

'

copy the contents in the repository to /tmp
brew install gumbo-query
==> Installing gumbo-query from git/lazytiger
==> Cloning https://github.com/Falven/gumbo-query.git
Updating /Library/Caches/Homebrew/gumbo-query--git
==> Checking out branch master
==> cd build
==> cmake ..
==> make
==> make install -DCMAKE_INSTALL_PREFIX:/usr/local/Cellar/gumbo-query/

/Applications/Xcode.app/Contents/Developer/usr/bin/make: invalid option -- D

@DomT4
Copy link
Member

DomT4 commented Mar 20, 2016

This is an upstream problem, not a Homebrew problem. Their formula is written problematically. Needs to be something like this:

class GumboQuery < Formula
  homepage "https://github.com/Falven/gumbo-query"
  head "https://github.com/Falven/gumbo-query.git"

  depends_on "cmake" => :build

  def install
    cd "build" do
      system "cmake", "..", "-DCMAKE_INSTALL_PREFIX=#{prefix}"
      system "make"
      system "make", "install"
    end
  end

  def test
    system "make test" # This won't work here. Should be updated or removed.
  end
end

@DomT4 DomT4 closed this as completed Mar 20, 2016
@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants